Skip to content

Commit 9cbd0d9

Browse files
committed
win panic fix
1 parent 322e80a commit 9cbd0d9

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

crates/compilers/src/preprocessor/data.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,12 @@ impl ContractData {
181181
let helper = format!(
182182
r#"
183183
pragma solidity >=0.4.0;
184-
185184
import "{path}";
186-
187185
abstract contract DeployHelper{contract_id} is {name} {{
188186
struct ConstructorArgs {{
189187
{struct_fields};
190188
}}
191189
}}
192-
193190
function encodeArgs{contract_id}(DeployHelper{contract_id}.ConstructorArgs memory args) pure returns (bytes memory) {{
194191
return abi.encode({abi_encode_args});
195192
}}

crates/compilers/src/preprocessor/deps.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,13 @@ pub(crate) fn remove_bytecode_dependencies(
326326
format!(
327327
"import {{DeployHelper{id}, encodeArgs{id}}} from \"foundry-pp/DeployHelper{id}.sol\";",
328328
)
329-
}).join("\n");
329+
}).join("");
330330
updates.insert((
331331
source.file.src.len(),
332332
source.file.src.len(),
333333
format!(
334334
r#"
335335
{helper_imports}
336-
337336
interface {vm_interface_name} {{
338337
function deployCode(string memory _artifact) external returns (address);
339338
function deployCode(string memory _artifact, bytes32 _salt) external returns (address);

crates/compilers/src/preprocessor/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ fn interface_representation(content: &str, file: &Path) -> Result<String, Emitte
210210

211211
let content =
212212
replace_source_content(content, spans_to_remove.iter().map(|span| (span.to_range(), "")))
213+
.replace("\r\n", "\n")
213214
.replace("\n", "");
214215
Ok(utils::RE_TWO_OR_MORE_SPACES.replace_all(&content, "").to_string())
215216
}

0 commit comments

Comments
 (0)