From 5ab997bbf37ef7eda95ef544ac9876c84915d997 Mon Sep 17 00:00:00 2001 From: Khaeljy Date: Mon, 25 Sep 2023 05:16:49 +0200 Subject: [PATCH] feat: add CALL opcodes (call, delegate & create) (#258) * add CALL opcodes (call, delegate & create) * cargo fmt --- crates/ef-testing/src/models/case.rs | 96 ++++++++++++++++++++++++++++ crates/ef-testing/tests/tests.rs | 11 ++++ 2 files changed, 107 insertions(+) diff --git a/crates/ef-testing/src/models/case.rs b/crates/ef-testing/src/models/case.rs index 29406813..6b698dbe 100644 --- a/crates/ef-testing/src/models/case.rs +++ b/crates/ef-testing/src/models/case.rs @@ -132,6 +132,102 @@ impl BlockchainTestCase { | "create2InitCodeSizeLimit.json" // ef-tests #155 | "createInitCodeSizeLimit.json" // ef-tests #156 | "creationTxInitCodeSizeLimit.json" // ef-tests #157 + | "Call1024BalanceTooLow.json" // ef-tests #161 + | "Call1024OOG.json" // ef-tests #162 + | "Call1024PreCalls.json" // ef-tests #163 + | "CallcodeLoseGasOOG.json" // ef-tests #164 + | "callcodeOutput3.json" // ef-tests #165 + | "CallLoseGasOOG.json" // ef-tests #166 + | "callOutput3.json" // ef-tests #167 + | "callOutput3partial.json" // ef-tests #168 + | "callOutput3partialFail.json" // ef-tests #169 + | "CallRecursiveBombPreCall.json" // ef-tests #170 + | "deleagateCallAfterValueTransfer.json" // ef-tests #171 + | "Delegatecall1024.json" // ef-tests #172 + | "Delegatecall1024OOG.json" // ef-tests #173 + | "delegatecallEmptycontract.json" // ef-tests #174 + | "delegatecallInInitcodeToEmptyContract.json" // ef-tests #175 + | "delegatecallInInitcodeToExistingContract.json" // ef-tests #176 + | "delegatecallInInitcodeToExistingContractOOG.json" // ef-tests #177 + | "delegatecallOOGinCall.json" // ef-tests #178 + | "delegatecallSenderCheck.json" // ef-tests #179 + | "delegatecallValueCheck.json" // ef-tests #180 + | "delegatecodeDynamicCode.json" // ef-tests #181 + | "delegatecodeDynamicCode2SelfCall.json" // ef-tests #182 + | "callcallcallcode_001.json" // ef-tests #183 + | "callcallcallcode_001_OOGE.json" // ef-tests #184 + | "callcallcallcode_001_OOGMAfter.json" // ef-tests #185 + | "callcallcallcode_001_OOGMBefore.json" // ef-tests #186 + | "callcallcallcode_ABCB_RECURSIVE.json" // ef-tests #187 + | "callcallcodecallcode_011.json" // ef-tests #188 + | "callcallcodecallcode_011_OOGE.json" // ef-tests #189 + | "callcallcodecallcode_011_OOGMAfter.json" // ef-tests #190 + | "callcallcodecallcode_011_OOGMBefore.json" // ef-tests #191 + | "callcallcodecallcode_ABCB_RECURSIVE.json" // ef-tests #192 + | "callcallcodecall_010.json" // ef-tests #193 + | "callcallcodecall_010_OOGE.json" // ef-tests #194 + | "callcallcodecall_010_OOGMAfter.json" // ef-tests #195 + | "callcallcodecall_010_OOGMBefore.json" // ef-tests #196 + | "callcallcodecall_ABCB_RECURSIVE.json" // ef-tests #197 + | "callcallcode_01.json" // ef-tests #198 + | "callcallcode_01_OOGE.json" // ef-tests #199 + | "callcodecallcallcode_101.json" // ef-tests #200 + | "callcodecallcallcode_101_OOGE.json" // ef-tests #201 + | "callcodecallcallcode_101_OOGMAfter.json" // ef-tests #202 + | "callcodecallcallcode_101_OOGMBefore.json" // ef-tests #203 + | "callcodecallcallcode_ABCB_RECURSIVE.json" // ef-tests #204 + | "callcodecallcall_100.json" // ef-tests #205 + | "callcodecallcall_100_OOGE.json" // ef-tests #206 + | "callcodecallcall_100_OOGMAfter.json" // ef-tests #207 + | "callcodecallcall_100_OOGMBefore.json" // ef-tests #208 + | "callcodecallcall_ABCB_RECURSIVE.json" // ef-tests #209 + | "callcodecallcodecallcode_111.json" // ef-tests #210 + | "callcodecallcodecallcode_111_OOGE.json" // ef-tests #211 + | "callcodecallcodecallcode_111_OOGMAfter.json" // ef-tests #212 + | "callcodecallcodecallcode_111_OOGMBefore.json" // ef-tests #213 + | "callcodecallcodecallcode_111_SuicideEnd.json" // ef-tests #214 + | "callcodecallcodecallcode_ABCB_RECURSIVE.json" // ef-tests #215 + | "callcodecallcodecall_110.json" // ef-tests #216 + | "callcodecallcodecall_110_OOGE.json" // ef-tests #217 + | "callcodecallcodecall_110_OOGMAfter.json" // ef-tests #218 + | "callcodecallcodecall_110_OOGMBefore.json" // ef-tests #219 + | "callcodecallcodecall_ABCB_RECURSIVE.json" // ef-tests #220 + | "callcodecallcode_11.json" // ef-tests #221 + | "callcodecallcode_11_OOGE.json" // ef-tests #222 + | "callcodecall_10.json" // ef-tests #223 + | "callcodecall_10_OOGE.json" // ef-tests #224 + | "callcallcallcode_001_SuicideEnd.json" // ef-tests #225 + | "callcallcallcode_001_SuicideMiddle.json" // ef-tests #226 + | "callcallcodecallcode_011_SuicideEnd.json" // ef-tests #227 + | "callcallcodecallcode_011_SuicideMiddle.json" // ef-tests #228 + | "callcallcodecall_010_SuicideEnd.json" // ef-tests #229 + | "callcallcodecall_010_SuicideMiddle.json" // ef-tests #230 + | "callcallcode_01_SuicideEnd.json" // ef-tests #231 + | "callcodecallcallcode_101_SuicideEnd.json" // ef-tests #232 + | "callcodecallcallcode_101_SuicideMiddle.json" // ef-tests #233 + | "callcodecallcall_100_SuicideEnd.json" // ef-tests #234 + | "callcodecallcall_100_SuicideMiddle.json" // ef-tests #235 + | "callcodecallcodecall_110_SuicideEnd.json" // ef-tests #236 + | "callcodecall_10_SuicideEnd.json" // ef-tests #237 + | "callcallcall_000.json" // ef-tests #238 + | "callcallcall_000_OOGE.json" // ef-tests #239 + | "callcallcall_000_OOGMAfter.json" // ef-tests #240 + | "callcallcall_000_OOGMBefore.json" // ef-tests #241 + | "callcallcall_000_SuicideEnd.json" // ef-tests #242 + | "callcallcall_000_SuicideMiddle.json" // ef-tests #243 + | "callcallcall_ABCB_RECURSIVE.json" // ef-tests #244 + | "callcall_00.json" // ef-tests #245 + | "callcall_00_OOGE.json" // ef-tests #246 + | "callcall_00_OOGE_valueTransfer.json" // ef-tests #247 + | "callcall_00_SuicideEnd.json" // ef-tests #248 + | "callcodeDynamicCode.json" // ef-tests #249 + | "callcodeEmptycontract.json" // ef-tests #250 + | "callcodeInInitcodeToEmptyContract.json" // ef-tests #251 + | "callcodeInInitcodeToExisContractWithVTransferNEMoney.json" // ef-tests #252 + | "callcodeInInitcodeToExistingContract.json" // ef-tests #253 + | "callcodeInInitcodeToExistingContractWithValueTransfer.json" // ef-tests #254 + | "callcode_checkPC.json" // ef-tests #255 + | "callcodeDynamicCode2SelfCall.json" // ef-tests #256 ) || matches!(name, name if name.starts_with("opc") && name.ends_with(".json")) // ef-test #120 } diff --git a/crates/ef-testing/tests/tests.rs b/crates/ef-testing/tests/tests.rs index 2a16ad46..b4fd65d9 100644 --- a/crates/ef-testing/tests/tests.rs +++ b/crates/ef-testing/tests/tests.rs @@ -70,4 +70,15 @@ mod blockchain_tests { blockchain_tests!(st_log_tests, stLogTests); blockchain_tests!(st_bad_opcode, stBadOpcode); blockchain_tests!(shanghai, Shanghai); + blockchain_tests!(st_call_codes, stCallCodes); + //blockchain_tests!(st_call_create_call_code_test, stCallCreateCallCodeTest); // ef-tests #257 + blockchain_tests!( + st_call_delegate_codes_call_code_homestead, + stCallDelegateCodesCallCodeHomestead + ); + blockchain_tests!( + st_call_delegate_codes_homestead, + stCallDelegateCodesHomestead + ); + blockchain_tests!(st_delegatecall_test_homestead, stDelegatecallTestHomestead); }