Skip to content

Commit

Permalink
feat: add stMemoryTests (#84)
Browse files Browse the repository at this point in the history
* draft commit

* feat: add stMemoryTests

* dev: fix clippy issues

---------

Co-authored-by: Harsh Bajpai <harshbajpai@Harshs-MacBook-Pro.local>
  • Loading branch information
bajpai244 and Harsh Bajpai authored Sep 8, 2023
1 parent 0183f8e commit 6b82c72
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
6 changes: 5 additions & 1 deletion crates/ef-testing/src/models/case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl BlockchainTestCase {
| "mulmod.json" // kakarot #695
| "divByZero.json" // kakarot #695
| "jumpi.json" // kakarot #693
| "jump.json" // ef-tests #38
| "jump.json" // ef-tests #38
| "jumpToPush.json" // ef-tests #61
| "signextend.json" // kakarot #677
| "mload.json" // ef-tests #31
Expand All @@ -88,6 +88,10 @@ impl BlockchainTestCase {
| "suicide.json" // ef-tests #57
| "blockInfo.json" // ef-tests #67
| "envInfo.json" // ef-tests #63
| "memCopySelf.json" // ef-tests #52
| "bufferSrcOffset.json" // ef-tests #51
| "buffer.json" // ef-tests #50
| "oog.json" // ef-tests #49
)
}

Expand Down
10 changes: 2 additions & 8 deletions crates/ef-testing/src/utils/assert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ pub fn assert_contract_post_state(
if actual_nonce != account_nonce {
return Err(RunnerError::Other(format!(
"{} expected nonce {} for {:#20x}, got {}",
test_name,
account_nonce.to_string(),
evm_address,
actual_nonce.to_string()
test_name, account_nonce, evm_address, actual_nonce
)));
}

Expand Down Expand Up @@ -70,10 +67,7 @@ pub fn assert_contract_post_storage(
if actual_state_value != value {
return Err(RunnerError::Other(format!(
"{} expected storage value {} for {:#20x}, got {}",
test_name,
value.to_string(),
evm_address,
actual_state_value.to_string()
test_name, value, evm_address, actual_state_value
)));
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/ef-testing/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ mod blockchain_tests {
use super::*;

blockchain_tests!(vm_tests, VMTests);
blockchain_tests!(memory_tests, stMemoryTest);
}

0 comments on commit 6b82c72

Please sign in to comment.