Skip to content

Commit

Permalink
wip5
Browse files Browse the repository at this point in the history
  • Loading branch information
abukosek committed Jan 13, 2025
1 parent 9670053 commit 019461f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 54 deletions.
74 changes: 24 additions & 50 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtime-sdk/modules/evm-new/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ once_cell = "1.8.0"
# Ethereum.
ethabi = { version = "18.0.0", default-features = false, features = ["std"] }
ethereum = "0.15"
revm = { git = "https://github.com/bluealloy/revm", tag = "v42" }
revm = { git = "https://github.com/bluealloy/revm", tag = "v52", default-features = false, features = ["std", "serde", "optional_eip3607"] }
fixed-hash = "0.8.0"
primitive-types = { version = "0.12", default-features = false, features = ["rlp", "num-traits"] }
rlp = "0.5.2"
Expand Down
3 changes: 2 additions & 1 deletion runtime-sdk/modules/evm-new/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ impl<'ctx, C: Context, Cfg: Config> DatabaseCommit for OasisDB<'ctx, C, Cfg> {
&token::BaseUnits::new(account.info.balance.to::<u128>(), Cfg::TOKEN_DENOMINATION),
);

<C::Runtime as Runtime>::Accounts::set_nonce(sdk_address, account.info.nonce);
// Hmm...
//<C::Runtime as Runtime>::Accounts::set_nonce(sdk_address, account.info.nonce);

if account.info.code.is_some() {
let code = account.info.code.unwrap().bytecode().to_vec();
Expand Down
3 changes: 3 additions & 0 deletions runtime-sdk/modules/evm-new/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@ impl<Cfg: Config> Module<Cfg> {
let db = db::OasisDB::<'_, C, Cfg>::new(ctx);
let mut evm = Evm::builder()
.with_spec_id(SpecId::SHANGHAI)
.modify_cfg_env(|cfg| {
cfg.disable_eip3607 = true;
})
.with_db(db)
.modify_tx_env(f)
.build();
Expand Down
4 changes: 2 additions & 2 deletions runtime-sdk/modules/evm-new/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ fn test_fee_refunds() {
message,
} = dispatch_result.result
{
assert_eq!(module, "evm");
assert_eq!(module, "evm-new");
assert_eq!(code, 8);
assert_eq!(
decode_reverted(&message).unwrap(),
Expand Down Expand Up @@ -1174,7 +1174,7 @@ fn test_return_value_limits() {
message,
} = dispatch_result.result
{
assert_eq!(module, "evm");
assert_eq!(module, "evm-new");
assert_eq!(code, 8);
let message = decode_reverted_raw(&message).unwrap();
// Actual payload is ABI-encoded so the raw result starts at offset 68.
Expand Down

0 comments on commit 019461f

Please sign in to comment.