forked from privacy-scaling-explorations/zkevm-circuits
-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
143d7ae
commit 60280f3
Showing
4 changed files
with
41 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// tests for eip155 tx | ||
#[cfg(test)] | ||
mod test { | ||
use crate::test_util::CircuitTestBuilder; | ||
use eth_types::{address, AccessList, AccessListItem, Error, Word, H256}; | ||
use ethers_signers::Signer; | ||
use mock::{eth, gwei, TestContext, MOCK_ACCOUNTS, MOCK_WALLETS}; | ||
|
||
// test with empty access list. | ||
#[test] | ||
fn test_eip2930_tx_for_empty_access_list() { | ||
let ctx = build_ctx(gwei(80_000)).unwrap(); | ||
} | ||
|
||
fn build_ctx( | ||
sender_balance: Word, | ||
) -> Result<TestContext<2, 1>, Error> { | ||
TestContext::new( | ||
None, | ||
|accs| { | ||
accs[0] | ||
.address(MOCK_WALLETS[0].address()) | ||
.balance(sender_balance); | ||
accs[1].address(MOCK_ACCOUNTS[0]).balance(eth(1)); | ||
}, | ||
|mut txs, _accs| { | ||
txs[0] | ||
.from(MOCK_WALLETS[0].clone()) | ||
.to(MOCK_ACCOUNTS[0]) | ||
.gas(40_000.into()) | ||
.gas_price(30_000.into()) | ||
.value(gwei(20_000)) | ||
// Set tx type to EIP-155. | ||
.transaction_type(0); | ||
}, | ||
|block, _tx| block.number(0xcafeu64), | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.