Skip to content

Commit

Permalink
address pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed Nov 21, 2023
1 parent 8832951 commit 0c98e9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions crates/evm/src/create_helpers.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ impl MachineCreateHelpersImpl of MachineCreateHelpers {

// TODO(state): when the tx starts,
// store get_tx_info().unbox().nonce inside the sender account nonce
let sender_nonce: u64 = get_tx_info().unbox().nonce.try_into().unwrap();
// so that we can call self.nonce() instead of get_tx_info().unbox().nonce

let to = match create_type {
CreateType::CreateOrDeployTx => compute_contract_address(
self.address().evm, sender_nonce
),
CreateType::CreateOrDeployTx => {
let nonce = self.state.get_account(self.address().evm)?.nonce();
compute_contract_address(self.address().evm, sender_nonce: nonce)
},
CreateType::Create2 => compute_create2_contract_address(
self.address().evm, salt: self.stack.pop()?, bytecode: bytecode.span()
)?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ fn test_exec_call() {
}

#[test]
#[available_gas(50000000)]
#[available_gas(70000000)]
fn test_exec_call_no_return() {
// Given
let mut interpreter = EVMInterpreterTrait::new();
Expand Down

0 comments on commit 0c98e9c

Please sign in to comment.