Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

Commit be4b13d

Browse files
author
Mason Liang
committed
Add failing revert test
1 parent 91b59e7 commit be4b13d

File tree

1 file changed

+32
-0
lines changed
  • zkevm-circuits/src/evm_circuit/execution

1 file changed

+32
-0
lines changed

zkevm-circuits/src/evm_circuit/execution/tstore.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,36 @@ mod test {
178178

179179
CircuitTestBuilder::new_from_test_ctx(ctx).run();
180180
}
181+
182+
#[test]
183+
fn test_revert() {
184+
let key = Word::from(34);
185+
let value = Word::from(100);
186+
187+
let bytecode = bytecode! {
188+
PUSH32(value)
189+
PUSH32(key)
190+
TSTORE
191+
PUSH32(0)
192+
PUSH32(0)
193+
REVERT
194+
};
195+
let ctx = TestContext::<2, 1>::new(
196+
None,
197+
|accs| {
198+
accs[0]
199+
.address(MOCK_ACCOUNTS[0])
200+
.balance(Word::from(10u64.pow(19)))
201+
.code(bytecode)
202+
accs[1]
203+
.address(MOCK_ACCOUNTS[1])
204+
.balance(Word::from(10u64.pow(19)));
205+
},
206+
tx_from_1_to_0,
207+
|block, _txs| block,
208+
)
209+
.unwrap();
210+
211+
CircuitTestBuilder::new_from_test_ctx(ctx).run();
212+
}
181213
}

0 commit comments

Comments
 (0)