mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
add 0xef0001 || accounts[0].addr unit test back
This commit is contained in:
parent
d82bb03d98
commit
e26eceee77
1 changed files with 12 additions and 1 deletions
|
|
@ -850,6 +850,17 @@ func TestEstimateGas(t *testing.T) {
|
||||||
},
|
},
|
||||||
want: 46000,
|
want: 46000,
|
||||||
},
|
},
|
||||||
|
// Should retrieve the code of 0xef0001 || accounts[0].addr and return an invalid opcode error.
|
||||||
|
{
|
||||||
|
blockNumber: rpc.LatestBlockNumber,
|
||||||
|
call: TransactionArgs{
|
||||||
|
From: &accounts[0].addr,
|
||||||
|
To: &accounts[0].addr,
|
||||||
|
Value: (*hexutil.Big)(big.NewInt(0)),
|
||||||
|
AuthorizationList: []types.SetCodeAuthorization{setCodeAuthorization},
|
||||||
|
},
|
||||||
|
expectErr: errors.New("invalid opcode: opcode 0xef not defined"),
|
||||||
|
},
|
||||||
// SetCodeTx with empty authorization list should fail.
|
// SetCodeTx with empty authorization list should fail.
|
||||||
{
|
{
|
||||||
blockNumber: rpc.LatestBlockNumber,
|
blockNumber: rpc.LatestBlockNumber,
|
||||||
|
|
@ -881,7 +892,7 @@ func TestEstimateGas(t *testing.T) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if !errors.Is(err, tc.expectErr) {
|
if !errors.Is(err, tc.expectErr) {
|
||||||
if !reflect.DeepEqual(err, tc.expectErr) {
|
if err.Error() != tc.expectErr.Error() {
|
||||||
t.Errorf("test %d: error mismatch, want %v, have %v", i, tc.expectErr, err)
|
t.Errorf("test %d: error mismatch, want %v, have %v", i, tc.expectErr, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue