diff --git a/precompiles/prototype/prototype.go b/precompiles/prototype/prototype.go index 5a19e1373f..801e6bde52 100644 --- a/precompiles/prototype/prototype.go +++ b/precompiles/prototype/prototype.go @@ -9,7 +9,6 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/vm" @@ -27,9 +26,6 @@ var ( ABI abi.ABI ContractAddress = common.HexToAddress("0x0000000000000000000000000000000000000065") GasRequiredByMethod = map[[4]byte]uint64{} - - //go:embed IPrototype.abi - prototypeABI string ) func init() { @@ -37,14 +33,6 @@ func init() { } func initABI() { - if prototypeABI == "" { - panic("missing prototype ABI") - } - - var IPrototypeMetaData = &bind.MetaData{ - ABI: prototypeABI, - } - if err := ABI.UnmarshalJSON([]byte(IPrototypeMetaData.ABI)); err != nil { panic(err) } @@ -60,6 +48,8 @@ func initABI() { GasRequiredByMethod[methodID] = 10000 case GetGasStabilityPoolBalanceName: GasRequiredByMethod[methodID] = 10000 + default: + GasRequiredByMethod[methodID] = 0 } } } diff --git a/precompiles/prototype/prototype_test.go b/precompiles/prototype/prototype_test.go index a97fc01e3b..8b64562c80 100644 --- a/precompiles/prototype/prototype_test.go +++ b/precompiles/prototype/prototype_test.go @@ -280,19 +280,8 @@ func Test_InvalidMethod(t *testing.T) { require.False(t, doNotExist, "invalidMethod should not be present in the ABI") } -func Test_MissingABI(t *testing.T) { - prototypeABI = "" - defer func() { - if r := recover(); r != nil { - require.Equal(t, "missing prototype ABI", r, "expected error: missing ABI, got: %v", r) - } - }() - - initABI() -} - func Test_InvalidABI(t *testing.T) { - prototypeABI = "invalid json" + IPrototypeMetaData.ABI = "invalid json" defer func() { if r := recover(); r != nil { require.IsType(t, &json.SyntaxError{}, r, "expected error type: json.SyntaxError, got: %T", r) @@ -300,4 +289,4 @@ func Test_InvalidABI(t *testing.T) { }() initABI() -} \ No newline at end of file +}