mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
fix: RequiredGas
This commit is contained in:
parent
7c5bd265c7
commit
e4b122d7c7
2 changed files with 6 additions and 0 deletions
|
|
@ -79,6 +79,9 @@ func (d *DASignersPrecompile) Address() common.Address {
|
||||||
|
|
||||||
// RequiredGas implements vm.PrecompiledContract.
|
// RequiredGas implements vm.PrecompiledContract.
|
||||||
func (d *DASignersPrecompile) RequiredGas(input []byte) uint64 {
|
func (d *DASignersPrecompile) RequiredGas(input []byte) uint64 {
|
||||||
|
if len(input) < 4 {
|
||||||
|
return DASignersRequiredGasMax
|
||||||
|
}
|
||||||
method, err := d.abi.MethodById(input[:4])
|
method, err := d.abi.MethodById(input[:4])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return DASignersRequiredGasMax
|
return DASignersRequiredGasMax
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,9 @@ func (w *WrappedA0giBasePrecompile) Address() common.Address {
|
||||||
|
|
||||||
// RequiredGas implements vm.PrecompiledContract.
|
// RequiredGas implements vm.PrecompiledContract.
|
||||||
func (w *WrappedA0giBasePrecompile) RequiredGas(input []byte) uint64 {
|
func (w *WrappedA0giBasePrecompile) RequiredGas(input []byte) uint64 {
|
||||||
|
if len(input) < 4 {
|
||||||
|
return WrappedA0GIBaseRequiredGasMax
|
||||||
|
}
|
||||||
method, err := w.abi.MethodById(input[:4])
|
method, err := w.abi.MethodById(input[:4])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return WrappedA0GIBaseRequiredGasMax
|
return WrappedA0GIBaseRequiredGasMax
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue