mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
enhance error message
This commit is contained in:
parent
0ced839a19
commit
5623a3533e
2 changed files with 4 additions and 4 deletions
|
|
@ -1141,7 +1141,7 @@ func TestCall(t *testing.T) {
|
||||||
blockOverrides: override.BlockOverrides{
|
blockOverrides: override.BlockOverrides{
|
||||||
BeaconRoot: &common.Hash{0, 1, 2},
|
BeaconRoot: &common.Hash{0, 1, 2},
|
||||||
},
|
},
|
||||||
expectErr: errors.New(`"beaconRoot" is not supported for this RPC method`),
|
expectErr: errors.New(`block override "beaconRoot" is not supported for this RPC method`),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "unsupported block override withdrawals",
|
name: "unsupported block override withdrawals",
|
||||||
|
|
@ -1150,7 +1150,7 @@ func TestCall(t *testing.T) {
|
||||||
blockOverrides: override.BlockOverrides{
|
blockOverrides: override.BlockOverrides{
|
||||||
Withdrawals: &types.Withdrawals{},
|
Withdrawals: &types.Withdrawals{},
|
||||||
},
|
},
|
||||||
expectErr: errors.New(`"withdrawals" is not supported for this RPC method`),
|
expectErr: errors.New(`block override "withdrawals" is not supported for this RPC method`),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tc := range testSuite {
|
for _, tc := range testSuite {
|
||||||
|
|
|
||||||
|
|
@ -139,10 +139,10 @@ func (o *BlockOverrides) Apply(blockCtx *vm.BlockContext) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if o.BeaconRoot != nil {
|
if o.BeaconRoot != nil {
|
||||||
return errors.New(`"beaconRoot" is not supported for this RPC method`)
|
return errors.New(`block override "beaconRoot" is not supported for this RPC method`)
|
||||||
}
|
}
|
||||||
if o.Withdrawals != nil {
|
if o.Withdrawals != nil {
|
||||||
return errors.New(`"withdrawals" is not supported for this RPC method`)
|
return errors.New(`block override "withdrawals" is not supported for this RPC method`)
|
||||||
}
|
}
|
||||||
if o.Number != nil {
|
if o.Number != nil {
|
||||||
blockCtx.BlockNumber = o.Number.ToInt()
|
blockCtx.BlockNumber = o.Number.ToInt()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue