diff --git a/contracts b/contracts index aeaae5d1c..36074a092 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit aeaae5d1cf934473ff630985cae3b076093b1587 +Subproject commit 36074a092741027d7fae7a126696fe6315de2a6a diff --git a/go-ethereum b/go-ethereum index 8f86e725d..846839164 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 8f86e725d972a204fb91f40bf74b93b298b8689d +Subproject commit 8468391640657b3eb9ed791d4b1c3ff3b6577a8e diff --git a/system_tests/program_test.go b/system_tests/program_test.go index 8dd8384b2..5f26699bb 100644 --- a/system_tests/program_test.go +++ b/system_tests/program_test.go @@ -39,6 +39,38 @@ import ( var oneEth = arbmath.UintToBig(1e18) +func TestSelfDestruct(t *testing.T) { + t.Parallel() + + builder, auth, cleanup := setupProgramTest(t, true) + ctx := builder.ctx + l2info := builder.L2Info + l2client := builder.L2.Client + defer cleanup() + + ensure := func(tx *types.Transaction, err error) *types.Receipt { + t.Helper() + Require(t, err) + receipt, err := EnsureTxSucceeded(ctx, l2client, tx) + Require(t, err) + return receipt + } + pack := func(data []byte, err error) []byte { + Require(t, err) + return data + } + + mockAddr, tx, _, err := mocksgen.DeployProgramTest(&auth, l2client) + ensure(tx, err) + multiAddr := deployWasm(t, ctx, auth, l2client, rustFile("multicall")) + callSelfDestruct, _ := util.NewCallParser(mocksgen.ProgramTestABI, "callSelfDestruct") + + delegate := argsForMulticall(vm.DELEGATECALL, mockAddr, nil, pack(callSelfDestruct(multiAddr))) + tx = l2info.PrepareTxTo("Owner", &multiAddr, 1e9, nil, delegate) + Require(t, l2client.SendTransaction(ctx, tx)) + EnsureTxFailed(t, ctx, l2client, tx) +} + func TestProgramKeccak(t *testing.T) { t.Parallel() keccakTest(t, true)