Skip to content

Commit

Permalink
fix(e2e): deploy contracts without Solidity constructor when not need…
Browse files Browse the repository at this point in the history
…ed (#295)

This PR changes the `e2e` testing library to allow deployments of
contracts without a constructor., when the constructor file is not
present. This is already allowed by
[koba](https://github.com/OpenZeppelin/koba/blob/main/src/generator.rs#L27-L30).

#### PR Checklist

- [x] Tests
- [ ] ~Documentation~ (not required)

---------

Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com>
Co-authored-by: Alisander Qoshqosh <qalisander@gmail.com>
  • Loading branch information
3 people authored Sep 23, 2024
1 parent b1eef80 commit 8fb2758
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 0 additions & 6 deletions examples/ecdsa/src/constructor.sol

This file was deleted.

6 changes: 5 additions & 1 deletion lib/e2e/src/deploy.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::path::Path;

use alloy::{rpc::types::TransactionReceipt, sol_types::SolConstructor};
use koba::config::Deploy;

Expand Down Expand Up @@ -45,11 +47,13 @@ impl Deployer {
let pkg = Crate::new()?;
let wasm_path = pkg.wasm;
let sol_path = pkg.manifest_dir.join("src/constructor.sol");
let sol =
if Path::new(&sol_path).exists() { Some(sol_path) } else { None };

let config = Deploy {
generate_config: koba::config::Generate {
wasm: wasm_path.clone(),
sol: Some(sol_path),
sol,
args: self.ctr_args,
legacy: false,
},
Expand Down

0 comments on commit 8fb2758

Please sign in to comment.