From a074c61be6d592d78334833d581fdc927bfb2493 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 26 Nov 2024 03:56:31 -0500 Subject: [PATCH 1/4] chore: copy evm & feemarket types to sdk-go --- .gitignore | 3 + Makefile | 4 + chain/evm/types/access_list.go | 55 + chain/evm/types/access_list_tx.go | 249 + chain/evm/types/access_tuple.pb.go | 366 + chain/evm/types/chain_config.go | 204 + chain/evm/types/chain_config.pb.go | 1392 ++++ chain/evm/types/codec.go | 96 + chain/evm/types/compiled_contract.go | 117 + chain/evm/types/dynamic_fee_tx.go | 281 + chain/evm/types/errors.go | 287 + chain/evm/types/eth.go | 84 + chain/evm/types/events.go | 24 + chain/evm/types/events.pb.go | 1266 +++ chain/evm/types/genesis.go | 49 + chain/evm/types/genesis.pb.go | 682 ++ chain/evm/types/interfaces.go | 74 + chain/evm/types/key.go | 78 + chain/evm/types/legacy_tx.go | 217 + chain/evm/types/log.pb.go | 702 ++ chain/evm/types/logs.go | 127 + chain/evm/types/msg.go | 395 + chain/evm/types/params.go | 128 + chain/evm/types/params.pb.go | 626 ++ chain/evm/types/protocol.go | 9 + chain/evm/types/query.go | 24 + chain/evm/types/query.pb.go | 6800 +++++++++++++++++ chain/evm/types/response.go | 72 + chain/evm/types/state.pb.go | 370 + chain/evm/types/storage.go | 66 + chain/evm/types/trace_config.pb.go | 896 +++ chain/evm/types/tracer.go | 56 + chain/evm/types/transaction_logs.pb.go | 387 + chain/evm/types/tx.go | 56 + chain/evm/types/tx.pb.go | 3411 +++++++++ chain/evm/types/tx_args.go | 218 + chain/evm/types/tx_data.go | 123 + chain/evm/types/tx_result.pb.go | 532 ++ chain/evm/types/utils.go | 252 + chain/feemarket/types/codec.go | 43 + chain/feemarket/types/events.go | 9 + chain/feemarket/types/events.pb.go | 547 ++ chain/feemarket/types/feemarket.pb.go | 582 ++ chain/feemarket/types/genesis.go | 23 + chain/feemarket/types/genesis.pb.go | 365 + chain/feemarket/types/interfaces.go | 15 + chain/feemarket/types/keys.go | 24 + chain/feemarket/types/msg.go | 28 + chain/feemarket/types/params.go | 219 + chain/feemarket/types/query.pb.go | 1197 +++ chain/feemarket/types/tx.pb.go | 596 ++ proto/injective/evm/v1/access_tuple.proto | 16 + proto/injective/evm/v1/chain_config.proto | 117 + proto/injective/evm/v1/events.proto | 44 + proto/injective/evm/v1/genesis.proto | 28 + proto/injective/evm/v1/log.proto | 37 + proto/injective/evm/v1/params.proto | 25 + proto/injective/evm/v1/query.proto | 338 + proto/injective/evm/v1/state.proto | 12 + proto/injective/evm/v1/trace_config.proto | 43 + proto/injective/evm/v1/transaction_logs.proto | 16 + proto/injective/evm/v1/tx.proto | 189 + proto/injective/evm/v1/tx_result.proto | 28 + proto/injective/feemarket/v1/events.proto | 18 + proto/injective/feemarket/v1/feemarket.proto | 32 + proto/injective/feemarket/v1/genesis.proto | 20 + proto/injective/feemarket/v1/query.proto | 56 + proto/injective/feemarket/v1/tx.proto | 31 + 68 files changed, 25476 insertions(+) create mode 100644 chain/evm/types/access_list.go create mode 100644 chain/evm/types/access_list_tx.go create mode 100644 chain/evm/types/access_tuple.pb.go create mode 100644 chain/evm/types/chain_config.go create mode 100644 chain/evm/types/chain_config.pb.go create mode 100644 chain/evm/types/codec.go create mode 100644 chain/evm/types/compiled_contract.go create mode 100644 chain/evm/types/dynamic_fee_tx.go create mode 100644 chain/evm/types/errors.go create mode 100644 chain/evm/types/eth.go create mode 100644 chain/evm/types/events.go create mode 100644 chain/evm/types/events.pb.go create mode 100644 chain/evm/types/genesis.go create mode 100644 chain/evm/types/genesis.pb.go create mode 100644 chain/evm/types/interfaces.go create mode 100644 chain/evm/types/key.go create mode 100644 chain/evm/types/legacy_tx.go create mode 100644 chain/evm/types/log.pb.go create mode 100644 chain/evm/types/logs.go create mode 100644 chain/evm/types/msg.go create mode 100644 chain/evm/types/params.go create mode 100644 chain/evm/types/params.pb.go create mode 100644 chain/evm/types/protocol.go create mode 100644 chain/evm/types/query.go create mode 100644 chain/evm/types/query.pb.go create mode 100644 chain/evm/types/response.go create mode 100644 chain/evm/types/state.pb.go create mode 100644 chain/evm/types/storage.go create mode 100644 chain/evm/types/trace_config.pb.go create mode 100644 chain/evm/types/tracer.go create mode 100644 chain/evm/types/transaction_logs.pb.go create mode 100644 chain/evm/types/tx.go create mode 100644 chain/evm/types/tx.pb.go create mode 100644 chain/evm/types/tx_args.go create mode 100644 chain/evm/types/tx_data.go create mode 100644 chain/evm/types/tx_result.pb.go create mode 100644 chain/evm/types/utils.go create mode 100644 chain/feemarket/types/codec.go create mode 100644 chain/feemarket/types/events.go create mode 100644 chain/feemarket/types/events.pb.go create mode 100644 chain/feemarket/types/feemarket.pb.go create mode 100644 chain/feemarket/types/genesis.go create mode 100644 chain/feemarket/types/genesis.pb.go create mode 100644 chain/feemarket/types/interfaces.go create mode 100644 chain/feemarket/types/keys.go create mode 100644 chain/feemarket/types/msg.go create mode 100644 chain/feemarket/types/params.go create mode 100644 chain/feemarket/types/query.pb.go create mode 100644 chain/feemarket/types/tx.pb.go create mode 100644 proto/injective/evm/v1/access_tuple.proto create mode 100644 proto/injective/evm/v1/chain_config.proto create mode 100644 proto/injective/evm/v1/events.proto create mode 100644 proto/injective/evm/v1/genesis.proto create mode 100644 proto/injective/evm/v1/log.proto create mode 100644 proto/injective/evm/v1/params.proto create mode 100644 proto/injective/evm/v1/query.proto create mode 100644 proto/injective/evm/v1/state.proto create mode 100644 proto/injective/evm/v1/trace_config.proto create mode 100644 proto/injective/evm/v1/transaction_logs.proto create mode 100644 proto/injective/evm/v1/tx.proto create mode 100644 proto/injective/evm/v1/tx_result.proto create mode 100644 proto/injective/feemarket/v1/events.proto create mode 100644 proto/injective/feemarket/v1/feemarket.proto create mode 100644 proto/injective/feemarket/v1/genesis.proto create mode 100644 proto/injective/feemarket/v1/query.proto create mode 100644 proto/injective/feemarket/v1/tx.proto diff --git a/.gitignore b/.gitignore index 8f38a601..261555bf 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ .chain_cookie .exchange_cookie coverage.out +.anima +.vscode + diff --git a/Makefile b/Makefile index 4492bf96..3d8962c6 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,10 @@ copy-chain-types: rm -rf chain/stream/types/*test.go rm -rf chain/stream/types/*gw.go cp ../injective-core/injective-chain/types/*.go chain/types rm -rf chain/types/*test.go rm -rf chain/types/*gw.go + cp ../injective-core/injective-chain/modules/evm/types/*.go chain/evm/types + rm -rf chain/evm/types/*test.go rm -rf chain/evm/types/*gw.go + cp ../injective-core/injective-chain/modules/feemarket/types/*.go chain/feemarket/types + rm -rf chain/feemarket/types/*test.go rm -rf chain/feemarket/types/*gw.go @echo "👉 Replace injective-core/injective-chain/modules with sdk-go/chain" @echo "👉 Replace injective-core/injective-chain/codec with sdk-go/chain/codec" diff --git a/chain/evm/types/access_list.go b/chain/evm/types/access_list.go new file mode 100644 index 00000000..7ebc63fd --- /dev/null +++ b/chain/evm/types/access_list.go @@ -0,0 +1,55 @@ +package types + +import ( + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" +) + +// AccessList is an EIP-2930 access list that represents the slice of +// the protobuf AccessTuples. +type AccessList []AccessTuple + +// NewAccessList creates a new protobuf-compatible AccessList from an ethereum +// core AccessList type +func NewAccessList(ethAccessList *ethtypes.AccessList) AccessList { + if ethAccessList == nil { + return nil + } + + al := AccessList{} + for _, tuple := range *ethAccessList { + storageKeys := make([]string, len(tuple.StorageKeys)) + + for i := range tuple.StorageKeys { + storageKeys[i] = tuple.StorageKeys[i].String() + } + + al = append(al, AccessTuple{ + Address: tuple.Address.String(), + StorageKeys: storageKeys, + }) + } + + return al +} + +// ToEthAccessList is an utility function to convert the protobuf compatible +// AccessList to eth core AccessList from go-ethereum +func (al AccessList) ToEthAccessList() *ethtypes.AccessList { + var ethAccessList ethtypes.AccessList + + for _, tuple := range al { + storageKeys := make([]common.Hash, len(tuple.StorageKeys)) + + for i := range tuple.StorageKeys { + storageKeys[i] = common.HexToHash(tuple.StorageKeys[i]) + } + + ethAccessList = append(ethAccessList, ethtypes.AccessTuple{ + Address: common.HexToAddress(tuple.Address), + StorageKeys: storageKeys, + }) + } + + return ðAccessList +} diff --git a/chain/evm/types/access_list_tx.go b/chain/evm/types/access_list_tx.go new file mode 100644 index 00000000..972dfe23 --- /dev/null +++ b/chain/evm/types/access_list_tx.go @@ -0,0 +1,249 @@ +package types + +import ( + "math/big" + + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + errortypes "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + + "github.com/InjectiveLabs/sdk-go/chain/types" +) + +func NewAccessListTx(tx *ethtypes.Transaction) (*AccessListTx, error) { + txData := &AccessListTx{ + Nonce: tx.Nonce(), + Data: tx.Data(), + GasLimit: tx.Gas(), + } + + v, r, s := tx.RawSignatureValues() + if to := tx.To(); to != nil { + txData.To = to.Hex() + } + + if tx.Value() != nil { + amountInt, err := types.SafeNewIntFromBigInt(tx.Value()) + if err != nil { + return nil, err + } + txData.Amount = &amountInt + } + + if tx.GasPrice() != nil { + gasPriceInt, err := types.SafeNewIntFromBigInt(tx.GasPrice()) + if err != nil { + return nil, err + } + txData.GasPrice = &gasPriceInt + } + + if tx.AccessList() != nil { + al := tx.AccessList() + txData.Accesses = NewAccessList(&al) + } + + txData.SetSignatureValues(tx.ChainId(), v, r, s) + return txData, nil +} + +// TxType returns the tx type +func (tx *AccessListTx) TxType() uint8 { + return ethtypes.AccessListTxType +} + +// Copy returns an instance with the same field values +func (tx *AccessListTx) Copy() TxData { + return &AccessListTx{ + ChainID: tx.ChainID, + Nonce: tx.Nonce, + GasPrice: tx.GasPrice, + GasLimit: tx.GasLimit, + To: tx.To, + Amount: tx.Amount, + Data: common.CopyBytes(tx.Data), + Accesses: tx.Accesses, + V: common.CopyBytes(tx.V), + R: common.CopyBytes(tx.R), + S: common.CopyBytes(tx.S), + } +} + +// GetChainID returns the chain id field from the AccessListTx +func (tx *AccessListTx) GetChainID() *big.Int { + if tx.ChainID == nil { + return nil + } + + return tx.ChainID.BigInt() +} + +// GetAccessList returns the AccessList field. +func (tx *AccessListTx) GetAccessList() ethtypes.AccessList { + if tx.Accesses == nil { + return nil + } + return *tx.Accesses.ToEthAccessList() +} + +// GetData returns the a copy of the input data bytes. +func (tx *AccessListTx) GetData() []byte { + return common.CopyBytes(tx.Data) +} + +// GetGas returns the gas limit. +func (tx *AccessListTx) GetGas() uint64 { + return tx.GasLimit +} + +// GetGasPrice returns the gas price field. +func (tx *AccessListTx) GetGasPrice() *big.Int { + if tx.GasPrice == nil { + return nil + } + return tx.GasPrice.BigInt() +} + +// GetGasTipCap returns the gas price field. +func (tx *AccessListTx) GetGasTipCap() *big.Int { + return tx.GetGasPrice() +} + +// GetGasFeeCap returns the gas price field. +func (tx *AccessListTx) GetGasFeeCap() *big.Int { + return tx.GetGasPrice() +} + +// GetValue returns the tx amount. +func (tx *AccessListTx) GetValue() *big.Int { + if tx.Amount == nil { + return nil + } + + return tx.Amount.BigInt() +} + +// GetNonce returns the account sequence for the transaction. +func (tx *AccessListTx) GetNonce() uint64 { return tx.Nonce } + +// GetTo returns the pointer to the recipient address. +func (tx *AccessListTx) GetTo() *common.Address { + if tx.To == "" { + return nil + } + to := common.HexToAddress(tx.To) + return &to +} + +// AsEthereumData returns an AccessListTx transaction tx from the proto-formatted +// TxData defined on the Cosmos EVM. +func (tx *AccessListTx) AsEthereumData() ethtypes.TxData { + v, r, s := tx.GetRawSignatureValues() + return ðtypes.AccessListTx{ + ChainID: tx.GetChainID(), + Nonce: tx.GetNonce(), + GasPrice: tx.GetGasPrice(), + Gas: tx.GetGas(), + To: tx.GetTo(), + Value: tx.GetValue(), + Data: tx.GetData(), + AccessList: tx.GetAccessList(), + V: v, + R: r, + S: s, + } +} + +// GetRawSignatureValues returns the V, R, S signature values of the transaction. +// The return values should not be modified by the caller. +func (tx *AccessListTx) GetRawSignatureValues() (v, r, s *big.Int) { + return rawSignatureValues(tx.V, tx.R, tx.S) +} + +// SetSignatureValues sets the signature values to the transaction. +func (tx *AccessListTx) SetSignatureValues(chainID, v, r, s *big.Int) { + if v != nil { + tx.V = v.Bytes() + } + if r != nil { + tx.R = r.Bytes() + } + if s != nil { + tx.S = s.Bytes() + } + if chainID != nil { + chainIDInt := sdkmath.NewIntFromBigInt(chainID) + tx.ChainID = &chainIDInt + } +} + +// Validate performs a stateless validation of the tx fields. +func (tx AccessListTx) Validate() error { + gasPrice := tx.GetGasPrice() + if gasPrice == nil { + return errorsmod.Wrap(ErrInvalidGasPrice, "cannot be nil") + } + if !types.IsValidInt256(gasPrice) { + return errorsmod.Wrap(ErrInvalidGasPrice, "out of bound") + } + + if gasPrice.Sign() == -1 { + return errorsmod.Wrapf(ErrInvalidGasPrice, "gas price cannot be negative %s", gasPrice) + } + + amount := tx.GetValue() + // Amount can be 0 + if amount != nil && amount.Sign() == -1 { + return errorsmod.Wrapf(ErrInvalidAmount, "amount cannot be negative %s", amount) + } + if !types.IsValidInt256(amount) { + return errorsmod.Wrap(ErrInvalidAmount, "out of bound") + } + + if !types.IsValidInt256(tx.Fee()) { + return errorsmod.Wrap(ErrInvalidGasFee, "out of bound") + } + + if tx.To != "" { + if err := types.ValidateAddress(tx.To); err != nil { + return errorsmod.Wrap(err, "invalid to address") + } + } + + if tx.GetChainID() == nil { + return errorsmod.Wrap( + errortypes.ErrInvalidChainID, + "chain ID must be present on AccessList txs", + ) + } + + return nil +} + +// Fee returns gasprice * gaslimit. +func (tx AccessListTx) Fee() *big.Int { + return fee(tx.GetGasPrice(), tx.GetGas()) +} + +// Cost returns amount + gasprice * gaslimit. +func (tx AccessListTx) Cost() *big.Int { + return cost(tx.Fee(), tx.GetValue()) +} + +// EffectiveGasPrice is the same as GasPrice for AccessListTx +func (tx AccessListTx) EffectiveGasPrice(_ *big.Int) *big.Int { + return tx.GetGasPrice() +} + +// EffectiveFee is the same as Fee for AccessListTx +func (tx AccessListTx) EffectiveFee(_ *big.Int) *big.Int { + return tx.Fee() +} + +// EffectiveCost is the same as Cost for AccessListTx +func (tx AccessListTx) EffectiveCost(_ *big.Int) *big.Int { + return tx.Cost() +} diff --git a/chain/evm/types/access_tuple.pb.go b/chain/evm/types/access_tuple.pb.go new file mode 100644 index 00000000..a096d275 --- /dev/null +++ b/chain/evm/types/access_tuple.pb.go @@ -0,0 +1,366 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/evm/v1/access_tuple.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// AccessTuple is the element type of an access list. +type AccessTuple struct { + // address is a hex formatted ethereum address + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // storage_keys are hex formatted hashes of the storage keys + StorageKeys []string `protobuf:"bytes,2,rep,name=storage_keys,json=storageKeys,proto3" json:"storageKeys"` +} + +func (m *AccessTuple) Reset() { *m = AccessTuple{} } +func (m *AccessTuple) String() string { return proto.CompactTextString(m) } +func (*AccessTuple) ProtoMessage() {} +func (*AccessTuple) Descriptor() ([]byte, []int) { + return fileDescriptor_08f52b3371b9b4eb, []int{0} +} +func (m *AccessTuple) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AccessTuple) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AccessTuple.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AccessTuple) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccessTuple.Merge(m, src) +} +func (m *AccessTuple) XXX_Size() int { + return m.Size() +} +func (m *AccessTuple) XXX_DiscardUnknown() { + xxx_messageInfo_AccessTuple.DiscardUnknown(m) +} + +var xxx_messageInfo_AccessTuple proto.InternalMessageInfo + +func init() { + proto.RegisterType((*AccessTuple)(nil), "injective.evm.v1.AccessTuple") +} + +func init() { + proto.RegisterFile("injective/evm/v1/access_tuple.proto", fileDescriptor_08f52b3371b9b4eb) +} + +var fileDescriptor_08f52b3371b9b4eb = []byte{ + // 240 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0xcc, 0xcb, 0x4a, + 0x4d, 0x2e, 0xc9, 0x2c, 0x4b, 0xd5, 0x4f, 0x2d, 0xcb, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4c, 0x4e, + 0x4e, 0x2d, 0x2e, 0x8e, 0x2f, 0x29, 0x2d, 0xc8, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x80, 0x2b, 0xd2, 0x4b, 0x2d, 0xcb, 0xd5, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, + 0x07, 0x4b, 0xea, 0x83, 0x58, 0x10, 0x75, 0x4a, 0x89, 0x5c, 0xdc, 0x8e, 0x60, 0xdd, 0x21, 0x20, + 0xcd, 0x42, 0x12, 0x5c, 0xec, 0x89, 0x29, 0x29, 0x45, 0xa9, 0xc5, 0xc5, 0x12, 0x8c, 0x0a, 0x8c, + 0x1a, 0x9c, 0x41, 0x30, 0xae, 0x90, 0x11, 0x17, 0x4f, 0x71, 0x49, 0x7e, 0x51, 0x62, 0x7a, 0x6a, + 0x7c, 0x76, 0x6a, 0x65, 0xb1, 0x04, 0x93, 0x02, 0xb3, 0x06, 0xa7, 0x13, 0xff, 0xab, 0x7b, 0xf2, + 0xdc, 0x50, 0x71, 0xef, 0xd4, 0xca, 0xe2, 0x20, 0x64, 0x8e, 0x15, 0x4b, 0xc7, 0x02, 0x79, 0x06, + 0xa7, 0xe4, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, + 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xf2, 0x4c, 0xcf, 0x2c, + 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xf7, 0x84, 0xb9, 0xd7, 0x27, 0x31, 0xa9, 0x58, + 0x1f, 0xee, 0x7a, 0xdd, 0xe4, 0xfc, 0xa2, 0x54, 0x64, 0x6e, 0x46, 0x62, 0x66, 0x9e, 0x7e, 0x6e, + 0x7e, 0x4a, 0x69, 0x4e, 0x6a, 0x31, 0xd8, 0xff, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, + 0xef, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x43, 0x1e, 0x02, 0x5c, 0x1d, 0x01, 0x00, 0x00, +} + +func (m *AccessTuple) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AccessTuple) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccessTuple) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.StorageKeys) > 0 { + for iNdEx := len(m.StorageKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.StorageKeys[iNdEx]) + copy(dAtA[i:], m.StorageKeys[iNdEx]) + i = encodeVarintAccessTuple(dAtA, i, uint64(len(m.StorageKeys[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintAccessTuple(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintAccessTuple(dAtA []byte, offset int, v uint64) int { + offset -= sovAccessTuple(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AccessTuple) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovAccessTuple(uint64(l)) + } + if len(m.StorageKeys) > 0 { + for _, s := range m.StorageKeys { + l = len(s) + n += 1 + l + sovAccessTuple(uint64(l)) + } + } + return n +} + +func sovAccessTuple(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAccessTuple(x uint64) (n int) { + return sovAccessTuple(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AccessTuple) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccessTuple + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AccessTuple: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AccessTuple: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccessTuple + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAccessTuple + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAccessTuple + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageKeys", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccessTuple + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAccessTuple + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAccessTuple + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StorageKeys = append(m.StorageKeys, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAccessTuple(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAccessTuple + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAccessTuple(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAccessTuple + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAccessTuple + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAccessTuple + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthAccessTuple + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAccessTuple + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAccessTuple + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAccessTuple = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAccessTuple = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAccessTuple = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/evm/types/chain_config.go b/chain/evm/types/chain_config.go new file mode 100644 index 00000000..d19af55a --- /dev/null +++ b/chain/evm/types/chain_config.go @@ -0,0 +1,204 @@ +package types + +import ( + "math/big" + "strings" + + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/params" +) + +// EthereumConfig returns an Ethereum ChainConfig for EVM state transitions. +// All the negative or nil values are converted to nil +func (cc ChainConfig) EthereumConfig(chainID *big.Int) *params.ChainConfig { + cfg := ¶ms.ChainConfig{ + ChainID: chainID, + HomesteadBlock: getBlockValue(cc.HomesteadBlock), + DAOForkBlock: getBlockValue(cc.DAOForkBlock), + DAOForkSupport: cc.DAOForkSupport, + EIP150Block: getBlockValue(cc.EIP150Block), + EIP155Block: getBlockValue(cc.EIP155Block), + EIP158Block: getBlockValue(cc.EIP158Block), + ByzantiumBlock: getBlockValue(cc.ByzantiumBlock), + ConstantinopleBlock: getBlockValue(cc.ConstantinopleBlock), + PetersburgBlock: getBlockValue(cc.PetersburgBlock), + IstanbulBlock: getBlockValue(cc.IstanbulBlock), + MuirGlacierBlock: getBlockValue(cc.MuirGlacierBlock), + BerlinBlock: getBlockValue(cc.BerlinBlock), + LondonBlock: getBlockValue(cc.LondonBlock), + ArrowGlacierBlock: getBlockValue(cc.ArrowGlacierBlock), + GrayGlacierBlock: getBlockValue(cc.GrayGlacierBlock), + MergeNetsplitBlock: getBlockValue(cc.MergeNetsplitBlock), + TerminalTotalDifficulty: nil, + Ethash: nil, + Clique: nil, + ShanghaiTime: getTimeValue(cc.ShanghaiTime), + CancunTime: getTimeValue(cc.CancunTime), + PragueTime: getTimeValue(cc.PragueTime), + } + return cfg +} + +// DefaultChainConfig returns default evm parameters. +func DefaultChainConfig() ChainConfig { + homesteadBlock := sdkmath.ZeroInt() + daoForkBlock := sdkmath.ZeroInt() + eip150Block := sdkmath.ZeroInt() + eip155Block := sdkmath.ZeroInt() + eip158Block := sdkmath.ZeroInt() + byzantiumBlock := sdkmath.ZeroInt() + constantinopleBlock := sdkmath.ZeroInt() + petersburgBlock := sdkmath.ZeroInt() + istanbulBlock := sdkmath.ZeroInt() + muirGlacierBlock := sdkmath.ZeroInt() + berlinBlock := sdkmath.ZeroInt() + londonBlock := sdkmath.ZeroInt() + arrowGlacierBlock := sdkmath.ZeroInt() + grayGlacierBlock := sdkmath.ZeroInt() + mergeNetsplitBlock := sdkmath.ZeroInt() + shanghaiTime := sdkmath.ZeroInt() + + return ChainConfig{ + HomesteadBlock: &homesteadBlock, + DAOForkBlock: &daoForkBlock, + DAOForkSupport: true, + EIP150Block: &eip150Block, + EIP150Hash: common.Hash{}.String(), + EIP155Block: &eip155Block, + EIP158Block: &eip158Block, + ByzantiumBlock: &byzantiumBlock, + ConstantinopleBlock: &constantinopleBlock, + PetersburgBlock: &petersburgBlock, + IstanbulBlock: &istanbulBlock, + MuirGlacierBlock: &muirGlacierBlock, + BerlinBlock: &berlinBlock, + LondonBlock: &londonBlock, + ArrowGlacierBlock: &arrowGlacierBlock, + GrayGlacierBlock: &grayGlacierBlock, + MergeNetsplitBlock: &mergeNetsplitBlock, + ShanghaiTime: &shanghaiTime, + } +} + +func getBlockValue(block *sdkmath.Int) *big.Int { + if block == nil || block.IsNegative() { + return nil + } + + return block.BigIntMut() +} + +func getTimeValue(time *sdkmath.Int) *uint64 { + if time == nil || time.IsNegative() { + return nil + } + t := time.BigIntMut().Uint64() + return &t +} + +// Validate performs a basic validation of the ChainConfig params. The function will return an error +// if any of the block values is uninitialized (i.e nil) or if the EIP150Hash is an invalid hash. +func (cc ChainConfig) Validate() error { + if err := ValidateBlock(cc.HomesteadBlock); err != nil { + return errorsmod.Wrap(err, "homesteadBlock") + } + if err := ValidateBlock(cc.DAOForkBlock); err != nil { + return errorsmod.Wrap(err, "daoForkBlock") + } + if err := ValidateBlock(cc.EIP150Block); err != nil { + return errorsmod.Wrap(err, "eip150Block") + } + if err := ValidateHash(cc.EIP150Hash); err != nil { + return err + } + if err := ValidateBlock(cc.EIP155Block); err != nil { + return errorsmod.Wrap(err, "eip155Block") + } + if err := ValidateBlock(cc.EIP158Block); err != nil { + return errorsmod.Wrap(err, "eip158Block") + } + if err := ValidateBlock(cc.ByzantiumBlock); err != nil { + return errorsmod.Wrap(err, "byzantiumBlock") + } + if err := ValidateBlock(cc.ConstantinopleBlock); err != nil { + return errorsmod.Wrap(err, "constantinopleBlock") + } + if err := ValidateBlock(cc.PetersburgBlock); err != nil { + return errorsmod.Wrap(err, "petersburgBlock") + } + if err := ValidateBlock(cc.IstanbulBlock); err != nil { + return errorsmod.Wrap(err, "istanbulBlock") + } + if err := ValidateBlock(cc.MuirGlacierBlock); err != nil { + return errorsmod.Wrap(err, "muirGlacierBlock") + } + if err := ValidateBlock(cc.BerlinBlock); err != nil { + return errorsmod.Wrap(err, "berlinBlock") + } + if err := ValidateBlock(cc.LondonBlock); err != nil { + return errorsmod.Wrap(err, "londonBlock") + } + if err := ValidateBlock(cc.ArrowGlacierBlock); err != nil { + return errorsmod.Wrap(err, "arrowGlacierBlock") + } + if err := ValidateBlock(cc.GrayGlacierBlock); err != nil { + return errorsmod.Wrap(err, "GrayGlacierBlock") + } + if err := ValidateBlock(cc.MergeNetsplitBlock); err != nil { + return errorsmod.Wrap(err, "MergeNetsplitBlock") + } + if err := ValidateTime(cc.ShanghaiTime); err != nil { + return errorsmod.Wrap(err, "ShanghaiTime") + } + if err := ValidateTime(cc.CancunTime); err != nil { + return errorsmod.Wrap(err, "CancunTime") + } + if err := ValidateTime(cc.PragueTime); err != nil { + return errorsmod.Wrap(err, "PragueTime") + } + // NOTE: chain ID is not needed to check config order + if err := cc.EthereumConfig(nil).CheckConfigForkOrder(); err != nil { + return errorsmod.Wrap(err, "invalid config fork order") + } + return nil +} + +func ValidateHash(hex string) error { + if hex != "" && strings.TrimSpace(hex) == "" { + return errorsmod.Wrap(ErrInvalidChainConfig, "hash cannot be blank") + } + + return nil +} + +func ValidateBlock(block *sdkmath.Int) error { + // nil value means that the fork has not yet been applied + if block == nil { + return nil + } + + if block.IsNegative() { + return errorsmod.Wrapf( + ErrInvalidChainConfig, "block value cannot be negative: %s", block, + ) + } + + return nil +} + +func ValidateTime(time *sdkmath.Int) error { + // nil value means that the fork has not yet been applied + if time == nil { + return nil + } + + if time.IsNegative() { + return errorsmod.Wrapf( + ErrInvalidChainConfig, "time value cannot be negative: %s", time, + ) + } + + return nil +} diff --git a/chain/evm/types/chain_config.pb.go b/chain/evm/types/chain_config.pb.go new file mode 100644 index 00000000..c580b5e9 --- /dev/null +++ b/chain/evm/types/chain_config.pb.go @@ -0,0 +1,1392 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/evm/v1/chain_config.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// ChainConfig defines the Ethereum ChainConfig parameters using *sdkmath.Int values +// instead of *big.Int. +type ChainConfig struct { + // homestead_block switch (nil no fork, 0 = already homestead) + HomesteadBlock *cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=homestead_block,json=homesteadBlock,proto3,customtype=cosmossdk.io/math.Int" json:"homestead_block,omitempty" yaml:"homestead_block"` + // dao_fork_block corresponds to TheDAO hard-fork switch block (nil no fork) + DAOForkBlock *cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=dao_fork_block,json=daoForkBlock,proto3,customtype=cosmossdk.io/math.Int" json:"dao_fork_block,omitempty" yaml:"dao_fork_block"` + // dao_fork_support defines whether the nodes supports or opposes the DAO hard-fork + DAOForkSupport bool `protobuf:"varint,3,opt,name=dao_fork_support,json=daoForkSupport,proto3" json:"dao_fork_support,omitempty" yaml:"dao_fork_support"` + // eip150_block: EIP150 implements the Gas price changes + // (https://github.com/ethereum/EIPs/issues/150) EIP150 HF block (nil no fork) + EIP150Block *cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=eip150_block,json=eip150Block,proto3,customtype=cosmossdk.io/math.Int" json:"eip150_block,omitempty" yaml:"eip150_block"` + // eip150_hash: EIP150 HF hash (needed for header only clients as only gas pricing changed) + EIP150Hash string `protobuf:"bytes,5,opt,name=eip150_hash,json=eip150Hash,proto3" json:"eip150_hash,omitempty" yaml:"byzantium_block"` + // eip155_block: EIP155Block HF block + EIP155Block *cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=eip155_block,json=eip155Block,proto3,customtype=cosmossdk.io/math.Int" json:"eip155_block,omitempty" yaml:"eip155_block"` + // eip158_block: EIP158 HF block + EIP158Block *cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=eip158_block,json=eip158Block,proto3,customtype=cosmossdk.io/math.Int" json:"eip158_block,omitempty" yaml:"eip158_block"` + // byzantium_block: Byzantium switch block (nil no fork, 0 = already on byzantium) + ByzantiumBlock *cosmossdk_io_math.Int `protobuf:"bytes,8,opt,name=byzantium_block,json=byzantiumBlock,proto3,customtype=cosmossdk.io/math.Int" json:"byzantium_block,omitempty" yaml:"byzantium_block"` + // constantinople_block: Constantinople switch block (nil no fork, 0 = already activated) + ConstantinopleBlock *cosmossdk_io_math.Int `protobuf:"bytes,9,opt,name=constantinople_block,json=constantinopleBlock,proto3,customtype=cosmossdk.io/math.Int" json:"constantinople_block,omitempty" yaml:"constantinople_block"` + // petersburg_block: Petersburg switch block (nil same as Constantinople) + PetersburgBlock *cosmossdk_io_math.Int `protobuf:"bytes,10,opt,name=petersburg_block,json=petersburgBlock,proto3,customtype=cosmossdk.io/math.Int" json:"petersburg_block,omitempty" yaml:"petersburg_block"` + // istanbul_block: Istanbul switch block (nil no fork, 0 = already on istanbul) + IstanbulBlock *cosmossdk_io_math.Int `protobuf:"bytes,11,opt,name=istanbul_block,json=istanbulBlock,proto3,customtype=cosmossdk.io/math.Int" json:"istanbul_block,omitempty" yaml:"istanbul_block"` + // muir_glacier_block: Eip-2384 (bomb delay) switch block (nil no fork, 0 = already activated) + MuirGlacierBlock *cosmossdk_io_math.Int `protobuf:"bytes,12,opt,name=muir_glacier_block,json=muirGlacierBlock,proto3,customtype=cosmossdk.io/math.Int" json:"muir_glacier_block,omitempty" yaml:"muir_glacier_block"` + // berlin_block: Berlin switch block (nil = no fork, 0 = already on berlin) + BerlinBlock *cosmossdk_io_math.Int `protobuf:"bytes,13,opt,name=berlin_block,json=berlinBlock,proto3,customtype=cosmossdk.io/math.Int" json:"berlin_block,omitempty" yaml:"berlin_block"` + // london_block: London switch block (nil = no fork, 0 = already on london) + LondonBlock *cosmossdk_io_math.Int `protobuf:"bytes,17,opt,name=london_block,json=londonBlock,proto3,customtype=cosmossdk.io/math.Int" json:"london_block,omitempty" yaml:"london_block"` + // arrow_glacier_block: Eip-4345 (bomb delay) switch block (nil = no fork, 0 = already activated) + ArrowGlacierBlock *cosmossdk_io_math.Int `protobuf:"bytes,18,opt,name=arrow_glacier_block,json=arrowGlacierBlock,proto3,customtype=cosmossdk.io/math.Int" json:"arrow_glacier_block,omitempty" yaml:"arrow_glacier_block"` + // gray_glacier_block: EIP-5133 (bomb delay) switch block (nil = no fork, 0 = already activated) + GrayGlacierBlock *cosmossdk_io_math.Int `protobuf:"bytes,20,opt,name=gray_glacier_block,json=grayGlacierBlock,proto3,customtype=cosmossdk.io/math.Int" json:"gray_glacier_block,omitempty" yaml:"gray_glacier_block"` + // merge_netsplit_block: Virtual fork after The Merge to use as a network splitter + MergeNetsplitBlock *cosmossdk_io_math.Int `protobuf:"bytes,21,opt,name=merge_netsplit_block,json=mergeNetsplitBlock,proto3,customtype=cosmossdk.io/math.Int" json:"merge_netsplit_block,omitempty" yaml:"merge_netsplit_block"` + // shanghai switch time (nil = no fork, 0 = already on shanghai) + ShanghaiTime *cosmossdk_io_math.Int `protobuf:"bytes,22,opt,name=shanghai_time,json=shanghaiTime,proto3,customtype=cosmossdk.io/math.Int" json:"shanghai_time,omitempty" yaml:"shanghai_time"` + // cancun switch time (nil = no fork, 0 = already on cancun) + CancunTime *cosmossdk_io_math.Int `protobuf:"bytes,23,opt,name=cancun_time,json=cancunTime,proto3,customtype=cosmossdk.io/math.Int" json:"cancun_time,omitempty" yaml:"cancun_time"` + // prague switch time (nil = no fork, 0 = already on prague) + PragueTime *cosmossdk_io_math.Int `protobuf:"bytes,24,opt,name=prague_time,json=pragueTime,proto3,customtype=cosmossdk.io/math.Int" json:"prague_time,omitempty" yaml:"prague_time"` +} + +func (m *ChainConfig) Reset() { *m = ChainConfig{} } +func (m *ChainConfig) String() string { return proto.CompactTextString(m) } +func (*ChainConfig) ProtoMessage() {} +func (*ChainConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_40db39f43bdf71b8, []int{0} +} +func (m *ChainConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChainConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChainConfig.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ChainConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainConfig.Merge(m, src) +} +func (m *ChainConfig) XXX_Size() int { + return m.Size() +} +func (m *ChainConfig) XXX_DiscardUnknown() { + xxx_messageInfo_ChainConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_ChainConfig proto.InternalMessageInfo + +func (m *ChainConfig) GetDAOForkSupport() bool { + if m != nil { + return m.DAOForkSupport + } + return false +} + +func (m *ChainConfig) GetEIP150Hash() string { + if m != nil { + return m.EIP150Hash + } + return "" +} + +func init() { + proto.RegisterType((*ChainConfig)(nil), "injective.evm.v1.ChainConfig") +} + +func init() { + proto.RegisterFile("injective/evm/v1/chain_config.proto", fileDescriptor_40db39f43bdf71b8) +} + +var fileDescriptor_40db39f43bdf71b8 = []byte{ + // 827 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x96, 0xdf, 0x6e, 0xe3, 0x44, + 0x14, 0xc6, 0x1b, 0x08, 0x4b, 0x76, 0x9c, 0x3a, 0xae, 0x9b, 0xee, 0x86, 0x45, 0x4a, 0x56, 0xc3, + 0x4d, 0x6f, 0x36, 0x6e, 0x28, 0x81, 0x8a, 0x1b, 0x44, 0x96, 0x7f, 0xa9, 0x10, 0xac, 0x66, 0x11, + 0x08, 0x84, 0x64, 0x8d, 0xed, 0x59, 0x7b, 0x36, 0xb6, 0xc7, 0xf2, 0xd8, 0x59, 0x85, 0xa7, 0xe0, + 0xb1, 0xe0, 0xae, 0x97, 0x88, 0x8b, 0x08, 0xa5, 0x6f, 0xd0, 0x27, 0x40, 0x9e, 0x99, 0x38, 0x71, + 0x9a, 0xb5, 0x72, 0xd7, 0xf3, 0xf9, 0x7c, 0xbf, 0xef, 0xf8, 0x68, 0xdc, 0x0c, 0xf8, 0x88, 0xc6, + 0xaf, 0x89, 0x9b, 0xd1, 0x39, 0xb1, 0xc8, 0x3c, 0xb2, 0xe6, 0x23, 0xcb, 0x0d, 0x30, 0x8d, 0x6d, + 0x97, 0xc5, 0xaf, 0xa8, 0x3f, 0x4c, 0x52, 0x96, 0x31, 0xd3, 0x28, 0x9b, 0x86, 0x64, 0x1e, 0x0d, + 0xe7, 0xa3, 0x27, 0x5d, 0x9f, 0xf9, 0x4c, 0x3c, 0xb4, 0x8a, 0xbf, 0x64, 0x1f, 0xfc, 0xbb, 0x03, + 0xb4, 0xe7, 0x85, 0xfd, 0xb9, 0x70, 0x9b, 0xbf, 0x83, 0x4e, 0xc0, 0x22, 0xc2, 0x33, 0x82, 0x3d, + 0xdb, 0x09, 0x99, 0x3b, 0xeb, 0x35, 0x9e, 0x36, 0xce, 0x1f, 0x4e, 0x2e, 0xff, 0x5d, 0x0e, 0xce, + 0x5c, 0xc6, 0x23, 0xc6, 0xb9, 0x37, 0x1b, 0x52, 0x66, 0x45, 0x38, 0x0b, 0x86, 0xd3, 0x38, 0xbb, + 0x5b, 0x0e, 0x1e, 0x2d, 0x70, 0x14, 0x7e, 0x0e, 0x77, 0x9c, 0x10, 0xe9, 0xa5, 0x32, 0x29, 0x04, + 0x33, 0x00, 0xba, 0x87, 0x99, 0xfd, 0x8a, 0xa5, 0x33, 0x05, 0x7f, 0x47, 0xc0, 0x27, 0x6f, 0x85, + 0xaf, 0x96, 0x83, 0xf6, 0x57, 0x5f, 0xfe, 0xf8, 0x0d, 0x4b, 0x67, 0x02, 0x71, 0xb7, 0x1c, 0x9c, + 0xc9, 0xb0, 0x2a, 0x08, 0xa2, 0xb6, 0x87, 0x59, 0xd9, 0x66, 0xfe, 0x02, 0x8c, 0xb2, 0x81, 0xe7, + 0x49, 0xc2, 0xd2, 0xac, 0xf7, 0xee, 0xd3, 0xc6, 0x79, 0x6b, 0xf2, 0x6c, 0xb5, 0x1c, 0xe8, 0x0a, + 0xf9, 0x52, 0x3e, 0xb9, 0x5b, 0x0e, 0x1e, 0xef, 0x40, 0x95, 0x07, 0x22, 0x5d, 0x61, 0x55, 0xab, + 0xe9, 0x80, 0x36, 0xa1, 0xc9, 0x68, 0x7c, 0xa1, 0x5e, 0xa0, 0x29, 0x5e, 0xe0, 0x8b, 0xba, 0x17, + 0xd0, 0xbe, 0x9e, 0xbe, 0x18, 0x8d, 0x2f, 0xd6, 0xf3, 0x9f, 0xca, 0xa8, 0x6d, 0x0a, 0x44, 0x9a, + 0x2c, 0xe5, 0xf0, 0x53, 0xa0, 0x4a, 0x3b, 0xc0, 0x3c, 0xe8, 0xbd, 0x27, 0x22, 0xce, 0x57, 0xcb, + 0x01, 0x90, 0xa4, 0xef, 0x30, 0x0f, 0x36, 0x5b, 0x77, 0x16, 0x7f, 0xe0, 0x38, 0xa3, 0x79, 0xb4, + 0x66, 0x01, 0x69, 0x2e, 0xba, 0xca, 0x71, 0xc7, 0x6a, 0xdc, 0x07, 0x87, 0x8e, 0x3b, 0xde, 0x37, + 0xee, 0xb8, 0x3a, 0xae, 0xec, 0x29, 0x33, 0xae, 0x54, 0xc6, 0xfb, 0x87, 0x66, 0x5c, 0xed, 0xcb, + 0xb8, 0xaa, 0x66, 0xc8, 0x9e, 0xe2, 0x5c, 0xee, 0xbc, 0x67, 0xaf, 0x75, 0xf0, 0xb9, 0xbc, 0xb7, + 0x21, 0xbd, 0x54, 0x24, 0x7d, 0x06, 0xba, 0x2e, 0x8b, 0x79, 0x56, 0x68, 0x31, 0x4b, 0x42, 0xa2, + 0x22, 0x1e, 0x8a, 0x88, 0xab, 0xba, 0x88, 0x0f, 0x65, 0xc4, 0x3e, 0x3b, 0x44, 0xa7, 0x55, 0x59, + 0x86, 0xd9, 0xc0, 0x48, 0x48, 0x46, 0x52, 0xee, 0xe4, 0xa9, 0xaf, 0x82, 0x80, 0x08, 0xfa, 0xa4, + 0x2e, 0x48, 0x9d, 0xd0, 0x5d, 0x2b, 0x44, 0x9d, 0x8d, 0x24, 0x03, 0x7e, 0x05, 0x3a, 0x2d, 0x52, + 0x9d, 0x3c, 0x54, 0x78, 0x4d, 0xe0, 0x3f, 0xae, 0xc3, 0xab, 0xaf, 0xaa, 0x6a, 0x84, 0xe8, 0x78, + 0x2d, 0x48, 0xb4, 0x07, 0xcc, 0x28, 0xa7, 0xa9, 0xed, 0x87, 0xd8, 0xa5, 0x24, 0x55, 0xf8, 0xb6, + 0xc0, 0x7f, 0x5a, 0x87, 0xff, 0x40, 0xe2, 0xef, 0x9b, 0x21, 0x32, 0x0a, 0xf1, 0x5b, 0xa9, 0xc9, + 0x94, 0x97, 0xa0, 0xed, 0x90, 0x34, 0xa4, 0xb1, 0xe2, 0x1f, 0x0b, 0xfe, 0x45, 0x1d, 0x5f, 0x9d, + 0xa0, 0x6d, 0x1b, 0x44, 0x9a, 0x2c, 0x4b, 0x68, 0xc8, 0x62, 0x8f, 0xad, 0xa1, 0x27, 0x07, 0x43, + 0xb7, 0x6d, 0x10, 0x69, 0xb2, 0x94, 0x50, 0x1f, 0x9c, 0xe2, 0x34, 0x65, 0x6f, 0x76, 0x16, 0x62, + 0x0a, 0xf6, 0x67, 0x75, 0xec, 0x27, 0x92, 0xbd, 0xc7, 0x0d, 0xd1, 0x89, 0x50, 0x2b, 0x2b, 0xf1, + 0x80, 0xe9, 0xa7, 0x78, 0xb1, 0x93, 0xd3, 0x3d, 0x78, 0xf1, 0xf7, 0xcd, 0x10, 0x19, 0x85, 0x58, + 0x49, 0x79, 0x0d, 0xba, 0x11, 0x49, 0x7d, 0x62, 0xc7, 0x24, 0xe3, 0x49, 0x48, 0x33, 0x95, 0x73, + 0x76, 0xf0, 0x77, 0xb0, 0xcf, 0x0e, 0x91, 0x29, 0xe4, 0x1f, 0x94, 0x2a, 0xb3, 0x7e, 0x06, 0xc7, + 0x3c, 0xc0, 0xb1, 0x1f, 0x60, 0x6a, 0x67, 0x34, 0x22, 0xbd, 0x47, 0x22, 0x64, 0x54, 0x17, 0xd2, + 0x95, 0x21, 0x15, 0x1f, 0x44, 0xed, 0x75, 0xfd, 0x13, 0x8d, 0x88, 0xf9, 0x02, 0x68, 0x2e, 0x8e, + 0xdd, 0x3c, 0x96, 0xd4, 0xc7, 0x82, 0x6a, 0xd5, 0x51, 0x4d, 0xf5, 0x09, 0x6f, 0x5c, 0x10, 0x01, + 0x59, 0xad, 0x89, 0x49, 0x8a, 0xfd, 0x9c, 0x48, 0x62, 0xef, 0x60, 0xe2, 0x96, 0x0b, 0x22, 0x20, + 0xab, 0x82, 0x78, 0xdd, 0x6c, 0xe9, 0x46, 0xe7, 0xba, 0xd9, 0xea, 0x18, 0xc6, 0x75, 0xb3, 0x65, + 0x18, 0x27, 0xd7, 0xcd, 0xd6, 0xa9, 0xd1, 0x45, 0xc7, 0x0b, 0x16, 0x32, 0x7b, 0x7e, 0x29, 0xf7, + 0x86, 0x34, 0xf2, 0x06, 0x73, 0xf5, 0x4f, 0x0b, 0xe9, 0x2e, 0xce, 0x70, 0xb8, 0xe0, 0x6a, 0xa9, + 0xc8, 0x90, 0xab, 0xde, 0xfc, 0x04, 0x4e, 0xdc, 0xbf, 0x56, 0xfd, 0xc6, 0xcd, 0xaa, 0xdf, 0xf8, + 0x6f, 0xd5, 0x6f, 0xfc, 0x79, 0xdb, 0x3f, 0xba, 0xb9, 0xed, 0x1f, 0xfd, 0x73, 0xdb, 0x3f, 0xfa, + 0x6d, 0xea, 0xd3, 0x2c, 0xc8, 0x9d, 0xa1, 0xcb, 0x22, 0x6b, 0xba, 0xbe, 0x18, 0x7c, 0x8f, 0x1d, + 0x6e, 0x95, 0xd7, 0x84, 0x67, 0x2e, 0x4b, 0xc9, 0x76, 0x59, 0x5c, 0x0a, 0xac, 0x88, 0x79, 0x79, + 0x48, 0xb8, 0xb8, 0x68, 0x64, 0x8b, 0x84, 0x70, 0xe7, 0x81, 0xb8, 0x37, 0x5c, 0xfe, 0x1f, 0x00, + 0x00, 0xff, 0xff, 0xbd, 0x1f, 0x16, 0x6d, 0x86, 0x08, 0x00, 0x00, +} + +func (m *ChainConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ChainConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChainConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PragueTime != nil { + { + size := m.PragueTime.Size() + i -= size + if _, err := m.PragueTime.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } + if m.CancunTime != nil { + { + size := m.CancunTime.Size() + i -= size + if _, err := m.CancunTime.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if m.ShanghaiTime != nil { + { + size := m.ShanghaiTime.Size() + i -= size + if _, err := m.ShanghaiTime.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if m.MergeNetsplitBlock != nil { + { + size := m.MergeNetsplitBlock.Size() + i -= size + if _, err := m.MergeNetsplitBlock.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if m.GrayGlacierBlock != nil { + { + size := m.GrayGlacierBlock.Size() + i -= size + if _, err := m.GrayGlacierBlock.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if m.ArrowGlacierBlock != nil { + { + size := m.ArrowGlacierBlock.Size() + i -= size + if _, err := m.ArrowGlacierBlock.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if m.LondonBlock != nil { + { + size := m.LondonBlock.Size() + i -= size + if _, err := m.LondonBlock.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if m.BerlinBlock != nil { + { + size := m.BerlinBlock.Size() + i -= size + if _, err := m.BerlinBlock.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + if m.MuirGlacierBlock != nil { + { + size := m.MuirGlacierBlock.Size() + i -= size + if _, err := m.MuirGlacierBlock.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if m.IstanbulBlock != nil { + { + size := m.IstanbulBlock.Size() + i -= size + if _, err := m.IstanbulBlock.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if m.PetersburgBlock != nil { + { + size := m.PetersburgBlock.Size() + i -= size + if _, err := m.PetersburgBlock.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.ConstantinopleBlock != nil { + { + size := m.ConstantinopleBlock.Size() + i -= size + if _, err := m.ConstantinopleBlock.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.ByzantiumBlock != nil { + { + size := m.ByzantiumBlock.Size() + i -= size + if _, err := m.ByzantiumBlock.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.EIP158Block != nil { + { + size := m.EIP158Block.Size() + i -= size + if _, err := m.EIP158Block.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.EIP155Block != nil { + { + size := m.EIP155Block.Size() + i -= size + if _, err := m.EIP155Block.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.EIP150Hash) > 0 { + i -= len(m.EIP150Hash) + copy(dAtA[i:], m.EIP150Hash) + i = encodeVarintChainConfig(dAtA, i, uint64(len(m.EIP150Hash))) + i-- + dAtA[i] = 0x2a + } + if m.EIP150Block != nil { + { + size := m.EIP150Block.Size() + i -= size + if _, err := m.EIP150Block.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.DAOForkSupport { + i-- + if m.DAOForkSupport { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.DAOForkBlock != nil { + { + size := m.DAOForkBlock.Size() + i -= size + if _, err := m.DAOForkBlock.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.HomesteadBlock != nil { + { + size := m.HomesteadBlock.Size() + i -= size + if _, err := m.HomesteadBlock.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintChainConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintChainConfig(dAtA []byte, offset int, v uint64) int { + offset -= sovChainConfig(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ChainConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HomesteadBlock != nil { + l = m.HomesteadBlock.Size() + n += 1 + l + sovChainConfig(uint64(l)) + } + if m.DAOForkBlock != nil { + l = m.DAOForkBlock.Size() + n += 1 + l + sovChainConfig(uint64(l)) + } + if m.DAOForkSupport { + n += 2 + } + if m.EIP150Block != nil { + l = m.EIP150Block.Size() + n += 1 + l + sovChainConfig(uint64(l)) + } + l = len(m.EIP150Hash) + if l > 0 { + n += 1 + l + sovChainConfig(uint64(l)) + } + if m.EIP155Block != nil { + l = m.EIP155Block.Size() + n += 1 + l + sovChainConfig(uint64(l)) + } + if m.EIP158Block != nil { + l = m.EIP158Block.Size() + n += 1 + l + sovChainConfig(uint64(l)) + } + if m.ByzantiumBlock != nil { + l = m.ByzantiumBlock.Size() + n += 1 + l + sovChainConfig(uint64(l)) + } + if m.ConstantinopleBlock != nil { + l = m.ConstantinopleBlock.Size() + n += 1 + l + sovChainConfig(uint64(l)) + } + if m.PetersburgBlock != nil { + l = m.PetersburgBlock.Size() + n += 1 + l + sovChainConfig(uint64(l)) + } + if m.IstanbulBlock != nil { + l = m.IstanbulBlock.Size() + n += 1 + l + sovChainConfig(uint64(l)) + } + if m.MuirGlacierBlock != nil { + l = m.MuirGlacierBlock.Size() + n += 1 + l + sovChainConfig(uint64(l)) + } + if m.BerlinBlock != nil { + l = m.BerlinBlock.Size() + n += 1 + l + sovChainConfig(uint64(l)) + } + if m.LondonBlock != nil { + l = m.LondonBlock.Size() + n += 2 + l + sovChainConfig(uint64(l)) + } + if m.ArrowGlacierBlock != nil { + l = m.ArrowGlacierBlock.Size() + n += 2 + l + sovChainConfig(uint64(l)) + } + if m.GrayGlacierBlock != nil { + l = m.GrayGlacierBlock.Size() + n += 2 + l + sovChainConfig(uint64(l)) + } + if m.MergeNetsplitBlock != nil { + l = m.MergeNetsplitBlock.Size() + n += 2 + l + sovChainConfig(uint64(l)) + } + if m.ShanghaiTime != nil { + l = m.ShanghaiTime.Size() + n += 2 + l + sovChainConfig(uint64(l)) + } + if m.CancunTime != nil { + l = m.CancunTime.Size() + n += 2 + l + sovChainConfig(uint64(l)) + } + if m.PragueTime != nil { + l = m.PragueTime.Size() + n += 2 + l + sovChainConfig(uint64(l)) + } + return n +} + +func sovChainConfig(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozChainConfig(x uint64) (n int) { + return sovChainConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ChainConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChainConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChainConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HomesteadBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.HomesteadBlock = &v + if err := m.HomesteadBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DAOForkBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.DAOForkBlock = &v + if err := m.DAOForkBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DAOForkSupport", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DAOForkSupport = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EIP150Block", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.EIP150Block = &v + if err := m.EIP150Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EIP150Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EIP150Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EIP155Block", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.EIP155Block = &v + if err := m.EIP155Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EIP158Block", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.EIP158Block = &v + if err := m.EIP158Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ByzantiumBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.ByzantiumBlock = &v + if err := m.ByzantiumBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConstantinopleBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.ConstantinopleBlock = &v + if err := m.ConstantinopleBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PetersburgBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.PetersburgBlock = &v + if err := m.PetersburgBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IstanbulBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.IstanbulBlock = &v + if err := m.IstanbulBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MuirGlacierBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.MuirGlacierBlock = &v + if err := m.MuirGlacierBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BerlinBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.BerlinBlock = &v + if err := m.BerlinBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LondonBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.LondonBlock = &v + if err := m.LondonBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ArrowGlacierBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.ArrowGlacierBlock = &v + if err := m.ArrowGlacierBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GrayGlacierBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.GrayGlacierBlock = &v + if err := m.GrayGlacierBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MergeNetsplitBlock", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.MergeNetsplitBlock = &v + if err := m.MergeNetsplitBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShanghaiTime", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.ShanghaiTime = &v + if err := m.ShanghaiTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CancunTime", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.CancunTime = &v + if err := m.CancunTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 24: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PragueTime", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChainConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChainConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.PragueTime = &v + if err := m.PragueTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChainConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChainConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipChainConfig(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowChainConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowChainConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowChainConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthChainConfig + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupChainConfig + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthChainConfig + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthChainConfig = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowChainConfig = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupChainConfig = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/evm/types/codec.go b/chain/evm/types/codec.go new file mode 100644 index 00000000..1c071173 --- /dev/null +++ b/chain/evm/types/codec.go @@ -0,0 +1,96 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + errortypes "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/msgservice" + "github.com/cosmos/cosmos-sdk/types/tx" + proto "github.com/cosmos/gogoproto/proto" +) + +var ( + amino = codec.NewLegacyAmino() + // ModuleCdc references the global evm module codec. Note, the codec should + // ONLY be used in certain instances of tests and for JSON encoding. + ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) + + // AminoCdc is a amino codec created to support amino JSON compatible msgs. + AminoCdc = codec.NewAminoCodec(amino) //nolint:staticcheck +) + +const ( + // Amino names + updateParamsName = "evm/MsgUpdateParams" +) + +// NOTE: This is required for the GetSignBytes function +func init() { + RegisterLegacyAminoCodec(amino) + amino.Seal() +} + +// RegisterInterfaces registers the client interfaces to protobuf Any. +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgEthereumTx{}, + ) + registry.RegisterImplementations( + (*tx.TxExtensionOptionI)(nil), + &ExtensionOptionsEthereumTx{}, + ) + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgEthereumTx{}, + &MsgUpdateParams{}, + ) + registry.RegisterInterface( + "injective.evm.v1.TxData", + (*TxData)(nil), + &DynamicFeeTx{}, + &AccessListTx{}, + &LegacyTx{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +// PackTxData constructs a new Any packed with the given tx data value. It returns +// an error if the client state can't be casted to a protobuf message or if the concrete +// implementation is not registered to the protobuf codec. +func PackTxData(txData TxData) (*codectypes.Any, error) { + msg, ok := txData.(proto.Message) + if !ok { + return nil, errorsmod.Wrapf(errortypes.ErrPackAny, "cannot proto marshal %T", txData) + } + + anyTxData, err := codectypes.NewAnyWithValue(msg) + if err != nil { + return nil, errorsmod.Wrap(errortypes.ErrPackAny, err.Error()) + } + + return anyTxData, nil +} + +// UnpackTxData unpacks an Any into a TxData. It returns an error if the +// client state can't be unpacked into a TxData. +func UnpackTxData(any *codectypes.Any) (TxData, error) { + if any == nil { + return nil, errorsmod.Wrap(errortypes.ErrUnpackAny, "protobuf Any message cannot be nil") + } + + txData, ok := any.GetCachedValue().(TxData) + if !ok { + return nil, errorsmod.Wrapf(errortypes.ErrUnpackAny, "cannot unpack Any into TxData %T", any) + } + + return txData, nil +} + +// RegisterLegacyAminoCodec required for EIP-712 +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgUpdateParams{}, updateParamsName, nil) +} diff --git a/chain/evm/types/compiled_contract.go b/chain/evm/types/compiled_contract.go new file mode 100644 index 00000000..081d815b --- /dev/null +++ b/chain/evm/types/compiled_contract.go @@ -0,0 +1,117 @@ +package types + +import ( + // embed compiled smart contract + _ "embed" + "encoding/hex" + "encoding/json" + "fmt" + + "github.com/ethereum/go-ethereum/accounts/abi" +) + +// HexString is a byte array that serializes to hex +type HexString []byte + +// MarshalJSON serializes ByteArray to hex +func (s HexString) MarshalJSON() ([]byte, error) { + return json.Marshal(fmt.Sprintf("%x", string(s))) +} + +// UnmarshalJSON deserializes ByteArray to hex +func (s *HexString) UnmarshalJSON(data []byte) error { + var x string + if err := json.Unmarshal(data, &x); err != nil { + return err + } + str, err := hex.DecodeString(x) + if err != nil { + return err + } + *s = str + return nil +} + +// CompiledContract contains compiled bytecode and abi +type CompiledContract struct { + ABI abi.ABI + Bin HexString +} + +type jsonCompiledContract struct { + ABI string + Bin HexString +} + +// MarshalJSON serializes ByteArray to hex +func (s CompiledContract) MarshalJSON() ([]byte, error) { + abi1, err := json.Marshal(s.ABI) + if err != nil { + return nil, err + } + return json.Marshal(jsonCompiledContract{ABI: string(abi1), Bin: s.Bin}) +} + +// UnmarshalJSON deserializes ByteArray to hex +func (s *CompiledContract) UnmarshalJSON(data []byte) error { + var x jsonCompiledContract + if err := json.Unmarshal(data, &x); err != nil { + return err + } + + s.Bin = x.Bin + if err := json.Unmarshal([]byte(x.ABI), &s.ABI); err != nil { + return fmt.Errorf("failed to unmarshal ABI: %w", err) + } + + return nil +} + +var ( + //go:embed ERC20Contract.json + erc20JSON []byte + + // ERC20Contract is the compiled test erc20 contract + ERC20Contract CompiledContract + + //go:embed SimpleStorageContract.json + simpleStorageJSON []byte + + // SimpleStorageContract is the compiled test simple storage contract + SimpleStorageContract CompiledContract + + //go:embed TestMessageCall.json + testMessageCallJSON []byte + + // TestMessageCall is the compiled message call benchmark contract + TestMessageCall CompiledContract +) + +func init() { + err := json.Unmarshal(erc20JSON, &ERC20Contract) + if err != nil { + panic(err) + } + + if len(ERC20Contract.Bin) == 0 { + panic("load contract failed") + } + + err = json.Unmarshal(testMessageCallJSON, &TestMessageCall) + if err != nil { + panic(err) + } + + if len(TestMessageCall.Bin) == 0 { + panic("load contract failed") + } + + err = json.Unmarshal(simpleStorageJSON, &SimpleStorageContract) + if err != nil { + panic(err) + } + + if len(TestMessageCall.Bin) == 0 { + panic("load contract failed") + } +} diff --git a/chain/evm/types/dynamic_fee_tx.go b/chain/evm/types/dynamic_fee_tx.go new file mode 100644 index 00000000..e7852104 --- /dev/null +++ b/chain/evm/types/dynamic_fee_tx.go @@ -0,0 +1,281 @@ +package types + +import ( + "math/big" + + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + errortypes "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + + "github.com/InjectiveLabs/sdk-go/chain/types" +) + +func NewDynamicFeeTx(tx *ethtypes.Transaction) (*DynamicFeeTx, error) { + txData := &DynamicFeeTx{ + Nonce: tx.Nonce(), + Data: tx.Data(), + GasLimit: tx.Gas(), + } + + v, r, s := tx.RawSignatureValues() + if to := tx.To(); to != nil { + txData.To = to.Hex() + } + + if tx.Value() != nil { + amountInt, err := types.SafeNewIntFromBigInt(tx.Value()) + if err != nil { + return nil, err + } + txData.Amount = &amountInt + } + + if tx.GasFeeCap() != nil { + gasFeeCapInt, err := types.SafeNewIntFromBigInt(tx.GasFeeCap()) + if err != nil { + return nil, err + } + txData.GasFeeCap = &gasFeeCapInt + } + + if tx.GasTipCap() != nil { + gasTipCapInt, err := types.SafeNewIntFromBigInt(tx.GasTipCap()) + if err != nil { + return nil, err + } + txData.GasTipCap = &gasTipCapInt + } + + if tx.AccessList() != nil { + al := tx.AccessList() + txData.Accesses = NewAccessList(&al) + } + + txData.SetSignatureValues(tx.ChainId(), v, r, s) + return txData, nil +} + +// TxType returns the tx type +func (tx *DynamicFeeTx) TxType() uint8 { + return ethtypes.DynamicFeeTxType +} + +// Copy returns an instance with the same field values +func (tx *DynamicFeeTx) Copy() TxData { + return &DynamicFeeTx{ + ChainID: tx.ChainID, + Nonce: tx.Nonce, + GasTipCap: tx.GasTipCap, + GasFeeCap: tx.GasFeeCap, + GasLimit: tx.GasLimit, + To: tx.To, + Amount: tx.Amount, + Data: common.CopyBytes(tx.Data), + Accesses: tx.Accesses, + V: common.CopyBytes(tx.V), + R: common.CopyBytes(tx.R), + S: common.CopyBytes(tx.S), + } +} + +// GetChainID returns the chain id field from the DynamicFeeTx +func (tx *DynamicFeeTx) GetChainID() *big.Int { + if tx.ChainID == nil { + return nil + } + + return tx.ChainID.BigInt() +} + +// GetAccessList returns the AccessList field. +func (tx *DynamicFeeTx) GetAccessList() ethtypes.AccessList { + if tx.Accesses == nil { + return nil + } + return *tx.Accesses.ToEthAccessList() +} + +// GetData returns the a copy of the input data bytes. +func (tx *DynamicFeeTx) GetData() []byte { + return common.CopyBytes(tx.Data) +} + +// GetGas returns the gas limit. +func (tx *DynamicFeeTx) GetGas() uint64 { + return tx.GasLimit +} + +// GetGasPrice returns the gas fee cap field. +func (tx *DynamicFeeTx) GetGasPrice() *big.Int { + return tx.GetGasFeeCap() +} + +// GetGasTipCap returns the gas tip cap field. +func (tx *DynamicFeeTx) GetGasTipCap() *big.Int { + if tx.GasTipCap == nil { + return nil + } + return tx.GasTipCap.BigInt() +} + +// GetGasFeeCap returns the gas fee cap field. +func (tx *DynamicFeeTx) GetGasFeeCap() *big.Int { + if tx.GasFeeCap == nil { + return nil + } + return tx.GasFeeCap.BigInt() +} + +// GetValue returns the tx amount. +func (tx *DynamicFeeTx) GetValue() *big.Int { + if tx.Amount == nil { + return nil + } + + return tx.Amount.BigInt() +} + +// GetNonce returns the account sequence for the transaction. +func (tx *DynamicFeeTx) GetNonce() uint64 { return tx.Nonce } + +// GetTo returns the pointer to the recipient address. +func (tx *DynamicFeeTx) GetTo() *common.Address { + if tx.To == "" { + return nil + } + to := common.HexToAddress(tx.To) + return &to +} + +// AsEthereumData returns an DynamicFeeTx transaction tx from the proto-formatted +// TxData defined on the Cosmos EVM. +func (tx *DynamicFeeTx) AsEthereumData() ethtypes.TxData { + v, r, s := tx.GetRawSignatureValues() + return ðtypes.DynamicFeeTx{ + ChainID: tx.GetChainID(), + Nonce: tx.GetNonce(), + GasTipCap: tx.GetGasTipCap(), + GasFeeCap: tx.GetGasFeeCap(), + Gas: tx.GetGas(), + To: tx.GetTo(), + Value: tx.GetValue(), + Data: tx.GetData(), + AccessList: tx.GetAccessList(), + V: v, + R: r, + S: s, + } +} + +// GetRawSignatureValues returns the V, R, S signature values of the transaction. +// The return values should not be modified by the caller. +func (tx *DynamicFeeTx) GetRawSignatureValues() (v, r, s *big.Int) { + return rawSignatureValues(tx.V, tx.R, tx.S) +} + +// SetSignatureValues sets the signature values to the transaction. +func (tx *DynamicFeeTx) SetSignatureValues(chainID, v, r, s *big.Int) { + if v != nil { + tx.V = v.Bytes() + } + if r != nil { + tx.R = r.Bytes() + } + if s != nil { + tx.S = s.Bytes() + } + if chainID != nil { + chainIDInt := sdkmath.NewIntFromBigInt(chainID) + tx.ChainID = &chainIDInt + } +} + +// Validate performs a stateless validation of the tx fields. +func (tx DynamicFeeTx) Validate() error { + if tx.GasTipCap == nil { + return errorsmod.Wrap(ErrInvalidGasCap, "gas tip cap cannot nil") + } + + if tx.GasFeeCap == nil { + return errorsmod.Wrap(ErrInvalidGasCap, "gas fee cap cannot nil") + } + + if tx.GasTipCap.IsNegative() { + return errorsmod.Wrapf(ErrInvalidGasCap, "gas tip cap cannot be negative %s", tx.GasTipCap) + } + + if tx.GasFeeCap.IsNegative() { + return errorsmod.Wrapf(ErrInvalidGasCap, "gas fee cap cannot be negative %s", tx.GasFeeCap) + } + + if !types.IsValidInt256(tx.GetGasTipCap()) { + return errorsmod.Wrap(ErrInvalidGasCap, "out of bound") + } + + if !types.IsValidInt256(tx.GetGasFeeCap()) { + return errorsmod.Wrap(ErrInvalidGasCap, "out of bound") + } + + if tx.GasFeeCap.LT(*tx.GasTipCap) { + return errorsmod.Wrapf( + ErrInvalidGasCap, "max priority fee per gas higher than max fee per gas (%s > %s)", + tx.GasTipCap, tx.GasFeeCap, + ) + } + + if !types.IsValidInt256(tx.Fee()) { + return errorsmod.Wrap(ErrInvalidGasFee, "out of bound") + } + + amount := tx.GetValue() + // Amount can be 0 + if amount != nil && amount.Sign() == -1 { + return errorsmod.Wrapf(ErrInvalidAmount, "amount cannot be negative %s", amount) + } + if !types.IsValidInt256(amount) { + return errorsmod.Wrap(ErrInvalidAmount, "out of bound") + } + + if tx.To != "" { + if err := types.ValidateAddress(tx.To); err != nil { + return errorsmod.Wrap(err, "invalid to address") + } + } + + if tx.GetChainID() == nil { + return errorsmod.Wrap( + errortypes.ErrInvalidChainID, + "chain ID must be present on AccessList txs", + ) + } + + return nil +} + +// Fee returns gasprice * gaslimit. +func (tx DynamicFeeTx) Fee() *big.Int { + return fee(tx.GetGasFeeCap(), tx.GasLimit) +} + +// Cost returns amount + gasprice * gaslimit. +func (tx DynamicFeeTx) Cost() *big.Int { + return cost(tx.Fee(), tx.GetValue()) +} + +// EffectiveGasPrice returns the effective gas price +func (tx *DynamicFeeTx) EffectiveGasPrice(baseFee *big.Int) *big.Int { + return EffectiveGasPrice(baseFee, tx.GasFeeCap.BigInt(), tx.GasTipCap.BigInt()) +} + +// EffectiveFee returns effective_gasprice * gaslimit. +func (tx DynamicFeeTx) EffectiveFee(baseFee *big.Int) *big.Int { + return fee(tx.EffectiveGasPrice(baseFee), tx.GasLimit) +} + +// EffectiveCost returns amount + effective_gasprice * gaslimit. +func (tx DynamicFeeTx) EffectiveCost(baseFee *big.Int) *big.Int { + return cost(tx.EffectiveFee(baseFee), tx.GetValue()) +} diff --git a/chain/evm/types/errors.go b/chain/evm/types/errors.go new file mode 100644 index 00000000..e23a862c --- /dev/null +++ b/chain/evm/types/errors.go @@ -0,0 +1,287 @@ +package types + +import ( + "encoding/json" + "errors" + "fmt" + + errorsmod "cosmossdk.io/errors" + "github.com/ethereum/go-ethereum/common" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/vm" +) + +const ( + codeErrInvalidState = uint32(iota) + 2 // NOTE: code 1 is reserved for internal errors + codeErrExecutionReverted // IMPORTANT: Do not move this error as it complies with the JSON-RPC error standard + codeErrChainConfigNotFound + codeErrInvalidChainConfig + codeErrZeroAddress + codeErrEmptyHash + codeErrBloomNotFound + codeErrTxReceiptNotFound + codeErrCreateDisabled + codeErrCallDisabled + codeErrInvalidAmount + codeErrInvalidGasPrice + codeErrInvalidGasFee + codeErrVMExecution + codeErrInvalidRefund + codeErrInconsistentGas + codeErrInvalidGasCap + codeErrInvalidBaseFee + codeErrGasOverflow + codeErrInvalidAccount + codeErrInvalidGasLimit + codeErrConfigOverrides +) + +var ErrPostTxProcessing = errors.New("failed to execute post processing") + +var ( + // ErrInvalidState returns an error resulting from an invalid Storage State. + ErrInvalidState = errorsmod.Register(ModuleName, codeErrInvalidState, "invalid storage state") + + // ErrExecutionReverted returns an error resulting from an error in EVM execution. + ErrExecutionReverted = errorsmod.Register(ModuleName, codeErrExecutionReverted, vm.ErrExecutionReverted.Error()) + + // ErrChainConfigNotFound returns an error if the chain config cannot be found on the store. + ErrChainConfigNotFound = errorsmod.Register(ModuleName, codeErrChainConfigNotFound, "chain configuration not found") + + // ErrInvalidChainConfig returns an error resulting from an invalid ChainConfig. + ErrInvalidChainConfig = errorsmod.Register(ModuleName, codeErrInvalidChainConfig, "invalid chain configuration") + + // ErrZeroAddress returns an error resulting from an zero (empty) ethereum Address. + ErrZeroAddress = errorsmod.Register(ModuleName, codeErrZeroAddress, "invalid zero address") + + // ErrEmptyHash returns an error resulting from an empty ethereum Hash. + ErrEmptyHash = errorsmod.Register(ModuleName, codeErrEmptyHash, "empty hash") + + // ErrBloomNotFound returns an error if the block bloom cannot be found on the store. + ErrBloomNotFound = errorsmod.Register(ModuleName, codeErrBloomNotFound, "block bloom not found") + + // ErrTxReceiptNotFound returns an error if the transaction receipt could not be found + ErrTxReceiptNotFound = errorsmod.Register(ModuleName, codeErrTxReceiptNotFound, "transaction receipt not found") + + // ErrCreateDisabled returns an error if the EnableCreate parameter is false. + ErrCreateDisabled = errorsmod.Register(ModuleName, codeErrCreateDisabled, "EVM Create operation is disabled") + + // ErrCallDisabled returns an error if the EnableCall parameter is false. + ErrCallDisabled = errorsmod.Register(ModuleName, codeErrCallDisabled, "EVM Call operation is disabled") + + // ErrInvalidAmount returns an error if a tx contains an invalid amount. + ErrInvalidAmount = errorsmod.Register(ModuleName, codeErrInvalidAmount, "invalid transaction amount") + + // ErrInvalidGasPrice returns an error if an invalid gas price is provided to the tx. + ErrInvalidGasPrice = errorsmod.Register(ModuleName, codeErrInvalidGasPrice, "invalid gas price") + + // ErrInvalidGasFee returns an error if the tx gas fee is out of bound. + ErrInvalidGasFee = errorsmod.Register(ModuleName, codeErrInvalidGasFee, "invalid gas fee") + + // ErrVMExecution returns an error resulting from an error in EVM execution. + ErrVMExecution = errorsmod.Register(ModuleName, codeErrVMExecution, "evm transaction execution failed") + + // ErrInvalidRefund returns an error if a the gas refund value is invalid. + ErrInvalidRefund = errorsmod.Register(ModuleName, codeErrInvalidRefund, "invalid gas refund amount") + + // ErrInconsistentGas returns an error if a the gas differs from the expected one. + ErrInconsistentGas = errorsmod.Register(ModuleName, codeErrInconsistentGas, "inconsistent gas") + + // ErrInvalidGasCap returns an error if a the gas cap value is negative or invalid + ErrInvalidGasCap = errorsmod.Register(ModuleName, codeErrInvalidGasCap, "invalid gas cap") + + // ErrInvalidBaseFee returns an error if a the base fee cap value is invalid + ErrInvalidBaseFee = errorsmod.Register(ModuleName, codeErrInvalidBaseFee, "invalid base fee") + + // ErrGasOverflow returns an error if gas computation overlow/underflow + ErrGasOverflow = errorsmod.Register(ModuleName, codeErrGasOverflow, "gas computation overflow/underflow") + + // ErrInvalidAccount returns an error if the account is not an EVM compatible account + ErrInvalidAccount = errorsmod.Register(ModuleName, codeErrInvalidAccount, "account type is not a valid ethereum account") + + // ErrInvalidGasLimit returns an error if gas limit value is invalid + ErrInvalidGasLimit = errorsmod.Register(ModuleName, codeErrInvalidGasLimit, "invalid gas limit") + + ErrConfigOverrides = errorsmod.Register(ModuleName, codeErrConfigOverrides, "failed to apply state override") +) + +// VmError is an interface that represents a reverted or failed EVM execution. +// The Ret() method returns the revert reason bytes associated with the error, if any. +// The Cause() method returns the unwrapped error. For ABCIInfo integration. +type VmError interface { + String() string + Cause() error + Error() string + VmError() string + Ret() []byte + Reason() string +} + +type vmErrorWithRet struct { + cause error + vmErr string + ret []byte + hash string + gasUsed uint64 + + // derived data + + err error + reason string +} + +// Ret returns the revert reason bytes associated with the VmError. +func (e *vmErrorWithRet) Ret() []byte { + if e == nil { + return nil + } + + return e.ret +} + +// VmError returns the VM error string associated with the VmError. +func (e *vmErrorWithRet) VmError() string { + if e == nil { + return "" + } + + return e.vmErr +} + +// Reason returns the reason string associated with the VmError. +func (e *vmErrorWithRet) Reason() string { + if e == nil { + return "" + } + + return e.reason +} + +// Cause returns the module-level error that can be used for ABCIInfo integration. +func (e *vmErrorWithRet) Cause() error { + if e == nil { + return nil + } + + return e.cause +} + +type abciLogVmError struct { + Hash string `json:"tx_hash"` + GasUsed uint64 `json:"gas_used"` + Reason string `json:"reason,omitempty"` + VmError string `json:"vm_error"` + Ret []byte `json:"ret,omitempty"` +} + +// String returns a human-readable string of the error. Includes revert reason if available. +func (e *vmErrorWithRet) String() string { + if e == nil || e.err == nil { + return "" + } + + return e.err.Error() +} + +// Error returns a JSON-encoded string representation of the VmErrorWithRet. +// This includes the transaction hash, gas used, revert reason (if available), +// and the VM error that occurred. For integration with ABCIInfo. +func (e *vmErrorWithRet) Error() string { + if e == nil { + return "" + } + + return e.toJSON() +} + +func (e *vmErrorWithRet) toJSON() string { + logData := &abciLogVmError{ + Hash: e.hash, + GasUsed: e.gasUsed, + Reason: e.reason, + VmError: e.vmErr, + Ret: e.ret, + } + + logStr, marshalError := json.Marshal(logData) + if marshalError != nil { + // fallback to the original error as text + // we cannot handle error in this flow, nor panic + return e.err.Error() + } + + return string(logStr) +} + +// NewVmErrorWithRet creates a new VmError augmented with the revert reason bytes. +// cause is the module-level error that can be used for ABCIInfo integration. +// vmErr is the VM error string associated with the VmError. +// ret is the revert reason bytes associated with the VmError (only if the VM error is ErrExecutionReverted). +func NewVmErrorWithRet( + vmErr string, + ret []byte, + hash string, + gasUsed uint64, +) VmError { + e := &vmErrorWithRet{ + vmErr: vmErr, + hash: hash, + gasUsed: gasUsed, + } + + if e.vmErr == vm.ErrExecutionReverted.Error() { + e.err = vm.ErrExecutionReverted + + // store only if the VM error is ErrExecutionReverted + e.ret = common.CopyBytes(ret) + + reason, errUnpack := abi.UnpackRevert(e.ret) + if errUnpack == nil { + e.err = fmt.Errorf("%s: %s", e.err.Error(), reason) + e.reason = reason + e.cause = errorsmod.Wrap(ErrExecutionReverted, e.toJSON()) + } + } else { + e.err = errors.New(e.vmErr) + e.cause = errorsmod.Wrap(ErrVMExecution, e.toJSON()) + } + + return e +} + +// NewExecErrorWithReason unpacks the revert return bytes and returns a wrapped error +// with the return reason. +func NewExecErrorWithReason(revertReason []byte) *RevertError { + result := common.CopyBytes(revertReason) + reason, errUnpack := abi.UnpackRevert(result) + + err := vm.ErrExecutionReverted + if errUnpack == nil { + err = fmt.Errorf("%s: %v", err.Error(), reason) + } + + return &RevertError{ + error: err, + reason: hexutil.Encode(result), + } +} + +// RevertError is an API error that encompass an EVM revert with JSON error +// code and a binary data blob. +type RevertError struct { + error + reason string // revert reason hex encoded +} + +// ErrorCode returns the JSON error code for a revert. +// See: https://github.com/ethereum/wiki/wiki/JSON-RPC-Error-Codes-Improvement-Proposal +func (e *RevertError) ErrorCode() int { + return 3 +} + +// ErrorData returns the hex encoded revert reason. +func (e *RevertError) ErrorData() interface{} { + return e.reason +} diff --git a/chain/evm/types/eth.go b/chain/evm/types/eth.go new file mode 100644 index 00000000..fe5e7087 --- /dev/null +++ b/chain/evm/types/eth.go @@ -0,0 +1,84 @@ +package types + +import ( + "encoding/json" + + errorsmod "cosmossdk.io/errors" + "github.com/InjectiveLabs/sdk-go/chain/types" + "github.com/ethereum/go-ethereum/common/hexutil" + ethtypes "github.com/ethereum/go-ethereum/core/types" +) + +type EthereumTx struct { + *ethtypes.Transaction +} + +func NewEthereumTx(txData ethtypes.TxData) EthereumTx { + return EthereumTx{ethtypes.NewTx(txData)} +} + +func (tx EthereumTx) Size() int { + if tx.Transaction == nil { + return 0 + } + return int(tx.Transaction.Size()) +} + +func (tx EthereumTx) MarshalTo(dst []byte) (int, error) { + if tx.Transaction == nil { + return 0, nil + } + bz, err := tx.MarshalBinary() + if err != nil { + return 0, err + } + copy(dst, bz) + return len(bz), nil +} + +func (tx *EthereumTx) Unmarshal(dst []byte) error { + if len(dst) == 0 { + tx.Transaction = nil + return nil + } + if tx.Transaction == nil { + tx.Transaction = new(ethtypes.Transaction) + } + return tx.UnmarshalBinary(dst) +} + +func (tx *EthereumTx) UnmarshalJSON(bz []byte) error { + var data hexutil.Bytes + if err := json.Unmarshal(bz, &data); err != nil { + return err + } + return tx.Unmarshal(data) +} + +func (tx EthereumTx) MarshalJSON() ([]byte, error) { + bz, err := tx.MarshalBinary() + if err != nil { + return nil, err + } + return json.Marshal(hexutil.Bytes(bz)) +} + +func (tx EthereumTx) Validate() error { + // prevent txs with 0 gas to fill up the mempool + if tx.Gas() == 0 { + return errorsmod.Wrap(ErrInvalidGasLimit, "gas limit must not be zero") + } + if !types.IsValidInt256(tx.GasPrice()) { + return errorsmod.Wrap(ErrInvalidGasPrice, "out of bound") + } + if !types.IsValidInt256(tx.GasFeeCap()) { + return errorsmod.Wrap(ErrInvalidGasPrice, "out of bound") + } + if !types.IsValidInt256(tx.GasTipCap()) { + return errorsmod.Wrap(ErrInvalidGasPrice, "out of bound") + } + if !types.IsValidInt256(tx.Cost()) { + return errorsmod.Wrap(ErrInvalidGasFee, "out of bound") + } + return nil +} diff --git a/chain/evm/types/events.go b/chain/evm/types/events.go new file mode 100644 index 00000000..d9e85928 --- /dev/null +++ b/chain/evm/types/events.go @@ -0,0 +1,24 @@ +package types + +// Evm module events +const ( + EventTypeEthereumTx = TypeMsgEthereumTx + EventTypeBlockBloom = "block_bloom" + EventTypeTxLog = "tx_log" + + AttributeKeyContractAddress = "contract" + AttributeKeyRecipient = "recipient" + AttributeKeyTxHash = "txHash" + AttributeKeyEthereumTxHash = "ethereumTxHash" + AttributeKeyTxIndex = "txIndex" + AttributeKeyTxGasUsed = "txGasUsed" + AttributeKeyTxType = "txType" + AttributeKeyTxLog = "txLog" + // tx failed in eth vm execution + AttributeKeyEthereumTxFailed = "ethereumTxFailed" + AttributeValueCategory = ModuleName + AttributeKeyEthereumBloom = "bloom" + + MetricKeyTransitionDB = "transition_db" + MetricKeyStaticCall = "static_call" +) diff --git a/chain/evm/types/events.pb.go b/chain/evm/types/events.pb.go new file mode 100644 index 00000000..7c3e58f3 --- /dev/null +++ b/chain/evm/types/events.pb.go @@ -0,0 +1,1266 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/evm/v1/events.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventEthereumTx defines the event for an Ethereum transaction +type EventEthereumTx struct { + // amount + Amount string `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` + // eth_hash is the Ethereum hash of the transaction + EthHash string `protobuf:"bytes,2,opt,name=eth_hash,json=ethHash,proto3" json:"eth_hash,omitempty"` + // index of the transaction in the block + Index string `protobuf:"bytes,3,opt,name=index,proto3" json:"index,omitempty"` + // gas_used is the amount of gas used by the transaction + GasUsed string `protobuf:"bytes,4,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + // hash is the Tendermint hash of the transaction + Hash string `protobuf:"bytes,5,opt,name=hash,proto3" json:"hash,omitempty"` + // recipient of the transaction + Recipient string `protobuf:"bytes,6,opt,name=recipient,proto3" json:"recipient,omitempty"` + // eth_tx_failed contains a VM error should it occur + EthTxFailed string `protobuf:"bytes,7,opt,name=eth_tx_failed,json=ethTxFailed,proto3" json:"eth_tx_failed,omitempty"` +} + +func (m *EventEthereumTx) Reset() { *m = EventEthereumTx{} } +func (m *EventEthereumTx) String() string { return proto.CompactTextString(m) } +func (*EventEthereumTx) ProtoMessage() {} +func (*EventEthereumTx) Descriptor() ([]byte, []int) { + return fileDescriptor_5024e613c650b0ae, []int{0} +} +func (m *EventEthereumTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventEthereumTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventEthereumTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventEthereumTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventEthereumTx.Merge(m, src) +} +func (m *EventEthereumTx) XXX_Size() int { + return m.Size() +} +func (m *EventEthereumTx) XXX_DiscardUnknown() { + xxx_messageInfo_EventEthereumTx.DiscardUnknown(m) +} + +var xxx_messageInfo_EventEthereumTx proto.InternalMessageInfo + +func (m *EventEthereumTx) GetAmount() string { + if m != nil { + return m.Amount + } + return "" +} + +func (m *EventEthereumTx) GetEthHash() string { + if m != nil { + return m.EthHash + } + return "" +} + +func (m *EventEthereumTx) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +func (m *EventEthereumTx) GetGasUsed() string { + if m != nil { + return m.GasUsed + } + return "" +} + +func (m *EventEthereumTx) GetHash() string { + if m != nil { + return m.Hash + } + return "" +} + +func (m *EventEthereumTx) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +func (m *EventEthereumTx) GetEthTxFailed() string { + if m != nil { + return m.EthTxFailed + } + return "" +} + +// EventTxLog defines the event for an Ethereum transaction log +type EventTxLog struct { + // tx_logs is an array of transaction logs + TxLogs []string `protobuf:"bytes,1,rep,name=tx_logs,json=txLogs,proto3" json:"tx_logs,omitempty"` +} + +func (m *EventTxLog) Reset() { *m = EventTxLog{} } +func (m *EventTxLog) String() string { return proto.CompactTextString(m) } +func (*EventTxLog) ProtoMessage() {} +func (*EventTxLog) Descriptor() ([]byte, []int) { + return fileDescriptor_5024e613c650b0ae, []int{1} +} +func (m *EventTxLog) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventTxLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventTxLog.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventTxLog) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventTxLog.Merge(m, src) +} +func (m *EventTxLog) XXX_Size() int { + return m.Size() +} +func (m *EventTxLog) XXX_DiscardUnknown() { + xxx_messageInfo_EventTxLog.DiscardUnknown(m) +} + +var xxx_messageInfo_EventTxLog proto.InternalMessageInfo + +func (m *EventTxLog) GetTxLogs() []string { + if m != nil { + return m.TxLogs + } + return nil +} + +// EventMessage +type EventMessage struct { + // module which emits the event + Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` + // sender of the message + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` + // tx_type is the type of the message + TxType string `protobuf:"bytes,3,opt,name=tx_type,json=txType,proto3" json:"tx_type,omitempty"` +} + +func (m *EventMessage) Reset() { *m = EventMessage{} } +func (m *EventMessage) String() string { return proto.CompactTextString(m) } +func (*EventMessage) ProtoMessage() {} +func (*EventMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_5024e613c650b0ae, []int{2} +} +func (m *EventMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventMessage.Merge(m, src) +} +func (m *EventMessage) XXX_Size() int { + return m.Size() +} +func (m *EventMessage) XXX_DiscardUnknown() { + xxx_messageInfo_EventMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_EventMessage proto.InternalMessageInfo + +func (m *EventMessage) GetModule() string { + if m != nil { + return m.Module + } + return "" +} + +func (m *EventMessage) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *EventMessage) GetTxType() string { + if m != nil { + return m.TxType + } + return "" +} + +// EventBlockBloom defines an Ethereum block bloom filter event +type EventBlockBloom struct { + // bloom is the bloom filter of the block + Bloom string `protobuf:"bytes,1,opt,name=bloom,proto3" json:"bloom,omitempty"` +} + +func (m *EventBlockBloom) Reset() { *m = EventBlockBloom{} } +func (m *EventBlockBloom) String() string { return proto.CompactTextString(m) } +func (*EventBlockBloom) ProtoMessage() {} +func (*EventBlockBloom) Descriptor() ([]byte, []int) { + return fileDescriptor_5024e613c650b0ae, []int{3} +} +func (m *EventBlockBloom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventBlockBloom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventBlockBloom.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventBlockBloom) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBlockBloom.Merge(m, src) +} +func (m *EventBlockBloom) XXX_Size() int { + return m.Size() +} +func (m *EventBlockBloom) XXX_DiscardUnknown() { + xxx_messageInfo_EventBlockBloom.DiscardUnknown(m) +} + +var xxx_messageInfo_EventBlockBloom proto.InternalMessageInfo + +func (m *EventBlockBloom) GetBloom() string { + if m != nil { + return m.Bloom + } + return "" +} + +func init() { + proto.RegisterType((*EventEthereumTx)(nil), "injective.evm.v1.EventEthereumTx") + proto.RegisterType((*EventTxLog)(nil), "injective.evm.v1.EventTxLog") + proto.RegisterType((*EventMessage)(nil), "injective.evm.v1.EventMessage") + proto.RegisterType((*EventBlockBloom)(nil), "injective.evm.v1.EventBlockBloom") +} + +func init() { proto.RegisterFile("injective/evm/v1/events.proto", fileDescriptor_5024e613c650b0ae) } + +var fileDescriptor_5024e613c650b0ae = []byte{ + // 378 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x51, 0xd1, 0x4a, 0xe3, 0x40, + 0x14, 0x6d, 0xb6, 0x6d, 0xba, 0x9d, 0xdd, 0x65, 0x97, 0x61, 0xd1, 0x08, 0x1a, 0x4a, 0x40, 0xf4, + 0xc5, 0x84, 0xe2, 0x1f, 0x14, 0x2a, 0x16, 0xea, 0x8b, 0x44, 0x04, 0x5f, 0xc2, 0x24, 0xb9, 0x66, + 0x46, 0x93, 0x4c, 0xc8, 0x4c, 0x42, 0xfa, 0x17, 0x7e, 0x96, 0xe0, 0x4b, 0x1f, 0x7d, 0x94, 0xf6, + 0x47, 0x64, 0x26, 0x69, 0xf5, 0x6d, 0xce, 0xb9, 0xf7, 0x9e, 0xb9, 0xe7, 0x1e, 0x74, 0xc2, 0xf2, + 0x27, 0x88, 0x24, 0xab, 0xc1, 0x83, 0x3a, 0xf3, 0xea, 0xa9, 0x07, 0x35, 0xe4, 0x52, 0xb8, 0x45, + 0xc9, 0x25, 0xc7, 0xff, 0xf6, 0x65, 0x17, 0xea, 0xcc, 0xad, 0xa7, 0xce, 0x9b, 0x81, 0xfe, 0xce, + 0x55, 0xcb, 0x5c, 0x52, 0x28, 0xa1, 0xca, 0xfc, 0x06, 0x1f, 0x20, 0x93, 0x64, 0xbc, 0xca, 0xa5, + 0x65, 0x4c, 0x8c, 0xf3, 0xf1, 0x6d, 0x87, 0xf0, 0x11, 0xfa, 0x09, 0x92, 0x06, 0x94, 0x08, 0x6a, + 0xfd, 0xd0, 0x95, 0x11, 0x48, 0x7a, 0x4d, 0x04, 0xc5, 0xff, 0xd1, 0x90, 0xe5, 0x31, 0x34, 0x56, + 0x5f, 0xf3, 0x2d, 0x50, 0x03, 0x09, 0x11, 0x41, 0x25, 0x20, 0xb6, 0x06, 0xed, 0x40, 0x42, 0xc4, + 0x9d, 0x80, 0x18, 0x63, 0x34, 0xd0, 0x3a, 0x43, 0x4d, 0xeb, 0x37, 0x3e, 0x46, 0xe3, 0x12, 0x22, + 0x56, 0x30, 0xc8, 0xa5, 0x65, 0xea, 0xc2, 0x17, 0x81, 0x1d, 0xf4, 0x47, 0xfd, 0x2e, 0x9b, 0xe0, + 0x91, 0xb0, 0x14, 0x62, 0x6b, 0xa4, 0x3b, 0x7e, 0x81, 0xa4, 0x7e, 0x73, 0xa5, 0x29, 0xe7, 0x14, + 0x21, 0x6d, 0xc6, 0x6f, 0x96, 0x3c, 0xc1, 0x87, 0x68, 0x24, 0x9b, 0x20, 0xe5, 0x89, 0xb0, 0x8c, + 0x49, 0x5f, 0x19, 0x91, 0x8a, 0x17, 0xce, 0x3d, 0xfa, 0xad, 0xdb, 0x6e, 0x40, 0x08, 0x92, 0x80, + 0x32, 0x9c, 0xf1, 0xb8, 0x4a, 0x61, 0x67, 0xb8, 0x45, 0x8a, 0x17, 0x90, 0xc7, 0x50, 0x76, 0x76, + 0x3b, 0xd4, 0x09, 0xcb, 0x55, 0x01, 0x9d, 0x5f, 0x53, 0x36, 0xfe, 0xaa, 0x00, 0xe7, 0xac, 0x3b, + 0xe6, 0x2c, 0xe5, 0xd1, 0xf3, 0x2c, 0xe5, 0x3c, 0x53, 0x97, 0x09, 0xd5, 0xa3, 0x93, 0x6e, 0xc1, + 0x2c, 0x7a, 0xdd, 0xd8, 0xc6, 0x7a, 0x63, 0x1b, 0x1f, 0x1b, 0xdb, 0x78, 0xd9, 0xda, 0xbd, 0xf5, + 0xd6, 0xee, 0xbd, 0x6f, 0xed, 0xde, 0xc3, 0x22, 0x61, 0x92, 0x56, 0xa1, 0x1b, 0xf1, 0xcc, 0x5b, + 0xec, 0xd2, 0x5a, 0x92, 0x50, 0x78, 0xfb, 0xec, 0x2e, 0x22, 0x5e, 0xc2, 0x77, 0x48, 0x09, 0xcb, + 0xbd, 0x76, 0x67, 0xa1, 0x73, 0x57, 0xab, 0x89, 0xd0, 0xd4, 0xa1, 0x5f, 0x7e, 0x06, 0x00, 0x00, + 0xff, 0xff, 0x78, 0xa7, 0x41, 0x06, 0x15, 0x02, 0x00, 0x00, +} + +func (m *EventEthereumTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventEthereumTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventEthereumTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.EthTxFailed) > 0 { + i -= len(m.EthTxFailed) + copy(dAtA[i:], m.EthTxFailed) + i = encodeVarintEvents(dAtA, i, uint64(len(m.EthTxFailed))) + i-- + dAtA[i] = 0x3a + } + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x32 + } + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x2a + } + if len(m.GasUsed) > 0 { + i -= len(m.GasUsed) + copy(dAtA[i:], m.GasUsed) + i = encodeVarintEvents(dAtA, i, uint64(len(m.GasUsed))) + i-- + dAtA[i] = 0x22 + } + if len(m.Index) > 0 { + i -= len(m.Index) + copy(dAtA[i:], m.Index) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Index))) + i-- + dAtA[i] = 0x1a + } + if len(m.EthHash) > 0 { + i -= len(m.EthHash) + copy(dAtA[i:], m.EthHash) + i = encodeVarintEvents(dAtA, i, uint64(len(m.EthHash))) + i-- + dAtA[i] = 0x12 + } + if len(m.Amount) > 0 { + i -= len(m.Amount) + copy(dAtA[i:], m.Amount) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Amount))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventTxLog) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventTxLog) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventTxLog) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TxLogs) > 0 { + for iNdEx := len(m.TxLogs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.TxLogs[iNdEx]) + copy(dAtA[i:], m.TxLogs[iNdEx]) + i = encodeVarintEvents(dAtA, i, uint64(len(m.TxLogs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *EventMessage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventMessage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TxType) > 0 { + i -= len(m.TxType) + copy(dAtA[i:], m.TxType) + i = encodeVarintEvents(dAtA, i, uint64(len(m.TxType))) + i-- + dAtA[i] = 0x1a + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x12 + } + if len(m.Module) > 0 { + i -= len(m.Module) + copy(dAtA[i:], m.Module) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Module))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventBlockBloom) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventBlockBloom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventBlockBloom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Bloom) > 0 { + i -= len(m.Bloom) + copy(dAtA[i:], m.Bloom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Bloom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventEthereumTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Amount) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.EthHash) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Index) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.GasUsed) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.EthTxFailed) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventTxLog) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.TxLogs) > 0 { + for _, s := range m.TxLogs { + l = len(s) + n += 1 + l + sovEvents(uint64(l)) + } + } + return n +} + +func (m *EventMessage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Module) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.TxType) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventBlockBloom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bloom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventEthereumTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventEthereumTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventEthereumTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EthHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EthHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GasUsed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EthTxFailed", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EthTxFailed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventTxLog) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventTxLog: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventTxLog: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxLogs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TxLogs = append(m.TxLogs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventMessage) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Module = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TxType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventBlockBloom) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventBlockBloom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBlockBloom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bloom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bloom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/evm/types/genesis.go b/chain/evm/types/genesis.go new file mode 100644 index 00000000..f4cb608a --- /dev/null +++ b/chain/evm/types/genesis.go @@ -0,0 +1,49 @@ +package types + +import ( + "fmt" + + chaintypes "github.com/InjectiveLabs/sdk-go/chain/types" +) + +// Validate performs a basic validation of a GenesisAccount fields. +func (ga GenesisAccount) Validate() error { + if err := chaintypes.ValidateAddress(ga.Address); err != nil { + return err + } + return ga.Storage.Validate() +} + +// DefaultGenesisState sets default evm genesis state with empty accounts and default params and +// chain config values. +func DefaultGenesisState() *GenesisState { + return &GenesisState{ + Accounts: []GenesisAccount{}, + Params: DefaultParams(), + } +} + +// NewGenesisState creates a new genesis state. +func NewGenesisState(params Params, accounts []GenesisAccount) *GenesisState { + return &GenesisState{ + Accounts: accounts, + Params: params, + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + seenAccounts := make(map[string]bool) + for _, acc := range gs.Accounts { + if seenAccounts[acc.Address] { + return fmt.Errorf("duplicated genesis account %s", acc.Address) + } + if err := acc.Validate(); err != nil { + return fmt.Errorf("invalid genesis account %s: %w", acc.Address, err) + } + seenAccounts[acc.Address] = true + } + + return gs.Params.Validate() +} diff --git a/chain/evm/types/genesis.pb.go b/chain/evm/types/genesis.pb.go new file mode 100644 index 00000000..9c88b816 --- /dev/null +++ b/chain/evm/types/genesis.pb.go @@ -0,0 +1,682 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/evm/v1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the evm module's genesis state. +type GenesisState struct { + // accounts is an array containing the ethereum genesis accounts. + Accounts []GenesisAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts"` + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_6b999f1496c0eb0b, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetAccounts() []GenesisAccount { + if m != nil { + return m.Accounts + } + return nil +} + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// GenesisAccount defines an account to be initialized in the genesis state. +// Its main difference between with Geth's GenesisAccount is that it uses a +// custom storage type and that it doesn't contain the private key field. +type GenesisAccount struct { + // address defines an ethereum hex formated address of an account + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // code defines the hex bytes of the account code. + Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` + // storage defines the set of state key values for the account. + Storage Storage `protobuf:"bytes,3,rep,name=storage,proto3,castrepeated=Storage" json:"storage"` +} + +func (m *GenesisAccount) Reset() { *m = GenesisAccount{} } +func (m *GenesisAccount) String() string { return proto.CompactTextString(m) } +func (*GenesisAccount) ProtoMessage() {} +func (*GenesisAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_6b999f1496c0eb0b, []int{1} +} +func (m *GenesisAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisAccount.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisAccount.Merge(m, src) +} +func (m *GenesisAccount) XXX_Size() int { + return m.Size() +} +func (m *GenesisAccount) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisAccount proto.InternalMessageInfo + +func (m *GenesisAccount) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *GenesisAccount) GetCode() string { + if m != nil { + return m.Code + } + return "" +} + +func (m *GenesisAccount) GetStorage() Storage { + if m != nil { + return m.Storage + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "injective.evm.v1.GenesisState") + proto.RegisterType((*GenesisAccount)(nil), "injective.evm.v1.GenesisAccount") +} + +func init() { proto.RegisterFile("injective/evm/v1/genesis.proto", fileDescriptor_6b999f1496c0eb0b) } + +var fileDescriptor_6b999f1496c0eb0b = []byte{ + // 324 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x51, 0x4f, 0x4f, 0xf2, 0x30, + 0x18, 0x5f, 0x5f, 0x08, 0xbc, 0x14, 0xa3, 0xa6, 0x31, 0x71, 0x21, 0x5a, 0x08, 0x27, 0x2e, 0xb6, + 0x01, 0x13, 0xef, 0xee, 0x62, 0x48, 0x3c, 0x98, 0x71, 0xf3, 0x56, 0xba, 0x27, 0x63, 0xc6, 0xad, + 0x64, 0x2d, 0x4b, 0xbc, 0x7a, 0xf4, 0xe4, 0xe7, 0xf0, 0x93, 0x70, 0xe4, 0xe8, 0x49, 0x0d, 0x7c, + 0x11, 0xb3, 0x6e, 0x2c, 0xea, 0x6e, 0xcf, 0xd3, 0xdf, 0xdf, 0xb6, 0x98, 0x46, 0xc9, 0x03, 0x48, + 0x13, 0x65, 0xc0, 0x21, 0x8b, 0x79, 0x36, 0xe6, 0x21, 0x24, 0xa0, 0x23, 0xcd, 0x96, 0xa9, 0x32, + 0x8a, 0x1c, 0x57, 0x38, 0x83, 0x2c, 0x66, 0xd9, 0xb8, 0x77, 0x5e, 0x53, 0x2c, 0x45, 0x2a, 0xe2, + 0x52, 0xd0, 0x3b, 0xab, 0xc1, 0xda, 0x08, 0x03, 0x25, 0x7a, 0x12, 0xaa, 0x50, 0xd9, 0x91, 0xe7, + 0x53, 0x71, 0x3a, 0x7c, 0x41, 0xf8, 0xe0, 0xa6, 0x88, 0x9d, 0xe5, 0x64, 0xe2, 0xe1, 0xff, 0x42, + 0x4a, 0xb5, 0x4a, 0x8c, 0x76, 0xd1, 0xa0, 0x31, 0xea, 0x4e, 0x06, 0xec, 0x6f, 0x11, 0x56, 0x2a, + 0xae, 0x0b, 0xa2, 0xd7, 0x5c, 0x7f, 0xf4, 0x1d, 0xbf, 0xd2, 0x91, 0x2b, 0xdc, 0x2a, 0x8a, 0xb9, + 0xff, 0x06, 0x68, 0xd4, 0x9d, 0xb8, 0x75, 0x87, 0x3b, 0x8b, 0x97, 0xca, 0x92, 0x3d, 0x7c, 0x46, + 0xf8, 0xf0, 0xb7, 0x35, 0x71, 0x71, 0x5b, 0x04, 0x41, 0x0a, 0x3a, 0x6f, 0x83, 0x46, 0x1d, 0x7f, + 0xbf, 0x12, 0x82, 0x9b, 0x52, 0x05, 0x60, 0x23, 0x3a, 0xbe, 0x9d, 0x89, 0x87, 0xdb, 0xda, 0xa8, + 0x54, 0x84, 0xe0, 0x36, 0x6c, 0xf7, 0xd3, 0x7a, 0xb2, 0xbd, 0xa6, 0x77, 0x94, 0x07, 0xbf, 0x7d, + 0xf6, 0xdb, 0xb3, 0x82, 0xef, 0xef, 0x85, 0x9e, 0x5c, 0x6f, 0x29, 0xda, 0x6c, 0x29, 0xfa, 0xda, + 0x52, 0xf4, 0xba, 0xa3, 0xce, 0x66, 0x47, 0x9d, 0xf7, 0x1d, 0x75, 0xee, 0xa7, 0x61, 0x64, 0x16, + 0xab, 0x39, 0x93, 0x2a, 0xe6, 0xd3, 0xbd, 0xed, 0xad, 0x98, 0x6b, 0x5e, 0x85, 0x5c, 0x48, 0x95, + 0xc2, 0xcf, 0x75, 0x21, 0xa2, 0x84, 0xc7, 0x2a, 0x58, 0x3d, 0x82, 0xb6, 0xbf, 0x62, 0x9e, 0x96, + 0xa0, 0xe7, 0x2d, 0xfb, 0xfa, 0x97, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x9e, 0x28, 0xb0, + 0x04, 0x02, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Accounts) > 0 { + for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Accounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *GenesisAccount) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Storage) > 0 { + for iNdEx := len(m.Storage) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Storage[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Code) > 0 { + i -= len(m.Code) + copy(dAtA[i:], m.Code) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Code))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Accounts) > 0 { + for _, e := range m.Accounts { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *GenesisAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Code) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.Storage) > 0 { + for _, e := range m.Storage { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Accounts = append(m.Accounts, GenesisAccount{}) + if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenesisAccount) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Code = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Storage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Storage = append(m.Storage, State{}) + if err := m.Storage[len(m.Storage)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/evm/types/interfaces.go b/chain/evm/types/interfaces.go new file mode 100644 index 00000000..4082bc0c --- /dev/null +++ b/chain/evm/types/interfaces.go @@ -0,0 +1,74 @@ +package types + +import ( + context "context" + "math/big" + + "github.com/cosmos/cosmos-sdk/x/auth/ante" + "github.com/cosmos/cosmos-sdk/x/bank/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + feemarkettypes "github.com/InjectiveLabs/sdk-go/chain/feemarket/types" + "github.com/ethereum/go-ethereum/core" + ethtypes "github.com/ethereum/go-ethereum/core/types" +) + +// AccountKeeper defines the expected account keeper interface +type AccountKeeper interface { + ante.AccountKeeper + NewAccountWithAddress(ctx context.Context, addr sdk.AccAddress) sdk.AccountI + GetModuleAddress(moduleName string) sdk.AccAddress + GetAllAccounts(ctx context.Context) (accounts []sdk.AccountI) + IterateAccounts(ctx context.Context, cb func(account sdk.AccountI) bool) + GetSequence(context.Context, sdk.AccAddress) (uint64, error) + RemoveAccount(ctx context.Context, account sdk.AccountI) +} + +// BankKeeper defines the expected interface needed to retrieve account balances. +type BankKeeper interface { + authtypes.BankKeeper + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromModuleToAccountVirtual(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModuleVirtual(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + BlockedAddr(addr sdk.AccAddress) bool + GetSupply(ctx context.Context, denom string) sdk.Coin + GetDenomMetaData(ctx context.Context, denom string) (types.Metadata, bool) + SetDenomMetaData(ctx context.Context, denomMetaData types.Metadata) +} + +// StakingKeeper returns the historical headers kept in store. +type StakingKeeper interface { + GetHistoricalInfo(ctx context.Context, height int64) (stakingtypes.HistoricalInfo, error) + GetValidatorByConsAddr(ctx context.Context, consAddr sdk.ConsAddress) (validator stakingtypes.Validator, err error) +} + +// FeeMarketKeeper +type FeeMarketKeeper interface { + GetBaseFee(ctx sdk.Context) *big.Int + GetParams(ctx sdk.Context) feemarkettypes.Params +} + +// Event Hooks +// These can be utilized to customize evm transaction processing. + +// EvmHooks event hooks for evm tx processing +type EvmHooks interface { + // Must be called after tx is processed successfully, if return an error, the whole transaction is reverted. + PostTxProcessing(ctx sdk.Context, msg *core.Message, receipt *ethtypes.Receipt) error +} + +type ( + LegacyParams = paramtypes.ParamSet + // Subspace defines an interface that implements the legacy Cosmos SDK x/params Subspace type. + // NOTE: This is used solely for migration of the Cosmos SDK x/params managed parameters. + Subspace interface { + GetParamSetIfExists(ctx sdk.Context, ps LegacyParams) + } +) diff --git a/chain/evm/types/key.go b/chain/evm/types/key.go new file mode 100644 index 00000000..62a3e497 --- /dev/null +++ b/chain/evm/types/key.go @@ -0,0 +1,78 @@ +package types + +import ( + "encoding/binary" + + "github.com/ethereum/go-ethereum/common" +) + +const ( + // ModuleName string name of module + ModuleName = "evm" + + // StoreKey key for ethereum storage data, account code (StateDB) or block + // related data for Web3. + // The EVM module should use a prefix store. + StoreKey = ModuleName + + // ObjectStoreKey is the key to access the EVM object store, that is reset + // during the Commit phase. + ObjectStoreKey = "object:" + ModuleName + + // RouterKey uses module name for routing + RouterKey = ModuleName +) + +// prefix bytes for the EVM persistent store +const ( + prefixCode = iota + 1 + prefixStorage + prefixParams +) + +// prefix bytes for the EVM object store +const ( + prefixObjectBloom = iota + 1 + prefixObjectGasUsed + prefixObjectParams +) + +// KVStore key prefixes +var ( + KeyPrefixCode = []byte{prefixCode} + KeyPrefixStorage = []byte{prefixStorage} + KeyPrefixParams = []byte{prefixParams} +) + +// Object Store key prefixes +var ( + KeyPrefixObjectBloom = []byte{prefixObjectBloom} + KeyPrefixObjectGasUsed = []byte{prefixObjectGasUsed} + // cache the `EVMBlockConfig` during the whole block execution + KeyPrefixObjectParams = []byte{prefixObjectParams} +) + +// AddressStoragePrefix returns a prefix to iterate over a given account storage. +func AddressStoragePrefix(address common.Address) []byte { + return append(KeyPrefixStorage, address.Bytes()...) +} + +// StateKey defines the full key under which an account state is stored. +func StateKey(address common.Address, key []byte) []byte { + return append(AddressStoragePrefix(address), key...) +} + +func ObjectGasUsedKey(txIndex int) []byte { + var key [1 + 8]byte + key[0] = prefixObjectGasUsed + binary.BigEndian.PutUint64(key[1:], uint64(txIndex)) + return key[:] +} + +func ObjectBloomKey(txIndex, msgIndex int) []byte { + var key [1 + 8 + 8]byte + key[0] = prefixObjectBloom + binary.BigEndian.PutUint64(key[1:], uint64(txIndex)) + binary.BigEndian.PutUint64(key[9:], uint64(msgIndex)) + return key[:] +} diff --git a/chain/evm/types/legacy_tx.go b/chain/evm/types/legacy_tx.go new file mode 100644 index 00000000..4f6b9267 --- /dev/null +++ b/chain/evm/types/legacy_tx.go @@ -0,0 +1,217 @@ +package types + +import ( + "math/big" + + errorsmod "cosmossdk.io/errors" + "github.com/InjectiveLabs/sdk-go/chain/types" + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" +) + +func NewLegacyTx(tx *ethtypes.Transaction) (*LegacyTx, error) { + txData := &LegacyTx{ + Nonce: tx.Nonce(), + Data: tx.Data(), + GasLimit: tx.Gas(), + } + + v, r, s := tx.RawSignatureValues() + if to := tx.To(); to != nil { + txData.To = to.Hex() + } + + if tx.Value() != nil { + amountInt, err := types.SafeNewIntFromBigInt(tx.Value()) + if err != nil { + return nil, err + } + txData.Amount = &amountInt + } + + if tx.GasPrice() != nil { + gasPriceInt, err := types.SafeNewIntFromBigInt(tx.GasPrice()) + if err != nil { + return nil, err + } + txData.GasPrice = &gasPriceInt + } + + txData.SetSignatureValues(tx.ChainId(), v, r, s) + return txData, nil +} + +// TxType returns the tx type +func (tx *LegacyTx) TxType() uint8 { + return ethtypes.LegacyTxType +} + +// Copy returns an instance with the same field values +func (tx *LegacyTx) Copy() TxData { + return &LegacyTx{ + Nonce: tx.Nonce, + GasPrice: tx.GasPrice, + GasLimit: tx.GasLimit, + To: tx.To, + Amount: tx.Amount, + Data: common.CopyBytes(tx.Data), + V: common.CopyBytes(tx.V), + R: common.CopyBytes(tx.R), + S: common.CopyBytes(tx.S), + } +} + +// GetChainID returns the chain id field from the derived signature values +func (tx *LegacyTx) GetChainID() *big.Int { + v, _, _ := tx.GetRawSignatureValues() + return DeriveChainID(v) +} + +// GetAccessList returns nil +func (tx *LegacyTx) GetAccessList() ethtypes.AccessList { + return nil +} + +// GetData returns the a copy of the input data bytes. +func (tx *LegacyTx) GetData() []byte { + return common.CopyBytes(tx.Data) +} + +// GetGas returns the gas limit. +func (tx *LegacyTx) GetGas() uint64 { + return tx.GasLimit +} + +// GetGasPrice returns the gas price field. +func (tx *LegacyTx) GetGasPrice() *big.Int { + if tx.GasPrice == nil { + return nil + } + return tx.GasPrice.BigInt() +} + +// GetGasTipCap returns the gas price field. +func (tx *LegacyTx) GetGasTipCap() *big.Int { + return tx.GetGasPrice() +} + +// GetGasFeeCap returns the gas price field. +func (tx *LegacyTx) GetGasFeeCap() *big.Int { + return tx.GetGasPrice() +} + +// GetValue returns the tx amount. +func (tx *LegacyTx) GetValue() *big.Int { + if tx.Amount == nil { + return nil + } + return tx.Amount.BigInt() +} + +// GetNonce returns the account sequence for the transaction. +func (tx *LegacyTx) GetNonce() uint64 { return tx.Nonce } + +// GetTo returns the pointer to the recipient address. +func (tx *LegacyTx) GetTo() *common.Address { + if tx.To == "" { + return nil + } + to := common.HexToAddress(tx.To) + return &to +} + +// AsEthereumData returns an AccessListTx transaction tx from the proto-formatted +// TxData defined on the Cosmos EVM. +func (tx *LegacyTx) AsEthereumData() ethtypes.TxData { + v, r, s := tx.GetRawSignatureValues() + return ðtypes.LegacyTx{ + Nonce: tx.GetNonce(), + GasPrice: tx.GetGasPrice(), + Gas: tx.GetGas(), + To: tx.GetTo(), + Value: tx.GetValue(), + Data: tx.GetData(), + V: v, + R: r, + S: s, + } +} + +// GetRawSignatureValues returns the V, R, S signature values of the transaction. +// The return values should not be modified by the caller. +func (tx *LegacyTx) GetRawSignatureValues() (v, r, s *big.Int) { + return rawSignatureValues(tx.V, tx.R, tx.S) +} + +// SetSignatureValues sets the signature values to the transaction. +func (tx *LegacyTx) SetSignatureValues(_, v, r, s *big.Int) { + if v != nil { + tx.V = v.Bytes() + } + if r != nil { + tx.R = r.Bytes() + } + if s != nil { + tx.S = s.Bytes() + } +} + +// Validate performs a stateless validation of the tx fields. +func (tx LegacyTx) Validate() error { + gasPrice := tx.GetGasPrice() + if gasPrice == nil { + return errorsmod.Wrap(ErrInvalidGasPrice, "gas price cannot be nil") + } + + if gasPrice.Sign() == -1 { + return errorsmod.Wrapf(ErrInvalidGasPrice, "gas price cannot be negative %s", gasPrice) + } + if !types.IsValidInt256(gasPrice) { + return errorsmod.Wrap(ErrInvalidGasPrice, "out of bound") + } + if !types.IsValidInt256(tx.Fee()) { + return errorsmod.Wrap(ErrInvalidGasFee, "out of bound") + } + + amount := tx.GetValue() + // Amount can be 0 + if amount != nil && amount.Sign() == -1 { + return errorsmod.Wrapf(ErrInvalidAmount, "amount cannot be negative %s", amount) + } + if !types.IsValidInt256(amount) { + return errorsmod.Wrap(ErrInvalidAmount, "out of bound") + } + + if tx.To != "" { + if err := types.ValidateAddress(tx.To); err != nil { + return errorsmod.Wrap(err, "invalid to address") + } + } + + return nil +} + +// Fee returns gasprice * gaslimit. +func (tx LegacyTx) Fee() *big.Int { + return fee(tx.GetGasPrice(), tx.GetGas()) +} + +// Cost returns amount + gasprice * gaslimit. +func (tx LegacyTx) Cost() *big.Int { + return cost(tx.Fee(), tx.GetValue()) +} + +// EffectiveGasPrice is the same as GasPrice for LegacyTx +func (tx LegacyTx) EffectiveGasPrice(_ *big.Int) *big.Int { + return tx.GetGasPrice() +} + +// EffectiveFee is the same as Fee for LegacyTx +func (tx LegacyTx) EffectiveFee(_ *big.Int) *big.Int { + return tx.Fee() +} + +// EffectiveCost is the same as Cost for LegacyTx +func (tx LegacyTx) EffectiveCost(_ *big.Int) *big.Int { + return tx.Cost() +} diff --git a/chain/evm/types/log.pb.go b/chain/evm/types/log.pb.go new file mode 100644 index 00000000..7662a851 --- /dev/null +++ b/chain/evm/types/log.pb.go @@ -0,0 +1,702 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/evm/v1/log.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Log represents an protobuf compatible Ethereum Log that defines a contract +// log event. These events are generated by the LOG opcode and stored/indexed by +// the node. +// +// NOTE: address, topics and data are consensus fields. The rest of the fields +// are derived, i.e. filled in by the nodes, but not secured by consensus. +type Log struct { + // address of the contract that generated the event + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // topics is a list of topics provided by the contract. + Topics []string `protobuf:"bytes,2,rep,name=topics,proto3" json:"topics,omitempty"` + // data which is supplied by the contract, usually ABI-encoded + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + // block_number of the block in which the transaction was included + BlockNumber uint64 `protobuf:"varint,4,opt,name=block_number,json=blockNumber,proto3" json:"blockNumber"` + // tx_hash is the transaction hash + TxHash string `protobuf:"bytes,5,opt,name=tx_hash,json=txHash,proto3" json:"transactionHash"` + // tx_index of the transaction in the block + TxIndex uint64 `protobuf:"varint,6,opt,name=tx_index,json=txIndex,proto3" json:"transactionIndex"` + // block_hash of the block in which the transaction was included + BlockHash string `protobuf:"bytes,7,opt,name=block_hash,json=blockHash,proto3" json:"blockHash"` + // index of the log in the block + Index uint64 `protobuf:"varint,8,opt,name=index,proto3" json:"logIndex"` + // removed is true if this log was reverted due to a chain + // reorganisation. You must pay attention to this field if you receive logs + // through a filter query. + Removed bool `protobuf:"varint,9,opt,name=removed,proto3" json:"removed,omitempty"` +} + +func (m *Log) Reset() { *m = Log{} } +func (m *Log) String() string { return proto.CompactTextString(m) } +func (*Log) ProtoMessage() {} +func (*Log) Descriptor() ([]byte, []int) { + return fileDescriptor_4acd1b1de1881b72, []int{0} +} +func (m *Log) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Log) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Log.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Log) XXX_Merge(src proto.Message) { + xxx_messageInfo_Log.Merge(m, src) +} +func (m *Log) XXX_Size() int { + return m.Size() +} +func (m *Log) XXX_DiscardUnknown() { + xxx_messageInfo_Log.DiscardUnknown(m) +} + +var xxx_messageInfo_Log proto.InternalMessageInfo + +func (m *Log) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Log) GetTopics() []string { + if m != nil { + return m.Topics + } + return nil +} + +func (m *Log) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *Log) GetBlockNumber() uint64 { + if m != nil { + return m.BlockNumber + } + return 0 +} + +func (m *Log) GetTxHash() string { + if m != nil { + return m.TxHash + } + return "" +} + +func (m *Log) GetTxIndex() uint64 { + if m != nil { + return m.TxIndex + } + return 0 +} + +func (m *Log) GetBlockHash() string { + if m != nil { + return m.BlockHash + } + return "" +} + +func (m *Log) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *Log) GetRemoved() bool { + if m != nil { + return m.Removed + } + return false +} + +func init() { + proto.RegisterType((*Log)(nil), "injective.evm.v1.Log") +} + +func init() { proto.RegisterFile("injective/evm/v1/log.proto", fileDescriptor_4acd1b1de1881b72) } + +var fileDescriptor_4acd1b1de1881b72 = []byte{ + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x51, 0xbd, 0xae, 0x9b, 0x30, + 0x18, 0x8d, 0xf3, 0xc3, 0x8f, 0x9b, 0x2a, 0x91, 0x1b, 0x55, 0x56, 0x06, 0x40, 0x99, 0x18, 0x52, + 0xac, 0xb4, 0x6f, 0x90, 0xa9, 0x91, 0xa2, 0x0e, 0x8c, 0x5d, 0x22, 0x03, 0x16, 0xd0, 0x02, 0x8e, + 0xb0, 0x83, 0xe8, 0x5b, 0xf4, 0xb1, 0xae, 0xee, 0x94, 0xf1, 0x4e, 0xe8, 0x2a, 0xd9, 0x78, 0x8a, + 0x2b, 0xcc, 0x4d, 0x6e, 0x26, 0xce, 0xcf, 0xa7, 0x73, 0x90, 0x0f, 0x5c, 0xa6, 0xc5, 0x1f, 0x16, + 0xca, 0xb4, 0x62, 0x84, 0x55, 0x39, 0xa9, 0x36, 0x24, 0xe3, 0xb1, 0x77, 0x2c, 0xb9, 0xe4, 0x68, + 0x7e, 0xf7, 0x3c, 0x56, 0xe5, 0x5e, 0xb5, 0x59, 0x2e, 0x62, 0x1e, 0x73, 0x65, 0x92, 0x0e, 0xf5, + 0x77, 0xab, 0xe7, 0x21, 0x1c, 0xed, 0x79, 0x8c, 0x30, 0xd4, 0x69, 0x14, 0x95, 0x4c, 0x08, 0x0c, + 0x1c, 0xe0, 0x9a, 0xfe, 0x8d, 0xa2, 0xaf, 0x50, 0x93, 0xfc, 0x98, 0x86, 0x02, 0x0f, 0x9d, 0x91, + 0x6b, 0xfa, 0xef, 0x0c, 0x21, 0x38, 0x8e, 0xa8, 0xa4, 0x78, 0xe4, 0x00, 0x77, 0xea, 0x2b, 0x8c, + 0xbe, 0xc3, 0x69, 0x90, 0xf1, 0xf0, 0xef, 0xa1, 0x38, 0xe5, 0x01, 0x2b, 0xf1, 0xd8, 0x01, 0xee, + 0x78, 0x3b, 0x6b, 0x1b, 0xfb, 0x93, 0xd2, 0x7f, 0x29, 0xd9, 0x7f, 0x24, 0x68, 0x0d, 0x75, 0x59, + 0x1f, 0x12, 0x2a, 0x12, 0x3c, 0xe9, 0x9a, 0xb7, 0x5f, 0xda, 0xc6, 0x9e, 0xc9, 0x92, 0x16, 0x82, + 0x86, 0x32, 0xe5, 0xc5, 0x4f, 0x2a, 0x12, 0x5f, 0x93, 0x75, 0xf7, 0x45, 0x04, 0x1a, 0xb2, 0x3e, + 0xa4, 0x45, 0xc4, 0x6a, 0xac, 0xa9, 0xf4, 0x45, 0xdb, 0xd8, 0xf3, 0x87, 0xf3, 0x5d, 0xe7, 0xf9, + 0xba, 0xac, 0x15, 0x40, 0x6b, 0x08, 0xfb, 0x5f, 0x52, 0x0d, 0xba, 0x6a, 0xf8, 0xdc, 0x36, 0xb6, + 0xa9, 0x54, 0x95, 0xfd, 0x01, 0xd1, 0x0a, 0x4e, 0xfa, 0x6c, 0x43, 0x65, 0x4f, 0xdb, 0xc6, 0x36, + 0x32, 0x1e, 0xf7, 0x99, 0xbd, 0xd5, 0x3d, 0x55, 0xc9, 0x72, 0x5e, 0xb1, 0x08, 0x9b, 0x0e, 0x70, + 0x0d, 0xff, 0x46, 0xb7, 0xe1, 0xd3, 0xc5, 0x02, 0xe7, 0x8b, 0x05, 0x5e, 0x2f, 0x16, 0xf8, 0x7f, + 0xb5, 0x06, 0xe7, 0xab, 0x35, 0x78, 0xb9, 0x5a, 0x83, 0xdf, 0xbb, 0x38, 0x95, 0xc9, 0x29, 0xf0, + 0x42, 0x9e, 0x93, 0xdd, 0x6d, 0x99, 0x3d, 0x0d, 0x04, 0xb9, 0xef, 0xf4, 0x2d, 0xe4, 0x25, 0x7b, + 0xa4, 0x09, 0x4d, 0x0b, 0x92, 0xf3, 0xe8, 0x94, 0x31, 0xa1, 0x06, 0x96, 0xff, 0x8e, 0x4c, 0x04, + 0x9a, 0x1a, 0xee, 0xc7, 0x5b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa7, 0x73, 0x3f, 0x5a, 0xfe, 0x01, + 0x00, 0x00, +} + +func (m *Log) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Log) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Log) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Removed { + i-- + if m.Removed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if m.Index != 0 { + i = encodeVarintLog(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x40 + } + if len(m.BlockHash) > 0 { + i -= len(m.BlockHash) + copy(dAtA[i:], m.BlockHash) + i = encodeVarintLog(dAtA, i, uint64(len(m.BlockHash))) + i-- + dAtA[i] = 0x3a + } + if m.TxIndex != 0 { + i = encodeVarintLog(dAtA, i, uint64(m.TxIndex)) + i-- + dAtA[i] = 0x30 + } + if len(m.TxHash) > 0 { + i -= len(m.TxHash) + copy(dAtA[i:], m.TxHash) + i = encodeVarintLog(dAtA, i, uint64(len(m.TxHash))) + i-- + dAtA[i] = 0x2a + } + if m.BlockNumber != 0 { + i = encodeVarintLog(dAtA, i, uint64(m.BlockNumber)) + i-- + dAtA[i] = 0x20 + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintLog(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x1a + } + if len(m.Topics) > 0 { + for iNdEx := len(m.Topics) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Topics[iNdEx]) + copy(dAtA[i:], m.Topics[iNdEx]) + i = encodeVarintLog(dAtA, i, uint64(len(m.Topics[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintLog(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintLog(dAtA []byte, offset int, v uint64) int { + offset -= sovLog(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Log) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovLog(uint64(l)) + } + if len(m.Topics) > 0 { + for _, s := range m.Topics { + l = len(s) + n += 1 + l + sovLog(uint64(l)) + } + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovLog(uint64(l)) + } + if m.BlockNumber != 0 { + n += 1 + sovLog(uint64(m.BlockNumber)) + } + l = len(m.TxHash) + if l > 0 { + n += 1 + l + sovLog(uint64(l)) + } + if m.TxIndex != 0 { + n += 1 + sovLog(uint64(m.TxIndex)) + } + l = len(m.BlockHash) + if l > 0 { + n += 1 + l + sovLog(uint64(l)) + } + if m.Index != 0 { + n += 1 + sovLog(uint64(m.Index)) + } + if m.Removed { + n += 2 + } + return n +} + +func sovLog(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozLog(x uint64) (n int) { + return sovLog(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Log) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLog + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Log: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Log: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLog + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLog + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topics", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLog + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLog + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topics = append(m.Topics, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLog + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthLog + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockNumber", wireType) + } + m.BlockNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLog + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLog + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLog + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TxIndex", wireType) + } + m.TxIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLog + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TxIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLog + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLog + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLog + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Removed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLog + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Removed = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipLog(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipLog(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowLog + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowLog + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowLog + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthLog + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupLog + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthLog + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthLog = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowLog = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupLog = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/evm/types/logs.go b/chain/evm/types/logs.go new file mode 100644 index 00000000..1e666c89 --- /dev/null +++ b/chain/evm/types/logs.go @@ -0,0 +1,127 @@ +package types + +import ( + "errors" + "fmt" + + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + + chaintypes "github.com/InjectiveLabs/sdk-go/chain/types" +) + +// NewTransactionLogs creates a new NewTransactionLogs instance. +func NewTransactionLogs(hash common.Hash, logs []*Log) TransactionLogs { + return TransactionLogs{ + Hash: hash.String(), + Logs: logs, + } +} + +// NewTransactionLogsFromEth creates a new NewTransactionLogs instance using []*ethtypes.Log. +func NewTransactionLogsFromEth(hash common.Hash, ethlogs []*ethtypes.Log) TransactionLogs { + return TransactionLogs{ + Hash: hash.String(), + Logs: NewLogsFromEth(ethlogs), + } +} + +// Validate performs a basic validation of a GenesisAccount fields. +func (tx TransactionLogs) Validate() error { + if chaintypes.IsEmptyHash(tx.Hash) { + return fmt.Errorf("hash cannot be the empty %s", tx.Hash) + } + + for i, log := range tx.Logs { + if log == nil { + return fmt.Errorf("log %d cannot be nil", i) + } + if err := log.Validate(); err != nil { + return fmt.Errorf("invalid log %d: %w", i, err) + } + if log.TxHash != tx.Hash { + return fmt.Errorf("log tx hash mismatch (%s ≠ %s)", log.TxHash, tx.Hash) + } + } + return nil +} + +// EthLogs returns the Ethereum type Logs from the Transaction Logs. +func (tx TransactionLogs) EthLogs() []*ethtypes.Log { + return LogsToEthereum(tx.Logs) +} + +// Validate performs a basic validation of an ethereum Log fields. +func (log *Log) Validate() error { + if err := chaintypes.ValidateAddress(log.Address); err != nil { + return fmt.Errorf("invalid log address %w", err) + } + if chaintypes.IsEmptyHash(log.BlockHash) { + return fmt.Errorf("block hash cannot be the empty %s", log.BlockHash) + } + if log.BlockNumber == 0 { + return errors.New("block number cannot be zero") + } + if chaintypes.IsEmptyHash(log.TxHash) { + return fmt.Errorf("tx hash cannot be the empty %s", log.TxHash) + } + return nil +} + +// ToEthereum returns the Ethereum type Log from a Ethermint proto compatible Log. +func (log *Log) ToEthereum() *ethtypes.Log { + topics := make([]common.Hash, len(log.Topics)) + for i, topic := range log.Topics { + topics[i] = common.HexToHash(topic) + } + + return ðtypes.Log{ + Address: common.HexToAddress(log.Address), + Topics: topics, + Data: log.Data, + BlockNumber: log.BlockNumber, + TxHash: common.HexToHash(log.TxHash), + TxIndex: uint(log.TxIndex), + Index: uint(log.Index), + BlockHash: common.HexToHash(log.BlockHash), + Removed: log.Removed, + } +} + +func NewLogsFromEth(ethlogs []*ethtypes.Log) []*Log { + var logs []*Log //nolint: prealloc + for _, ethlog := range ethlogs { + logs = append(logs, NewLogFromEth(ethlog)) + } + + return logs +} + +// LogsToEthereum casts the Ethermint Logs to a slice of Ethereum Logs. +func LogsToEthereum(logs []*Log) []*ethtypes.Log { + var ethLogs []*ethtypes.Log //nolint: prealloc + for i := range logs { + ethLogs = append(ethLogs, logs[i].ToEthereum()) + } + return ethLogs +} + +// NewLogFromEth creates a new Log instance from a Ethereum type Log. +func NewLogFromEth(log *ethtypes.Log) *Log { + topics := make([]string, len(log.Topics)) + for i, topic := range log.Topics { + topics[i] = topic.String() + } + + return &Log{ + Address: HexAddress(log.Address.Bytes()), + Topics: topics, + Data: log.Data, + BlockNumber: log.BlockNumber, + TxHash: log.TxHash.String(), + TxIndex: uint64(log.TxIndex), + Index: uint64(log.Index), + BlockHash: log.BlockHash.String(), + Removed: log.Removed, + } +} diff --git a/chain/evm/types/msg.go b/chain/evm/types/msg.go new file mode 100644 index 00000000..9d9851b9 --- /dev/null +++ b/chain/evm/types/msg.go @@ -0,0 +1,395 @@ +package types + +import ( + "bytes" + "errors" + "fmt" + "math/big" + + sdkmath "cosmossdk.io/math" + "google.golang.org/protobuf/proto" + + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/client" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + sdk "github.com/cosmos/cosmos-sdk/types" + errortypes "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/cosmos/cosmos-sdk/x/auth/ante" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + + "github.com/ethereum/go-ethereum/common" + cmath "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core" + ethtypes "github.com/ethereum/go-ethereum/core/types" +) + +var ( + _ sdk.Msg = &MsgEthereumTx{} + _ sdk.Tx = &MsgEthereumTx{} + _ ante.GasTx = &MsgEthereumTx{} + _ sdk.Msg = &MsgUpdateParams{} + + _ codectypes.UnpackInterfacesMessage = MsgEthereumTx{} +) + +// message type and route constants +const ( + // TypeMsgEthereumTx defines the type string of an Ethereum transaction + TypeMsgEthereumTx = "ethereum_tx" +) + +func NewTxWithData(txData ethtypes.TxData) *MsgEthereumTx { + return &MsgEthereumTx{Raw: NewEthereumTx(txData)} +} + +// NewTx returns a reference to a new Ethereum transaction message. +func NewTx( + chainID *big.Int, nonce uint64, to *common.Address, amount *big.Int, + gasLimit uint64, gasPrice, gasFeeCap, gasTipCap *big.Int, input []byte, accesses *ethtypes.AccessList, +) *MsgEthereumTx { + return newMsgEthereumTx(chainID, nonce, to, amount, gasLimit, gasPrice, gasFeeCap, gasTipCap, input, accesses) +} + +// NewTxContract returns a reference to a new Ethereum transaction +// message designated for contract creation. +func NewTxContract( + chainID *big.Int, + nonce uint64, + amount *big.Int, + gasLimit uint64, + gasPrice, gasFeeCap, gasTipCap *big.Int, + input []byte, + accesses *ethtypes.AccessList, +) *MsgEthereumTx { + return newMsgEthereumTx(chainID, nonce, nil, amount, gasLimit, gasPrice, gasFeeCap, gasTipCap, input, accesses) +} + +func newMsgEthereumTx( + chainID *big.Int, nonce uint64, to *common.Address, amount *big.Int, + gasLimit uint64, gasPrice, gasFeeCap, gasTipCap *big.Int, input []byte, accesses *ethtypes.AccessList, +) *MsgEthereumTx { + var txData ethtypes.TxData + + switch { + case gasFeeCap != nil: + var accessList ethtypes.AccessList + if accesses != nil { + accessList = *accesses + } + txData = ðtypes.DynamicFeeTx{ + ChainID: chainID, + Nonce: nonce, + To: to, + Value: amount, + Gas: gasLimit, + GasTipCap: gasTipCap, + GasFeeCap: gasFeeCap, + Data: input, + AccessList: accessList, + } + case accesses != nil: + txData = ðtypes.AccessListTx{ + ChainID: chainID, + Nonce: nonce, + To: to, + Value: amount, + Gas: gasLimit, + GasPrice: gasPrice, + Data: input, + AccessList: *accesses, + } + default: + txData = ðtypes.LegacyTx{ + Nonce: nonce, + To: to, + Value: amount, + Gas: gasLimit, + GasPrice: gasPrice, + Data: input, + } + } + + return NewTxWithData(txData) +} + +func (msg *MsgEthereumTx) FromEthereumTx(tx *ethtypes.Transaction) { + msg.Raw.Transaction = tx +} + +// FromSignedEthereumTx populates the message fields from the given signed ethereum transaction, and set From field. +func (msg *MsgEthereumTx) FromSignedEthereumTx(tx *ethtypes.Transaction, signer ethtypes.Signer) error { + msg.Raw.Transaction = tx + + from, err := ethtypes.Sender(signer, tx) + if err != nil { + return err + } + + msg.From = from.Bytes() + return nil +} + +// Route returns the route value of an MsgEthereumTx. +func (msg MsgEthereumTx) Route() string { return RouterKey } + +// Type returns the type value of an MsgEthereumTx. +func (msg MsgEthereumTx) Type() string { return TypeMsgEthereumTx } + +// ValidateBasic implements the sdk.Msg interface. It performs basic validation +// checks of a Transaction. If returns an error if validation fails. +func (msg MsgEthereumTx) ValidateBasic() error { + // From and Raw are only two fields allowed in new transaction format. + if len(msg.From) == 0 { + return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "sender address is missing") + } + if msg.Raw.Transaction == nil { + return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "raw tx is missing") + } + + // Check removed fields not exists + if len(msg.DeprecatedFrom) != 0 { + return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "deprecated From field is not empty") + } + if len(msg.DeprecatedHash) != 0 { + return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "deprecated Hash field is not empty") + } + // Validate Size_ field, should be kept empty + if msg.Size_ != 0 { + return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "tx size is deprecated") + } + if msg.Data != nil { + return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "tx data is deprecated in favor of Raw") + } + + if err := msg.Raw.Validate(); err != nil { + return err + } + + return nil +} + +// GetMsgs returns a single MsgEthereumTx as an sdk.Msg. +func (msg *MsgEthereumTx) GetMsgs() []sdk.Msg { + return []sdk.Msg{msg} +} + +func (msg *MsgEthereumTx) GetMsgsV2() ([]proto.Message, error) { + return nil, errors.New("not implemented") +} + +// GetSender convert the From field to common.Address +// From should always be set, which is validated in ValidateBasic +func (msg *MsgEthereumTx) GetSender() common.Address { + return common.BytesToAddress(msg.From) +} + +// GetSenderLegacy fallbacks to old behavior if From is empty, should be used by json-rpc +func (msg *MsgEthereumTx) GetSenderLegacy(signer ethtypes.Signer) (common.Address, error) { + if len(msg.From) > 0 { + return msg.GetSender(), nil + } + sender, err := msg.recoverSender(signer) + if err != nil { + return common.Address{}, err + } + msg.From = sender.Bytes() + return sender, nil +} + +// recoverSender recovers the sender address from the transaction signature. +func (msg *MsgEthereumTx) recoverSender(signer ethtypes.Signer) (common.Address, error) { + return ethtypes.Sender(signer, msg.AsTransaction()) +} + +// GetSignBytes returns the Amino bytes of an Ethereum transaction message used +// for signing. +// +// NOTE: This method cannot be used as a chain ID is needed to create valid bytes +// to sign over. Use 'RLPSignBytes' instead. +func (msg MsgEthereumTx) GetSignBytes() []byte { + panic("must use 'RLPSignBytes' with a chain ID to get the valid bytes to sign") +} + +// Sign calculates a secp256k1 ECDSA signature and signs the transaction. It +// takes a keyring signer and the chainID to sign an Ethereum transaction according to +// EIP155 standard. +// This method mutates the transaction as it populates the V, R, S +// fields of the Transaction's Signature. +// The function will fail if the sender address is not defined for the msg or if +// the sender is not registered on the keyring +func (msg *MsgEthereumTx) Sign(ethSigner ethtypes.Signer, keyringSigner keyring.Signer) error { + from := msg.GetFrom() + if from.Empty() { + return fmt.Errorf("sender address not defined for message") + } + + tx := msg.AsTransaction() + txHash := ethSigner.Hash(tx) + + sig, _, err := keyringSigner.SignByAddress(from, txHash.Bytes(), signing.SignMode_SIGN_MODE_TEXTUAL) + if err != nil { + return err + } + + tx, err = tx.WithSignature(ethSigner, sig) + if err != nil { + return err + } + + msg.Raw.Transaction = tx + return nil +} + +// GetGas implements the GasTx interface. It returns the GasLimit of the transaction. +func (msg MsgEthereumTx) GetGas() uint64 { + return msg.AsTransaction().Gas() +} + +// GetFee returns the fee for non dynamic fee tx +func (msg MsgEthereumTx) GetFee() *big.Int { + tx := msg.AsTransaction() + price := tx.GasPrice() + return price.Mul(price, new(big.Int).SetUint64(tx.Gas())) +} + +// GetEffectiveFee returns the fee for dynamic fee tx +func (msg MsgEthereumTx) GetEffectiveFee(baseFee *big.Int) *big.Int { + price := msg.GetEffectiveGasPrice(baseFee) + return price.Mul(price, new(big.Int).SetUint64(msg.GetGas())) +} + +// GetEffectiveGasPrice returns the fee for dynamic fee tx +func (msg MsgEthereumTx) GetEffectiveGasPrice(baseFee *big.Int) *big.Int { + tx := msg.AsTransaction() + if baseFee == nil { + return tx.GasPrice() + } + // for legacy tx, both gasTipCap and gasFeeCap are gasPrice, the result is equavalent. + return cmath.BigMin(new(big.Int).Add(tx.GasTipCap(), baseFee), tx.GasFeeCap()) +} + +// GetFrom loads the ethereum sender address from the sigcache and returns an +// sdk.AccAddress from its bytes +func (msg *MsgEthereumTx) GetFrom() sdk.AccAddress { + return sdk.AccAddress(msg.From) +} + +// AsTransaction creates an Ethereum Transaction type from the msg fields +func (msg *MsgEthereumTx) AsTransaction() *ethtypes.Transaction { + tx := msg.Raw.Transaction + if tx != nil { + return tx + } + + // fallback to legacy format + txData, err := UnpackTxData(msg.Data) + if err != nil { + return nil + } + msg.Raw = NewEthereumTx(txData.AsEthereumData()) + return msg.Raw.Transaction +} + +// AsMessage creates an Ethereum core.Message from the msg fields +func (msg *MsgEthereumTx) AsMessage(baseFee *big.Int) *core.Message { + tx := msg.AsTransaction() + ethMsg := &core.Message{ + Nonce: tx.Nonce(), + GasLimit: tx.Gas(), + GasPrice: new(big.Int).Set(tx.GasPrice()), + GasFeeCap: new(big.Int).Set(tx.GasFeeCap()), + GasTipCap: new(big.Int).Set(tx.GasTipCap()), + To: tx.To(), + Value: tx.Value(), + Data: tx.Data(), + AccessList: tx.AccessList(), + SkipAccountChecks: false, + + From: common.BytesToAddress(msg.From), + } + // If baseFee provided, set gasPrice to effectiveGasPrice. + if baseFee != nil { + ethMsg.GasPrice = cmath.BigMin(ethMsg.GasPrice.Add(ethMsg.GasTipCap, baseFee), ethMsg.GasFeeCap) + } + return ethMsg +} + +// VerifySender verify the sender address against the signature values using the latest signer for the given chainID. +func (msg *MsgEthereumTx) VerifySender(signer ethtypes.Signer) error { + from, err := msg.recoverSender(signer) + if err != nil { + return err + } + + if !bytes.Equal(msg.From, from.Bytes()) { + return fmt.Errorf("sender verification failed. got %s, expected %s", HexAddress(from.Bytes()), HexAddress(msg.From)) + } + return nil +} + +// UnpackInterfaces implements UnpackInterfacesMesssage.UnpackInterfaces +func (msg MsgEthereumTx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + return unpacker.UnpackAny(msg.Data, new(TxData)) +} + +// UnmarshalBinary decodes the canonical encoding of transactions. +func (msg *MsgEthereumTx) UnmarshalBinary(b []byte, signer ethtypes.Signer) error { + tx := ðtypes.Transaction{} + if err := tx.UnmarshalBinary(b); err != nil { + return err + } + return msg.FromSignedEthereumTx(tx, signer) +} + +func (msg *MsgEthereumTx) Hash() common.Hash { + return msg.AsTransaction().Hash() +} + +// BuildTx builds the canonical cosmos tx from ethereum msg +func (msg *MsgEthereumTx) BuildTx(b client.TxBuilder, evmDenom string) (authsigning.Tx, error) { + builder, ok := b.(authtx.ExtensionOptionsTxBuilder) + if !ok { + return nil, errors.New("unsupported builder") + } + + option, err := codectypes.NewAnyWithValue(&ExtensionOptionsEthereumTx{}) + if err != nil { + return nil, err + } + + fees := make(sdk.Coins, 0) + fee := msg.GetFee() + feeAmt := sdkmath.NewIntFromBigInt(fee) + if feeAmt.Sign() > 0 { + fees = append(fees, sdk.NewCoin(evmDenom, feeAmt)) + } + + builder.SetExtensionOptions(option) + + if err := builder.SetMsgs(&MsgEthereumTx{ + From: msg.From, + Raw: msg.Raw, + }); err != nil { + return nil, err + } + builder.SetFeeAmount(fees) + builder.SetGasLimit(msg.GetGas()) + return builder.GetTx(), nil +} + +// ValidateBasic does a sanity check of the provided data +func (m *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + + return m.Params.Validate() +} + +// GetSignBytes implements the LegacyMsg interface. +func (m MsgUpdateParams) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m)) +} diff --git a/chain/evm/types/params.go b/chain/evm/types/params.go new file mode 100644 index 00000000..e36e80a9 --- /dev/null +++ b/chain/evm/types/params.go @@ -0,0 +1,128 @@ +package types + +import ( + "fmt" + "math/big" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/params" +) + +const ( + // DefaultEVMDenom defines the default EVM denomination on Injective + DefaultEVMDenom = "inj" + // DefaultAllowUnprotectedTxs rejects all unprotected txs (i.e false) + DefaultAllowUnprotectedTxs = false + // DefaultEnableCreate enables contract creation (i.e true) + DefaultEnableCreate = true + // DefaultEnableCall enables contract calls (i.e true) + DefaultEnableCall = true + // DefaultGasPrice is default gas price for evm transactions + DefaultGasPrice = 160000000 + // DefaultRPCGasLimit is default gas limit for RPC call operations + DefaultRPCGasLimit = 80000000 +) + +// NewParams creates a new Params instance +func NewParams(evmDenom string, allowUnprotectedTxs, enableCreate, enableCall bool, config ChainConfig, extraEIPs []int64) Params { + return Params{ + EvmDenom: evmDenom, + AllowUnprotectedTxs: allowUnprotectedTxs, + EnableCreate: enableCreate, + EnableCall: enableCall, + ExtraEIPs: extraEIPs, + ChainConfig: config, + } +} + +// DefaultParams returns default evm parameters +// ExtraEIPs is empty to prevent overriding the latest hard fork instruction set +func DefaultParams() Params { + config := DefaultChainConfig() + return Params{ + EvmDenom: DefaultEVMDenom, + EnableCreate: DefaultEnableCreate, + EnableCall: DefaultEnableCall, + ChainConfig: config, + AllowUnprotectedTxs: DefaultAllowUnprotectedTxs, + } +} + +// Validate performs basic validation on evm parameters. +func (p Params) Validate() error { + if err := ValidateEVMDenom(p.EvmDenom); err != nil { + return err + } + + if err := validateEIPs(p.ExtraEIPs); err != nil { + return err + } + + if err := ValidateBool(p.EnableCall); err != nil { + return err + } + + if err := ValidateBool(p.EnableCreate); err != nil { + return err + } + + if err := ValidateBool(p.AllowUnprotectedTxs); err != nil { + return err + } + + return ValidateChainConfig(p.ChainConfig) +} + +// EIPs returns the ExtraEIPS as a int slice +func (p Params) EIPs() []int { + eips := make([]int, len(p.ExtraEIPs)) + for i, eip := range p.ExtraEIPs { + eips[i] = int(eip) + } + return eips +} + +func ValidateEVMDenom(i interface{}) error { + denom, ok := i.(string) + if !ok { + return fmt.Errorf("invalid parameter EVM denom type: %T", i) + } + + return sdk.ValidateDenom(denom) +} + +func ValidateBool(i interface{}) error { + _, ok := i.(bool) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + return nil +} + +func validateEIPs(i interface{}) error { + eips, ok := i.([]int64) + if !ok { + return fmt.Errorf("invalid EIP slice type: %T", i) + } + + for _, eip := range eips { + if !vm.ValidEip(int(eip)) { + return fmt.Errorf("EIP %d is not activateable, valid EIPS are: %s", eip, vm.ActivateableEips()) + } + } + return nil +} + +func ValidateChainConfig(i interface{}) error { + cfg, ok := i.(ChainConfig) + if !ok { + return fmt.Errorf("invalid chain config type: %T", i) + } + return cfg.Validate() +} + +// IsLondon returns if london hardfork is enabled. +func IsLondon(ethConfig *params.ChainConfig, height int64) bool { + return ethConfig.IsLondon(big.NewInt(height)) +} diff --git a/chain/evm/types/params.pb.go b/chain/evm/types/params.pb.go new file mode 100644 index 00000000..4f82b468 --- /dev/null +++ b/chain/evm/types/params.pb.go @@ -0,0 +1,626 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/evm/v1/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the EVM module parameters +type Params struct { + // evm_denom represents the token denomination used to run the EVM state + // transitions. + EvmDenom string `protobuf:"bytes,1,opt,name=evm_denom,json=evmDenom,proto3" json:"evm_denom,omitempty" yaml:"evm_denom"` + // enable_create toggles state transitions that use the vm.Create function + EnableCreate bool `protobuf:"varint,2,opt,name=enable_create,json=enableCreate,proto3" json:"enable_create,omitempty" yaml:"enable_create"` + // enable_call toggles state transitions that use the vm.Call function + EnableCall bool `protobuf:"varint,3,opt,name=enable_call,json=enableCall,proto3" json:"enable_call,omitempty" yaml:"enable_call"` + // extra_eips defines the additional EIPs for the vm.Config + ExtraEIPs []int64 `protobuf:"varint,4,rep,packed,name=extra_eips,json=extraEips,proto3" json:"extra_eips,omitempty" yaml:"extra_eips"` + // chain_config defines the EVM chain configuration parameters + ChainConfig ChainConfig `protobuf:"bytes,5,opt,name=chain_config,json=chainConfig,proto3" json:"chain_config"` + // allow_unprotected_txs defines if replay-protected (i.e non EIP155 + // signed) transactions can be executed on the state machine. + AllowUnprotectedTxs bool `protobuf:"varint,6,opt,name=allow_unprotected_txs,json=allowUnprotectedTxs,proto3" json:"allow_unprotected_txs,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_8c2cd8aa1c2e968a, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetEvmDenom() string { + if m != nil { + return m.EvmDenom + } + return "" +} + +func (m *Params) GetEnableCreate() bool { + if m != nil { + return m.EnableCreate + } + return false +} + +func (m *Params) GetEnableCall() bool { + if m != nil { + return m.EnableCall + } + return false +} + +func (m *Params) GetExtraEIPs() []int64 { + if m != nil { + return m.ExtraEIPs + } + return nil +} + +func (m *Params) GetChainConfig() ChainConfig { + if m != nil { + return m.ChainConfig + } + return ChainConfig{} +} + +func (m *Params) GetAllowUnprotectedTxs() bool { + if m != nil { + return m.AllowUnprotectedTxs + } + return false +} + +func init() { + proto.RegisterType((*Params)(nil), "injective.evm.v1.Params") +} + +func init() { proto.RegisterFile("injective/evm/v1/params.proto", fileDescriptor_8c2cd8aa1c2e968a) } + +var fileDescriptor_8c2cd8aa1c2e968a = []byte{ + // 410 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xe3, 0xa6, 0x44, 0xcd, 0xa6, 0x48, 0x65, 0x09, 0xc8, 0xaa, 0x54, 0xdb, 0x32, 0x17, + 0x5f, 0xb0, 0x95, 0x72, 0x40, 0x42, 0xe2, 0x80, 0x43, 0x90, 0x22, 0x71, 0xa8, 0x2c, 0xb8, 0x70, + 0xb1, 0xd6, 0x9b, 0xc1, 0x35, 0xda, 0xf5, 0x5a, 0xde, 0x8d, 0x49, 0xdf, 0x82, 0xc7, 0xea, 0xb1, + 0x47, 0x4e, 0x16, 0x72, 0xde, 0xc0, 0x4f, 0x80, 0xbc, 0x49, 0xdd, 0x40, 0x6f, 0xfb, 0xcf, 0xf7, + 0xff, 0xa3, 0xd9, 0x19, 0x74, 0x91, 0xe5, 0x3f, 0x80, 0xaa, 0xac, 0x82, 0x00, 0x2a, 0x1e, 0x54, + 0xb3, 0xa0, 0x20, 0x25, 0xe1, 0xd2, 0x2f, 0x4a, 0xa1, 0x04, 0x3e, 0xeb, 0xb1, 0x0f, 0x15, 0xf7, + 0xab, 0xd9, 0xf9, 0x34, 0x15, 0xa9, 0xd0, 0x30, 0xe8, 0x5e, 0x3b, 0xdf, 0xf9, 0xab, 0x47, 0x6d, + 0xe8, 0x35, 0xc9, 0xf2, 0x98, 0x8a, 0xfc, 0x7b, 0x96, 0xee, 0x4c, 0x6e, 0x7b, 0x84, 0x46, 0x57, + 0xba, 0x3b, 0x9e, 0xa1, 0x31, 0x54, 0x3c, 0x5e, 0x41, 0x2e, 0xb8, 0x69, 0x38, 0x86, 0x37, 0x0e, + 0xa7, 0x6d, 0x6d, 0x9f, 0xdd, 0x10, 0xce, 0xde, 0xb9, 0x3d, 0x72, 0xa3, 0x13, 0xa8, 0xf8, 0xc7, + 0xee, 0x89, 0xdf, 0xa3, 0xa7, 0x90, 0x93, 0x84, 0x41, 0x4c, 0x4b, 0x20, 0x0a, 0xcc, 0x23, 0xc7, + 0xf0, 0x4e, 0x42, 0xb3, 0xad, 0xed, 0xe9, 0x3e, 0x76, 0x88, 0xdd, 0xe8, 0x74, 0xa7, 0xe7, 0x5a, + 0xe2, 0xb7, 0x68, 0x72, 0xcf, 0x09, 0x63, 0xe6, 0x50, 0x87, 0x5f, 0xb6, 0xb5, 0x8d, 0xff, 0x0d, + 0x13, 0xc6, 0xdc, 0x08, 0xed, 0xa3, 0x84, 0x31, 0xfc, 0x01, 0x21, 0xd8, 0xa8, 0x92, 0xc4, 0x90, + 0x15, 0xd2, 0x3c, 0x76, 0x86, 0xde, 0x30, 0x74, 0x9b, 0xda, 0x1e, 0x2f, 0xba, 0xea, 0x62, 0x79, + 0x25, 0xdb, 0xda, 0x7e, 0xb6, 0x6f, 0xd2, 0x1b, 0xdd, 0x68, 0xac, 0xc5, 0x22, 0x2b, 0x24, 0xfe, + 0x84, 0x4e, 0x0f, 0xd7, 0x61, 0x3e, 0x71, 0x0c, 0x6f, 0x72, 0x79, 0xe1, 0xff, 0xbf, 0x5c, 0x7f, + 0xde, 0xb9, 0xe6, 0xda, 0x14, 0x1e, 0xdf, 0xd6, 0xf6, 0x20, 0x9a, 0xd0, 0x87, 0x12, 0xbe, 0x44, + 0x2f, 0x08, 0x63, 0xe2, 0x67, 0xbc, 0xce, 0xbb, 0x8d, 0x02, 0x55, 0xb0, 0x8a, 0xd5, 0x46, 0x9a, + 0xa3, 0xee, 0x37, 0xd1, 0x73, 0x0d, 0xbf, 0x3e, 0xb0, 0x2f, 0x1b, 0x19, 0xd2, 0xdb, 0xc6, 0x32, + 0xee, 0x1a, 0xcb, 0xf8, 0xd3, 0x58, 0xc6, 0xaf, 0xad, 0x35, 0xb8, 0xdb, 0x5a, 0x83, 0xdf, 0x5b, + 0x6b, 0xf0, 0x6d, 0x99, 0x66, 0xea, 0x7a, 0x9d, 0xf8, 0x54, 0xf0, 0x60, 0x79, 0x3f, 0xc9, 0x67, + 0x92, 0xc8, 0xa0, 0x9f, 0xeb, 0x35, 0x15, 0x25, 0x1c, 0xca, 0x6e, 0x98, 0x80, 0x8b, 0xd5, 0x9a, + 0x81, 0xd4, 0x97, 0x56, 0x37, 0x05, 0xc8, 0x64, 0xa4, 0x0f, 0xfc, 0xe6, 0x6f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x3b, 0x9f, 0x1e, 0xd6, 0x4e, 0x02, 0x00, 0x00, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AllowUnprotectedTxs { + i-- + if m.AllowUnprotectedTxs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + { + size, err := m.ChainConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.ExtraEIPs) > 0 { + dAtA3 := make([]byte, len(m.ExtraEIPs)*10) + var j2 int + for _, num1 := range m.ExtraEIPs { + num := uint64(num1) + for num >= 1<<7 { + dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j2++ + } + dAtA3[j2] = uint8(num) + j2++ + } + i -= j2 + copy(dAtA[i:], dAtA3[:j2]) + i = encodeVarintParams(dAtA, i, uint64(j2)) + i-- + dAtA[i] = 0x22 + } + if m.EnableCall { + i-- + if m.EnableCall { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.EnableCreate { + i-- + if m.EnableCreate { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.EvmDenom) > 0 { + i -= len(m.EvmDenom) + copy(dAtA[i:], m.EvmDenom) + i = encodeVarintParams(dAtA, i, uint64(len(m.EvmDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.EvmDenom) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + if m.EnableCreate { + n += 2 + } + if m.EnableCall { + n += 2 + } + if len(m.ExtraEIPs) > 0 { + l = 0 + for _, e := range m.ExtraEIPs { + l += sovParams(uint64(e)) + } + n += 1 + sovParams(uint64(l)) + l + } + l = m.ChainConfig.Size() + n += 1 + l + sovParams(uint64(l)) + if m.AllowUnprotectedTxs { + n += 2 + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvmDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EvmDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableCreate", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableCreate = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableCall", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableCall = bool(v != 0) + case 4: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ExtraEIPs = append(m.ExtraEIPs, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.ExtraEIPs) == 0 { + m.ExtraEIPs = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ExtraEIPs = append(m.ExtraEIPs, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field ExtraEIPs", wireType) + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ChainConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowUnprotectedTxs", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowUnprotectedTxs = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/evm/types/protocol.go b/chain/evm/types/protocol.go new file mode 100644 index 00000000..580c344c --- /dev/null +++ b/chain/evm/types/protocol.go @@ -0,0 +1,9 @@ +package types + +// Constants to match up protocol versions and messages +const ( + eth65 = 65 + + // ProtocolVersion is the latest supported version of the eth protocol. + ProtocolVersion = eth65 +) diff --git a/chain/evm/types/query.go b/chain/evm/types/query.go new file mode 100644 index 00000000..677d918c --- /dev/null +++ b/chain/evm/types/query.go @@ -0,0 +1,24 @@ +package types + +import ( + codectypes "github.com/cosmos/cosmos-sdk/codec/types" +) + +// UnpackInterfaces implements UnpackInterfacesMesssage.UnpackInterfaces +func (m QueryTraceTxRequest) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + for _, msg := range m.Predecessors { + if err := msg.UnpackInterfaces(unpacker); err != nil { + return err + } + } + return m.Msg.UnpackInterfaces(unpacker) +} + +func (m QueryTraceBlockRequest) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + for _, msg := range m.Txs { + if err := msg.UnpackInterfaces(unpacker); err != nil { + return err + } + } + return nil +} diff --git a/chain/evm/types/query.pb.go b/chain/evm/types/query.pb.go new file mode 100644 index 00000000..133fb356 --- /dev/null +++ b/chain/evm/types/query.pb.go @@ -0,0 +1,6800 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/evm/v1/query.proto + +package types + +import ( + context "context" + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryAccountRequest is the request type for the Query/Account RPC method. +type QueryAccountRequest struct { + // address is the ethereum hex address to query the account for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryAccountRequest) Reset() { *m = QueryAccountRequest{} } +func (m *QueryAccountRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAccountRequest) ProtoMessage() {} +func (*QueryAccountRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{0} +} +func (m *QueryAccountRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAccountRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAccountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountRequest.Merge(m, src) +} +func (m *QueryAccountRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAccountRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAccountRequest proto.InternalMessageInfo + +// QueryAccountResponse is the response type for the Query/Account RPC method. +type QueryAccountResponse struct { + // balance is the balance of the EVM denomination. + Balance string `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` + // code_hash is the hex-formatted code bytes from the EOA. + CodeHash string `protobuf:"bytes,2,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty"` + // nonce is the account's sequence number. + Nonce uint64 `protobuf:"varint,3,opt,name=nonce,proto3" json:"nonce,omitempty"` +} + +func (m *QueryAccountResponse) Reset() { *m = QueryAccountResponse{} } +func (m *QueryAccountResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAccountResponse) ProtoMessage() {} +func (*QueryAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{1} +} +func (m *QueryAccountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAccountResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountResponse.Merge(m, src) +} +func (m *QueryAccountResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAccountResponse proto.InternalMessageInfo + +func (m *QueryAccountResponse) GetBalance() string { + if m != nil { + return m.Balance + } + return "" +} + +func (m *QueryAccountResponse) GetCodeHash() string { + if m != nil { + return m.CodeHash + } + return "" +} + +func (m *QueryAccountResponse) GetNonce() uint64 { + if m != nil { + return m.Nonce + } + return 0 +} + +// QueryCosmosAccountRequest is the request type for the Query/CosmosAccount RPC +// method. +type QueryCosmosAccountRequest struct { + // address is the ethereum hex address to query the account for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryCosmosAccountRequest) Reset() { *m = QueryCosmosAccountRequest{} } +func (m *QueryCosmosAccountRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCosmosAccountRequest) ProtoMessage() {} +func (*QueryCosmosAccountRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{2} +} +func (m *QueryCosmosAccountRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCosmosAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCosmosAccountRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCosmosAccountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCosmosAccountRequest.Merge(m, src) +} +func (m *QueryCosmosAccountRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCosmosAccountRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCosmosAccountRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCosmosAccountRequest proto.InternalMessageInfo + +// QueryCosmosAccountResponse is the response type for the Query/CosmosAccount +// RPC method. +type QueryCosmosAccountResponse struct { + // cosmos_address is the cosmos address of the account. + CosmosAddress string `protobuf:"bytes,1,opt,name=cosmos_address,json=cosmosAddress,proto3" json:"cosmos_address,omitempty"` + // sequence is the account's sequence number. + Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` + // account_number is the account number + AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` +} + +func (m *QueryCosmosAccountResponse) Reset() { *m = QueryCosmosAccountResponse{} } +func (m *QueryCosmosAccountResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCosmosAccountResponse) ProtoMessage() {} +func (*QueryCosmosAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{3} +} +func (m *QueryCosmosAccountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCosmosAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCosmosAccountResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCosmosAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCosmosAccountResponse.Merge(m, src) +} +func (m *QueryCosmosAccountResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCosmosAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCosmosAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCosmosAccountResponse proto.InternalMessageInfo + +func (m *QueryCosmosAccountResponse) GetCosmosAddress() string { + if m != nil { + return m.CosmosAddress + } + return "" +} + +func (m *QueryCosmosAccountResponse) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + +func (m *QueryCosmosAccountResponse) GetAccountNumber() uint64 { + if m != nil { + return m.AccountNumber + } + return 0 +} + +// QueryValidatorAccountRequest is the request type for the +// Query/ValidatorAccount RPC method. +type QueryValidatorAccountRequest struct { + // cons_address is the validator cons address to query the account for. + ConsAddress string `protobuf:"bytes,1,opt,name=cons_address,json=consAddress,proto3" json:"cons_address,omitempty"` +} + +func (m *QueryValidatorAccountRequest) Reset() { *m = QueryValidatorAccountRequest{} } +func (m *QueryValidatorAccountRequest) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorAccountRequest) ProtoMessage() {} +func (*QueryValidatorAccountRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{4} +} +func (m *QueryValidatorAccountRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorAccountRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryValidatorAccountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorAccountRequest.Merge(m, src) +} +func (m *QueryValidatorAccountRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorAccountRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorAccountRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorAccountRequest proto.InternalMessageInfo + +// QueryValidatorAccountResponse is the response type for the +// Query/ValidatorAccount RPC method. +type QueryValidatorAccountResponse struct { + // account_address is the cosmos address of the account in bech32 format. + AccountAddress string `protobuf:"bytes,1,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` + // sequence is the account's sequence number. + Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` + // account_number is the account number + AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` +} + +func (m *QueryValidatorAccountResponse) Reset() { *m = QueryValidatorAccountResponse{} } +func (m *QueryValidatorAccountResponse) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorAccountResponse) ProtoMessage() {} +func (*QueryValidatorAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{5} +} +func (m *QueryValidatorAccountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorAccountResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryValidatorAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorAccountResponse.Merge(m, src) +} +func (m *QueryValidatorAccountResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorAccountResponse proto.InternalMessageInfo + +func (m *QueryValidatorAccountResponse) GetAccountAddress() string { + if m != nil { + return m.AccountAddress + } + return "" +} + +func (m *QueryValidatorAccountResponse) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + +func (m *QueryValidatorAccountResponse) GetAccountNumber() uint64 { + if m != nil { + return m.AccountNumber + } + return 0 +} + +// QueryBalanceRequest is the request type for the Query/Balance RPC method. +type QueryBalanceRequest struct { + // address is the ethereum hex address to query the balance for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryBalanceRequest) Reset() { *m = QueryBalanceRequest{} } +func (m *QueryBalanceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBalanceRequest) ProtoMessage() {} +func (*QueryBalanceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{6} +} +func (m *QueryBalanceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBalanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBalanceRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBalanceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBalanceRequest.Merge(m, src) +} +func (m *QueryBalanceRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBalanceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBalanceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBalanceRequest proto.InternalMessageInfo + +// QueryBalanceResponse is the response type for the Query/Balance RPC method. +type QueryBalanceResponse struct { + // balance is the balance of the EVM denomination. + Balance string `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` +} + +func (m *QueryBalanceResponse) Reset() { *m = QueryBalanceResponse{} } +func (m *QueryBalanceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBalanceResponse) ProtoMessage() {} +func (*QueryBalanceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{7} +} +func (m *QueryBalanceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBalanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBalanceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBalanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBalanceResponse.Merge(m, src) +} +func (m *QueryBalanceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBalanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBalanceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBalanceResponse proto.InternalMessageInfo + +func (m *QueryBalanceResponse) GetBalance() string { + if m != nil { + return m.Balance + } + return "" +} + +// QueryStorageRequest is the request type for the Query/Storage RPC method. +type QueryStorageRequest struct { + // address is the ethereum hex address to query the storage state for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // key defines the key of the storage state + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` +} + +func (m *QueryStorageRequest) Reset() { *m = QueryStorageRequest{} } +func (m *QueryStorageRequest) String() string { return proto.CompactTextString(m) } +func (*QueryStorageRequest) ProtoMessage() {} +func (*QueryStorageRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{8} +} +func (m *QueryStorageRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryStorageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryStorageRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryStorageRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryStorageRequest.Merge(m, src) +} +func (m *QueryStorageRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryStorageRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryStorageRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryStorageRequest proto.InternalMessageInfo + +// QueryStorageResponse is the response type for the Query/Storage RPC +// method. +type QueryStorageResponse struct { + // value defines the storage state value hash associated with the given key. + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *QueryStorageResponse) Reset() { *m = QueryStorageResponse{} } +func (m *QueryStorageResponse) String() string { return proto.CompactTextString(m) } +func (*QueryStorageResponse) ProtoMessage() {} +func (*QueryStorageResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{9} +} +func (m *QueryStorageResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryStorageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryStorageResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryStorageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryStorageResponse.Merge(m, src) +} +func (m *QueryStorageResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryStorageResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryStorageResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryStorageResponse proto.InternalMessageInfo + +func (m *QueryStorageResponse) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +// QueryCodeRequest is the request type for the Query/Code RPC method. +type QueryCodeRequest struct { + // address is the ethereum hex address to query the code for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryCodeRequest) Reset() { *m = QueryCodeRequest{} } +func (m *QueryCodeRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCodeRequest) ProtoMessage() {} +func (*QueryCodeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{10} +} +func (m *QueryCodeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCodeRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCodeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCodeRequest.Merge(m, src) +} +func (m *QueryCodeRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCodeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCodeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCodeRequest proto.InternalMessageInfo + +// QueryCodeResponse is the response type for the Query/Code RPC +// method. +type QueryCodeResponse struct { + // code represents the code bytes from an ethereum address. + Code []byte `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` +} + +func (m *QueryCodeResponse) Reset() { *m = QueryCodeResponse{} } +func (m *QueryCodeResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCodeResponse) ProtoMessage() {} +func (*QueryCodeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{11} +} +func (m *QueryCodeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCodeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCodeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCodeResponse.Merge(m, src) +} +func (m *QueryCodeResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCodeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCodeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCodeResponse proto.InternalMessageInfo + +func (m *QueryCodeResponse) GetCode() []byte { + if m != nil { + return m.Code + } + return nil +} + +// QueryTxLogsRequest is the request type for the Query/TxLogs RPC method. +type QueryTxLogsRequest struct { + // hash is the ethereum transaction hex hash to query the logs for. + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryTxLogsRequest) Reset() { *m = QueryTxLogsRequest{} } +func (m *QueryTxLogsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTxLogsRequest) ProtoMessage() {} +func (*QueryTxLogsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{12} +} +func (m *QueryTxLogsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTxLogsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTxLogsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTxLogsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTxLogsRequest.Merge(m, src) +} +func (m *QueryTxLogsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTxLogsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTxLogsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTxLogsRequest proto.InternalMessageInfo + +// QueryTxLogsResponse is the response type for the Query/TxLogs RPC method. +type QueryTxLogsResponse struct { + // logs represents the ethereum logs generated from the given transaction. + Logs []*Log `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryTxLogsResponse) Reset() { *m = QueryTxLogsResponse{} } +func (m *QueryTxLogsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTxLogsResponse) ProtoMessage() {} +func (*QueryTxLogsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{13} +} +func (m *QueryTxLogsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTxLogsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTxLogsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTxLogsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTxLogsResponse.Merge(m, src) +} +func (m *QueryTxLogsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTxLogsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTxLogsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTxLogsResponse proto.InternalMessageInfo + +func (m *QueryTxLogsResponse) GetLogs() []*Log { + if m != nil { + return m.Logs + } + return nil +} + +func (m *QueryTxLogsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryParamsRequest defines the request type for querying x/evm parameters. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{14} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse defines the response type for querying x/evm parameters. +type QueryParamsResponse struct { + // params define the evm module parameters. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{15} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// EthCallRequest defines EthCall request +type EthCallRequest struct { + // args uses the same json format as the json rpc api. + Args []byte `protobuf:"bytes,1,opt,name=args,proto3" json:"args,omitempty"` + // gas_cap defines the default gas cap to be used + GasCap uint64 `protobuf:"varint,2,opt,name=gas_cap,json=gasCap,proto3" json:"gas_cap,omitempty"` + // proposer_address of the requested block in hex format + ProposerAddress github_com_cosmos_cosmos_sdk_types.ConsAddress `protobuf:"bytes,3,opt,name=proposer_address,json=proposerAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ConsAddress" json:"proposer_address,omitempty"` + // chain_id is the eip155 chain id parsed from the requested block header + ChainId int64 `protobuf:"varint,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // state overrides encoded as json + Overrides []byte `protobuf:"bytes,5,opt,name=overrides,proto3" json:"overrides,omitempty"` +} + +func (m *EthCallRequest) Reset() { *m = EthCallRequest{} } +func (m *EthCallRequest) String() string { return proto.CompactTextString(m) } +func (*EthCallRequest) ProtoMessage() {} +func (*EthCallRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{16} +} +func (m *EthCallRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EthCallRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EthCallRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EthCallRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_EthCallRequest.Merge(m, src) +} +func (m *EthCallRequest) XXX_Size() int { + return m.Size() +} +func (m *EthCallRequest) XXX_DiscardUnknown() { + xxx_messageInfo_EthCallRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_EthCallRequest proto.InternalMessageInfo + +func (m *EthCallRequest) GetArgs() []byte { + if m != nil { + return m.Args + } + return nil +} + +func (m *EthCallRequest) GetGasCap() uint64 { + if m != nil { + return m.GasCap + } + return 0 +} + +func (m *EthCallRequest) GetProposerAddress() github_com_cosmos_cosmos_sdk_types.ConsAddress { + if m != nil { + return m.ProposerAddress + } + return nil +} + +func (m *EthCallRequest) GetChainId() int64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *EthCallRequest) GetOverrides() []byte { + if m != nil { + return m.Overrides + } + return nil +} + +// EstimateGasResponse defines EstimateGas response +type EstimateGasResponse struct { + // gas returns the estimated gas + Gas uint64 `protobuf:"varint,1,opt,name=gas,proto3" json:"gas,omitempty"` + // ret is the returned data from evm function (result or data supplied with revert + // opcode) + Ret []byte `protobuf:"bytes,2,opt,name=ret,proto3" json:"ret,omitempty"` + // vm_error is the error returned by vm execution + VmError string `protobuf:"bytes,3,opt,name=vm_error,json=vmError,proto3" json:"vm_error,omitempty"` +} + +func (m *EstimateGasResponse) Reset() { *m = EstimateGasResponse{} } +func (m *EstimateGasResponse) String() string { return proto.CompactTextString(m) } +func (*EstimateGasResponse) ProtoMessage() {} +func (*EstimateGasResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{17} +} +func (m *EstimateGasResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EstimateGasResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EstimateGasResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EstimateGasResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_EstimateGasResponse.Merge(m, src) +} +func (m *EstimateGasResponse) XXX_Size() int { + return m.Size() +} +func (m *EstimateGasResponse) XXX_DiscardUnknown() { + xxx_messageInfo_EstimateGasResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_EstimateGasResponse proto.InternalMessageInfo + +func (m *EstimateGasResponse) GetGas() uint64 { + if m != nil { + return m.Gas + } + return 0 +} + +func (m *EstimateGasResponse) GetRet() []byte { + if m != nil { + return m.Ret + } + return nil +} + +func (m *EstimateGasResponse) GetVmError() string { + if m != nil { + return m.VmError + } + return "" +} + +// QueryTraceTxRequest defines TraceTx request +type QueryTraceTxRequest struct { + // msg is the MsgEthereumTx for the requested transaction + Msg *MsgEthereumTx `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` + // trace_config holds extra parameters to trace functions. + TraceConfig *TraceConfig `protobuf:"bytes,3,opt,name=trace_config,json=traceConfig,proto3" json:"trace_config,omitempty"` + // predecessors is an array of transactions included in the same block + // need to be replayed first to get correct context for tracing. + Predecessors []*MsgEthereumTx `protobuf:"bytes,4,rep,name=predecessors,proto3" json:"predecessors,omitempty"` + // block_number of requested transaction + BlockNumber int64 `protobuf:"varint,5,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + // block_hash of requested transaction + BlockHash string `protobuf:"bytes,6,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // block_time of requested transaction + BlockTime time.Time `protobuf:"bytes,7,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time"` + // proposer_address is the proposer of the requested block + ProposerAddress github_com_cosmos_cosmos_sdk_types.ConsAddress `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ConsAddress" json:"proposer_address,omitempty"` + // chain_id is the the eip155 chain id parsed from the requested block header + ChainId int64 `protobuf:"varint,9,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryTraceTxRequest) Reset() { *m = QueryTraceTxRequest{} } +func (m *QueryTraceTxRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTraceTxRequest) ProtoMessage() {} +func (*QueryTraceTxRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{18} +} +func (m *QueryTraceTxRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTraceTxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTraceTxRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTraceTxRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTraceTxRequest.Merge(m, src) +} +func (m *QueryTraceTxRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTraceTxRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTraceTxRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTraceTxRequest proto.InternalMessageInfo + +func (m *QueryTraceTxRequest) GetMsg() *MsgEthereumTx { + if m != nil { + return m.Msg + } + return nil +} + +func (m *QueryTraceTxRequest) GetTraceConfig() *TraceConfig { + if m != nil { + return m.TraceConfig + } + return nil +} + +func (m *QueryTraceTxRequest) GetPredecessors() []*MsgEthereumTx { + if m != nil { + return m.Predecessors + } + return nil +} + +func (m *QueryTraceTxRequest) GetBlockNumber() int64 { + if m != nil { + return m.BlockNumber + } + return 0 +} + +func (m *QueryTraceTxRequest) GetBlockHash() string { + if m != nil { + return m.BlockHash + } + return "" +} + +func (m *QueryTraceTxRequest) GetBlockTime() time.Time { + if m != nil { + return m.BlockTime + } + return time.Time{} +} + +func (m *QueryTraceTxRequest) GetProposerAddress() github_com_cosmos_cosmos_sdk_types.ConsAddress { + if m != nil { + return m.ProposerAddress + } + return nil +} + +func (m *QueryTraceTxRequest) GetChainId() int64 { + if m != nil { + return m.ChainId + } + return 0 +} + +// QueryTraceTxResponse defines TraceTx response +type QueryTraceTxResponse struct { + // data is the response serialized in bytes + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *QueryTraceTxResponse) Reset() { *m = QueryTraceTxResponse{} } +func (m *QueryTraceTxResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTraceTxResponse) ProtoMessage() {} +func (*QueryTraceTxResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{19} +} +func (m *QueryTraceTxResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTraceTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTraceTxResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTraceTxResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTraceTxResponse.Merge(m, src) +} +func (m *QueryTraceTxResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTraceTxResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTraceTxResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTraceTxResponse proto.InternalMessageInfo + +func (m *QueryTraceTxResponse) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// QueryTraceCallRequest defines TraceCall request +type QueryTraceCallRequest struct { + // args uses the same json format as the json rpc api. + Args []byte `protobuf:"bytes,1,opt,name=args,proto3" json:"args,omitempty"` + // gas_cap defines the default gas cap to be used + GasCap uint64 `protobuf:"varint,2,opt,name=gas_cap,json=gasCap,proto3" json:"gas_cap,omitempty"` + // proposer_address of the requested block in hex format + ProposerAddress github_com_cosmos_cosmos_sdk_types.ConsAddress `protobuf:"bytes,3,opt,name=proposer_address,json=proposerAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ConsAddress" json:"proposer_address,omitempty"` + // trace_config holds extra parameters to trace functions. + TraceConfig *TraceConfig `protobuf:"bytes,4,opt,name=trace_config,json=traceConfig,proto3" json:"trace_config,omitempty"` + // block_number of requested transaction + BlockNumber int64 `protobuf:"varint,5,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + // block_hash of requested transaction + BlockHash string `protobuf:"bytes,6,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // block_time of requested transaction + BlockTime time.Time `protobuf:"bytes,7,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time"` + // chain_id is the the eip155 chain id parsed from the requested block header + ChainId int64 `protobuf:"varint,8,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryTraceCallRequest) Reset() { *m = QueryTraceCallRequest{} } +func (m *QueryTraceCallRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTraceCallRequest) ProtoMessage() {} +func (*QueryTraceCallRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{20} +} +func (m *QueryTraceCallRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTraceCallRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTraceCallRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTraceCallRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTraceCallRequest.Merge(m, src) +} +func (m *QueryTraceCallRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTraceCallRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTraceCallRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTraceCallRequest proto.InternalMessageInfo + +func (m *QueryTraceCallRequest) GetArgs() []byte { + if m != nil { + return m.Args + } + return nil +} + +func (m *QueryTraceCallRequest) GetGasCap() uint64 { + if m != nil { + return m.GasCap + } + return 0 +} + +func (m *QueryTraceCallRequest) GetProposerAddress() github_com_cosmos_cosmos_sdk_types.ConsAddress { + if m != nil { + return m.ProposerAddress + } + return nil +} + +func (m *QueryTraceCallRequest) GetTraceConfig() *TraceConfig { + if m != nil { + return m.TraceConfig + } + return nil +} + +func (m *QueryTraceCallRequest) GetBlockNumber() int64 { + if m != nil { + return m.BlockNumber + } + return 0 +} + +func (m *QueryTraceCallRequest) GetBlockHash() string { + if m != nil { + return m.BlockHash + } + return "" +} + +func (m *QueryTraceCallRequest) GetBlockTime() time.Time { + if m != nil { + return m.BlockTime + } + return time.Time{} +} + +func (m *QueryTraceCallRequest) GetChainId() int64 { + if m != nil { + return m.ChainId + } + return 0 +} + +// QueryTraceCallResponse defines TraceCallResponse +type QueryTraceCallResponse struct { + // data is the response serialized in bytes + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *QueryTraceCallResponse) Reset() { *m = QueryTraceCallResponse{} } +func (m *QueryTraceCallResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTraceCallResponse) ProtoMessage() {} +func (*QueryTraceCallResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{21} +} +func (m *QueryTraceCallResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTraceCallResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTraceCallResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTraceCallResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTraceCallResponse.Merge(m, src) +} +func (m *QueryTraceCallResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTraceCallResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTraceCallResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTraceCallResponse proto.InternalMessageInfo + +func (m *QueryTraceCallResponse) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// QueryTraceBlockRequest defines TraceTx request +type QueryTraceBlockRequest struct { + // txs is an array of messages in the block + Txs []*MsgEthereumTx `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` + // trace_config holds extra parameters to trace functions. + TraceConfig *TraceConfig `protobuf:"bytes,3,opt,name=trace_config,json=traceConfig,proto3" json:"trace_config,omitempty"` + // block_number of the traced block + BlockNumber int64 `protobuf:"varint,5,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + // block_hash (hex) of the traced block + BlockHash string `protobuf:"bytes,6,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // block_time of the traced block + BlockTime time.Time `protobuf:"bytes,7,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time"` + // proposer_address is the address of the requested block + ProposerAddress github_com_cosmos_cosmos_sdk_types.ConsAddress `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ConsAddress" json:"proposer_address,omitempty"` + // chain_id is the eip155 chain id parsed from the requested block header + ChainId int64 `protobuf:"varint,9,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryTraceBlockRequest) Reset() { *m = QueryTraceBlockRequest{} } +func (m *QueryTraceBlockRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTraceBlockRequest) ProtoMessage() {} +func (*QueryTraceBlockRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{22} +} +func (m *QueryTraceBlockRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTraceBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTraceBlockRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTraceBlockRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTraceBlockRequest.Merge(m, src) +} +func (m *QueryTraceBlockRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTraceBlockRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTraceBlockRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTraceBlockRequest proto.InternalMessageInfo + +func (m *QueryTraceBlockRequest) GetTxs() []*MsgEthereumTx { + if m != nil { + return m.Txs + } + return nil +} + +func (m *QueryTraceBlockRequest) GetTraceConfig() *TraceConfig { + if m != nil { + return m.TraceConfig + } + return nil +} + +func (m *QueryTraceBlockRequest) GetBlockNumber() int64 { + if m != nil { + return m.BlockNumber + } + return 0 +} + +func (m *QueryTraceBlockRequest) GetBlockHash() string { + if m != nil { + return m.BlockHash + } + return "" +} + +func (m *QueryTraceBlockRequest) GetBlockTime() time.Time { + if m != nil { + return m.BlockTime + } + return time.Time{} +} + +func (m *QueryTraceBlockRequest) GetProposerAddress() github_com_cosmos_cosmos_sdk_types.ConsAddress { + if m != nil { + return m.ProposerAddress + } + return nil +} + +func (m *QueryTraceBlockRequest) GetChainId() int64 { + if m != nil { + return m.ChainId + } + return 0 +} + +// QueryTraceBlockResponse defines TraceBlock response +type QueryTraceBlockResponse struct { + // data is the response serialized in bytes + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *QueryTraceBlockResponse) Reset() { *m = QueryTraceBlockResponse{} } +func (m *QueryTraceBlockResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTraceBlockResponse) ProtoMessage() {} +func (*QueryTraceBlockResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{23} +} +func (m *QueryTraceBlockResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTraceBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTraceBlockResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTraceBlockResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTraceBlockResponse.Merge(m, src) +} +func (m *QueryTraceBlockResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTraceBlockResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTraceBlockResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTraceBlockResponse proto.InternalMessageInfo + +func (m *QueryTraceBlockResponse) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// QueryBaseFeeRequest defines the request type for querying the EIP1559 base +// fee. +type QueryBaseFeeRequest struct { +} + +func (m *QueryBaseFeeRequest) Reset() { *m = QueryBaseFeeRequest{} } +func (m *QueryBaseFeeRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBaseFeeRequest) ProtoMessage() {} +func (*QueryBaseFeeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{24} +} +func (m *QueryBaseFeeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBaseFeeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBaseFeeRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBaseFeeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBaseFeeRequest.Merge(m, src) +} +func (m *QueryBaseFeeRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBaseFeeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBaseFeeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBaseFeeRequest proto.InternalMessageInfo + +// QueryBaseFeeResponse returns the EIP1559 base fee. +type QueryBaseFeeResponse struct { + // base_fee is the EIP1559 base fee + BaseFee *cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=base_fee,json=baseFee,proto3,customtype=cosmossdk.io/math.Int" json:"base_fee,omitempty"` +} + +func (m *QueryBaseFeeResponse) Reset() { *m = QueryBaseFeeResponse{} } +func (m *QueryBaseFeeResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBaseFeeResponse) ProtoMessage() {} +func (*QueryBaseFeeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_de864616de3dea80, []int{25} +} +func (m *QueryBaseFeeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBaseFeeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBaseFeeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBaseFeeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBaseFeeResponse.Merge(m, src) +} +func (m *QueryBaseFeeResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBaseFeeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBaseFeeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBaseFeeResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*QueryAccountRequest)(nil), "injective.evm.v1.QueryAccountRequest") + proto.RegisterType((*QueryAccountResponse)(nil), "injective.evm.v1.QueryAccountResponse") + proto.RegisterType((*QueryCosmosAccountRequest)(nil), "injective.evm.v1.QueryCosmosAccountRequest") + proto.RegisterType((*QueryCosmosAccountResponse)(nil), "injective.evm.v1.QueryCosmosAccountResponse") + proto.RegisterType((*QueryValidatorAccountRequest)(nil), "injective.evm.v1.QueryValidatorAccountRequest") + proto.RegisterType((*QueryValidatorAccountResponse)(nil), "injective.evm.v1.QueryValidatorAccountResponse") + proto.RegisterType((*QueryBalanceRequest)(nil), "injective.evm.v1.QueryBalanceRequest") + proto.RegisterType((*QueryBalanceResponse)(nil), "injective.evm.v1.QueryBalanceResponse") + proto.RegisterType((*QueryStorageRequest)(nil), "injective.evm.v1.QueryStorageRequest") + proto.RegisterType((*QueryStorageResponse)(nil), "injective.evm.v1.QueryStorageResponse") + proto.RegisterType((*QueryCodeRequest)(nil), "injective.evm.v1.QueryCodeRequest") + proto.RegisterType((*QueryCodeResponse)(nil), "injective.evm.v1.QueryCodeResponse") + proto.RegisterType((*QueryTxLogsRequest)(nil), "injective.evm.v1.QueryTxLogsRequest") + proto.RegisterType((*QueryTxLogsResponse)(nil), "injective.evm.v1.QueryTxLogsResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "injective.evm.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "injective.evm.v1.QueryParamsResponse") + proto.RegisterType((*EthCallRequest)(nil), "injective.evm.v1.EthCallRequest") + proto.RegisterType((*EstimateGasResponse)(nil), "injective.evm.v1.EstimateGasResponse") + proto.RegisterType((*QueryTraceTxRequest)(nil), "injective.evm.v1.QueryTraceTxRequest") + proto.RegisterType((*QueryTraceTxResponse)(nil), "injective.evm.v1.QueryTraceTxResponse") + proto.RegisterType((*QueryTraceCallRequest)(nil), "injective.evm.v1.QueryTraceCallRequest") + proto.RegisterType((*QueryTraceCallResponse)(nil), "injective.evm.v1.QueryTraceCallResponse") + proto.RegisterType((*QueryTraceBlockRequest)(nil), "injective.evm.v1.QueryTraceBlockRequest") + proto.RegisterType((*QueryTraceBlockResponse)(nil), "injective.evm.v1.QueryTraceBlockResponse") + proto.RegisterType((*QueryBaseFeeRequest)(nil), "injective.evm.v1.QueryBaseFeeRequest") + proto.RegisterType((*QueryBaseFeeResponse)(nil), "injective.evm.v1.QueryBaseFeeResponse") +} + +func init() { proto.RegisterFile("injective/evm/v1/query.proto", fileDescriptor_de864616de3dea80) } + +var fileDescriptor_de864616de3dea80 = []byte{ + // 1583 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0x4d, 0x6f, 0x1b, 0xc5, + 0x1b, 0xcf, 0xc6, 0x4e, 0xec, 0x8c, 0x93, 0x36, 0xff, 0x69, 0xf2, 0xaf, 0xb3, 0x24, 0x76, 0xba, + 0x69, 0xde, 0xda, 0x74, 0x97, 0x98, 0xaa, 0x12, 0xbd, 0x40, 0x13, 0xa5, 0x25, 0x34, 0x45, 0x65, + 0x89, 0x38, 0x20, 0x21, 0x6b, 0xbc, 0x3b, 0x5d, 0x2f, 0xf1, 0xee, 0xb8, 0x3b, 0x6b, 0xe3, 0xf4, + 0x85, 0x03, 0x82, 0x52, 0x54, 0x09, 0x55, 0xe2, 0x8e, 0xfa, 0x0d, 0xf8, 0x1a, 0x3d, 0x56, 0x42, + 0x48, 0x88, 0x43, 0xa9, 0x5a, 0x0e, 0x7c, 0x02, 0x0e, 0x9c, 0xd0, 0xcc, 0xce, 0xda, 0x6b, 0xaf, + 0xd7, 0x4e, 0x51, 0x91, 0x2a, 0x71, 0xf2, 0xbc, 0x3c, 0x2f, 0xbf, 0x99, 0xe7, 0x99, 0xe7, 0xf9, + 0xad, 0xc1, 0xbc, 0xed, 0x7e, 0x86, 0x0d, 0xdf, 0x6e, 0x62, 0x0d, 0x37, 0x1d, 0xad, 0xb9, 0xa9, + 0xdd, 0x6c, 0x60, 0xef, 0x50, 0xad, 0x7b, 0xc4, 0x27, 0x70, 0xba, 0xbd, 0xab, 0xe2, 0xa6, 0xa3, + 0x36, 0x37, 0xe5, 0x33, 0x06, 0xa1, 0x0e, 0xa1, 0x5a, 0x05, 0x51, 0x1c, 0x88, 0x6a, 0xcd, 0xcd, + 0x0a, 0xf6, 0xd1, 0xa6, 0x56, 0x47, 0x96, 0xed, 0x22, 0xdf, 0x26, 0x6e, 0xa0, 0x2d, 0xcf, 0xc5, + 0x6c, 0xfb, 0x2d, 0xb1, 0x25, 0xc7, 0xb6, 0x6a, 0xc4, 0x12, 0x7b, 0x0b, 0xb1, 0xbd, 0x3a, 0xf2, + 0x90, 0x43, 0xc5, 0xf6, 0x52, 0xdc, 0xaa, 0x87, 0x0c, 0x5c, 0x36, 0x88, 0x7b, 0xc3, 0x0e, 0x6d, + 0xcc, 0x58, 0xc4, 0x22, 0x7c, 0xa8, 0xb1, 0x91, 0x58, 0x9d, 0xb7, 0x08, 0xb1, 0x6a, 0x58, 0x43, + 0x75, 0x5b, 0x43, 0xae, 0x4b, 0x7c, 0x8e, 0x36, 0x34, 0x5c, 0x14, 0xbb, 0x7c, 0x56, 0x69, 0xdc, + 0xd0, 0x7c, 0xdb, 0xc1, 0xd4, 0x47, 0x4e, 0x3d, 0x10, 0x50, 0xde, 0x06, 0x27, 0x3e, 0x64, 0x27, + 0xbe, 0x64, 0x18, 0xa4, 0xe1, 0xfa, 0x3a, 0xbe, 0xd9, 0xc0, 0xd4, 0x87, 0x79, 0x90, 0x41, 0xa6, + 0xe9, 0x61, 0x4a, 0xf3, 0xd2, 0xa2, 0xb4, 0x36, 0xa1, 0x87, 0xd3, 0x8b, 0xd9, 0xfb, 0x8f, 0x8a, + 0x23, 0x7f, 0x3c, 0x2a, 0x8e, 0x28, 0x06, 0x98, 0xe9, 0x56, 0xa5, 0x75, 0xe2, 0x52, 0xcc, 0x74, + 0x2b, 0xa8, 0x86, 0x5c, 0x03, 0x87, 0xba, 0x62, 0x0a, 0xdf, 0x00, 0x13, 0x06, 0x31, 0x71, 0xb9, + 0x8a, 0x68, 0x35, 0x3f, 0xca, 0xf7, 0xb2, 0x6c, 0xe1, 0x3d, 0x44, 0xab, 0x70, 0x06, 0x8c, 0xb9, + 0x84, 0x29, 0xa5, 0x16, 0xa5, 0xb5, 0xb4, 0x1e, 0x4c, 0x94, 0x77, 0xc0, 0x1c, 0x77, 0xb2, 0xcd, + 0x43, 0xf4, 0x0f, 0x50, 0xde, 0x93, 0x80, 0xdc, 0xcf, 0x82, 0x00, 0xbb, 0x0c, 0x8e, 0x05, 0xd1, + 0x2f, 0x77, 0x5b, 0x9a, 0x0a, 0x56, 0x2f, 0x05, 0x8b, 0x50, 0x06, 0x59, 0xca, 0x9c, 0x32, 0x7c, + 0xa3, 0x1c, 0x5f, 0x7b, 0xce, 0x4c, 0xa0, 0xc0, 0x6a, 0xd9, 0x6d, 0x38, 0x15, 0xec, 0x89, 0x13, + 0x4c, 0x89, 0xd5, 0x0f, 0xf8, 0xa2, 0x72, 0x15, 0xcc, 0x73, 0x1c, 0x1f, 0xa3, 0x9a, 0x6d, 0x22, + 0x9f, 0x78, 0x3d, 0x87, 0x39, 0x05, 0x26, 0x0d, 0xe2, 0xf6, 0xe2, 0xc8, 0xb1, 0xb5, 0x4b, 0xb1, + 0x53, 0x3d, 0x90, 0xc0, 0x42, 0x82, 0x35, 0x71, 0xb0, 0x55, 0x70, 0x3c, 0x44, 0xd5, 0x6d, 0x31, + 0x04, 0xfb, 0x0a, 0x8f, 0x16, 0x26, 0xd1, 0x56, 0x10, 0xe7, 0x97, 0x09, 0xcf, 0x9b, 0x22, 0x89, + 0xda, 0xaa, 0xc3, 0x92, 0x48, 0xb9, 0x2a, 0x9c, 0x7d, 0xe4, 0x13, 0x0f, 0x59, 0xc3, 0x9d, 0xc1, + 0x69, 0x90, 0x3a, 0xc0, 0x87, 0x22, 0xdf, 0xd8, 0x30, 0xe2, 0x7e, 0x43, 0xb8, 0x6f, 0x1b, 0x13, + 0xee, 0x67, 0xc0, 0x58, 0x13, 0xd5, 0x1a, 0xa1, 0xf3, 0x60, 0xa2, 0x5c, 0x00, 0xd3, 0x22, 0x95, + 0xcc, 0x97, 0x3a, 0xe4, 0x2a, 0xf8, 0x5f, 0x44, 0x4f, 0xb8, 0x80, 0x20, 0xcd, 0x72, 0x9f, 0x6b, + 0x4d, 0xea, 0x7c, 0xac, 0xdc, 0x02, 0x90, 0x0b, 0xee, 0xb7, 0xf6, 0x88, 0x45, 0x43, 0x17, 0x10, + 0xa4, 0xf9, 0x8b, 0x09, 0xec, 0xf3, 0x31, 0xbc, 0x0c, 0x40, 0xa7, 0x36, 0xf1, 0xb3, 0xe5, 0x4a, + 0x2b, 0x6a, 0x90, 0xb4, 0x2a, 0x2b, 0x64, 0x6a, 0x50, 0xf3, 0x44, 0x21, 0x53, 0xaf, 0x77, 0xae, + 0x4a, 0x8f, 0x68, 0x46, 0x40, 0x7e, 0x2b, 0x89, 0x8b, 0x0d, 0x9d, 0x0b, 0x9c, 0xeb, 0x20, 0x5d, + 0x23, 0x16, 0x3b, 0x5d, 0x6a, 0x2d, 0x57, 0x9a, 0x55, 0x7b, 0xcb, 0xa7, 0xba, 0x47, 0x2c, 0x9d, + 0x8b, 0xc0, 0x2b, 0x7d, 0x40, 0xad, 0x0e, 0x05, 0x15, 0xf8, 0x89, 0xa2, 0x52, 0x66, 0xc4, 0x3d, + 0x5c, 0xe7, 0x45, 0x52, 0xe0, 0x56, 0xae, 0x09, 0x80, 0xe1, 0xaa, 0x00, 0x78, 0x01, 0x8c, 0x07, + 0xc5, 0x94, 0x5f, 0x50, 0xae, 0x94, 0x8f, 0x43, 0x0c, 0x34, 0xb6, 0xd2, 0x8f, 0x9f, 0x16, 0x47, + 0x74, 0x21, 0xad, 0xfc, 0x2c, 0x81, 0x63, 0x3b, 0x7e, 0x75, 0x1b, 0xd5, 0x6a, 0x91, 0x9b, 0x46, + 0x9e, 0x45, 0xc3, 0x98, 0xb0, 0x31, 0x3c, 0x09, 0x32, 0x16, 0xa2, 0x65, 0x03, 0xd5, 0xc5, 0xf3, + 0x18, 0xb7, 0x10, 0xdd, 0x46, 0x75, 0xf8, 0x29, 0x98, 0xae, 0x7b, 0xa4, 0x4e, 0x28, 0xf6, 0xda, + 0x4f, 0x8c, 0x3d, 0x8f, 0xc9, 0xad, 0xd2, 0x5f, 0x4f, 0x8b, 0xaa, 0x65, 0xfb, 0xd5, 0x46, 0x45, + 0x35, 0x88, 0xa3, 0x89, 0xfe, 0x12, 0xfc, 0x9c, 0xa3, 0xe6, 0x81, 0xe6, 0x1f, 0xd6, 0x31, 0x55, + 0xb7, 0x3b, 0x6f, 0x5b, 0x3f, 0x1e, 0xda, 0x0a, 0xdf, 0xe5, 0x1c, 0xc8, 0x1a, 0x55, 0x64, 0xbb, + 0x65, 0xdb, 0xcc, 0xa7, 0x17, 0xa5, 0xb5, 0x94, 0x9e, 0xe1, 0xf3, 0x5d, 0x13, 0xce, 0x83, 0x09, + 0xd2, 0xc4, 0x9e, 0x67, 0x9b, 0x98, 0xe6, 0xc7, 0x38, 0xd6, 0xce, 0x82, 0xb2, 0x0f, 0x4e, 0xec, + 0x50, 0xdf, 0x76, 0x90, 0x8f, 0xaf, 0xa0, 0xce, 0x35, 0x4d, 0x83, 0x94, 0x85, 0x82, 0xa3, 0xa5, + 0x75, 0x36, 0x64, 0x2b, 0x1e, 0xf6, 0xf9, 0xa9, 0x26, 0x75, 0x36, 0x64, 0x3e, 0x9b, 0x4e, 0x19, + 0x7b, 0x1e, 0x09, 0x5e, 0xfa, 0x84, 0x9e, 0x69, 0x3a, 0x3b, 0x6c, 0xaa, 0x3c, 0x4b, 0x85, 0xe9, + 0xc1, 0x3a, 0xd3, 0x7e, 0x2b, 0xbc, 0xb2, 0x4d, 0x90, 0x72, 0xa8, 0x25, 0xae, 0xbe, 0x18, 0xbf, + 0xfa, 0x6b, 0xd4, 0xda, 0xf1, 0xab, 0xd8, 0xc3, 0x0d, 0x67, 0xbf, 0xa5, 0x33, 0x59, 0xf8, 0x2e, + 0x98, 0x8c, 0xb6, 0x37, 0xee, 0x29, 0x57, 0x5a, 0x88, 0xeb, 0x72, 0x57, 0xdb, 0x5c, 0x48, 0xcf, + 0xf9, 0x9d, 0x09, 0xdc, 0x06, 0x93, 0x75, 0x0f, 0x9b, 0xd8, 0xc0, 0x94, 0x12, 0x8f, 0xe6, 0xd3, + 0x3c, 0x37, 0x87, 0x7a, 0xef, 0x52, 0x62, 0x05, 0xb7, 0x52, 0x23, 0xc6, 0x41, 0x58, 0xda, 0xc6, + 0xf8, 0x25, 0xe7, 0xf8, 0x5a, 0x50, 0xd8, 0xe0, 0x02, 0x00, 0x81, 0x08, 0x7f, 0x7f, 0xe3, 0xfc, + 0x46, 0x26, 0xf8, 0x0a, 0x6f, 0x59, 0xdb, 0xe1, 0x36, 0xeb, 0xaa, 0xf9, 0x0c, 0x3f, 0x86, 0xac, + 0x06, 0x2d, 0x57, 0x0d, 0x5b, 0xae, 0xba, 0x1f, 0xb6, 0xdc, 0xad, 0x2c, 0xcb, 0xbf, 0x87, 0xbf, + 0x15, 0x25, 0x61, 0x84, 0xed, 0xf4, 0x4d, 0xa3, 0xec, 0xbf, 0x93, 0x46, 0x13, 0x5d, 0x69, 0xf4, + 0x7e, 0x3a, 0x3b, 0x3a, 0x9d, 0xd2, 0xb3, 0x7e, 0xab, 0x6c, 0xbb, 0x26, 0x6e, 0x29, 0x67, 0x44, + 0x31, 0x6c, 0x47, 0xb8, 0x53, 0xa9, 0x4c, 0xe4, 0xa3, 0xf0, 0x55, 0xb0, 0xb1, 0xf2, 0x4d, 0x0a, + 0xcc, 0x76, 0x84, 0x5f, 0xd7, 0x37, 0xd4, 0x9b, 0x69, 0xe9, 0x97, 0xce, 0xb4, 0xd7, 0x24, 0x49, + 0xa2, 0x51, 0xcc, 0x76, 0x45, 0x51, 0xd9, 0x00, 0xff, 0xef, 0x0d, 0xc4, 0x80, 0xb8, 0x7d, 0x97, + 0x8a, 0x8a, 0x6f, 0x31, 0x07, 0x91, 0x97, 0xec, 0xb7, 0xc2, 0x3a, 0x3f, 0xfc, 0x25, 0xfb, 0x2d, + 0xfa, 0x0a, 0x5e, 0xf2, 0x7f, 0xfd, 0x11, 0x2a, 0xe7, 0xc0, 0xc9, 0x58, 0x3c, 0x06, 0xc4, 0x6f, + 0xb6, 0x4d, 0xb5, 0x28, 0xbe, 0x8c, 0xc3, 0x96, 0xae, 0xec, 0xb5, 0x69, 0x94, 0x58, 0x16, 0x26, + 0xce, 0x83, 0x2c, 0xeb, 0xbb, 0xe5, 0x1b, 0x58, 0x50, 0x99, 0xad, 0xb9, 0x5f, 0x9f, 0x16, 0x67, + 0x03, 0xf4, 0xd4, 0x3c, 0x50, 0x6d, 0xa2, 0x39, 0xc8, 0xaf, 0xaa, 0xbb, 0xae, 0xcf, 0x28, 0x16, + 0xd7, 0x2e, 0xfd, 0x39, 0x05, 0xc6, 0xb8, 0x39, 0xf8, 0xb5, 0x04, 0x32, 0x82, 0x59, 0xc2, 0xe5, + 0x78, 0x58, 0xfb, 0x7c, 0x3a, 0xc8, 0x2b, 0xc3, 0xc4, 0x02, 0x68, 0xca, 0xd9, 0x2f, 0x7f, 0xfa, + 0xfd, 0xfb, 0xd1, 0x65, 0xb8, 0xa4, 0xc5, 0x3e, 0x7e, 0x04, 0xbb, 0xd4, 0x6e, 0x8b, 0x50, 0xdc, + 0x85, 0x3f, 0x48, 0x60, 0xaa, 0x8b, 0xc0, 0xc3, 0xb3, 0x09, 0x6e, 0xfa, 0x7d, 0x28, 0xc8, 0x1b, + 0x47, 0x13, 0x16, 0xc8, 0x4a, 0x1c, 0xd9, 0x06, 0x3c, 0x13, 0x47, 0x16, 0x7e, 0x2b, 0xc4, 0x00, + 0xfe, 0x28, 0x81, 0xe9, 0x5e, 0x2e, 0x0e, 0xd5, 0x04, 0xb7, 0x09, 0x9f, 0x00, 0xb2, 0x76, 0x64, + 0x79, 0x81, 0xf4, 0x22, 0x47, 0x7a, 0x1e, 0x96, 0xe2, 0x48, 0x9b, 0xa1, 0x4e, 0x07, 0x6c, 0xf4, + 0xf3, 0xe2, 0x2e, 0xbc, 0x27, 0x81, 0x8c, 0x60, 0xdd, 0x89, 0xa1, 0xed, 0x26, 0xf4, 0x89, 0xa1, + 0xed, 0x21, 0xef, 0xca, 0x06, 0x87, 0xb5, 0x02, 0x4f, 0xc7, 0x61, 0x09, 0x16, 0x4f, 0x23, 0x57, + 0xf7, 0x40, 0x02, 0x19, 0xc1, 0xbf, 0x13, 0x81, 0x74, 0x93, 0xfd, 0x44, 0x20, 0x3d, 0x34, 0x5e, + 0xd9, 0xe4, 0x40, 0xce, 0xc2, 0xf5, 0x38, 0x10, 0x1a, 0x88, 0x76, 0x70, 0x68, 0xb7, 0x0f, 0xf0, + 0xe1, 0x5d, 0x78, 0x0b, 0xa4, 0x19, 0x4d, 0x87, 0x4a, 0x62, 0xca, 0xb4, 0xb9, 0xbf, 0xbc, 0x34, + 0x50, 0x46, 0x60, 0x58, 0xe7, 0x18, 0x96, 0xe0, 0xa9, 0x7e, 0xd9, 0x64, 0x76, 0xdd, 0xc4, 0xe7, + 0x60, 0x3c, 0x60, 0xaa, 0xf0, 0x74, 0x82, 0xe5, 0x2e, 0x42, 0x2c, 0x2f, 0x0f, 0x91, 0x12, 0x08, + 0x16, 0x39, 0x02, 0x19, 0xe6, 0xb5, 0x84, 0x7f, 0x21, 0x60, 0x0b, 0x64, 0x04, 0x13, 0x86, 0x8b, + 0x71, 0x9b, 0xdd, 0x24, 0x59, 0x5e, 0x1d, 0xd6, 0x1a, 0x42, 0xbf, 0x0a, 0xf7, 0x3b, 0x0f, 0xe5, + 0xb8, 0x5f, 0xec, 0x57, 0xcb, 0x06, 0x73, 0xf7, 0x05, 0xc8, 0x45, 0xc8, 0xea, 0x11, 0xbc, 0xf7, + 0x39, 0x73, 0x1f, 0xb6, 0xab, 0xac, 0x70, 0xdf, 0x8b, 0xb0, 0xd0, 0xc7, 0xb7, 0x10, 0x2f, 0x33, + 0x0e, 0x7c, 0x07, 0x64, 0x04, 0xdd, 0x49, 0xcc, 0xbd, 0x6e, 0xc2, 0x9b, 0x98, 0x7b, 0x3d, 0xac, + 0x69, 0xd0, 0xe9, 0x83, 0x9e, 0xe9, 0xb7, 0xe0, 0x7d, 0x09, 0x80, 0x4e, 0xe1, 0x87, 0x6b, 0x83, + 0x4c, 0x47, 0x7b, 0xb5, 0xbc, 0x7e, 0x04, 0x49, 0x81, 0x63, 0x99, 0xe3, 0x28, 0xc2, 0x85, 0x24, + 0x1c, 0xbc, 0x0b, 0xc2, 0xaf, 0x24, 0x30, 0xd1, 0xa6, 0x10, 0x70, 0x75, 0x90, 0xfd, 0x68, 0x38, + 0xd6, 0x86, 0x0b, 0x0a, 0x1c, 0xa7, 0x39, 0x8e, 0x02, 0x9c, 0x4f, 0xc2, 0xc1, 0xf3, 0xe1, 0x0e, + 0x2b, 0x4a, 0xbc, 0x0b, 0x0d, 0x28, 0x4a, 0xd1, 0xd6, 0x37, 0xa0, 0x28, 0x75, 0xb5, 0xc2, 0x41, + 0xf1, 0x08, 0x5b, 0xe4, 0x96, 0xf1, 0xf8, 0x79, 0x41, 0x7a, 0xf2, 0xbc, 0x20, 0x3d, 0x7b, 0x5e, + 0x90, 0x1e, 0xbe, 0x28, 0x8c, 0x3c, 0x79, 0x51, 0x18, 0xf9, 0xe5, 0x45, 0x61, 0xe4, 0x93, 0xdd, + 0x08, 0x05, 0xd8, 0x0d, 0xf5, 0xf7, 0x50, 0x85, 0x76, 0xac, 0x9d, 0x33, 0x88, 0x87, 0xa3, 0x53, + 0xd6, 0xe1, 0x35, 0x87, 0x98, 0x8d, 0x1a, 0xa6, 0xdc, 0x15, 0x67, 0x0a, 0x95, 0x71, 0x4e, 0x4a, + 0xde, 0xfa, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x98, 0x5b, 0xf4, 0xa7, 0x14, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Account queries an Ethereum account. + Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) + // CosmosAccount queries an Ethereum account's Cosmos Address. + CosmosAccount(ctx context.Context, in *QueryCosmosAccountRequest, opts ...grpc.CallOption) (*QueryCosmosAccountResponse, error) + // ValidatorAccount queries an Ethereum account's from a validator consensus + // Address. + ValidatorAccount(ctx context.Context, in *QueryValidatorAccountRequest, opts ...grpc.CallOption) (*QueryValidatorAccountResponse, error) + // Balance queries the balance of a the EVM denomination for a single + // EthAccount. + Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) + // Storage queries the balance of all coins for a single account. + Storage(ctx context.Context, in *QueryStorageRequest, opts ...grpc.CallOption) (*QueryStorageResponse, error) + // Code queries the balance of all coins for a single account. + Code(ctx context.Context, in *QueryCodeRequest, opts ...grpc.CallOption) (*QueryCodeResponse, error) + // Params queries the parameters of x/evm module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // EthCall implements the `eth_call` rpc api + EthCall(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) + // EstimateGas implements the `eth_estimateGas` rpc api + EstimateGas(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*EstimateGasResponse, error) + // TraceTx implements the `debug_traceTransaction` rpc api + TraceTx(ctx context.Context, in *QueryTraceTxRequest, opts ...grpc.CallOption) (*QueryTraceTxResponse, error) + // TraceBlock implements the `debug_traceBlockByNumber` and `debug_traceBlockByHash` rpc api + TraceBlock(ctx context.Context, in *QueryTraceBlockRequest, opts ...grpc.CallOption) (*QueryTraceBlockResponse, error) + // TraceCall implements the `debug_traceCall` rpc api + TraceCall(ctx context.Context, in *QueryTraceCallRequest, opts ...grpc.CallOption) (*QueryTraceCallResponse, error) + // BaseFee queries the base fee of the parent block of the current block, + // it's similar to feemarket module's method, but also checks london hardfork status. + BaseFee(ctx context.Context, in *QueryBaseFeeRequest, opts ...grpc.CallOption) (*QueryBaseFeeResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) { + out := new(QueryAccountResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Query/Account", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) CosmosAccount(ctx context.Context, in *QueryCosmosAccountRequest, opts ...grpc.CallOption) (*QueryCosmosAccountResponse, error) { + out := new(QueryCosmosAccountResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Query/CosmosAccount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ValidatorAccount(ctx context.Context, in *QueryValidatorAccountRequest, opts ...grpc.CallOption) (*QueryValidatorAccountResponse, error) { + out := new(QueryValidatorAccountResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Query/ValidatorAccount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) { + out := new(QueryBalanceResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Query/Balance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Storage(ctx context.Context, in *QueryStorageRequest, opts ...grpc.CallOption) (*QueryStorageResponse, error) { + out := new(QueryStorageResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Query/Storage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Code(ctx context.Context, in *QueryCodeRequest, opts ...grpc.CallOption) (*QueryCodeResponse, error) { + out := new(QueryCodeResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Query/Code", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) EthCall(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) { + out := new(MsgEthereumTxResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Query/EthCall", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) EstimateGas(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*EstimateGasResponse, error) { + out := new(EstimateGasResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Query/EstimateGas", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TraceTx(ctx context.Context, in *QueryTraceTxRequest, opts ...grpc.CallOption) (*QueryTraceTxResponse, error) { + out := new(QueryTraceTxResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Query/TraceTx", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TraceBlock(ctx context.Context, in *QueryTraceBlockRequest, opts ...grpc.CallOption) (*QueryTraceBlockResponse, error) { + out := new(QueryTraceBlockResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Query/TraceBlock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TraceCall(ctx context.Context, in *QueryTraceCallRequest, opts ...grpc.CallOption) (*QueryTraceCallResponse, error) { + out := new(QueryTraceCallResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Query/TraceCall", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BaseFee(ctx context.Context, in *QueryBaseFeeRequest, opts ...grpc.CallOption) (*QueryBaseFeeResponse, error) { + out := new(QueryBaseFeeResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Query/BaseFee", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Account queries an Ethereum account. + Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) + // CosmosAccount queries an Ethereum account's Cosmos Address. + CosmosAccount(context.Context, *QueryCosmosAccountRequest) (*QueryCosmosAccountResponse, error) + // ValidatorAccount queries an Ethereum account's from a validator consensus + // Address. + ValidatorAccount(context.Context, *QueryValidatorAccountRequest) (*QueryValidatorAccountResponse, error) + // Balance queries the balance of a the EVM denomination for a single + // EthAccount. + Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) + // Storage queries the balance of all coins for a single account. + Storage(context.Context, *QueryStorageRequest) (*QueryStorageResponse, error) + // Code queries the balance of all coins for a single account. + Code(context.Context, *QueryCodeRequest) (*QueryCodeResponse, error) + // Params queries the parameters of x/evm module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // EthCall implements the `eth_call` rpc api + EthCall(context.Context, *EthCallRequest) (*MsgEthereumTxResponse, error) + // EstimateGas implements the `eth_estimateGas` rpc api + EstimateGas(context.Context, *EthCallRequest) (*EstimateGasResponse, error) + // TraceTx implements the `debug_traceTransaction` rpc api + TraceTx(context.Context, *QueryTraceTxRequest) (*QueryTraceTxResponse, error) + // TraceBlock implements the `debug_traceBlockByNumber` and `debug_traceBlockByHash` rpc api + TraceBlock(context.Context, *QueryTraceBlockRequest) (*QueryTraceBlockResponse, error) + // TraceCall implements the `debug_traceCall` rpc api + TraceCall(context.Context, *QueryTraceCallRequest) (*QueryTraceCallResponse, error) + // BaseFee queries the base fee of the parent block of the current block, + // it's similar to feemarket module's method, but also checks london hardfork status. + BaseFee(context.Context, *QueryBaseFeeRequest) (*QueryBaseFeeResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Account(ctx context.Context, req *QueryAccountRequest) (*QueryAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Account not implemented") +} +func (*UnimplementedQueryServer) CosmosAccount(ctx context.Context, req *QueryCosmosAccountRequest) (*QueryCosmosAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CosmosAccount not implemented") +} +func (*UnimplementedQueryServer) ValidatorAccount(ctx context.Context, req *QueryValidatorAccountRequest) (*QueryValidatorAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorAccount not implemented") +} +func (*UnimplementedQueryServer) Balance(ctx context.Context, req *QueryBalanceRequest) (*QueryBalanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented") +} +func (*UnimplementedQueryServer) Storage(ctx context.Context, req *QueryStorageRequest) (*QueryStorageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Storage not implemented") +} +func (*UnimplementedQueryServer) Code(ctx context.Context, req *QueryCodeRequest) (*QueryCodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Code not implemented") +} +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) EthCall(ctx context.Context, req *EthCallRequest) (*MsgEthereumTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EthCall not implemented") +} +func (*UnimplementedQueryServer) EstimateGas(ctx context.Context, req *EthCallRequest) (*EstimateGasResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EstimateGas not implemented") +} +func (*UnimplementedQueryServer) TraceTx(ctx context.Context, req *QueryTraceTxRequest) (*QueryTraceTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TraceTx not implemented") +} +func (*UnimplementedQueryServer) TraceBlock(ctx context.Context, req *QueryTraceBlockRequest) (*QueryTraceBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TraceBlock not implemented") +} +func (*UnimplementedQueryServer) TraceCall(ctx context.Context, req *QueryTraceCallRequest) (*QueryTraceCallResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TraceCall not implemented") +} +func (*UnimplementedQueryServer) BaseFee(ctx context.Context, req *QueryBaseFeeRequest) (*QueryBaseFeeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BaseFee not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Account(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Query/Account", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Account(ctx, req.(*QueryAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CosmosAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCosmosAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CosmosAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Query/CosmosAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CosmosAccount(ctx, req.(*QueryCosmosAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ValidatorAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ValidatorAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Query/ValidatorAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ValidatorAccount(ctx, req.(*QueryValidatorAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Balance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBalanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Balance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Query/Balance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Balance(ctx, req.(*QueryBalanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Storage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryStorageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Storage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Query/Storage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Storage(ctx, req.(*QueryStorageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Code_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Code(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Query/Code", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Code(ctx, req.(*QueryCodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_EthCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EthCallRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).EthCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Query/EthCall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EthCall(ctx, req.(*EthCallRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_EstimateGas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EthCallRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).EstimateGas(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Query/EstimateGas", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EstimateGas(ctx, req.(*EthCallRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TraceTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTraceTxRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TraceTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Query/TraceTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TraceTx(ctx, req.(*QueryTraceTxRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TraceBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTraceBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TraceBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Query/TraceBlock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TraceBlock(ctx, req.(*QueryTraceBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TraceCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTraceCallRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TraceCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Query/TraceCall", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TraceCall(ctx, req.(*QueryTraceCallRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BaseFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBaseFeeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BaseFee(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Query/BaseFee", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BaseFee(ctx, req.(*QueryBaseFeeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "injective.evm.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Account", + Handler: _Query_Account_Handler, + }, + { + MethodName: "CosmosAccount", + Handler: _Query_CosmosAccount_Handler, + }, + { + MethodName: "ValidatorAccount", + Handler: _Query_ValidatorAccount_Handler, + }, + { + MethodName: "Balance", + Handler: _Query_Balance_Handler, + }, + { + MethodName: "Storage", + Handler: _Query_Storage_Handler, + }, + { + MethodName: "Code", + Handler: _Query_Code_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "EthCall", + Handler: _Query_EthCall_Handler, + }, + { + MethodName: "EstimateGas", + Handler: _Query_EstimateGas_Handler, + }, + { + MethodName: "TraceTx", + Handler: _Query_TraceTx_Handler, + }, + { + MethodName: "TraceBlock", + Handler: _Query_TraceBlock_Handler, + }, + { + MethodName: "TraceCall", + Handler: _Query_TraceCall_Handler, + }, + { + MethodName: "BaseFee", + Handler: _Query_BaseFee_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "injective/evm/v1/query.proto", +} + +func (m *QueryAccountRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAccountRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAccountResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAccountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Nonce != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Nonce)) + i-- + dAtA[i] = 0x18 + } + if len(m.CodeHash) > 0 { + i -= len(m.CodeHash) + copy(dAtA[i:], m.CodeHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.CodeHash))) + i-- + dAtA[i] = 0x12 + } + if len(m.Balance) > 0 { + i -= len(m.Balance) + copy(dAtA[i:], m.Balance) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Balance))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryCosmosAccountRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCosmosAccountRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCosmosAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryCosmosAccountResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCosmosAccountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCosmosAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AccountNumber != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AccountNumber)) + i-- + dAtA[i] = 0x18 + } + if m.Sequence != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x10 + } + if len(m.CosmosAddress) > 0 { + i -= len(m.CosmosAddress) + copy(dAtA[i:], m.CosmosAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.CosmosAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorAccountRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryValidatorAccountRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConsAddress) > 0 { + i -= len(m.ConsAddress) + copy(dAtA[i:], m.ConsAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorAccountResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryValidatorAccountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AccountNumber != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AccountNumber)) + i-- + dAtA[i] = 0x18 + } + if m.Sequence != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x10 + } + if len(m.AccountAddress) > 0 { + i -= len(m.AccountAddress) + copy(dAtA[i:], m.AccountAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AccountAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBalanceRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBalanceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBalanceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBalanceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBalanceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBalanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Balance) > 0 { + i -= len(m.Balance) + copy(dAtA[i:], m.Balance) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Balance))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryStorageRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryStorageRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryStorageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryStorageResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryStorageResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryStorageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryCodeRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCodeRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCodeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryCodeResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCodeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Code) > 0 { + i -= len(m.Code) + copy(dAtA[i:], m.Code) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Code))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryTxLogsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTxLogsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTxLogsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryTxLogsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTxLogsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTxLogsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Logs) > 0 { + for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Logs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EthCallRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EthCallRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EthCallRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Overrides) > 0 { + i -= len(m.Overrides) + copy(dAtA[i:], m.Overrides) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Overrides))) + i-- + dAtA[i] = 0x2a + } + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x20 + } + if len(m.ProposerAddress) > 0 { + i -= len(m.ProposerAddress) + copy(dAtA[i:], m.ProposerAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ProposerAddress))) + i-- + dAtA[i] = 0x1a + } + if m.GasCap != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.GasCap)) + i-- + dAtA[i] = 0x10 + } + if len(m.Args) > 0 { + i -= len(m.Args) + copy(dAtA[i:], m.Args) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Args))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EstimateGasResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EstimateGasResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EstimateGasResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.VmError) > 0 { + i -= len(m.VmError) + copy(dAtA[i:], m.VmError) + i = encodeVarintQuery(dAtA, i, uint64(len(m.VmError))) + i-- + dAtA[i] = 0x1a + } + if len(m.Ret) > 0 { + i -= len(m.Ret) + copy(dAtA[i:], m.Ret) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Ret))) + i-- + dAtA[i] = 0x12 + } + if m.Gas != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Gas)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryTraceTxRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTraceTxRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTraceTxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x48 + } + if len(m.ProposerAddress) > 0 { + i -= len(m.ProposerAddress) + copy(dAtA[i:], m.ProposerAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ProposerAddress))) + i-- + dAtA[i] = 0x42 + } + n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.BlockTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.BlockTime):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintQuery(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x3a + if len(m.BlockHash) > 0 { + i -= len(m.BlockHash) + copy(dAtA[i:], m.BlockHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.BlockHash))) + i-- + dAtA[i] = 0x32 + } + if m.BlockNumber != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockNumber)) + i-- + dAtA[i] = 0x28 + } + if len(m.Predecessors) > 0 { + for iNdEx := len(m.Predecessors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Predecessors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.TraceConfig != nil { + { + size, err := m.TraceConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Msg != nil { + { + size, err := m.Msg.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryTraceTxResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTraceTxResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTraceTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryTraceCallRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTraceCallRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTraceCallRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x40 + } + n7, err7 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.BlockTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.BlockTime):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintQuery(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x3a + if len(m.BlockHash) > 0 { + i -= len(m.BlockHash) + copy(dAtA[i:], m.BlockHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.BlockHash))) + i-- + dAtA[i] = 0x32 + } + if m.BlockNumber != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockNumber)) + i-- + dAtA[i] = 0x28 + } + if m.TraceConfig != nil { + { + size, err := m.TraceConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.ProposerAddress) > 0 { + i -= len(m.ProposerAddress) + copy(dAtA[i:], m.ProposerAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ProposerAddress))) + i-- + dAtA[i] = 0x1a + } + if m.GasCap != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.GasCap)) + i-- + dAtA[i] = 0x10 + } + if len(m.Args) > 0 { + i -= len(m.Args) + copy(dAtA[i:], m.Args) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Args))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryTraceCallResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTraceCallResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTraceCallResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryTraceBlockRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTraceBlockRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTraceBlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x48 + } + if len(m.ProposerAddress) > 0 { + i -= len(m.ProposerAddress) + copy(dAtA[i:], m.ProposerAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ProposerAddress))) + i-- + dAtA[i] = 0x42 + } + n9, err9 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.BlockTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.BlockTime):]) + if err9 != nil { + return 0, err9 + } + i -= n9 + i = encodeVarintQuery(dAtA, i, uint64(n9)) + i-- + dAtA[i] = 0x3a + if len(m.BlockHash) > 0 { + i -= len(m.BlockHash) + copy(dAtA[i:], m.BlockHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.BlockHash))) + i-- + dAtA[i] = 0x32 + } + if m.BlockNumber != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockNumber)) + i-- + dAtA[i] = 0x28 + } + if m.TraceConfig != nil { + { + size, err := m.TraceConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Txs) > 0 { + for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Txs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryTraceBlockResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTraceBlockResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTraceBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBaseFeeRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBaseFeeRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBaseFeeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryBaseFeeResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBaseFeeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBaseFeeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BaseFee != nil { + { + size := m.BaseFee.Size() + i -= size + if _, err := m.BaseFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryAccountRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAccountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Balance) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.CodeHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Nonce != 0 { + n += 1 + sovQuery(uint64(m.Nonce)) + } + return n +} + +func (m *QueryCosmosAccountRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCosmosAccountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CosmosAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Sequence != 0 { + n += 1 + sovQuery(uint64(m.Sequence)) + } + if m.AccountNumber != 0 { + n += 1 + sovQuery(uint64(m.AccountNumber)) + } + return n +} + +func (m *QueryValidatorAccountRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryValidatorAccountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AccountAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Sequence != 0 { + n += 1 + sovQuery(uint64(m.Sequence)) + } + if m.AccountNumber != 0 { + n += 1 + sovQuery(uint64(m.AccountNumber)) + } + return n +} + +func (m *QueryBalanceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBalanceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Balance) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryStorageRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryStorageResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCodeRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCodeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Code) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryTxLogsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryTxLogsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Logs) > 0 { + for _, e := range m.Logs { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *EthCallRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Args) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.GasCap != 0 { + n += 1 + sovQuery(uint64(m.GasCap)) + } + l = len(m.ProposerAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } + l = len(m.Overrides) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *EstimateGasResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Gas != 0 { + n += 1 + sovQuery(uint64(m.Gas)) + } + l = len(m.Ret) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.VmError) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryTraceTxRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Msg != nil { + l = m.Msg.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.TraceConfig != nil { + l = m.TraceConfig.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Predecessors) > 0 { + for _, e := range m.Predecessors { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.BlockNumber != 0 { + n += 1 + sovQuery(uint64(m.BlockNumber)) + } + l = len(m.BlockHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.BlockTime) + n += 1 + l + sovQuery(uint64(l)) + l = len(m.ProposerAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } + return n +} + +func (m *QueryTraceTxResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryTraceCallRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Args) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.GasCap != 0 { + n += 1 + sovQuery(uint64(m.GasCap)) + } + l = len(m.ProposerAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.TraceConfig != nil { + l = m.TraceConfig.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.BlockNumber != 0 { + n += 1 + sovQuery(uint64(m.BlockNumber)) + } + l = len(m.BlockHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.BlockTime) + n += 1 + l + sovQuery(uint64(l)) + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } + return n +} + +func (m *QueryTraceCallResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryTraceBlockRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Txs) > 0 { + for _, e := range m.Txs { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.TraceConfig != nil { + l = m.TraceConfig.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.BlockNumber != 0 { + n += 1 + sovQuery(uint64(m.BlockNumber)) + } + l = len(m.BlockHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.BlockTime) + n += 1 + l + sovQuery(uint64(l)) + l = len(m.ProposerAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } + return n +} + +func (m *QueryTraceBlockResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBaseFeeRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryBaseFeeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BaseFee != nil { + l = m.BaseFee.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryAccountRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAccountRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAccountResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Balance = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CodeHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CodeHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + m.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Nonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCosmosAccountRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCosmosAccountRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCosmosAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCosmosAccountResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCosmosAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCosmosAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CosmosAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CosmosAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) + } + m.AccountNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AccountNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorAccountRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryValidatorAccountRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorAccountResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryValidatorAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AccountAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) + } + m.AccountNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AccountNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBalanceRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBalanceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBalanceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBalanceResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBalanceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBalanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Balance = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryStorageRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryStorageRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryStorageRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryStorageResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryStorageResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryStorageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCodeRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCodeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCodeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCodeResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCodeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCodeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Code = append(m.Code[:0], dAtA[iNdEx:postIndex]...) + if m.Code == nil { + m.Code = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTxLogsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTxLogsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTxLogsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTxLogsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTxLogsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTxLogsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Logs = append(m.Logs, &Log{}) + if err := m.Logs[len(m.Logs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EthCallRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EthCallRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EthCallRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args[:0], dAtA[iNdEx:postIndex]...) + if m.Args == nil { + m.Args = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasCap", wireType) + } + m.GasCap = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasCap |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ProposerAddress == nil { + m.ProposerAddress = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Overrides", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Overrides = append(m.Overrides[:0], dAtA[iNdEx:postIndex]...) + if m.Overrides == nil { + m.Overrides = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EstimateGasResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EstimateGasResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EstimateGasResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Gas", wireType) + } + m.Gas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Gas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ret", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ret = append(m.Ret[:0], dAtA[iNdEx:postIndex]...) + if m.Ret == nil { + m.Ret = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VmError", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VmError = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTraceTxRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTraceTxRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTraceTxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Msg == nil { + m.Msg = &MsgEthereumTx{} + } + if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TraceConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TraceConfig == nil { + m.TraceConfig = &TraceConfig{} + } + if err := m.TraceConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Predecessors", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Predecessors = append(m.Predecessors, &MsgEthereumTx{}) + if err := m.Predecessors[len(m.Predecessors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockNumber", wireType) + } + m.BlockNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.BlockTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ProposerAddress == nil { + m.ProposerAddress = []byte{} + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTraceTxResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTraceTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTraceTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTraceCallRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTraceCallRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTraceCallRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args[:0], dAtA[iNdEx:postIndex]...) + if m.Args == nil { + m.Args = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasCap", wireType) + } + m.GasCap = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasCap |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ProposerAddress == nil { + m.ProposerAddress = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TraceConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TraceConfig == nil { + m.TraceConfig = &TraceConfig{} + } + if err := m.TraceConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockNumber", wireType) + } + m.BlockNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.BlockTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTraceCallResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTraceCallResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTraceCallResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTraceBlockRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTraceBlockRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTraceBlockRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Txs = append(m.Txs, &MsgEthereumTx{}) + if err := m.Txs[len(m.Txs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TraceConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TraceConfig == nil { + m.TraceConfig = &TraceConfig{} + } + if err := m.TraceConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockNumber", wireType) + } + m.BlockNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.BlockTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ProposerAddress == nil { + m.ProposerAddress = []byte{} + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTraceBlockResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTraceBlockResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTraceBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBaseFeeRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBaseFeeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBaseFeeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBaseFeeResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBaseFeeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBaseFeeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.BaseFee = &v + if err := m.BaseFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/evm/types/response.go b/chain/evm/types/response.go new file mode 100644 index 00000000..2ad67ce3 --- /dev/null +++ b/chain/evm/types/response.go @@ -0,0 +1,72 @@ +package types + +import ( + abci "github.com/cometbft/cometbft/abci/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + proto "github.com/cosmos/gogoproto/proto" +) + +// PatchTxResponses fills the evm tx index and log indexes in the tx result +func PatchTxResponses(input []*abci.ExecTxResult) []*abci.ExecTxResult { + var ( + txIndex uint64 + logIndex uint64 + ) + for _, res := range input { + // assume no error result in msg handler + if res.Code != 0 { + continue + } + + var txMsgData sdk.TxMsgData + if err := proto.Unmarshal(res.Data, &txMsgData); err != nil { + panic(err) + } + + var ( + // if the response data is modified and need to be marshaled back + dataDirty bool + ) + + for i, rsp := range txMsgData.MsgResponses { + var response MsgEthereumTxResponse + if rsp.TypeUrl != "/"+proto.MessageName(&response) { + continue + } + + if err := proto.Unmarshal(rsp.Value, &response); err != nil { + panic(err) + } + + if len(response.Logs) > 0 { + for _, log := range response.Logs { + log.TxIndex = txIndex + log.Index = logIndex + logIndex++ + } + + anyRsp, err := codectypes.NewAnyWithValue(&response) + if err != nil { + panic(err) + } + txMsgData.MsgResponses[i] = anyRsp + + dataDirty = true + } + + txIndex++ + } + + if dataDirty { + data, err := proto.Marshal(&txMsgData) + if err != nil { + panic(err) + } + + res.Data = data + } + } + + return input +} diff --git a/chain/evm/types/state.pb.go b/chain/evm/types/state.pb.go new file mode 100644 index 00000000..317b85c6 --- /dev/null +++ b/chain/evm/types/state.pb.go @@ -0,0 +1,370 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/evm/v1/state.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// State represents a single Storage key value pair item. +type State struct { + // key is the stored key + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // value is the stored value for the given key + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *State) Reset() { *m = State{} } +func (m *State) String() string { return proto.CompactTextString(m) } +func (*State) ProtoMessage() {} +func (*State) Descriptor() ([]byte, []int) { + return fileDescriptor_7b4e9baa093ebab6, []int{0} +} +func (m *State) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *State) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_State.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *State) XXX_Merge(src proto.Message) { + xxx_messageInfo_State.Merge(m, src) +} +func (m *State) XXX_Size() int { + return m.Size() +} +func (m *State) XXX_DiscardUnknown() { + xxx_messageInfo_State.DiscardUnknown(m) +} + +var xxx_messageInfo_State proto.InternalMessageInfo + +func (m *State) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *State) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func init() { + proto.RegisterType((*State)(nil), "injective.evm.v1.State") +} + +func init() { proto.RegisterFile("injective/evm/v1/state.proto", fileDescriptor_7b4e9baa093ebab6) } + +var fileDescriptor_7b4e9baa093ebab6 = []byte{ + // 184 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc9, 0xcc, 0xcb, 0x4a, + 0x4d, 0x2e, 0xc9, 0x2c, 0x4b, 0xd5, 0x4f, 0x2d, 0xcb, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x2e, 0x49, + 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xcb, 0xea, 0xa5, 0x96, 0xe5, + 0xea, 0x95, 0x19, 0x2a, 0xe9, 0x73, 0xb1, 0x06, 0x83, 0x14, 0x08, 0x09, 0x70, 0x31, 0x67, 0xa7, + 0x56, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x81, 0x98, 0x42, 0x22, 0x5c, 0xac, 0x65, 0x89, + 0x39, 0xa5, 0xa9, 0x12, 0x4c, 0x60, 0x31, 0x08, 0xc7, 0x29, 0xf9, 0xc4, 0x23, 0x39, 0xc6, 0x0b, + 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, + 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x3c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, + 0xf5, 0x3d, 0x61, 0xf6, 0xf8, 0x24, 0x26, 0x15, 0xeb, 0xc3, 0x6d, 0xd5, 0x4d, 0xce, 0x2f, 0x4a, + 0x45, 0xe6, 0x66, 0x24, 0x66, 0xe6, 0xe9, 0xe7, 0xe6, 0xa7, 0x94, 0xe6, 0xa4, 0x16, 0x83, 0x1d, + 0x5c, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0xae, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, + 0x93, 0x1a, 0xbf, 0xe3, 0xce, 0x00, 0x00, 0x00, +} + +func (m *State) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *State) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *State) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintState(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintState(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintState(dAtA []byte, offset int, v uint64) int { + offset -= sovState(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *State) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + return n +} + +func sovState(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozState(x uint64) (n int) { + return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *State) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: State: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: State: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipState(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipState(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowState + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowState + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowState + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthState + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupState + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthState + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowState = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/evm/types/storage.go b/chain/evm/types/storage.go new file mode 100644 index 00000000..7e51f420 --- /dev/null +++ b/chain/evm/types/storage.go @@ -0,0 +1,66 @@ +package types + +import ( + "fmt" + "strings" + + errorsmod "cosmossdk.io/errors" + "github.com/ethereum/go-ethereum/common" +) + +// Storage represents the account Storage map as a slice of single key value +// State pairs. This is to prevent non determinism at genesis initialization or export. +type Storage []State + +// Validate performs a basic validation of the Storage fields. +func (s Storage) Validate() error { + seenStorage := make(map[string]bool) + for i, state := range s { + if seenStorage[state.Key] { + return errorsmod.Wrapf(ErrInvalidState, "duplicate state key %d: %s", i, state.Key) + } + + if err := state.Validate(); err != nil { + return err + } + + seenStorage[state.Key] = true + } + return nil +} + +// String implements the stringer interface +func (s Storage) String() string { + var str string + for _, state := range s { + str += fmt.Sprintf("%s\n", state.String()) + } + + return str +} + +// Copy returns a copy of storage. +func (s Storage) Copy() Storage { + cpy := make(Storage, len(s)) + copy(cpy, s) + + return cpy +} + +// Validate performs a basic validation of the State fields. +// NOTE: state value can be empty +func (s State) Validate() error { + if strings.TrimSpace(s.Key) == "" { + return errorsmod.Wrap(ErrInvalidState, "state key hash cannot be blank") + } + + return nil +} + +// NewState creates a new State instance +func NewState(key, value common.Hash) State { + return State{ + Key: key.String(), + Value: value.String(), + } +} diff --git a/chain/evm/types/trace_config.pb.go b/chain/evm/types/trace_config.pb.go new file mode 100644 index 00000000..3f74e97c --- /dev/null +++ b/chain/evm/types/trace_config.pb.go @@ -0,0 +1,896 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/evm/v1/trace_config.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// TraceConfig holds extra parameters to trace functions. +type TraceConfig struct { + // tracer is a custom javascript tracer + Tracer string `protobuf:"bytes,1,opt,name=tracer,proto3" json:"tracer,omitempty"` + // timeout overrides the default timeout of 5 seconds for JavaScript-based tracing + // calls + Timeout string `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` + // reexec defines the number of blocks the tracer is willing to go back + Reexec uint64 `protobuf:"varint,3,opt,name=reexec,proto3" json:"reexec,omitempty"` + // disable_stack switches stack capture + DisableStack bool `protobuf:"varint,5,opt,name=disable_stack,json=disableStack,proto3" json:"disableStack"` + // disable_storage switches storage capture + DisableStorage bool `protobuf:"varint,6,opt,name=disable_storage,json=disableStorage,proto3" json:"disableStorage"` + // debug can be used to print output during capture end + Debug bool `protobuf:"varint,8,opt,name=debug,proto3" json:"debug,omitempty"` + // limit defines the maximum length of output, but zero means unlimited + Limit int32 `protobuf:"varint,9,opt,name=limit,proto3" json:"limit,omitempty"` + // overrides can be used to execute a trace using future fork rules + Overrides *ChainConfig `protobuf:"bytes,10,opt,name=overrides,proto3" json:"overrides,omitempty"` + // enable_memory switches memory capture + EnableMemory bool `protobuf:"varint,11,opt,name=enable_memory,json=enableMemory,proto3" json:"enableMemory"` + // enable_return_data switches the capture of return data + EnableReturnData bool `protobuf:"varint,12,opt,name=enable_return_data,json=enableReturnData,proto3" json:"enableReturnData"` + // tracer_json_config configures the tracer using a JSON string + TracerJsonConfig string `protobuf:"bytes,13,opt,name=tracer_json_config,json=tracerJsonConfig,proto3" json:"tracerConfig"` + // temporary state modifications to Geth in order to simulate the effects of eth_call + StateOverrides []byte `protobuf:"bytes,14,opt,name=state_overrides,json=stateOverrides,proto3" json:"stateOverrides"` + // block overrides block context fields encoded as json + BlockOverrides []byte `protobuf:"bytes,15,opt,name=block_overrides,json=blockOverrides,proto3" json:"blockOverrides"` +} + +func (m *TraceConfig) Reset() { *m = TraceConfig{} } +func (m *TraceConfig) String() string { return proto.CompactTextString(m) } +func (*TraceConfig) ProtoMessage() {} +func (*TraceConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_c7e91cf99012bf9d, []int{0} +} +func (m *TraceConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TraceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TraceConfig.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TraceConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_TraceConfig.Merge(m, src) +} +func (m *TraceConfig) XXX_Size() int { + return m.Size() +} +func (m *TraceConfig) XXX_DiscardUnknown() { + xxx_messageInfo_TraceConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_TraceConfig proto.InternalMessageInfo + +func (m *TraceConfig) GetTracer() string { + if m != nil { + return m.Tracer + } + return "" +} + +func (m *TraceConfig) GetTimeout() string { + if m != nil { + return m.Timeout + } + return "" +} + +func (m *TraceConfig) GetReexec() uint64 { + if m != nil { + return m.Reexec + } + return 0 +} + +func (m *TraceConfig) GetDisableStack() bool { + if m != nil { + return m.DisableStack + } + return false +} + +func (m *TraceConfig) GetDisableStorage() bool { + if m != nil { + return m.DisableStorage + } + return false +} + +func (m *TraceConfig) GetDebug() bool { + if m != nil { + return m.Debug + } + return false +} + +func (m *TraceConfig) GetLimit() int32 { + if m != nil { + return m.Limit + } + return 0 +} + +func (m *TraceConfig) GetOverrides() *ChainConfig { + if m != nil { + return m.Overrides + } + return nil +} + +func (m *TraceConfig) GetEnableMemory() bool { + if m != nil { + return m.EnableMemory + } + return false +} + +func (m *TraceConfig) GetEnableReturnData() bool { + if m != nil { + return m.EnableReturnData + } + return false +} + +func (m *TraceConfig) GetTracerJsonConfig() string { + if m != nil { + return m.TracerJsonConfig + } + return "" +} + +func (m *TraceConfig) GetStateOverrides() []byte { + if m != nil { + return m.StateOverrides + } + return nil +} + +func (m *TraceConfig) GetBlockOverrides() []byte { + if m != nil { + return m.BlockOverrides + } + return nil +} + +func init() { + proto.RegisterType((*TraceConfig)(nil), "injective.evm.v1.TraceConfig") +} + +func init() { + proto.RegisterFile("injective/evm/v1/trace_config.proto", fileDescriptor_c7e91cf99012bf9d) +} + +var fileDescriptor_c7e91cf99012bf9d = []byte{ + // 492 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x93, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0x1b, 0x68, 0xbb, 0xd6, 0xed, 0xb6, 0xc8, 0x54, 0xc8, 0x9a, 0x44, 0x1a, 0xc1, 0x25, + 0x17, 0x12, 0x0d, 0xc4, 0x69, 0x12, 0x87, 0x8e, 0xcb, 0x2a, 0x10, 0x92, 0xe1, 0xc4, 0xa5, 0x72, + 0xdc, 0x97, 0xcc, 0x5b, 0x53, 0x4f, 0x8e, 0x1b, 0xb1, 0x6f, 0xc1, 0x99, 0x4f, 0xc4, 0x71, 0x47, + 0x4e, 0x15, 0x6a, 0x6f, 0xfd, 0x14, 0x93, 0xed, 0xf4, 0xef, 0x6e, 0xf9, 0xbd, 0xcf, 0xfb, 0xc4, + 0x7e, 0xdf, 0x47, 0x46, 0x6f, 0xc4, 0xf4, 0x06, 0xb8, 0x16, 0x25, 0x24, 0x50, 0xe6, 0x49, 0x79, + 0x9e, 0x68, 0xc5, 0x38, 0x8c, 0xb8, 0x9c, 0xfe, 0x14, 0x59, 0x7c, 0xa7, 0xa4, 0x96, 0xd8, 0xdf, + 0x34, 0xc5, 0x50, 0xe6, 0x71, 0x79, 0x7e, 0xd6, 0xcb, 0x64, 0x26, 0xad, 0x98, 0x98, 0x2f, 0xd7, + 0x77, 0xf6, 0xf4, 0x67, 0xfc, 0x9a, 0x89, 0xe9, 0xde, 0xcf, 0x5e, 0xff, 0x69, 0xa0, 0xce, 0x77, + 0x73, 0xc6, 0xa5, 0xad, 0xe2, 0x97, 0xa8, 0x69, 0x8f, 0x54, 0xc4, 0x0b, 0xbd, 0xa8, 0x4d, 0x2b, + 0xc2, 0x04, 0x1d, 0x69, 0x91, 0x83, 0x9c, 0x69, 0xf2, 0xcc, 0x0a, 0x6b, 0x34, 0x0e, 0x05, 0xf0, + 0x0b, 0x38, 0x79, 0x1e, 0x7a, 0x51, 0x9d, 0x56, 0x84, 0x3f, 0xa0, 0xe3, 0xb1, 0x28, 0x58, 0x3a, + 0x81, 0x51, 0xa1, 0x19, 0xbf, 0x25, 0x8d, 0xd0, 0x8b, 0x5a, 0x03, 0x7f, 0x35, 0xef, 0x77, 0x2b, + 0xe1, 0x9b, 0xa9, 0xd3, 0x3d, 0xc2, 0x17, 0xe8, 0x74, 0x6b, 0x93, 0x8a, 0x65, 0x40, 0x9a, 0xd6, + 0x88, 0x57, 0xf3, 0xfe, 0xc9, 0xa6, 0xd5, 0x2a, 0xf4, 0x80, 0x71, 0x0f, 0x35, 0xc6, 0x90, 0xce, + 0x32, 0xd2, 0x32, 0x16, 0xea, 0xc0, 0x54, 0x27, 0x22, 0x17, 0x9a, 0xb4, 0x43, 0x2f, 0x6a, 0x50, + 0x07, 0xf8, 0x02, 0xb5, 0x65, 0x09, 0x4a, 0x89, 0x31, 0x14, 0x04, 0x85, 0x5e, 0xd4, 0x79, 0xf7, + 0x2a, 0x3e, 0x5c, 0x6d, 0x7c, 0x69, 0x56, 0xe6, 0x76, 0x43, 0xb7, 0xfd, 0x66, 0x38, 0x98, 0xda, + 0x4b, 0xe6, 0x90, 0x4b, 0x75, 0x4f, 0x3a, 0xdb, 0xe1, 0x9c, 0xf0, 0xc5, 0xd6, 0xe9, 0x1e, 0xe1, + 0x01, 0xc2, 0x95, 0x4d, 0x81, 0x9e, 0xa9, 0xe9, 0x68, 0xcc, 0x34, 0x23, 0x5d, 0xeb, 0xed, 0xad, + 0xe6, 0x7d, 0xdf, 0xa9, 0xd4, 0x8a, 0x9f, 0x98, 0x66, 0xf4, 0x49, 0x05, 0x7f, 0x44, 0xd8, 0x65, + 0x32, 0xba, 0x29, 0xe4, 0x3a, 0x4d, 0x72, 0x6c, 0x42, 0x71, 0xe7, 0x3b, 0xb5, 0xba, 0xb3, 0xef, + 0x68, 0x58, 0xc8, 0x6a, 0x0a, 0xb3, 0xe0, 0x42, 0x33, 0x0d, 0xa3, 0xed, 0xf4, 0x27, 0xa1, 0x17, + 0x75, 0xdd, 0x82, 0xad, 0xf4, 0x75, 0xad, 0xd0, 0x03, 0x36, 0xe6, 0x74, 0x22, 0xf9, 0xed, 0x8e, + 0xf9, 0x74, 0x6b, 0xb6, 0xd2, 0x8e, 0x79, 0x9f, 0x87, 0xf5, 0x56, 0xdd, 0x6f, 0x0c, 0xeb, 0xad, + 0x23, 0xbf, 0xb5, 0x49, 0xae, 0xda, 0x1f, 0x7d, 0xb1, 0xe6, 0x9d, 0xc5, 0x0c, 0xf8, 0xdf, 0x45, + 0xe0, 0x3d, 0x2c, 0x02, 0xef, 0xff, 0x22, 0xf0, 0x7e, 0x2f, 0x83, 0xda, 0xc3, 0x32, 0xa8, 0xfd, + 0x5b, 0x06, 0xb5, 0x1f, 0x57, 0x99, 0xd0, 0xd7, 0xb3, 0x34, 0xe6, 0x32, 0x4f, 0xae, 0xd6, 0x99, + 0x7d, 0x66, 0x69, 0x91, 0x6c, 0x12, 0x7c, 0xcb, 0xa5, 0x82, 0x5d, 0x34, 0x49, 0x26, 0xb9, 0x1c, + 0xcf, 0x26, 0x50, 0xd8, 0x17, 0xa1, 0xef, 0xef, 0xa0, 0x48, 0x9b, 0xf6, 0x21, 0xbc, 0x7f, 0x0c, + 0x00, 0x00, 0xff, 0xff, 0xac, 0xd1, 0xa1, 0xe6, 0x7c, 0x03, 0x00, 0x00, +} + +func (m *TraceConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TraceConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TraceConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BlockOverrides) > 0 { + i -= len(m.BlockOverrides) + copy(dAtA[i:], m.BlockOverrides) + i = encodeVarintTraceConfig(dAtA, i, uint64(len(m.BlockOverrides))) + i-- + dAtA[i] = 0x7a + } + if len(m.StateOverrides) > 0 { + i -= len(m.StateOverrides) + copy(dAtA[i:], m.StateOverrides) + i = encodeVarintTraceConfig(dAtA, i, uint64(len(m.StateOverrides))) + i-- + dAtA[i] = 0x72 + } + if len(m.TracerJsonConfig) > 0 { + i -= len(m.TracerJsonConfig) + copy(dAtA[i:], m.TracerJsonConfig) + i = encodeVarintTraceConfig(dAtA, i, uint64(len(m.TracerJsonConfig))) + i-- + dAtA[i] = 0x6a + } + if m.EnableReturnData { + i-- + if m.EnableReturnData { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if m.EnableMemory { + i-- + if m.EnableMemory { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if m.Overrides != nil { + { + size, err := m.Overrides.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTraceConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.Limit != 0 { + i = encodeVarintTraceConfig(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x48 + } + if m.Debug { + i-- + if m.Debug { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.DisableStorage { + i-- + if m.DisableStorage { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.DisableStack { + i-- + if m.DisableStack { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.Reexec != 0 { + i = encodeVarintTraceConfig(dAtA, i, uint64(m.Reexec)) + i-- + dAtA[i] = 0x18 + } + if len(m.Timeout) > 0 { + i -= len(m.Timeout) + copy(dAtA[i:], m.Timeout) + i = encodeVarintTraceConfig(dAtA, i, uint64(len(m.Timeout))) + i-- + dAtA[i] = 0x12 + } + if len(m.Tracer) > 0 { + i -= len(m.Tracer) + copy(dAtA[i:], m.Tracer) + i = encodeVarintTraceConfig(dAtA, i, uint64(len(m.Tracer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTraceConfig(dAtA []byte, offset int, v uint64) int { + offset -= sovTraceConfig(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *TraceConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Tracer) + if l > 0 { + n += 1 + l + sovTraceConfig(uint64(l)) + } + l = len(m.Timeout) + if l > 0 { + n += 1 + l + sovTraceConfig(uint64(l)) + } + if m.Reexec != 0 { + n += 1 + sovTraceConfig(uint64(m.Reexec)) + } + if m.DisableStack { + n += 2 + } + if m.DisableStorage { + n += 2 + } + if m.Debug { + n += 2 + } + if m.Limit != 0 { + n += 1 + sovTraceConfig(uint64(m.Limit)) + } + if m.Overrides != nil { + l = m.Overrides.Size() + n += 1 + l + sovTraceConfig(uint64(l)) + } + if m.EnableMemory { + n += 2 + } + if m.EnableReturnData { + n += 2 + } + l = len(m.TracerJsonConfig) + if l > 0 { + n += 1 + l + sovTraceConfig(uint64(l)) + } + l = len(m.StateOverrides) + if l > 0 { + n += 1 + l + sovTraceConfig(uint64(l)) + } + l = len(m.BlockOverrides) + if l > 0 { + n += 1 + l + sovTraceConfig(uint64(l)) + } + return n +} + +func sovTraceConfig(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTraceConfig(x uint64) (n int) { + return sovTraceConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *TraceConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TraceConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TraceConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tracer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTraceConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTraceConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tracer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTraceConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTraceConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Timeout = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Reexec", wireType) + } + m.Reexec = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Reexec |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableStack", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableStack = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableStorage", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableStorage = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Debug", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Debug = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Overrides", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTraceConfig + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTraceConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Overrides == nil { + m.Overrides = &ChainConfig{} + } + if err := m.Overrides.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableMemory", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableMemory = bool(v != 0) + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableReturnData", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EnableReturnData = bool(v != 0) + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TracerJsonConfig", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTraceConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTraceConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TracerJsonConfig = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateOverrides", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTraceConfig + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTraceConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StateOverrides = append(m.StateOverrides[:0], dAtA[iNdEx:postIndex]...) + if m.StateOverrides == nil { + m.StateOverrides = []byte{} + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockOverrides", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTraceConfig + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTraceConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockOverrides = append(m.BlockOverrides[:0], dAtA[iNdEx:postIndex]...) + if m.BlockOverrides == nil { + m.BlockOverrides = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTraceConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTraceConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTraceConfig(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTraceConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTraceConfig + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTraceConfig + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTraceConfig + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTraceConfig = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTraceConfig = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTraceConfig = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/evm/types/tracer.go b/chain/evm/types/tracer.go new file mode 100644 index 00000000..af99eec2 --- /dev/null +++ b/chain/evm/types/tracer.go @@ -0,0 +1,56 @@ +package types + +import ( + "os" + + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/tracing" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/eth/tracers" + "github.com/ethereum/go-ethereum/eth/tracers/logger" + "github.com/ethereum/go-ethereum/params" +) + +const ( + TracerAccessList = "access_list" + TracerJSON = "json" + TracerStruct = "struct" + TracerMarkdown = "markdown" + TracerFirehose = "firehose" +) + +// NewTracer creates a new Logger tracer to collect execution traces from an +// EVM transaction. +func NewTracer(tracer string, msg *core.Message, rules params.Rules) *tracers.Tracer { + // TODO: enable additional log configuration + logCfg := &logger.Config{ + Debug: true, + } + + var hooks *tracing.Hooks + + switch tracer { + case TracerAccessList: + preCompiles := vm.DefaultActivePrecompiles(rules) + hooks = logger.NewAccessListTracer(msg.AccessList, msg.From, *msg.To, preCompiles).Hooks() + case TracerJSON: + hooks = logger.NewJSONLogger(logCfg, os.Stderr) + case TracerMarkdown: + hooks = logger.NewMarkdownLogger(logCfg, os.Stdout).Hooks() // TODO: Stderr ? + case TracerStruct: + hooks = logger.NewStructLogger(logCfg).Hooks() + default: + // Use noop tracer by default + hooks, _ = tracers.LiveDirectory.New("noop", nil) + } + + return &tracers.Tracer{ + Hooks: hooks, + } +} + +// TxTraceResult is the result of a single transaction trace during a block trace. +type TxTraceResult struct { + Result interface{} `json:"result,omitempty"` // Trace results produced by the tracer + Error string `json:"error,omitempty"` // Trace failure produced by the tracer +} diff --git a/chain/evm/types/transaction_logs.pb.go b/chain/evm/types/transaction_logs.pb.go new file mode 100644 index 00000000..ab74770c --- /dev/null +++ b/chain/evm/types/transaction_logs.pb.go @@ -0,0 +1,387 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/evm/v1/transaction_logs.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// TransactionLogs define the logs generated from a transaction execution +// with a given hash. It it used for import/export data as transactions are not +// persisted on blockchain state after an upgrade. +type TransactionLogs struct { + // hash of the transaction + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + // logs is an array of Logs for the given transaction hash + Logs []*Log `protobuf:"bytes,2,rep,name=logs,proto3" json:"logs,omitempty"` +} + +func (m *TransactionLogs) Reset() { *m = TransactionLogs{} } +func (m *TransactionLogs) String() string { return proto.CompactTextString(m) } +func (*TransactionLogs) ProtoMessage() {} +func (*TransactionLogs) Descriptor() ([]byte, []int) { + return fileDescriptor_d8e2f616001a71e3, []int{0} +} +func (m *TransactionLogs) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionLogs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionLogs.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TransactionLogs) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionLogs.Merge(m, src) +} +func (m *TransactionLogs) XXX_Size() int { + return m.Size() +} +func (m *TransactionLogs) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionLogs.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionLogs proto.InternalMessageInfo + +func (m *TransactionLogs) GetHash() string { + if m != nil { + return m.Hash + } + return "" +} + +func (m *TransactionLogs) GetLogs() []*Log { + if m != nil { + return m.Logs + } + return nil +} + +func init() { + proto.RegisterType((*TransactionLogs)(nil), "injective.evm.v1.TransactionLogs") +} + +func init() { + proto.RegisterFile("injective/evm/v1/transaction_logs.proto", fileDescriptor_d8e2f616001a71e3) +} + +var fileDescriptor_d8e2f616001a71e3 = []byte{ + // 220 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcf, 0xcc, 0xcb, 0x4a, + 0x4d, 0x2e, 0xc9, 0x2c, 0x4b, 0xd5, 0x4f, 0x2d, 0xcb, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x29, 0x4a, + 0xcc, 0x2b, 0x4e, 0x4c, 0x2e, 0xc9, 0xcc, 0xcf, 0x8b, 0xcf, 0xc9, 0x4f, 0x2f, 0xd6, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0x2b, 0xd4, 0x4b, 0x2d, 0xcb, 0xd5, 0x2b, 0x33, 0x94, 0x92, + 0xc2, 0xd0, 0x9a, 0x93, 0x9f, 0x0e, 0x51, 0xad, 0x14, 0xc0, 0xc5, 0x1f, 0x82, 0x30, 0xc7, 0x27, + 0x3f, 0xbd, 0x58, 0x48, 0x88, 0x8b, 0x25, 0x23, 0xb1, 0x38, 0x43, 0x82, 0x51, 0x81, 0x51, 0x83, + 0x33, 0x08, 0xcc, 0x16, 0xd2, 0xe4, 0x62, 0x01, 0x59, 0x21, 0xc1, 0xa4, 0xc0, 0xac, 0xc1, 0x6d, + 0x24, 0xaa, 0x87, 0x6e, 0x87, 0x9e, 0x4f, 0x7e, 0x7a, 0x10, 0x58, 0x89, 0x53, 0xf2, 0x89, 0x47, + 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, + 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x79, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, + 0x25, 0xe7, 0xe7, 0xea, 0x7b, 0xc2, 0x0c, 0xf0, 0x49, 0x4c, 0x2a, 0xd6, 0x87, 0x1b, 0xa7, 0x9b, + 0x9c, 0x5f, 0x94, 0x8a, 0xcc, 0xcd, 0x48, 0xcc, 0xcc, 0xd3, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, + 0x2d, 0x06, 0xbb, 0xbe, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x7a, 0x63, 0x40, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x2a, 0x84, 0xdf, 0xa5, 0x16, 0x01, 0x00, 0x00, +} + +func (m *TransactionLogs) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TransactionLogs) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionLogs) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Logs) > 0 { + for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Logs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTransactionLogs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTransactionLogs(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTransactionLogs(dAtA []byte, offset int, v uint64) int { + offset -= sovTransactionLogs(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *TransactionLogs) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTransactionLogs(uint64(l)) + } + if len(m.Logs) > 0 { + for _, e := range m.Logs { + l = e.Size() + n += 1 + l + sovTransactionLogs(uint64(l)) + } + } + return n +} + +func sovTransactionLogs(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTransactionLogs(x uint64) (n int) { + return sovTransactionLogs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *TransactionLogs) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransactionLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TransactionLogs: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionLogs: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransactionLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTransactionLogs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTransactionLogs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransactionLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTransactionLogs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTransactionLogs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Logs = append(m.Logs, &Log{}) + if err := m.Logs[len(m.Logs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransactionLogs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTransactionLogs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTransactionLogs(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTransactionLogs + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTransactionLogs + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTransactionLogs + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTransactionLogs + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTransactionLogs + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTransactionLogs + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTransactionLogs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTransactionLogs = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTransactionLogs = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/evm/types/tx.go b/chain/evm/types/tx.go new file mode 100644 index 00000000..c197909f --- /dev/null +++ b/chain/evm/types/tx.go @@ -0,0 +1,56 @@ +package types + +import ( + "math" + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/vm" +) + +// GetTxPriority returns the priority of a given Ethereum tx. It relies of the +// priority reduction global variable to calculate the tx priority given the tx +// tip price: +// +// tx_priority = tip_price / priority_reduction +func GetTxPriority(msg *MsgEthereumTx, baseFee *big.Int) (priority int64) { + // calculate priority based on effective gas price + tipPrice := msg.GetEffectiveGasPrice(baseFee) + // if london hardfork is not enabled, tipPrice is the gasPrice + if baseFee != nil { + tipPrice = new(big.Int).Sub(tipPrice, baseFee) + } + + priority = math.MaxInt64 + priorityBig := new(big.Int).Quo(tipPrice, DefaultPriorityReduction.BigInt()) + + // safety check + if priorityBig.IsInt64() { + priority = priorityBig.Int64() + } + + return priority +} + +// Failed returns if the contract execution failed in vm errors +func (m *MsgEthereumTxResponse) Failed() bool { + return len(m.VmError) > 0 +} + +// Return is a helper function to help caller distinguish between revert reason +// and function return. Return returns the data after execution if no error occurs. +func (m *MsgEthereumTxResponse) Return() []byte { + if m.Failed() { + return nil + } + return common.CopyBytes(m.Ret) +} + +// Revert returns the concrete revert reason if the execution is aborted by `REVERT` +// opcode. Note the reason can be nil if no data supplied with revert opcode. +func (m *MsgEthereumTxResponse) Revert() []byte { + if m.VmError != vm.ErrExecutionReverted.Error() { + return nil + } + return common.CopyBytes(m.Ret) +} diff --git a/chain/evm/types/tx.pb.go b/chain/evm/types/tx.pb.go new file mode 100644 index 00000000..8c569514 --- /dev/null +++ b/chain/evm/types/tx.pb.go @@ -0,0 +1,3411 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/evm/v1/tx.proto + +package types + +import ( + context "context" + cosmossdk_io_math "cosmossdk.io/math" + encoding_binary "encoding/binary" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgEthereumTx encapsulates an Ethereum transaction as an SDK message. +type MsgEthereumTx struct { + // data is inner transaction data of the Ethereum transaction + Data *types.Any `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + // size is the encoded storage size of the transaction (DEPRECATED) + Size_ float64 `protobuf:"fixed64,2,opt,name=size,proto3" json:"-"` + // hash of the transaction in hex format + DeprecatedHash string `protobuf:"bytes,3,opt,name=deprecated_hash,json=deprecatedHash,proto3" json:"deprecated_hash,omitempty" rlp:"-"` + DeprecatedFrom string `protobuf:"bytes,4,opt,name=deprecated_from,json=deprecatedFrom,proto3" json:"deprecated_from,omitempty"` // Deprecated: Do not use. + // from is the bytes of ethereum signer address. This address value is checked + // against the address derived from the signature (V, R, S) using the + // secp256k1 elliptic curve + From []byte `protobuf:"bytes,5,opt,name=from,proto3" json:"from,omitempty"` + // raw is the raw bytes of the ethereum transaction + Raw EthereumTx `protobuf:"bytes,6,opt,name=raw,proto3,customtype=EthereumTx" json:"raw"` +} + +func (m *MsgEthereumTx) Reset() { *m = MsgEthereumTx{} } +func (m *MsgEthereumTx) String() string { return proto.CompactTextString(m) } +func (*MsgEthereumTx) ProtoMessage() {} +func (*MsgEthereumTx) Descriptor() ([]byte, []int) { + return fileDescriptor_7f62438576d4fe29, []int{0} +} +func (m *MsgEthereumTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEthereumTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEthereumTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgEthereumTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEthereumTx.Merge(m, src) +} +func (m *MsgEthereumTx) XXX_Size() int { + return m.Size() +} +func (m *MsgEthereumTx) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEthereumTx.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEthereumTx proto.InternalMessageInfo + +// LegacyTx is the transaction data of regular Ethereum transactions. +// NOTE: All non-protected transactions (i.e non EIP155 signed) will fail if the +// AllowUnprotectedTxs parameter is disabled. +type LegacyTx struct { + // nonce corresponds to the account nonce (transaction sequence). + Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` + // gas_price defines the value for each gas unit + GasPrice *cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=gas_price,json=gasPrice,proto3,customtype=cosmossdk.io/math.Int" json:"gas_price,omitempty"` + // gas defines the gas limit defined for the transaction. + GasLimit uint64 `protobuf:"varint,3,opt,name=gas,proto3" json:"gas,omitempty"` + // to is the hex formatted address of the recipient + To string `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"` + // value defines the unsigned integer value of the transaction amount. + Amount *cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=value,proto3,customtype=cosmossdk.io/math.Int" json:"value,omitempty"` + // data is the data payload bytes of the transaction. + Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` + // v defines the signature value + V []byte `protobuf:"bytes,7,opt,name=v,proto3" json:"v,omitempty"` + // r defines the signature value + R []byte `protobuf:"bytes,8,opt,name=r,proto3" json:"r,omitempty"` + // s define the signature value + S []byte `protobuf:"bytes,9,opt,name=s,proto3" json:"s,omitempty"` +} + +func (m *LegacyTx) Reset() { *m = LegacyTx{} } +func (m *LegacyTx) String() string { return proto.CompactTextString(m) } +func (*LegacyTx) ProtoMessage() {} +func (*LegacyTx) Descriptor() ([]byte, []int) { + return fileDescriptor_7f62438576d4fe29, []int{1} +} +func (m *LegacyTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LegacyTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LegacyTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LegacyTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_LegacyTx.Merge(m, src) +} +func (m *LegacyTx) XXX_Size() int { + return m.Size() +} +func (m *LegacyTx) XXX_DiscardUnknown() { + xxx_messageInfo_LegacyTx.DiscardUnknown(m) +} + +var xxx_messageInfo_LegacyTx proto.InternalMessageInfo + +// AccessListTx is the data of EIP-2930 access list transactions. +type AccessListTx struct { + // chain_id of the destination EVM chain + ChainID *cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3,customtype=cosmossdk.io/math.Int" json:"chainID"` + // nonce corresponds to the account nonce (transaction sequence). + Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` + // gas_price defines the value for each gas unit + GasPrice *cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=gas_price,json=gasPrice,proto3,customtype=cosmossdk.io/math.Int" json:"gas_price,omitempty"` + // gas defines the gas limit defined for the transaction. + GasLimit uint64 `protobuf:"varint,4,opt,name=gas,proto3" json:"gas,omitempty"` + // to is the recipient address in hex format + To string `protobuf:"bytes,5,opt,name=to,proto3" json:"to,omitempty"` + // value defines the unsigned integer value of the transaction amount. + Amount *cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=value,proto3,customtype=cosmossdk.io/math.Int" json:"value,omitempty"` + // data is the data payload bytes of the transaction. + Data []byte `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` + // accesses is an array of access tuples + Accesses AccessList `protobuf:"bytes,8,rep,name=accesses,proto3,castrepeated=AccessList" json:"accessList"` + // v defines the signature value + V []byte `protobuf:"bytes,9,opt,name=v,proto3" json:"v,omitempty"` + // r defines the signature value + R []byte `protobuf:"bytes,10,opt,name=r,proto3" json:"r,omitempty"` + // s define the signature value + S []byte `protobuf:"bytes,11,opt,name=s,proto3" json:"s,omitempty"` +} + +func (m *AccessListTx) Reset() { *m = AccessListTx{} } +func (m *AccessListTx) String() string { return proto.CompactTextString(m) } +func (*AccessListTx) ProtoMessage() {} +func (*AccessListTx) Descriptor() ([]byte, []int) { + return fileDescriptor_7f62438576d4fe29, []int{2} +} +func (m *AccessListTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AccessListTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AccessListTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AccessListTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccessListTx.Merge(m, src) +} +func (m *AccessListTx) XXX_Size() int { + return m.Size() +} +func (m *AccessListTx) XXX_DiscardUnknown() { + xxx_messageInfo_AccessListTx.DiscardUnknown(m) +} + +var xxx_messageInfo_AccessListTx proto.InternalMessageInfo + +// DynamicFeeTx is the data of EIP-1559 dinamic fee transactions. +type DynamicFeeTx struct { + // chain_id of the destination EVM chain + ChainID *cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3,customtype=cosmossdk.io/math.Int" json:"chainID"` + // nonce corresponds to the account nonce (transaction sequence). + Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` + // gas_tip_cap defines the max value for the gas tip + GasTipCap *cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=gas_tip_cap,json=gasTipCap,proto3,customtype=cosmossdk.io/math.Int" json:"gas_tip_cap,omitempty"` + // gas_fee_cap defines the max value for the gas fee + GasFeeCap *cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=gas_fee_cap,json=gasFeeCap,proto3,customtype=cosmossdk.io/math.Int" json:"gas_fee_cap,omitempty"` + // gas defines the gas limit defined for the transaction. + GasLimit uint64 `protobuf:"varint,5,opt,name=gas,proto3" json:"gas,omitempty"` + // to is the hex formatted address of the recipient + To string `protobuf:"bytes,6,opt,name=to,proto3" json:"to,omitempty"` + // value defines the the transaction amount. + Amount *cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=value,proto3,customtype=cosmossdk.io/math.Int" json:"value,omitempty"` + // data is the data payload bytes of the transaction. + Data []byte `protobuf:"bytes,8,opt,name=data,proto3" json:"data,omitempty"` + // accesses is an array of access tuples + Accesses AccessList `protobuf:"bytes,9,rep,name=accesses,proto3,castrepeated=AccessList" json:"accessList"` + // v defines the signature value + V []byte `protobuf:"bytes,10,opt,name=v,proto3" json:"v,omitempty"` + // r defines the signature value + R []byte `protobuf:"bytes,11,opt,name=r,proto3" json:"r,omitempty"` + // s define the signature value + S []byte `protobuf:"bytes,12,opt,name=s,proto3" json:"s,omitempty"` +} + +func (m *DynamicFeeTx) Reset() { *m = DynamicFeeTx{} } +func (m *DynamicFeeTx) String() string { return proto.CompactTextString(m) } +func (*DynamicFeeTx) ProtoMessage() {} +func (*DynamicFeeTx) Descriptor() ([]byte, []int) { + return fileDescriptor_7f62438576d4fe29, []int{3} +} +func (m *DynamicFeeTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DynamicFeeTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DynamicFeeTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DynamicFeeTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_DynamicFeeTx.Merge(m, src) +} +func (m *DynamicFeeTx) XXX_Size() int { + return m.Size() +} +func (m *DynamicFeeTx) XXX_DiscardUnknown() { + xxx_messageInfo_DynamicFeeTx.DiscardUnknown(m) +} + +var xxx_messageInfo_DynamicFeeTx proto.InternalMessageInfo + +// ExtensionOptionsEthereumTx is an extension option for ethereum transactions +type ExtensionOptionsEthereumTx struct { +} + +func (m *ExtensionOptionsEthereumTx) Reset() { *m = ExtensionOptionsEthereumTx{} } +func (m *ExtensionOptionsEthereumTx) String() string { return proto.CompactTextString(m) } +func (*ExtensionOptionsEthereumTx) ProtoMessage() {} +func (*ExtensionOptionsEthereumTx) Descriptor() ([]byte, []int) { + return fileDescriptor_7f62438576d4fe29, []int{4} +} +func (m *ExtensionOptionsEthereumTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExtensionOptionsEthereumTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExtensionOptionsEthereumTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExtensionOptionsEthereumTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExtensionOptionsEthereumTx.Merge(m, src) +} +func (m *ExtensionOptionsEthereumTx) XXX_Size() int { + return m.Size() +} +func (m *ExtensionOptionsEthereumTx) XXX_DiscardUnknown() { + xxx_messageInfo_ExtensionOptionsEthereumTx.DiscardUnknown(m) +} + +var xxx_messageInfo_ExtensionOptionsEthereumTx proto.InternalMessageInfo + +// MsgEthereumTxResponse defines the Msg/EthereumTx response type. +type MsgEthereumTxResponse struct { + // hash of the ethereum transaction in hex format. This hash differs from the + // Tendermint sha256 hash of the transaction bytes. See + // https://github.com/tendermint/tendermint/issues/6539 for reference + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + // logs contains the transaction hash and the proto-compatible ethereum + // logs. + Logs []*Log `protobuf:"bytes,2,rep,name=logs,proto3" json:"logs,omitempty"` + // ret is the returned data from evm function (result or data supplied with revert + // opcode) + Ret []byte `protobuf:"bytes,3,opt,name=ret,proto3" json:"ret,omitempty"` + // vm_error is the error returned by vm execution + VmError string `protobuf:"bytes,4,opt,name=vm_error,json=vmError,proto3" json:"vm_error,omitempty"` + // gas_used specifies how much gas was consumed by the transaction + GasUsed uint64 `protobuf:"varint,5,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + // include the block hash for json-rpc to use + BlockHash []byte `protobuf:"bytes,6,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` +} + +func (m *MsgEthereumTxResponse) Reset() { *m = MsgEthereumTxResponse{} } +func (m *MsgEthereumTxResponse) String() string { return proto.CompactTextString(m) } +func (*MsgEthereumTxResponse) ProtoMessage() {} +func (*MsgEthereumTxResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7f62438576d4fe29, []int{5} +} +func (m *MsgEthereumTxResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEthereumTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEthereumTxResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgEthereumTxResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEthereumTxResponse.Merge(m, src) +} +func (m *MsgEthereumTxResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgEthereumTxResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEthereumTxResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEthereumTxResponse proto.InternalMessageInfo + +// MsgUpdateParams defines a Msg for updating the x/evm module parameters. +type MsgUpdateParams struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/evm parameters to update. + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_7f62438576d4fe29, []int{6} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7f62438576d4fe29, []int{7} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgEthereumTx)(nil), "injective.evm.v1.MsgEthereumTx") + proto.RegisterType((*LegacyTx)(nil), "injective.evm.v1.LegacyTx") + proto.RegisterType((*AccessListTx)(nil), "injective.evm.v1.AccessListTx") + proto.RegisterType((*DynamicFeeTx)(nil), "injective.evm.v1.DynamicFeeTx") + proto.RegisterType((*ExtensionOptionsEthereumTx)(nil), "injective.evm.v1.ExtensionOptionsEthereumTx") + proto.RegisterType((*MsgEthereumTxResponse)(nil), "injective.evm.v1.MsgEthereumTxResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "injective.evm.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "injective.evm.v1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("injective/evm/v1/tx.proto", fileDescriptor_7f62438576d4fe29) } + +var fileDescriptor_7f62438576d4fe29 = []byte{ + // 1083 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0xda, 0xeb, 0x5f, 0x63, 0x37, 0xad, 0x46, 0x89, 0xba, 0xb6, 0xbe, 0xf1, 0xfa, 0xbb, + 0x05, 0xe1, 0x16, 0x65, 0x57, 0x0d, 0xa8, 0x52, 0x73, 0xcb, 0x36, 0x09, 0x04, 0x25, 0xa2, 0x5a, + 0xdc, 0x0b, 0x20, 0x59, 0x93, 0xdd, 0xc9, 0x7a, 0xa9, 0x77, 0x67, 0xb5, 0x33, 0x5e, 0x6c, 0x24, + 0xa4, 0xaa, 0x27, 0x8e, 0x54, 0xfc, 0x03, 0x9c, 0x39, 0xf5, 0xd0, 0x33, 0x17, 0x2e, 0x15, 0xa7, + 0x0a, 0x2e, 0xa8, 0x07, 0x83, 0x12, 0xa4, 0x8a, 0x1c, 0x39, 0x73, 0x40, 0x33, 0xb3, 0x8e, 0xe3, + 0x9a, 0x24, 0x50, 0x09, 0x6e, 0xf3, 0xe6, 0x7d, 0xde, 0xcc, 0x7b, 0x9f, 0xcf, 0xec, 0x7b, 0x0b, + 0xea, 0x41, 0xf4, 0x09, 0x76, 0x59, 0x90, 0x62, 0x0b, 0xa7, 0xa1, 0x95, 0xde, 0xb4, 0xd8, 0xd0, + 0x8c, 0x13, 0xc2, 0x08, 0xbc, 0x72, 0xe2, 0x32, 0x71, 0x1a, 0x9a, 0xe9, 0xcd, 0xc6, 0x55, 0x97, + 0xd0, 0x90, 0x50, 0x2b, 0xa4, 0x3e, 0x47, 0x86, 0xd4, 0x97, 0xd0, 0x46, 0x5d, 0x3a, 0xba, 0xc2, + 0xb2, 0xa4, 0x91, 0xb9, 0x96, 0x7c, 0xe2, 0x13, 0xb9, 0xcf, 0x57, 0xd9, 0xee, 0xff, 0x7c, 0x42, + 0xfc, 0x3e, 0xb6, 0x50, 0x1c, 0x58, 0x28, 0x8a, 0x08, 0x43, 0x2c, 0x20, 0xd1, 0x24, 0xa6, 0x9e, + 0x79, 0x85, 0xb5, 0x3f, 0x38, 0xb0, 0x50, 0x34, 0xca, 0x5c, 0xd7, 0xe6, 0xf2, 0x45, 0xae, 0x8b, + 0x29, 0xed, 0xb2, 0x41, 0xdc, 0xc7, 0x19, 0xa8, 0x31, 0x07, 0xea, 0x93, 0x49, 0xaa, 0x2b, 0x73, + 0xbe, 0x18, 0x25, 0x28, 0xcc, 0xae, 0x36, 0x1e, 0xe4, 0xc0, 0xa5, 0x3d, 0xea, 0x6f, 0xb1, 0x1e, + 0x4e, 0xf0, 0x20, 0xec, 0x0c, 0x61, 0x1b, 0xa8, 0x1e, 0x62, 0x48, 0x53, 0x5a, 0x4a, 0xbb, 0xba, + 0xb6, 0x64, 0xca, 0xdc, 0xcc, 0x49, 0x6e, 0xe6, 0x46, 0x34, 0x72, 0x04, 0x02, 0xd6, 0x81, 0x4a, + 0x83, 0xcf, 0xb0, 0x96, 0x6b, 0x29, 0x6d, 0xc5, 0x2e, 0x1c, 0x8f, 0x75, 0x65, 0xd5, 0x11, 0x5b, + 0xf0, 0x6d, 0x70, 0xd9, 0xc3, 0x71, 0x82, 0x5d, 0xc4, 0xb0, 0xd7, 0xed, 0x21, 0xda, 0xd3, 0xf2, + 0x2d, 0xa5, 0x5d, 0xb1, 0xab, 0xbf, 0x8f, 0xf5, 0x52, 0xd2, 0x8f, 0xd7, 0x8d, 0x55, 0xc3, 0x59, + 0x9c, 0x62, 0xde, 0x45, 0xb4, 0x07, 0xdf, 0x9c, 0x89, 0x3a, 0x48, 0x48, 0xa8, 0xa9, 0x22, 0x2a, + 0xa7, 0x29, 0xa7, 0xc1, 0xdb, 0x09, 0x09, 0x21, 0x04, 0xaa, 0x40, 0x14, 0x5a, 0x4a, 0xbb, 0xe6, + 0x88, 0x35, 0x7c, 0x0d, 0xe4, 0x13, 0xf4, 0xa9, 0x56, 0xe4, 0x5b, 0x36, 0x7c, 0x3a, 0xd6, 0x17, + 0x9e, 0x8f, 0x75, 0x30, 0x2d, 0xce, 0xe1, 0xee, 0xf5, 0x4b, 0x5f, 0x7c, 0xad, 0x2f, 0x3c, 0x7c, + 0xf1, 0xf8, 0x86, 0x08, 0x32, 0x1e, 0xe5, 0x40, 0x79, 0x17, 0xfb, 0xc8, 0x1d, 0x75, 0x86, 0x70, + 0x09, 0x14, 0x22, 0x12, 0xb9, 0x58, 0x94, 0xaf, 0x3a, 0xd2, 0x80, 0xb7, 0x40, 0xc5, 0x47, 0x5c, + 0xee, 0xc0, 0x95, 0xe5, 0x56, 0xec, 0xfa, 0xf3, 0xb1, 0xbe, 0x2c, 0x95, 0xa7, 0xde, 0x7d, 0x33, + 0x20, 0x56, 0x88, 0x58, 0xcf, 0xdc, 0x89, 0x98, 0x53, 0xf6, 0x11, 0xbd, 0xcb, 0xa1, 0xb0, 0x09, + 0xf2, 0x3e, 0xa2, 0xa2, 0x74, 0xd5, 0xae, 0x1d, 0x8e, 0xf5, 0xf2, 0x3b, 0x88, 0xee, 0x06, 0x61, + 0xc0, 0x1c, 0xee, 0x80, 0x8b, 0x20, 0xc7, 0x88, 0xac, 0xd1, 0xc9, 0x31, 0x02, 0x6f, 0x83, 0x42, + 0x8a, 0xfa, 0x03, 0x2c, 0x8a, 0xaa, 0xd8, 0xd7, 0xce, 0xbc, 0xe3, 0x70, 0xac, 0x17, 0x37, 0x42, + 0x32, 0x88, 0x98, 0x23, 0x23, 0x38, 0x1d, 0x42, 0xb6, 0xa2, 0xa4, 0x43, 0x08, 0x54, 0x03, 0x4a, + 0xaa, 0x95, 0xc4, 0x86, 0x92, 0x72, 0x2b, 0xd1, 0xca, 0xd2, 0x4a, 0xb8, 0x45, 0xb5, 0x8a, 0xb4, + 0xe8, 0xfa, 0x22, 0xa7, 0xe4, 0xfb, 0x27, 0xab, 0xc5, 0xce, 0x70, 0x13, 0x31, 0x64, 0x7c, 0x9b, + 0x07, 0xb5, 0x0d, 0xf1, 0xd0, 0x76, 0x03, 0xca, 0x3a, 0x43, 0xf8, 0x1e, 0x28, 0xbb, 0x3d, 0x14, + 0x44, 0xdd, 0xc0, 0x13, 0xd4, 0x54, 0x6c, 0xeb, 0xbc, 0xe4, 0x4a, 0x77, 0x38, 0x78, 0x67, 0xf3, + 0x78, 0xac, 0x97, 0x5c, 0xb9, 0x74, 0xb2, 0x85, 0x37, 0xe5, 0x38, 0x77, 0x26, 0xc7, 0xf9, 0x7f, + 0xcc, 0xb1, 0x7a, 0x3e, 0xc7, 0x85, 0x79, 0x8e, 0x8b, 0xaf, 0xcc, 0x71, 0xe9, 0x14, 0xc7, 0x1f, + 0x81, 0xb2, 0xfc, 0x22, 0x31, 0xd5, 0xca, 0xad, 0x7c, 0xbb, 0xba, 0xb6, 0x62, 0xbe, 0xdc, 0x48, + 0x4c, 0x49, 0x65, 0x87, 0x7f, 0xb2, 0x76, 0x8b, 0x3f, 0xcb, 0xe3, 0xb1, 0x0e, 0xd0, 0x09, 0xbf, + 0xdf, 0xfc, 0xac, 0x83, 0x29, 0xdb, 0xce, 0xc9, 0x81, 0x52, 0xc0, 0xca, 0x8c, 0x80, 0x60, 0x46, + 0xc0, 0xea, 0x59, 0x02, 0xfe, 0x91, 0x07, 0xb5, 0xcd, 0x51, 0x84, 0xc2, 0xc0, 0xdd, 0xc6, 0xf8, + 0x3f, 0x11, 0xf0, 0x36, 0xa8, 0x72, 0x01, 0x59, 0x10, 0x77, 0x5d, 0x14, 0x5f, 0x2c, 0x21, 0x97, + 0xbb, 0x13, 0xc4, 0x77, 0x50, 0x3c, 0x09, 0x3d, 0xc0, 0x58, 0x84, 0xaa, 0x7f, 0x27, 0x74, 0x1b, + 0x63, 0x1e, 0x9a, 0xc9, 0x5f, 0x38, 0x5f, 0xfe, 0xe2, 0xbc, 0xfc, 0xa5, 0x57, 0x96, 0xbf, 0x7c, + 0x86, 0xfc, 0x95, 0x7f, 0x45, 0x7e, 0x30, 0x23, 0x7f, 0x75, 0x46, 0xfe, 0xda, 0x59, 0xf2, 0x1b, + 0xa0, 0xb1, 0x35, 0x64, 0x38, 0xa2, 0x01, 0x89, 0xde, 0x8f, 0xc5, 0xac, 0x99, 0x76, 0xc1, 0x75, + 0x95, 0xa3, 0x8d, 0xef, 0x14, 0xb0, 0x3c, 0xd3, 0xfa, 0x1d, 0x4c, 0x63, 0x12, 0x51, 0x51, 0xa8, + 0x68, 0xd9, 0xe2, 0x9d, 0x38, 0x62, 0x0d, 0xaf, 0x03, 0xb5, 0x4f, 0x7c, 0xaa, 0xe5, 0x44, 0x91, + 0xcb, 0xf3, 0x45, 0xee, 0x12, 0xdf, 0x11, 0x10, 0x78, 0x05, 0xe4, 0x13, 0xcc, 0xc4, 0x03, 0xa8, + 0x39, 0x7c, 0x09, 0xeb, 0xa0, 0x9c, 0x86, 0x5d, 0x9c, 0x24, 0x24, 0xc9, 0xba, 0x5d, 0x29, 0x0d, + 0xb7, 0xb8, 0xc9, 0x5d, 0x5c, 0xfa, 0x01, 0xc5, 0x9e, 0x14, 0xd1, 0x29, 0xf9, 0x88, 0xde, 0xa3, + 0xd8, 0x83, 0x2b, 0x00, 0xec, 0xf7, 0x89, 0x7b, 0x5f, 0xce, 0x0f, 0xd9, 0xd8, 0x2a, 0x62, 0x87, + 0x4f, 0x8b, 0xac, 0x8a, 0x47, 0x0a, 0xb8, 0xbc, 0x47, 0xfd, 0x7b, 0xb1, 0x87, 0x18, 0xbe, 0x2b, + 0x46, 0x1b, 0x6f, 0x25, 0x68, 0xc0, 0x7a, 0x24, 0x09, 0xd8, 0x28, 0x7b, 0xec, 0xda, 0x0f, 0x4f, + 0x56, 0x97, 0xb2, 0x41, 0xbd, 0xe1, 0x79, 0x09, 0xa6, 0xf4, 0x03, 0x96, 0x04, 0x91, 0xef, 0x4c, + 0xa1, 0xf0, 0x16, 0x28, 0xca, 0xe1, 0x28, 0x1e, 0x76, 0x75, 0x4d, 0x9b, 0xaf, 0x52, 0xde, 0x60, + 0xab, 0x5c, 0x45, 0x27, 0x43, 0xaf, 0x2f, 0xf2, 0x61, 0x32, 0x3d, 0xc7, 0xa8, 0x83, 0xab, 0x2f, + 0xa5, 0x34, 0xa1, 0x76, 0xed, 0x37, 0x05, 0xe4, 0xf7, 0xa8, 0x0f, 0x3f, 0x07, 0xa7, 0xc6, 0x12, + 0xd4, 0xe7, 0x2f, 0x9a, 0x51, 0xa6, 0xf1, 0xc6, 0x05, 0x80, 0xc9, 0xf9, 0xc6, 0xeb, 0x0f, 0x7f, + 0xfc, 0xf5, 0xab, 0x9c, 0x6e, 0xac, 0x58, 0x73, 0x73, 0x1f, 0x67, 0xe8, 0x2e, 0x1b, 0xc2, 0x8f, + 0x41, 0x6d, 0x86, 0xb1, 0xff, 0xff, 0xe5, 0xf9, 0xa7, 0x21, 0x8d, 0xeb, 0x17, 0x42, 0x26, 0x49, + 0x34, 0x0a, 0x0f, 0x5e, 0x3c, 0xbe, 0xa1, 0xd8, 0xee, 0xd3, 0xc3, 0xa6, 0xf2, 0xec, 0xb0, 0xa9, + 0xfc, 0x72, 0xd8, 0x54, 0xbe, 0x3c, 0x6a, 0x2e, 0x3c, 0x3b, 0x6a, 0x2e, 0xfc, 0x74, 0xd4, 0x5c, + 0xf8, 0x70, 0xc7, 0x0f, 0x58, 0x6f, 0xb0, 0x6f, 0xba, 0x24, 0xb4, 0x76, 0x26, 0xa7, 0xee, 0xa2, + 0x7d, 0x3a, 0xcd, 0x7a, 0xd5, 0x25, 0x09, 0x3e, 0x6d, 0xf2, 0xde, 0x63, 0x85, 0xc4, 0x1b, 0xf4, + 0x31, 0x15, 0x25, 0xb1, 0x51, 0x8c, 0xe9, 0x7e, 0x51, 0xfc, 0x98, 0xbc, 0xf5, 0x67, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xd7, 0x70, 0xb1, 0xf4, 0xd9, 0x09, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // EthereumTx defines a method submitting Ethereum transactions. + EthereumTx(ctx context.Context, in *MsgEthereumTx, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) + // UpdateParams defined a governance operation for updating the x/evm module parameters. + // The authority is hard-coded to the Cosmos SDK x/gov module account + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) EthereumTx(ctx context.Context, in *MsgEthereumTx, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) { + out := new(MsgEthereumTxResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Msg/EthereumTx", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/injective.evm.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // EthereumTx defines a method submitting Ethereum transactions. + EthereumTx(context.Context, *MsgEthereumTx) (*MsgEthereumTxResponse, error) + // UpdateParams defined a governance operation for updating the x/evm module parameters. + // The authority is hard-coded to the Cosmos SDK x/gov module account + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) EthereumTx(ctx context.Context, req *MsgEthereumTx) (*MsgEthereumTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EthereumTx not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_EthereumTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgEthereumTx) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).EthereumTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Msg/EthereumTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EthereumTx(ctx, req.(*MsgEthereumTx)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.evm.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "injective.evm.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EthereumTx", + Handler: _Msg_EthereumTx_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "injective/evm/v1/tx.proto", +} + +func (m *MsgEthereumTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgEthereumTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEthereumTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Raw.Size() + i -= size + if _, err := m.Raw.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if len(m.From) > 0 { + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintTx(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0x2a + } + if len(m.DeprecatedFrom) > 0 { + i -= len(m.DeprecatedFrom) + copy(dAtA[i:], m.DeprecatedFrom) + i = encodeVarintTx(dAtA, i, uint64(len(m.DeprecatedFrom))) + i-- + dAtA[i] = 0x22 + } + if len(m.DeprecatedHash) > 0 { + i -= len(m.DeprecatedHash) + copy(dAtA[i:], m.DeprecatedHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.DeprecatedHash))) + i-- + dAtA[i] = 0x1a + } + if m.Size_ != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Size_)))) + i-- + dAtA[i] = 0x11 + } + if m.Data != nil { + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LegacyTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LegacyTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LegacyTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.S) > 0 { + i -= len(m.S) + copy(dAtA[i:], m.S) + i = encodeVarintTx(dAtA, i, uint64(len(m.S))) + i-- + dAtA[i] = 0x4a + } + if len(m.R) > 0 { + i -= len(m.R) + copy(dAtA[i:], m.R) + i = encodeVarintTx(dAtA, i, uint64(len(m.R))) + i-- + dAtA[i] = 0x42 + } + if len(m.V) > 0 { + i -= len(m.V) + copy(dAtA[i:], m.V) + i = encodeVarintTx(dAtA, i, uint64(len(m.V))) + i-- + dAtA[i] = 0x3a + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTx(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x32 + } + if m.Amount != nil { + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.To) > 0 { + i -= len(m.To) + copy(dAtA[i:], m.To) + i = encodeVarintTx(dAtA, i, uint64(len(m.To))) + i-- + dAtA[i] = 0x22 + } + if m.GasLimit != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.GasLimit)) + i-- + dAtA[i] = 0x18 + } + if m.GasPrice != nil { + { + size := m.GasPrice.Size() + i -= size + if _, err := m.GasPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Nonce != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Nonce)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AccessListTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AccessListTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccessListTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.S) > 0 { + i -= len(m.S) + copy(dAtA[i:], m.S) + i = encodeVarintTx(dAtA, i, uint64(len(m.S))) + i-- + dAtA[i] = 0x5a + } + if len(m.R) > 0 { + i -= len(m.R) + copy(dAtA[i:], m.R) + i = encodeVarintTx(dAtA, i, uint64(len(m.R))) + i-- + dAtA[i] = 0x52 + } + if len(m.V) > 0 { + i -= len(m.V) + copy(dAtA[i:], m.V) + i = encodeVarintTx(dAtA, i, uint64(len(m.V))) + i-- + dAtA[i] = 0x4a + } + if len(m.Accesses) > 0 { + for iNdEx := len(m.Accesses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Accesses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTx(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x3a + } + if m.Amount != nil { + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.To) > 0 { + i -= len(m.To) + copy(dAtA[i:], m.To) + i = encodeVarintTx(dAtA, i, uint64(len(m.To))) + i-- + dAtA[i] = 0x2a + } + if m.GasLimit != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.GasLimit)) + i-- + dAtA[i] = 0x20 + } + if m.GasPrice != nil { + { + size := m.GasPrice.Size() + i -= size + if _, err := m.GasPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Nonce != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Nonce)) + i-- + dAtA[i] = 0x10 + } + if m.ChainID != nil { + { + size := m.ChainID.Size() + i -= size + if _, err := m.ChainID.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DynamicFeeTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DynamicFeeTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DynamicFeeTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.S) > 0 { + i -= len(m.S) + copy(dAtA[i:], m.S) + i = encodeVarintTx(dAtA, i, uint64(len(m.S))) + i-- + dAtA[i] = 0x62 + } + if len(m.R) > 0 { + i -= len(m.R) + copy(dAtA[i:], m.R) + i = encodeVarintTx(dAtA, i, uint64(len(m.R))) + i-- + dAtA[i] = 0x5a + } + if len(m.V) > 0 { + i -= len(m.V) + copy(dAtA[i:], m.V) + i = encodeVarintTx(dAtA, i, uint64(len(m.V))) + i-- + dAtA[i] = 0x52 + } + if len(m.Accesses) > 0 { + for iNdEx := len(m.Accesses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Accesses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTx(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x42 + } + if m.Amount != nil { + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if len(m.To) > 0 { + i -= len(m.To) + copy(dAtA[i:], m.To) + i = encodeVarintTx(dAtA, i, uint64(len(m.To))) + i-- + dAtA[i] = 0x32 + } + if m.GasLimit != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.GasLimit)) + i-- + dAtA[i] = 0x28 + } + if m.GasFeeCap != nil { + { + size := m.GasFeeCap.Size() + i -= size + if _, err := m.GasFeeCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.GasTipCap != nil { + { + size := m.GasTipCap.Size() + i -= size + if _, err := m.GasTipCap.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Nonce != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Nonce)) + i-- + dAtA[i] = 0x10 + } + if m.ChainID != nil { + { + size := m.ChainID.Size() + i -= size + if _, err := m.ChainID.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExtensionOptionsEthereumTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExtensionOptionsEthereumTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExtensionOptionsEthereumTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgEthereumTxResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgEthereumTxResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEthereumTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BlockHash) > 0 { + i -= len(m.BlockHash) + copy(dAtA[i:], m.BlockHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.BlockHash))) + i-- + dAtA[i] = 0x32 + } + if m.GasUsed != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.GasUsed)) + i-- + dAtA[i] = 0x28 + } + if len(m.VmError) > 0 { + i -= len(m.VmError) + copy(dAtA[i:], m.VmError) + i = encodeVarintTx(dAtA, i, uint64(len(m.VmError))) + i-- + dAtA[i] = 0x22 + } + if len(m.Ret) > 0 { + i -= len(m.Ret) + copy(dAtA[i:], m.Ret) + i = encodeVarintTx(dAtA, i, uint64(len(m.Ret))) + i-- + dAtA[i] = 0x1a + } + if len(m.Logs) > 0 { + for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Logs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTx(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgEthereumTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Data != nil { + l = m.Data.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.Size_ != 0 { + n += 9 + } + l = len(m.DeprecatedHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DeprecatedFrom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Raw.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *LegacyTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Nonce != 0 { + n += 1 + sovTx(uint64(m.Nonce)) + } + if m.GasPrice != nil { + l = m.GasPrice.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.GasLimit != 0 { + n += 1 + sovTx(uint64(m.GasLimit)) + } + l = len(m.To) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Amount != nil { + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.V) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.R) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.S) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *AccessListTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainID != nil { + l = m.ChainID.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.Nonce != 0 { + n += 1 + sovTx(uint64(m.Nonce)) + } + if m.GasPrice != nil { + l = m.GasPrice.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.GasLimit != 0 { + n += 1 + sovTx(uint64(m.GasLimit)) + } + l = len(m.To) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Amount != nil { + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Accesses) > 0 { + for _, e := range m.Accesses { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.V) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.R) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.S) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *DynamicFeeTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainID != nil { + l = m.ChainID.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.Nonce != 0 { + n += 1 + sovTx(uint64(m.Nonce)) + } + if m.GasTipCap != nil { + l = m.GasTipCap.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.GasFeeCap != nil { + l = m.GasFeeCap.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.GasLimit != 0 { + n += 1 + sovTx(uint64(m.GasLimit)) + } + l = len(m.To) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Amount != nil { + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Accesses) > 0 { + for _, e := range m.Accesses { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.V) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.R) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.S) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *ExtensionOptionsEthereumTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgEthereumTxResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Logs) > 0 { + for _, e := range m.Logs { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.Ret) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.VmError) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.GasUsed != 0 { + n += 1 + sovTx(uint64(m.GasUsed)) + } + l = len(m.BlockHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgEthereumTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgEthereumTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEthereumTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Data == nil { + m.Data = &types.Any{} + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Size_ = float64(math.Float64frombits(v)) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedFrom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeprecatedFrom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.From = append(m.From[:0], dAtA[iNdEx:postIndex]...) + if m.From == nil { + m.From = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Raw.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LegacyTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LegacyTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LegacyTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + m.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Nonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.GasPrice = &v + if err := m.GasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasLimit", wireType) + } + m.GasLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasLimit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.To = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.Amount = &v + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field V", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.V = append(m.V[:0], dAtA[iNdEx:postIndex]...) + if m.V == nil { + m.V = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field R", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.R = append(m.R[:0], dAtA[iNdEx:postIndex]...) + if m.R == nil { + m.R = []byte{} + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field S", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.S = append(m.S[:0], dAtA[iNdEx:postIndex]...) + if m.S == nil { + m.S = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AccessListTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AccessListTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AccessListTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.ChainID = &v + if err := m.ChainID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + m.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Nonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.GasPrice = &v + if err := m.GasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasLimit", wireType) + } + m.GasLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasLimit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.To = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.Amount = &v + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accesses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Accesses = append(m.Accesses, AccessTuple{}) + if err := m.Accesses[len(m.Accesses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field V", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.V = append(m.V[:0], dAtA[iNdEx:postIndex]...) + if m.V == nil { + m.V = []byte{} + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field R", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.R = append(m.R[:0], dAtA[iNdEx:postIndex]...) + if m.R == nil { + m.R = []byte{} + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field S", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.S = append(m.S[:0], dAtA[iNdEx:postIndex]...) + if m.S == nil { + m.S = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DynamicFeeTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DynamicFeeTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DynamicFeeTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.ChainID = &v + if err := m.ChainID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + m.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Nonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasTipCap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.GasTipCap = &v + if err := m.GasTipCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasFeeCap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.GasFeeCap = &v + if err := m.GasFeeCap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasLimit", wireType) + } + m.GasLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasLimit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.To = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.Amount = &v + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accesses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Accesses = append(m.Accesses, AccessTuple{}) + if err := m.Accesses[len(m.Accesses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field V", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.V = append(m.V[:0], dAtA[iNdEx:postIndex]...) + if m.V == nil { + m.V = []byte{} + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field R", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.R = append(m.R[:0], dAtA[iNdEx:postIndex]...) + if m.R == nil { + m.R = []byte{} + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field S", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.S = append(m.S[:0], dAtA[iNdEx:postIndex]...) + if m.S == nil { + m.S = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExtensionOptionsEthereumTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExtensionOptionsEthereumTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExtensionOptionsEthereumTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgEthereumTxResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgEthereumTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEthereumTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Logs = append(m.Logs, &Log{}) + if err := m.Logs[len(m.Logs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ret", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ret = append(m.Ret[:0], dAtA[iNdEx:postIndex]...) + if m.Ret == nil { + m.Ret = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VmError", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VmError = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) + } + m.GasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHash = append(m.BlockHash[:0], dAtA[iNdEx:postIndex]...) + if m.BlockHash == nil { + m.BlockHash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/evm/types/tx_args.go b/chain/evm/types/tx_args.go new file mode 100644 index 00000000..ce7ad3c5 --- /dev/null +++ b/chain/evm/types/tx_args.go @@ -0,0 +1,218 @@ +package types + +import ( + "errors" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" +) + +// TransactionArgs represents the arguments to construct a new transaction +// or a message call using JSON-RPC. +// Duplicate struct definition since geth struct is in internal package +// Ref: https://github.com/ethereum/go-ethereum/blob/release/1.10.4/internal/ethapi/transaction_args.go#L36 +type TransactionArgs struct { + From *common.Address `json:"from"` + To *common.Address `json:"to"` + Gas *hexutil.Uint64 `json:"gas"` + GasPrice *hexutil.Big `json:"gasPrice"` + MaxFeePerGas *hexutil.Big `json:"maxFeePerGas"` + MaxPriorityFeePerGas *hexutil.Big `json:"maxPriorityFeePerGas"` + Value *hexutil.Big `json:"value"` + Nonce *hexutil.Uint64 `json:"nonce"` + + // We accept "data" and "input" for backwards-compatibility reasons. + // "input" is the newer name and should be preferred by clients. + // Issue detail: https://github.com/ethereum/go-ethereum/issues/15628 + Data *hexutil.Bytes `json:"data"` + Input *hexutil.Bytes `json:"input"` + + // Introduced by AccessListTxType transaction. + AccessList *types.AccessList `json:"accessList,omitempty"` + ChainID *hexutil.Big `json:"chainId,omitempty"` +} + +// String return the struct in a string format +func (args *TransactionArgs) String() string { + // Todo: There is currently a bug with hexutil.Big when the value its nil, printing would trigger an exception + return fmt.Sprintf("TransactionArgs{From:%v, To:%v, Gas:%v,"+ + " Nonce:%v, Data:%v, Input:%v, AccessList:%v}", + args.From, + args.To, + args.Gas, + args.Nonce, + args.Data, + args.Input, + args.AccessList) +} + +// ToTransaction converts the arguments to an ethereum transaction. +// This assumes that setTxDefaults has been called. +func (args *TransactionArgs) ToTransaction() *MsgEthereumTx { + var gas, nonce uint64 + if args.Nonce != nil { + nonce = uint64(*args.Nonce) + } + + if args.Gas != nil { + gas = uint64(*args.Gas) + } + + var data types.TxData + switch { + case args.MaxFeePerGas != nil: + al := types.AccessList{} + if args.AccessList != nil { + al = *args.AccessList + } + data = &types.DynamicFeeTx{ + To: args.To, + ChainID: (*big.Int)(args.ChainID), + Nonce: nonce, + Gas: gas, + GasFeeCap: (*big.Int)(args.MaxFeePerGas), + GasTipCap: (*big.Int)(args.MaxPriorityFeePerGas), + Value: (*big.Int)(args.Value), + Data: args.GetData(), + AccessList: al, + } + case args.AccessList != nil: + data = &types.AccessListTx{ + To: args.To, + ChainID: (*big.Int)(args.ChainID), + Nonce: nonce, + Gas: gas, + GasPrice: (*big.Int)(args.GasPrice), + Value: (*big.Int)(args.Value), + Data: args.GetData(), + AccessList: *args.AccessList, + } + default: + data = &types.LegacyTx{ + To: args.To, + Nonce: nonce, + Gas: gas, + GasPrice: (*big.Int)(args.GasPrice), + Value: (*big.Int)(args.Value), + Data: args.GetData(), + } + } + + tx := NewTxWithData(data) + if args.From != nil { + tx.From = args.From.Bytes() + } + return tx +} + +// ToMessage converts the arguments to the Message type used by the core evm. +// This assumes that setTxDefaults has been called. +func (args *TransactionArgs) ToMessage(globalGasCap uint64, baseFee *big.Int) (*core.Message, error) { + // Reject invalid combinations of pre- and post-1559 fee styles + if args.GasPrice != nil && (args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil) { + return nil, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified") + } + + // Set sender address or use zero address if none specified. + addr := args.GetFrom() + + // Set default gas & gas price if none were set + gas := globalGasCap + if gas == 0 { + gas = uint64(math.MaxUint64 / 2) + } + if args.Gas != nil { + gas = uint64(*args.Gas) + } + if globalGasCap != 0 && globalGasCap < gas { + gas = globalGasCap + } + var ( + gasPrice *big.Int + gasFeeCap *big.Int + gasTipCap *big.Int + ) + if baseFee == nil { + // If there's no basefee, then it must be a non-1559 execution + gasPrice = new(big.Int) + if args.GasPrice != nil { + gasPrice = args.GasPrice.ToInt() + } + gasFeeCap, gasTipCap = gasPrice, gasPrice + } else { + // A basefee is provided, necessitating 1559-type execution + if args.GasPrice != nil { + // User specified the legacy gas field, convert to 1559 gas typing + gasPrice = args.GasPrice.ToInt() + gasFeeCap, gasTipCap = gasPrice, gasPrice + } else { + // User specified 1559 gas fields (or none), use those + gasFeeCap = new(big.Int) + if args.MaxFeePerGas != nil { + gasFeeCap = args.MaxFeePerGas.ToInt() + } + gasTipCap = new(big.Int) + if args.MaxPriorityFeePerGas != nil { + gasTipCap = args.MaxPriorityFeePerGas.ToInt() + } + // Backfill the legacy gasPrice for EVM execution, unless we're all zeroes + gasPrice = new(big.Int) + if gasFeeCap.BitLen() > 0 || gasTipCap.BitLen() > 0 { + gasPrice = math.BigMin(new(big.Int).Add(gasTipCap, baseFee), gasFeeCap) + } + } + } + value := new(big.Int) + if args.Value != nil { + value = args.Value.ToInt() + } + data := args.GetData() + var accessList types.AccessList + if args.AccessList != nil { + accessList = *args.AccessList + } + + nonce := uint64(0) + if args.Nonce != nil { + nonce = uint64(*args.Nonce) + } + + msg := &core.Message{ + From: addr, + To: args.To, + Nonce: nonce, + Value: value, + GasLimit: gas, + GasPrice: gasPrice, + GasFeeCap: gasFeeCap, + GasTipCap: gasTipCap, + Data: data, + AccessList: accessList, + SkipAccountChecks: true, + } + return msg, nil +} + +// GetFrom retrieves the transaction sender address. +func (args *TransactionArgs) GetFrom() common.Address { + if args.From == nil { + return common.Address{} + } + return *args.From +} + +// GetData retrieves the transaction calldata. Input field is preferred. +func (args *TransactionArgs) GetData() []byte { + if args.Input != nil { + return *args.Input + } + if args.Data != nil { + return *args.Data + } + return nil +} diff --git a/chain/evm/types/tx_data.go b/chain/evm/types/tx_data.go new file mode 100644 index 00000000..b5129add --- /dev/null +++ b/chain/evm/types/tx_data.go @@ -0,0 +1,123 @@ +package types + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" +) + +var ( + _ TxData = &LegacyTx{} + _ TxData = &AccessListTx{} + _ TxData = &DynamicFeeTx{} +) + +// TxData implements the Ethereum transaction tx structure. It is used +// solely as intended in Ethereum abiding by the protocol. +type TxData interface { + // TODO: embed ethtypes.TxData. See https://github.com/ethereum/go-ethereum/issues/23154 + + TxType() byte + Copy() TxData + GetChainID() *big.Int + GetAccessList() ethtypes.AccessList + GetData() []byte + GetNonce() uint64 + GetGas() uint64 + GetGasPrice() *big.Int + GetGasTipCap() *big.Int + GetGasFeeCap() *big.Int + GetValue() *big.Int + GetTo() *common.Address + + GetRawSignatureValues() (v, r, s *big.Int) + SetSignatureValues(chainID, v, r, s *big.Int) + + AsEthereumData() ethtypes.TxData + Validate() error + + // static fee + Fee() *big.Int + Cost() *big.Int + + // effective gasPrice/fee/cost according to current base fee + EffectiveGasPrice(baseFee *big.Int) *big.Int + EffectiveFee(baseFee *big.Int) *big.Int + EffectiveCost(baseFee *big.Int) *big.Int +} + +// NOTE: All non-protected transactions (i.e non EIP155 signed) will fail if the +// AllowUnprotectedTxs parameter is disabled. +func NewTxDataFromTx(tx *ethtypes.Transaction) (TxData, error) { + var txData TxData + var err error + switch tx.Type() { + case ethtypes.DynamicFeeTxType: + txData, err = NewDynamicFeeTx(tx) + case ethtypes.AccessListTxType: + txData, err = NewAccessListTx(tx) + default: + txData, err = NewLegacyTx(tx) + } + if err != nil { + return nil, err + } + + return txData, nil +} + +// DeriveChainID derives the chain id from the given v parameter. +// +// CONTRACT: v value is either: +// +// - {0,1} + CHAIN_ID * 2 + 35, if EIP155 is used +// - {0,1} + 27, otherwise +// +// Ref: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md +func DeriveChainID(v *big.Int) *big.Int { + if v == nil || v.Sign() < 1 { + return nil + } + + if v.BitLen() <= 64 { + v := v.Uint64() + if v == 27 || v == 28 { + return new(big.Int) + } + + if v < 35 { + return nil + } + + // V MUST be of the form {0,1} + CHAIN_ID * 2 + 35 + return new(big.Int).SetUint64((v - 35) / 2) + } + v = new(big.Int).Sub(v, big.NewInt(35)) + return v.Div(v, big.NewInt(2)) +} + +func rawSignatureValues(vBz, rBz, sBz []byte) (v, r, s *big.Int) { + if len(vBz) > 0 { + v = new(big.Int).SetBytes(vBz) + } + if len(rBz) > 0 { + r = new(big.Int).SetBytes(rBz) + } + if len(sBz) > 0 { + s = new(big.Int).SetBytes(sBz) + } + return v, r, s +} + +func fee(gasPrice *big.Int, gas uint64) *big.Int { + gasLimit := new(big.Int).SetUint64(gas) + return new(big.Int).Mul(gasPrice, gasLimit) +} + +func cost(fee, value *big.Int) *big.Int { + if value != nil { + return new(big.Int).Add(fee, value) + } + return fee +} diff --git a/chain/evm/types/tx_result.pb.go b/chain/evm/types/tx_result.pb.go new file mode 100644 index 00000000..3445010a --- /dev/null +++ b/chain/evm/types/tx_result.pb.go @@ -0,0 +1,532 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/evm/v1/tx_result.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// TxResult stores results of Tx execution. +type TxResult struct { + // contract_address contains the ethereum address of the created contract (if + // any). If the state transition is an evm.Call, the contract address will be + // empty. + ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty" yaml:"contract_address"` + // bloom represents the bloom filter bytes + Bloom []byte `protobuf:"bytes,2,opt,name=bloom,proto3" json:"bloom,omitempty"` + // tx_logs contains the transaction hash and the proto-compatible ethereum + // logs. + TxLogs TransactionLogs `protobuf:"bytes,3,opt,name=tx_logs,json=txLogs,proto3" json:"tx_logs" yaml:"tx_logs"` + // ret defines the bytes from the execution. + Ret []byte `protobuf:"bytes,4,opt,name=ret,proto3" json:"ret,omitempty"` + // reverted flag is set to true when the call has been reverted + Reverted bool `protobuf:"varint,5,opt,name=reverted,proto3" json:"reverted,omitempty"` + // gas_used notes the amount of gas consumed while execution + GasUsed uint64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` +} + +func (m *TxResult) Reset() { *m = TxResult{} } +func (m *TxResult) String() string { return proto.CompactTextString(m) } +func (*TxResult) ProtoMessage() {} +func (*TxResult) Descriptor() ([]byte, []int) { + return fileDescriptor_6868197df3a51cef, []int{0} +} +func (m *TxResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxResult.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TxResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxResult.Merge(m, src) +} +func (m *TxResult) XXX_Size() int { + return m.Size() +} +func (m *TxResult) XXX_DiscardUnknown() { + xxx_messageInfo_TxResult.DiscardUnknown(m) +} + +var xxx_messageInfo_TxResult proto.InternalMessageInfo + +func init() { + proto.RegisterType((*TxResult)(nil), "injective.evm.v1.TxResult") +} + +func init() { proto.RegisterFile("injective/evm/v1/tx_result.proto", fileDescriptor_6868197df3a51cef) } + +var fileDescriptor_6868197df3a51cef = []byte{ + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0x3f, 0x6e, 0xa3, 0x40, + 0x14, 0xc6, 0x19, 0xff, 0x65, 0x67, 0x57, 0xbb, 0x16, 0xb2, 0x76, 0x59, 0xaf, 0x04, 0x2c, 0xcd, + 0xd2, 0x2c, 0xc8, 0x49, 0xe7, 0x2e, 0x2e, 0x22, 0x59, 0x72, 0x85, 0x9c, 0x26, 0x0d, 0x1a, 0xe0, + 0x09, 0x13, 0x01, 0x63, 0xcd, 0x0c, 0x08, 0xdf, 0x20, 0x52, 0x9a, 0x1c, 0x21, 0xc7, 0x71, 0xe9, + 0x32, 0x95, 0x15, 0xd9, 0x37, 0xf0, 0x09, 0x22, 0x43, 0xec, 0x44, 0x4e, 0xf7, 0xbe, 0xf7, 0xbe, + 0x99, 0xdf, 0xfb, 0x66, 0xb0, 0x11, 0x67, 0x77, 0x10, 0x88, 0xb8, 0x00, 0x07, 0x8a, 0xd4, 0x29, + 0x86, 0x8e, 0x28, 0x3d, 0x06, 0x3c, 0x4f, 0x84, 0xbd, 0x60, 0x54, 0x50, 0xa5, 0x77, 0x72, 0xd8, + 0x50, 0xa4, 0x76, 0x31, 0x1c, 0xf4, 0x23, 0x1a, 0xd1, 0x6a, 0xe8, 0x1c, 0xaa, 0xda, 0x37, 0xf8, + 0xf7, 0xf9, 0x26, 0x46, 0x32, 0x4e, 0x02, 0x11, 0xd3, 0xcc, 0x4b, 0x68, 0xc4, 0x6b, 0xa3, 0xf9, + 0xd0, 0xc0, 0xf2, 0xac, 0x74, 0x2b, 0x86, 0x72, 0x8d, 0x7b, 0x01, 0xcd, 0x04, 0x23, 0x81, 0xf0, + 0x48, 0x18, 0x32, 0xe0, 0x5c, 0x45, 0x06, 0xb2, 0xbe, 0x8c, 0xff, 0xec, 0x37, 0xfa, 0xaf, 0x25, + 0x49, 0x93, 0x91, 0x79, 0xee, 0x30, 0xdd, 0x1f, 0xc7, 0xd6, 0x55, 0xdd, 0x51, 0xfa, 0xb8, 0xed, + 0x27, 0x94, 0xa6, 0x6a, 0xc3, 0x40, 0xd6, 0x37, 0xb7, 0x16, 0x8a, 0x8b, 0xbb, 0xa2, 0xac, 0xd8, + 0x6a, 0xd3, 0x40, 0xd6, 0xd7, 0x8b, 0xbf, 0xf6, 0x79, 0x1a, 0x7b, 0xf6, 0xbe, 0xe5, 0x94, 0x46, + 0x7c, 0xfc, 0x73, 0xb5, 0xd1, 0xa5, 0xfd, 0x46, 0xff, 0x5e, 0xb3, 0xdf, 0xce, 0x9b, 0x6e, 0x47, + 0x94, 0x87, 0xb9, 0xd2, 0xc3, 0x4d, 0x06, 0x42, 0x6d, 0x55, 0x9c, 0x43, 0xa9, 0x0c, 0xb0, 0xcc, + 0xa0, 0x00, 0x26, 0x20, 0x54, 0xdb, 0x06, 0xb2, 0x64, 0xf7, 0xa4, 0x95, 0xdf, 0x58, 0x8e, 0x08, + 0xf7, 0x72, 0x0e, 0xa1, 0xda, 0x31, 0x90, 0xd5, 0x72, 0xbb, 0x11, 0xe1, 0x37, 0x1c, 0xc2, 0x51, + 0xeb, 0xfe, 0x49, 0x97, 0xc6, 0xc1, 0x6a, 0xab, 0xa1, 0xf5, 0x56, 0x43, 0x2f, 0x5b, 0x0d, 0x3d, + 0xee, 0x34, 0x69, 0xbd, 0xd3, 0xa4, 0xe7, 0x9d, 0x26, 0xdd, 0x4e, 0xa2, 0x58, 0xcc, 0x73, 0xdf, + 0x0e, 0x68, 0xea, 0x4c, 0x8e, 0x5b, 0x4f, 0x89, 0xcf, 0x9d, 0x53, 0x86, 0xff, 0x01, 0x65, 0xf0, + 0x51, 0xce, 0x49, 0x9c, 0x39, 0x29, 0x0d, 0xf3, 0x04, 0x78, 0xf5, 0x0d, 0x62, 0xb9, 0x00, 0xee, + 0x77, 0xaa, 0x97, 0xbf, 0x7c, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xc0, 0x68, 0xf8, 0x65, 0xee, 0x01, + 0x00, 0x00, +} + +func (m *TxResult) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TxResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TxResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.GasUsed != 0 { + i = encodeVarintTxResult(dAtA, i, uint64(m.GasUsed)) + i-- + dAtA[i] = 0x30 + } + if m.Reverted { + i-- + if m.Reverted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(m.Ret) > 0 { + i -= len(m.Ret) + copy(dAtA[i:], m.Ret) + i = encodeVarintTxResult(dAtA, i, uint64(len(m.Ret))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.TxLogs.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTxResult(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Bloom) > 0 { + i -= len(m.Bloom) + copy(dAtA[i:], m.Bloom) + i = encodeVarintTxResult(dAtA, i, uint64(len(m.Bloom))) + i-- + dAtA[i] = 0x12 + } + if len(m.ContractAddress) > 0 { + i -= len(m.ContractAddress) + copy(dAtA[i:], m.ContractAddress) + i = encodeVarintTxResult(dAtA, i, uint64(len(m.ContractAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTxResult(dAtA []byte, offset int, v uint64) int { + offset -= sovTxResult(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *TxResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ContractAddress) + if l > 0 { + n += 1 + l + sovTxResult(uint64(l)) + } + l = len(m.Bloom) + if l > 0 { + n += 1 + l + sovTxResult(uint64(l)) + } + l = m.TxLogs.Size() + n += 1 + l + sovTxResult(uint64(l)) + l = len(m.Ret) + if l > 0 { + n += 1 + l + sovTxResult(uint64(l)) + } + if m.Reverted { + n += 2 + } + if m.GasUsed != 0 { + n += 1 + sovTxResult(uint64(m.GasUsed)) + } + return n +} + +func sovTxResult(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTxResult(x uint64) (n int) { + return sovTxResult(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *TxResult) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTxResult + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TxResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TxResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTxResult + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTxResult + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTxResult + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bloom", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTxResult + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTxResult + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTxResult + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bloom = append(m.Bloom[:0], dAtA[iNdEx:postIndex]...) + if m.Bloom == nil { + m.Bloom = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxLogs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTxResult + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTxResult + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTxResult + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TxLogs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ret", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTxResult + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTxResult + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTxResult + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ret = append(m.Ret[:0], dAtA[iNdEx:postIndex]...) + if m.Ret == nil { + m.Ret = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Reverted", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTxResult + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Reverted = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) + } + m.GasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTxResult + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTxResult(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTxResult + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTxResult(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTxResult + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTxResult + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTxResult + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTxResult + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTxResult + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTxResult + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTxResult = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTxResult = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTxResult = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/evm/types/utils.go b/chain/evm/types/utils.go new file mode 100644 index 00000000..54710f47 --- /dev/null +++ b/chain/evm/types/utils.go @@ -0,0 +1,252 @@ +package types + +import ( + "encoding/hex" + "encoding/json" + "fmt" + "math/big" + + feemarkettypes "github.com/InjectiveLabs/sdk-go/chain/feemarket/types" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/gogoproto/proto" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" +) + +// DefaultPriorityReduction is the default amount of price values required for 1 unit of priority. +// Because priority is `int64` while price is `big.Int`, it's necessary to scale down the range to keep it more pratical. +// The default value is the same as the `sdk.DefaultPowerReduction`. +var DefaultPriorityReduction = sdk.DefaultPowerReduction + +var ( + // EmptyCodeHash is the known hash of the empty EVM bytecode. + EmptyCodeHash = crypto.Keccak256(nil) + + // EmptyRootHash is the known root hash of an empty merkle trie. + EmptyRootHash = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421") +) + +// DecodeTxResponse decodes a protobuf-encoded byte slice into TxResponse +func DecodeTxResponse(in []byte) (*MsgEthereumTxResponse, error) { + responses, err := DecodeTxResponses(in) + if err != nil { + return nil, err + } + if len(responses) == 0 { + return &MsgEthereumTxResponse{}, nil + } + return responses[0], nil +} + +// DecodeTxResponses decodes a protobuf-encoded byte slice into TxResponses +func DecodeTxResponses(in []byte) ([]*MsgEthereumTxResponse, error) { + var txMsgData sdk.TxMsgData + if err := proto.Unmarshal(in, &txMsgData); err != nil { + return nil, err + } + responses := make([]*MsgEthereumTxResponse, 0, len(txMsgData.MsgResponses)) + for _, res := range txMsgData.MsgResponses { + var response MsgEthereumTxResponse + if res.TypeUrl != "/"+proto.MessageName(&response) { + continue + } + err := proto.Unmarshal(res.Value, &response) + if err != nil { + return nil, errorsmod.Wrap(err, "failed to unmarshal tx response message data") + } + responses = append(responses, &response) + } + return responses, nil +} + +func logsFromTxResponse(dst []*ethtypes.Log, rsp *MsgEthereumTxResponse, blockNumber uint64) []*ethtypes.Log { + if len(rsp.Logs) == 0 { + return nil + } + + if dst == nil { + dst = make([]*ethtypes.Log, 0, len(rsp.Logs)) + } + + txHash := common.HexToHash(rsp.Hash) + for _, log := range rsp.Logs { + // fill in the tx/block informations + l := log.ToEthereum() + l.TxHash = txHash + l.BlockNumber = blockNumber + if len(rsp.BlockHash) > 0 { + l.BlockHash = common.BytesToHash(rsp.BlockHash) + } + dst = append(dst, l) + } + return dst +} + +// DecodeMsgLogsFromEvents decodes a protobuf-encoded byte slice into ethereum logs, for a single message. +func DecodeMsgLogsFromEvents(in []byte, events []abci.Event, msgIndex int, blockNumber uint64) ([]*ethtypes.Log, error) { + txResponses, err := DecodeTxResponses(in) + if err != nil { + return nil, err + } + + var logs []*ethtypes.Log + if msgIndex < len(txResponses) { + logs = logsFromTxResponse(nil, txResponses[msgIndex], blockNumber) + } + + if len(logs) == 0 { + logs, err = TxLogsFromEvents(events, msgIndex) + } + + return logs, err +} + +// TxLogsFromEvents parses ethereum logs from cosmos events for specific msg index +func TxLogsFromEvents(events []abci.Event, msgIndex int) ([]*ethtypes.Log, error) { + for _, event := range events { + if event.Type != EventTypeTxLog { + continue + } + + if msgIndex > 0 { + // not the eth tx we want + msgIndex-- + continue + } + + return ParseTxLogsFromEvent(event) + } + + return []*ethtypes.Log{}, nil +} + +// ParseTxLogsFromEvent parse tx logs from one event +func ParseTxLogsFromEvent(event abci.Event) ([]*ethtypes.Log, error) { + logs := make([]*Log, 0, len(event.Attributes)) + for _, attr := range event.Attributes { + if attr.Key != AttributeKeyTxLog { + continue + } + + var log Log + if err := json.Unmarshal([]byte(attr.Value), &log); err != nil { + return nil, err + } + + logs = append(logs, &log) + } + return LogsToEthereum(logs), nil +} + +// DecodeTxLogsFromEvents decodes a protobuf-encoded byte slice into ethereum logs +func DecodeTxLogsFromEvents(in []byte, events []abci.Event, blockNumber uint64) ([]*ethtypes.Log, error) { + txResponses, err := DecodeTxResponses(in) + if err != nil { + return nil, err + } + var logs []*ethtypes.Log + for _, response := range txResponses { + logs = logsFromTxResponse(logs, response, blockNumber) + } + if len(logs) == 0 { + for _, event := range events { + if event.Type != EventTypeTxLog { + continue + } + txLogs, err := ParseTxLogsFromEvent(event) + if err != nil { + return nil, err + } + logs = append(logs, txLogs...) + } + } + return logs, nil +} + +// EncodeTransactionLogs encodes TransactionLogs slice into a protobuf-encoded byte slice. +func EncodeTransactionLogs(res *TransactionLogs) ([]byte, error) { + return proto.Marshal(res) +} + +// DecodeTransactionLogs decodes an protobuf-encoded byte slice into TransactionLogs +func DecodeTransactionLogs(data []byte) (TransactionLogs, error) { + var logs TransactionLogs + err := proto.Unmarshal(data, &logs) + if err != nil { + return TransactionLogs{}, err + } + return logs, nil +} + +// UnwrapEthereumMsg extract MsgEthereumTx from wrapping sdk.Tx +func UnwrapEthereumMsg(tx *sdk.Tx, ethHash common.Hash) (*MsgEthereumTx, error) { + if tx == nil { + return nil, fmt.Errorf("invalid tx: nil") + } + + for _, msg := range (*tx).GetMsgs() { + ethMsg, ok := msg.(*MsgEthereumTx) + if !ok { + return nil, fmt.Errorf("invalid tx type: %T", tx) + } + txHash := ethMsg.AsTransaction().Hash() + if txHash == ethHash { + return ethMsg, nil + } + } + + return nil, fmt.Errorf("eth tx not found: %s", ethHash) +} + +// BinSearch execute the binary search and hone in on an executable gas limit +func BinSearch(lo, hi uint64, executable func(uint64) (bool, *MsgEthereumTxResponse, error)) (uint64, error) { + for lo+1 < hi { + mid := (hi + lo) / 2 + failed, _, err := executable(mid) + // If the error is not nil(consensus error), it means the provided message + // call or transaction will never be accepted no matter how much gas it is + // assigned. Return the error directly, don't struggle anymore. + if err != nil { + return 0, err + } + if failed { + lo = mid + } else { + hi = mid + } + } + return hi, nil +} + +// EffectiveGasPrice compute the effective gas price based on eip-1159 rules +// `effectiveGasPrice = min(baseFee + tipCap, feeCap)` +func EffectiveGasPrice(baseFee *big.Int, feeCap *big.Int, tipCap *big.Int) *big.Int { + return math.BigMin(new(big.Int).Add(tipCap, baseFee), feeCap) +} + +// HexAddress encode ethereum address without checksum, faster to run for state machine +func HexAddress(a []byte) string { + var buf [common.AddressLength*2 + 2]byte + copy(buf[:2], "0x") + hex.Encode(buf[2:], a) + return string(buf[:]) +} + +func GetBaseFee(height int64, ethCfg *params.ChainConfig, feemarketParams *feemarkettypes.Params) *big.Int { + if !IsLondon(ethCfg, height) { + return nil + } + baseFee := feemarketParams.GetBaseFee() + // should not be nil if london hardfork enabled + if baseFee == nil { + return new(big.Int) + } + return baseFee +} diff --git a/chain/feemarket/types/codec.go b/chain/feemarket/types/codec.go new file mode 100644 index 00000000..13dc69d6 --- /dev/null +++ b/chain/feemarket/types/codec.go @@ -0,0 +1,43 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +var ( + amino = codec.NewLegacyAmino() + // ModuleCdc references the global fee market module codec. Note, the codec should + // ONLY be used in certain instances of tests and for JSON encoding. + ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) + + // AminoCdc is a amino codec created to support amino JSON compatible msgs. + AminoCdc = codec.NewAminoCodec(amino) //nolint:staticcheck +) + +const ( + // Amino names + updateParamsName = "feemarket/MsgUpdateParams" +) + +// NOTE: This is required for the GetSignBytes function +func init() { + RegisterLegacyAminoCodec(amino) + amino.Seal() +} + +// RegisterInterfaces registers the client interfaces to protobuf Any. +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgUpdateParams{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +// RegisterLegacyAminoCodec required for EIP-712 +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgUpdateParams{}, updateParamsName, nil) +} diff --git a/chain/feemarket/types/events.go b/chain/feemarket/types/events.go new file mode 100644 index 00000000..bcc28db8 --- /dev/null +++ b/chain/feemarket/types/events.go @@ -0,0 +1,9 @@ +package types + +// feemarket module events +const ( + EventTypeFeeMarket = "fee_market" + EventTypeBlockGas = "block_gas" + + AttributeKeyBaseFee = "base_fee" +) diff --git a/chain/feemarket/types/events.pb.go b/chain/feemarket/types/events.pb.go new file mode 100644 index 00000000..cf067639 --- /dev/null +++ b/chain/feemarket/types/events.pb.go @@ -0,0 +1,547 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/feemarket/v1/events.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventFeeMarket is the event type for the fee market module +type EventFeeMarket struct { + // base_fee for EIP-1559 blocks + BaseFee string `protobuf:"bytes,1,opt,name=base_fee,json=baseFee,proto3" json:"base_fee,omitempty"` +} + +func (m *EventFeeMarket) Reset() { *m = EventFeeMarket{} } +func (m *EventFeeMarket) String() string { return proto.CompactTextString(m) } +func (*EventFeeMarket) ProtoMessage() {} +func (*EventFeeMarket) Descriptor() ([]byte, []int) { + return fileDescriptor_b46b94ca59483e7d, []int{0} +} +func (m *EventFeeMarket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventFeeMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventFeeMarket.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventFeeMarket) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventFeeMarket.Merge(m, src) +} +func (m *EventFeeMarket) XXX_Size() int { + return m.Size() +} +func (m *EventFeeMarket) XXX_DiscardUnknown() { + xxx_messageInfo_EventFeeMarket.DiscardUnknown(m) +} + +var xxx_messageInfo_EventFeeMarket proto.InternalMessageInfo + +func (m *EventFeeMarket) GetBaseFee() string { + if m != nil { + return m.BaseFee + } + return "" +} + +// EventBlockGas defines an Ethereum block gas event +type EventBlockGas struct { + // height of the block + Height string `protobuf:"bytes,1,opt,name=height,proto3" json:"height,omitempty"` + // amount of gas wanted by the block + Amount string `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *EventBlockGas) Reset() { *m = EventBlockGas{} } +func (m *EventBlockGas) String() string { return proto.CompactTextString(m) } +func (*EventBlockGas) ProtoMessage() {} +func (*EventBlockGas) Descriptor() ([]byte, []int) { + return fileDescriptor_b46b94ca59483e7d, []int{1} +} +func (m *EventBlockGas) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventBlockGas) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventBlockGas.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventBlockGas) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBlockGas.Merge(m, src) +} +func (m *EventBlockGas) XXX_Size() int { + return m.Size() +} +func (m *EventBlockGas) XXX_DiscardUnknown() { + xxx_messageInfo_EventBlockGas.DiscardUnknown(m) +} + +var xxx_messageInfo_EventBlockGas proto.InternalMessageInfo + +func (m *EventBlockGas) GetHeight() string { + if m != nil { + return m.Height + } + return "" +} + +func (m *EventBlockGas) GetAmount() string { + if m != nil { + return m.Amount + } + return "" +} + +func init() { + proto.RegisterType((*EventFeeMarket)(nil), "injective.feemarket.v1.EventFeeMarket") + proto.RegisterType((*EventBlockGas)(nil), "injective.feemarket.v1.EventBlockGas") +} + +func init() { + proto.RegisterFile("injective/feemarket/v1/events.proto", fileDescriptor_b46b94ca59483e7d) +} + +var fileDescriptor_b46b94ca59483e7d = []byte{ + // 232 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0xcc, 0xcb, 0x4a, + 0x4d, 0x2e, 0xc9, 0x2c, 0x4b, 0xd5, 0x4f, 0x4b, 0x4d, 0xcd, 0x4d, 0x2c, 0xca, 0x4e, 0x2d, 0xd1, + 0x2f, 0x33, 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x83, 0x2b, 0xd2, 0x83, 0x2b, 0xd2, 0x2b, 0x33, 0x54, 0xd2, 0xe6, 0xe2, 0x73, 0x05, 0xa9, + 0x73, 0x4b, 0x4d, 0xf5, 0x05, 0x0b, 0x0a, 0x49, 0x72, 0x71, 0x24, 0x25, 0x16, 0xa7, 0xc6, 0xa7, + 0xa5, 0xa6, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xb1, 0x83, 0xf8, 0x6e, 0xa9, 0xa9, 0x4a, + 0xf6, 0x5c, 0xbc, 0x60, 0xc5, 0x4e, 0x39, 0xf9, 0xc9, 0xd9, 0xee, 0x89, 0xc5, 0x42, 0x62, 0x5c, + 0x6c, 0x19, 0xa9, 0x99, 0xe9, 0x19, 0x25, 0x50, 0x95, 0x50, 0x1e, 0x48, 0x3c, 0x31, 0x37, 0xbf, + 0x34, 0xaf, 0x44, 0x82, 0x09, 0x22, 0x0e, 0xe1, 0x39, 0x65, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, + 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, + 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x7f, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, + 0xbe, 0x27, 0xcc, 0xa9, 0x3e, 0x89, 0x49, 0xc5, 0xfa, 0x70, 0x87, 0xeb, 0x26, 0xe7, 0x17, 0xa5, + 0x22, 0x73, 0x33, 0x12, 0x33, 0xf3, 0xf4, 0x73, 0xf3, 0x53, 0x4a, 0x73, 0x52, 0x8b, 0x91, 0xbc, + 0x5e, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0xb7, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, + 0xe4, 0x1b, 0xb9, 0xde, 0x1e, 0x01, 0x00, 0x00, +} + +func (m *EventFeeMarket) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventFeeMarket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventFeeMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BaseFee) > 0 { + i -= len(m.BaseFee) + copy(dAtA[i:], m.BaseFee) + i = encodeVarintEvents(dAtA, i, uint64(len(m.BaseFee))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventBlockGas) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventBlockGas) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventBlockGas) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + i -= len(m.Amount) + copy(dAtA[i:], m.Amount) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Amount))) + i-- + dAtA[i] = 0x12 + } + if len(m.Height) > 0 { + i -= len(m.Height) + copy(dAtA[i:], m.Height) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Height))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventFeeMarket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BaseFee) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventBlockGas) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Height) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Amount) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventFeeMarket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventFeeMarket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventFeeMarket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BaseFee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventBlockGas) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventBlockGas: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBlockGas: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Height = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/feemarket/types/feemarket.pb.go b/chain/feemarket/types/feemarket.pb.go new file mode 100644 index 00000000..d80901d7 --- /dev/null +++ b/chain/feemarket/types/feemarket.pb.go @@ -0,0 +1,582 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/feemarket/v1/feemarket.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the EVM module parameters +type Params struct { + // no_base_fee forces the EIP-1559 base fee to 0 (needed for 0 price calls) + NoBaseFee bool `protobuf:"varint,1,opt,name=no_base_fee,json=noBaseFee,proto3" json:"no_base_fee,omitempty"` + // base_fee_change_denominator bounds the amount the base fee can change + // between blocks. + BaseFeeChangeDenominator uint32 `protobuf:"varint,2,opt,name=base_fee_change_denominator,json=baseFeeChangeDenominator,proto3" json:"base_fee_change_denominator,omitempty"` + // elasticity_multiplier bounds the maximum gas limit an EIP-1559 block may + // have. + ElasticityMultiplier uint32 `protobuf:"varint,3,opt,name=elasticity_multiplier,json=elasticityMultiplier,proto3" json:"elasticity_multiplier,omitempty"` + // enable_height defines at which block height the base fee calculation is enabled. + EnableHeight int64 `protobuf:"varint,5,opt,name=enable_height,json=enableHeight,proto3" json:"enable_height,omitempty"` + // base_fee for EIP-1559 blocks. + BaseFee cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=base_fee,json=baseFee,proto3,customtype=cosmossdk.io/math.Int" json:"base_fee"` + // min_gas_price defines the minimum gas price value for cosmos and eth transactions + MinGasPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=min_gas_price,json=minGasPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_gas_price"` + // min_gas_multiplier bounds the minimum gas used to be charged + // to senders based on gas limit + MinGasMultiplier cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=min_gas_multiplier,json=minGasMultiplier,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_gas_multiplier"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_a7a403a1af17f0f2, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetNoBaseFee() bool { + if m != nil { + return m.NoBaseFee + } + return false +} + +func (m *Params) GetBaseFeeChangeDenominator() uint32 { + if m != nil { + return m.BaseFeeChangeDenominator + } + return 0 +} + +func (m *Params) GetElasticityMultiplier() uint32 { + if m != nil { + return m.ElasticityMultiplier + } + return 0 +} + +func (m *Params) GetEnableHeight() int64 { + if m != nil { + return m.EnableHeight + } + return 0 +} + +func init() { + proto.RegisterType((*Params)(nil), "injective.feemarket.v1.Params") +} + +func init() { + proto.RegisterFile("injective/feemarket/v1/feemarket.proto", fileDescriptor_a7a403a1af17f0f2) +} + +var fileDescriptor_a7a403a1af17f0f2 = []byte{ + // 417 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x6a, 0xdb, 0x40, + 0x10, 0x86, 0xbd, 0x75, 0xe2, 0x38, 0x9b, 0x1a, 0xcc, 0x92, 0x14, 0xd1, 0x50, 0xc5, 0x34, 0x50, + 0x7c, 0xa9, 0x44, 0xc8, 0xa5, 0x97, 0x5e, 0xdc, 0xd0, 0x34, 0x25, 0xa5, 0xa9, 0x8e, 0xbd, 0x2c, + 0xa3, 0xf5, 0x44, 0x9a, 0x46, 0xbb, 0x6b, 0xb4, 0x6b, 0x83, 0xdf, 0xa2, 0x6f, 0xd2, 0xd7, 0xc8, + 0x31, 0xc7, 0xd2, 0x43, 0x28, 0xf6, 0x8b, 0x94, 0xc8, 0xb1, 0x64, 0xe8, 0x25, 0xb7, 0x9d, 0xf9, + 0xff, 0x6f, 0x98, 0x61, 0x7f, 0xfe, 0x86, 0xcc, 0x0f, 0x54, 0x9e, 0x66, 0x18, 0x5f, 0x23, 0x6a, + 0x28, 0x6f, 0xd0, 0xc7, 0xb3, 0x93, 0xa6, 0x88, 0x26, 0xa5, 0xf5, 0x56, 0xbc, 0xa8, 0x7d, 0x51, + 0x23, 0xcd, 0x4e, 0x5e, 0xee, 0x67, 0x36, 0xb3, 0x95, 0x25, 0x7e, 0x78, 0xad, 0xdc, 0xaf, 0x7f, + 0xb5, 0x79, 0xe7, 0x0a, 0x4a, 0xd0, 0x4e, 0x84, 0x7c, 0xcf, 0x58, 0x99, 0x82, 0x43, 0x79, 0x8d, + 0x18, 0xb0, 0x01, 0x1b, 0x76, 0x93, 0x5d, 0x63, 0x47, 0xe0, 0xf0, 0x23, 0xa2, 0x78, 0xcf, 0x0f, + 0xd7, 0xa2, 0x54, 0x39, 0x98, 0x0c, 0xe5, 0x18, 0x8d, 0xd5, 0x64, 0xc0, 0xdb, 0x32, 0x78, 0x36, + 0x60, 0xc3, 0x5e, 0x12, 0xa4, 0x2b, 0xf7, 0x87, 0xca, 0x70, 0xd6, 0xe8, 0xe2, 0x94, 0x1f, 0x60, + 0x01, 0xce, 0x93, 0x22, 0x3f, 0x97, 0x7a, 0x5a, 0x78, 0x9a, 0x14, 0x84, 0x65, 0xd0, 0xae, 0xc0, + 0xfd, 0x46, 0xfc, 0x52, 0x6b, 0xe2, 0x98, 0xf7, 0xd0, 0x40, 0x5a, 0xa0, 0xcc, 0x91, 0xb2, 0xdc, + 0x07, 0xdb, 0x03, 0x36, 0x6c, 0x27, 0xcf, 0x57, 0xcd, 0x4f, 0x55, 0x4f, 0xbc, 0xe3, 0xdd, 0x7a, + 0xeb, 0xce, 0x80, 0x0d, 0x77, 0x47, 0xaf, 0x6e, 0xef, 0x8f, 0x5a, 0x7f, 0xee, 0x8f, 0x0e, 0x94, + 0x75, 0xda, 0x3a, 0x37, 0xbe, 0x89, 0xc8, 0xc6, 0x1a, 0x7c, 0x1e, 0x5d, 0x18, 0x9f, 0xec, 0x3c, + 0x2e, 0x29, 0xce, 0x79, 0x4f, 0x93, 0x91, 0x19, 0x38, 0x39, 0x29, 0x49, 0x61, 0xb0, 0x53, 0xe1, + 0xc7, 0x8f, 0xf8, 0xe1, 0xff, 0xf8, 0x25, 0x66, 0xa0, 0xe6, 0x67, 0xa8, 0x92, 0x3d, 0x4d, 0xe6, + 0x1c, 0xdc, 0xd5, 0x03, 0x27, 0xbe, 0x71, 0xb1, 0x1e, 0xb4, 0x71, 0x59, 0xf7, 0xe9, 0xd3, 0xfa, + 0xab, 0x69, 0xcd, 0xe9, 0x9f, 0xb7, 0xba, 0x5b, 0xfd, 0xed, 0xa4, 0x4f, 0x86, 0x3c, 0x41, 0x51, + 0xff, 0xcb, 0x88, 0x6e, 0x17, 0x21, 0xbb, 0x5b, 0x84, 0xec, 0xef, 0x22, 0x64, 0x3f, 0x97, 0x61, + 0xeb, 0x6e, 0x19, 0xb6, 0x7e, 0x2f, 0xc3, 0xd6, 0xf7, 0xaf, 0x19, 0xf9, 0x7c, 0x9a, 0x46, 0xca, + 0xea, 0xf8, 0x62, 0x1d, 0x82, 0x4b, 0x48, 0x5d, 0x5c, 0x47, 0xe2, 0xad, 0xb2, 0x25, 0x6e, 0x96, + 0x39, 0x90, 0x89, 0xb5, 0x1d, 0x4f, 0x0b, 0x74, 0x1b, 0xb9, 0xf2, 0xf3, 0x09, 0xba, 0xb4, 0x53, + 0x65, 0xe4, 0xf4, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb3, 0xac, 0xe3, 0xe7, 0x7b, 0x02, 0x00, + 0x00, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MinGasMultiplier.Size() + i -= size + if _, err := m.MinGasMultiplier.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintFeemarket(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size := m.MinGasPrice.Size() + i -= size + if _, err := m.MinGasPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintFeemarket(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size := m.BaseFee.Size() + i -= size + if _, err := m.BaseFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintFeemarket(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if m.EnableHeight != 0 { + i = encodeVarintFeemarket(dAtA, i, uint64(m.EnableHeight)) + i-- + dAtA[i] = 0x28 + } + if m.ElasticityMultiplier != 0 { + i = encodeVarintFeemarket(dAtA, i, uint64(m.ElasticityMultiplier)) + i-- + dAtA[i] = 0x18 + } + if m.BaseFeeChangeDenominator != 0 { + i = encodeVarintFeemarket(dAtA, i, uint64(m.BaseFeeChangeDenominator)) + i-- + dAtA[i] = 0x10 + } + if m.NoBaseFee { + i-- + if m.NoBaseFee { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintFeemarket(dAtA []byte, offset int, v uint64) int { + offset -= sovFeemarket(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NoBaseFee { + n += 2 + } + if m.BaseFeeChangeDenominator != 0 { + n += 1 + sovFeemarket(uint64(m.BaseFeeChangeDenominator)) + } + if m.ElasticityMultiplier != 0 { + n += 1 + sovFeemarket(uint64(m.ElasticityMultiplier)) + } + if m.EnableHeight != 0 { + n += 1 + sovFeemarket(uint64(m.EnableHeight)) + } + l = m.BaseFee.Size() + n += 1 + l + sovFeemarket(uint64(l)) + l = m.MinGasPrice.Size() + n += 1 + l + sovFeemarket(uint64(l)) + l = m.MinGasMultiplier.Size() + n += 1 + l + sovFeemarket(uint64(l)) + return n +} + +func sovFeemarket(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozFeemarket(x uint64) (n int) { + return sovFeemarket(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeemarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoBaseFee", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeemarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoBaseFee = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseFeeChangeDenominator", wireType) + } + m.BaseFeeChangeDenominator = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeemarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BaseFeeChangeDenominator |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ElasticityMultiplier", wireType) + } + m.ElasticityMultiplier = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeemarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ElasticityMultiplier |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EnableHeight", wireType) + } + m.EnableHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeemarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EnableHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeemarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFeemarket + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFeemarket + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BaseFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinGasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeemarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFeemarket + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFeemarket + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinGasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinGasMultiplier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeemarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFeemarket + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFeemarket + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinGasMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFeemarket(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFeemarket + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipFeemarket(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFeemarket + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFeemarket + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFeemarket + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthFeemarket + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupFeemarket + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthFeemarket + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthFeemarket = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowFeemarket = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupFeemarket = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/feemarket/types/genesis.go b/chain/feemarket/types/genesis.go new file mode 100644 index 00000000..4fc70113 --- /dev/null +++ b/chain/feemarket/types/genesis.go @@ -0,0 +1,23 @@ +package types + +// DefaultGenesisState sets default fee market genesis state. +func DefaultGenesisState() *GenesisState { + return &GenesisState{ + Params: DefaultParams(), + BlockGas: 0, + } +} + +// NewGenesisState creates a new genesis state. +func NewGenesisState(params Params, blockGas uint64) *GenesisState { + return &GenesisState{ + Params: params, + BlockGas: blockGas, + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + return gs.Params.Validate() +} diff --git a/chain/feemarket/types/genesis.pb.go b/chain/feemarket/types/genesis.pb.go new file mode 100644 index 00000000..e8a2f12a --- /dev/null +++ b/chain/feemarket/types/genesis.pb.go @@ -0,0 +1,365 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/feemarket/v1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the feemarket module's genesis state. +type GenesisState struct { + // params defines all the parameters of the feemarket module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // block_gas is the amount of gas wanted on the last block before the upgrade. + // Zero by default. + BlockGas uint64 `protobuf:"varint,3,opt,name=block_gas,json=blockGas,proto3" json:"block_gas,omitempty"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_deb53c9b093e3af3, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetBlockGas() uint64 { + if m != nil { + return m.BlockGas + } + return 0 +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "injective.feemarket.v1.GenesisState") +} + +func init() { + proto.RegisterFile("injective/feemarket/v1/genesis.proto", fileDescriptor_deb53c9b093e3af3) +} + +var fileDescriptor_deb53c9b093e3af3 = []byte{ + // 264 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xc9, 0xcc, 0xcb, 0x4a, + 0x4d, 0x2e, 0xc9, 0x2c, 0x4b, 0xd5, 0x4f, 0x4b, 0x4d, 0xcd, 0x4d, 0x2c, 0xca, 0x4e, 0x2d, 0xd1, + 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0x12, 0x83, 0xab, 0xd2, 0x83, 0xab, 0xd2, 0x2b, 0x33, 0x94, 0x52, 0xc3, 0xa1, 0x1b, 0xa1, + 0x08, 0xac, 0x5f, 0x4a, 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0xcc, 0xd4, 0x07, 0xb1, 0x20, 0xa2, 0x4a, + 0x95, 0x5c, 0x3c, 0xee, 0x10, 0x6b, 0x82, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x6c, 0xb8, 0xd8, 0x0a, + 0x12, 0x8b, 0x12, 0x73, 0x8b, 0x25, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xe4, 0xf4, 0xb0, 0x5b, + 0xab, 0x17, 0x00, 0x56, 0xe5, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x54, 0x8f, 0x90, 0x34, + 0x17, 0x67, 0x52, 0x4e, 0x7e, 0x72, 0x76, 0x7c, 0x7a, 0x62, 0xb1, 0x04, 0xb3, 0x02, 0xa3, 0x06, + 0x4b, 0x10, 0x07, 0x58, 0xc0, 0x3d, 0xb1, 0xd8, 0x8b, 0x85, 0x83, 0x49, 0x80, 0x39, 0x88, 0x23, + 0x29, 0xb1, 0x38, 0x35, 0x3e, 0x2d, 0x35, 0xd5, 0x29, 0xf3, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, + 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, + 0x8f, 0xe5, 0x18, 0xa2, 0xfc, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, + 0x3d, 0x61, 0xd6, 0xfb, 0x24, 0x26, 0x15, 0xeb, 0xc3, 0x1d, 0xa3, 0x9b, 0x9c, 0x5f, 0x94, 0x8a, + 0xcc, 0xcd, 0x48, 0xcc, 0xcc, 0xd3, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0x46, 0x0a, 0x88, + 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x67, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x19, 0x28, 0x95, 0xac, 0x6a, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockGas != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.BlockGas)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if m.BlockGas != 0 { + n += 1 + sovGenesis(uint64(m.BlockGas)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockGas", wireType) + } + m.BlockGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/feemarket/types/interfaces.go b/chain/feemarket/types/interfaces.go new file mode 100644 index 00000000..496fbe96 --- /dev/null +++ b/chain/feemarket/types/interfaces.go @@ -0,0 +1,15 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +type ( + LegacyParams = paramtypes.ParamSet + // Subspace defines an interface that implements the legacy Cosmos SDK x/params Subspace type. + // NOTE: This is used solely for migration of the Cosmos SDK x/params managed parameters. + Subspace interface { + GetParamSetIfExists(ctx sdk.Context, ps LegacyParams) + } +) diff --git a/chain/feemarket/types/keys.go b/chain/feemarket/types/keys.go new file mode 100644 index 00000000..ea33d2bb --- /dev/null +++ b/chain/feemarket/types/keys.go @@ -0,0 +1,24 @@ +package types + +const ( + // ModuleName string name of module + ModuleName = "feemarket" + + // StoreKey key for base fee and block gas used. + // The Fee Market module should use a prefix store. + StoreKey = ModuleName + + // RouterKey uses module name for routing + RouterKey = ModuleName +) + +// prefix bytes for the feemarket persistent store +const ( + prefixBlockGasWanted = iota + 1 + deprecatedPrefixBaseFee // unused +) + +// KVStore key prefixes +var ( + KeyPrefixBlockGasWanted = []byte{prefixBlockGasWanted} +) diff --git a/chain/feemarket/types/msg.go b/chain/feemarket/types/msg.go new file mode 100644 index 00000000..71d49fdb --- /dev/null +++ b/chain/feemarket/types/msg.go @@ -0,0 +1,28 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateParams{} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress { + addr := sdk.MustAccAddressFromBech32(m.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check of the provided data +func (m *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + + return m.Params.Validate() +} + +// GetSignBytes implements the LegacyMsg interface. +func (m MsgUpdateParams) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m)) +} diff --git a/chain/feemarket/types/params.go b/chain/feemarket/types/params.go new file mode 100644 index 00000000..d79439d1 --- /dev/null +++ b/chain/feemarket/types/params.go @@ -0,0 +1,219 @@ +package types + +import ( + "fmt" + "math/big" + + sdkmath "cosmossdk.io/math" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/ethereum/go-ethereum/params" +) + +var ( + // DefaultMinGasMultiplier is 0.5 or 50% + DefaultMinGasMultiplier = sdkmath.LegacyNewDecWithPrec(50, 2) + // DefaultMinGasPrice is 0 (i.e disabled) + DefaultMinGasPrice = sdkmath.LegacyZeroDec() + // DefaultEnableHeight is 0 (i.e disabled) + DefaultEnableHeight = int64(0) + // DefaultNoBaseFee is false + DefaultNoBaseFee = false +) + +// Parameter keys +var ( + ParamsKey = []byte("Params") + ParamStoreKeyNoBaseFee = []byte("NoBaseFee") + ParamStoreKeyBaseFeeChangeDenominator = []byte("BaseFeeChangeDenominator") + ParamStoreKeyElasticityMultiplier = []byte("ElasticityMultiplier") + ParamStoreKeyBaseFee = []byte("BaseFee") + ParamStoreKeyEnableHeight = []byte("EnableHeight") + ParamStoreKeyMinGasPrice = []byte("MinGasPrice") + ParamStoreKeyMinGasMultiplier = []byte("MinGasMultiplier") +) + +// ParamKeyTable returns the parameter key table. +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// ParamSetPairs returns the parameter set pairs. +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair(ParamStoreKeyNoBaseFee, &p.NoBaseFee, validateBool), + paramtypes.NewParamSetPair(ParamStoreKeyBaseFeeChangeDenominator, &p.BaseFeeChangeDenominator, validateBaseFeeChangeDenominator), + paramtypes.NewParamSetPair(ParamStoreKeyElasticityMultiplier, &p.ElasticityMultiplier, validateElasticityMultiplier), + paramtypes.NewParamSetPair(ParamStoreKeyBaseFee, &p.BaseFee, validateBaseFee), + paramtypes.NewParamSetPair(ParamStoreKeyEnableHeight, &p.EnableHeight, validateEnableHeight), + paramtypes.NewParamSetPair(ParamStoreKeyMinGasPrice, &p.MinGasPrice, validateMinGasPrice), + paramtypes.NewParamSetPair(ParamStoreKeyMinGasMultiplier, &p.MinGasMultiplier, validateMinGasPrice), + } +} + +// NewParams creates a new Params instance +func NewParams( + noBaseFee bool, + baseFeeChangeDenom, + elasticityMultiplier uint32, + baseFee uint64, + enableHeight int64, + minGasPrice sdkmath.LegacyDec, + minGasPriceMultiplier sdkmath.LegacyDec, +) Params { + return Params{ + NoBaseFee: noBaseFee, + BaseFeeChangeDenominator: baseFeeChangeDenom, + ElasticityMultiplier: elasticityMultiplier, + BaseFee: sdkmath.NewIntFromUint64(baseFee), + EnableHeight: enableHeight, + MinGasPrice: minGasPrice, + MinGasMultiplier: minGasPriceMultiplier, + } +} + +// DefaultParams returns default evm parameters +func DefaultParams() Params { + return Params{ + NoBaseFee: DefaultNoBaseFee, + BaseFeeChangeDenominator: params.DefaultBaseFeeChangeDenominator, + ElasticityMultiplier: params.DefaultElasticityMultiplier, + BaseFee: sdkmath.NewIntFromUint64(params.InitialBaseFee), + EnableHeight: DefaultEnableHeight, + MinGasPrice: DefaultMinGasPrice, + MinGasMultiplier: DefaultMinGasMultiplier, + } +} + +// Validate performs basic validation on fee market parameters. +func (p Params) Validate() error { + if p.BaseFeeChangeDenominator == 0 { + return fmt.Errorf("base fee change denominator cannot be 0") + } + + if p.BaseFee.IsNegative() { + return fmt.Errorf("initial base fee cannot be negative: %s", p.BaseFee) + } + + if p.EnableHeight < 0 { + return fmt.Errorf("enable height cannot be negative: %d", p.EnableHeight) + } + + if err := validateMinGasMultiplier(p.MinGasMultiplier); err != nil { + return err + } + + if p.ElasticityMultiplier == 0 { + return fmt.Errorf("elasticity multiplier cannot be 0") + } + + return validateMinGasPrice(p.MinGasPrice) +} + +func validateBool(i interface{}) error { + _, ok := i.(bool) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + return nil +} + +func (p Params) IsBaseFeeEnabled(height int64) bool { + return !p.NoBaseFee && height >= p.EnableHeight +} + +func (p Params) GetBaseFee() *big.Int { + if p.NoBaseFee { + return nil + } + + return p.BaseFee.BigInt() +} + +func validateMinGasPrice(i interface{}) error { + v, ok := i.(sdkmath.LegacyDec) + + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.IsNil() { + return fmt.Errorf("invalid parameter: nil") + } + + if v.IsNegative() { + return fmt.Errorf("value cannot be negative: %s", i) + } + + return nil +} + +func validateBaseFeeChangeDenominator(i interface{}) error { + value, ok := i.(uint32) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if value == 0 { + return fmt.Errorf("base fee change denominator cannot be 0") + } + + return nil +} + +func validateElasticityMultiplier(i interface{}) error { + value, ok := i.(uint32) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + if value == 0 { + return fmt.Errorf("elasticity multiplier cannot be 0") + } + return nil +} + +func validateBaseFee(i interface{}) error { + value, ok := i.(sdkmath.Int) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if value.IsNegative() { + return fmt.Errorf("base fee cannot be negative") + } + + return nil +} + +func validateEnableHeight(i interface{}) error { + value, ok := i.(int64) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if value < 0 { + return fmt.Errorf("enable height cannot be negative: %d", value) + } + + return nil +} + +func validateMinGasMultiplier(i interface{}) error { + v, ok := i.(sdkmath.LegacyDec) + + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.IsNil() { + return fmt.Errorf("invalid parameter: nil") + } + + if v.IsNegative() { + return fmt.Errorf("value cannot be negative: %s", v) + } + + if v.GT(sdkmath.LegacyOneDec()) { + return fmt.Errorf("value cannot be greater than 1: %s", v) + } + return nil +} diff --git a/chain/feemarket/types/query.pb.go b/chain/feemarket/types/query.pb.go new file mode 100644 index 00000000..f12474e3 --- /dev/null +++ b/chain/feemarket/types/query.pb.go @@ -0,0 +1,1197 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/feemarket/v1/query.proto + +package types + +import ( + context "context" + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest defines the request type for querying x/evm parameters. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_16899c3b80537a82, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse defines the response type for querying x/evm parameters. +type QueryParamsResponse struct { + // params define the evm module parameters. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_16899c3b80537a82, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// QueryBaseFeeRequest defines the request type for querying the EIP1559 base +// fee. +type QueryBaseFeeRequest struct { +} + +func (m *QueryBaseFeeRequest) Reset() { *m = QueryBaseFeeRequest{} } +func (m *QueryBaseFeeRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBaseFeeRequest) ProtoMessage() {} +func (*QueryBaseFeeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_16899c3b80537a82, []int{2} +} +func (m *QueryBaseFeeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBaseFeeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBaseFeeRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBaseFeeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBaseFeeRequest.Merge(m, src) +} +func (m *QueryBaseFeeRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBaseFeeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBaseFeeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBaseFeeRequest proto.InternalMessageInfo + +// QueryBaseFeeResponse returns the EIP1559 base fee. +type QueryBaseFeeResponse struct { + // base_fee is the EIP1559 base fee + BaseFee *cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=base_fee,json=baseFee,proto3,customtype=cosmossdk.io/math.Int" json:"base_fee,omitempty"` +} + +func (m *QueryBaseFeeResponse) Reset() { *m = QueryBaseFeeResponse{} } +func (m *QueryBaseFeeResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBaseFeeResponse) ProtoMessage() {} +func (*QueryBaseFeeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_16899c3b80537a82, []int{3} +} +func (m *QueryBaseFeeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBaseFeeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBaseFeeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBaseFeeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBaseFeeResponse.Merge(m, src) +} +func (m *QueryBaseFeeResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBaseFeeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBaseFeeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBaseFeeResponse proto.InternalMessageInfo + +// QueryBlockGasRequest defines the request type for querying the EIP1559 base +// fee. +type QueryBlockGasRequest struct { +} + +func (m *QueryBlockGasRequest) Reset() { *m = QueryBlockGasRequest{} } +func (m *QueryBlockGasRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBlockGasRequest) ProtoMessage() {} +func (*QueryBlockGasRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_16899c3b80537a82, []int{4} +} +func (m *QueryBlockGasRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBlockGasRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBlockGasRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBlockGasRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBlockGasRequest.Merge(m, src) +} +func (m *QueryBlockGasRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBlockGasRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBlockGasRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBlockGasRequest proto.InternalMessageInfo + +// QueryBlockGasResponse returns block gas used for a given height. +type QueryBlockGasResponse struct { + // gas is the returned block gas + Gas int64 `protobuf:"varint,1,opt,name=gas,proto3" json:"gas,omitempty"` +} + +func (m *QueryBlockGasResponse) Reset() { *m = QueryBlockGasResponse{} } +func (m *QueryBlockGasResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBlockGasResponse) ProtoMessage() {} +func (*QueryBlockGasResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_16899c3b80537a82, []int{5} +} +func (m *QueryBlockGasResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBlockGasResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBlockGasResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBlockGasResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBlockGasResponse.Merge(m, src) +} +func (m *QueryBlockGasResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBlockGasResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBlockGasResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBlockGasResponse proto.InternalMessageInfo + +func (m *QueryBlockGasResponse) GetGas() int64 { + if m != nil { + return m.Gas + } + return 0 +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "injective.feemarket.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "injective.feemarket.v1.QueryParamsResponse") + proto.RegisterType((*QueryBaseFeeRequest)(nil), "injective.feemarket.v1.QueryBaseFeeRequest") + proto.RegisterType((*QueryBaseFeeResponse)(nil), "injective.feemarket.v1.QueryBaseFeeResponse") + proto.RegisterType((*QueryBlockGasRequest)(nil), "injective.feemarket.v1.QueryBlockGasRequest") + proto.RegisterType((*QueryBlockGasResponse)(nil), "injective.feemarket.v1.QueryBlockGasResponse") +} + +func init() { + proto.RegisterFile("injective/feemarket/v1/query.proto", fileDescriptor_16899c3b80537a82) +} + +var fileDescriptor_16899c3b80537a82 = []byte{ + // 455 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x3f, 0x6f, 0xd3, 0x40, + 0x14, 0xcf, 0x11, 0x48, 0xcb, 0xb1, 0xa0, 0x23, 0xa9, 0xc0, 0x42, 0xd7, 0x60, 0xa4, 0xaa, 0x05, + 0x7a, 0xa7, 0x16, 0x46, 0xa6, 0x0c, 0xa0, 0x4a, 0x95, 0x80, 0xb0, 0xb1, 0x54, 0x67, 0xf7, 0xd5, + 0x39, 0x12, 0xfb, 0xb9, 0xbe, 0x4b, 0xa4, 0xae, 0x6c, 0x2c, 0x08, 0xc1, 0xa7, 0xe1, 0x1b, 0x74, + 0xac, 0xc4, 0x82, 0x18, 0x2a, 0x94, 0xf0, 0x41, 0x50, 0x7c, 0x76, 0x5a, 0x03, 0x86, 0x6c, 0x97, + 0x97, 0xdf, 0xbf, 0xf7, 0x7b, 0x32, 0xf5, 0x75, 0xf2, 0x16, 0x42, 0xab, 0x27, 0x20, 0x8f, 0x00, + 0x62, 0x95, 0x0d, 0xc1, 0xca, 0xc9, 0x8e, 0x3c, 0x1e, 0x43, 0x76, 0x22, 0xd2, 0x0c, 0x2d, 0xb2, + 0xb5, 0x05, 0x46, 0x2c, 0x30, 0x62, 0xb2, 0xe3, 0xb5, 0x23, 0x8c, 0x30, 0x87, 0xc8, 0xf9, 0xcb, + 0xa1, 0xbd, 0x8d, 0x1a, 0xc5, 0x0b, 0xaa, 0xc3, 0xdd, 0x8d, 0x10, 0xa3, 0x11, 0x48, 0x95, 0x6a, + 0xa9, 0x92, 0x04, 0xad, 0xb2, 0x1a, 0x13, 0xe3, 0xfe, 0xf5, 0xdb, 0x94, 0xbd, 0x9a, 0x47, 0x78, + 0xa9, 0x32, 0x15, 0x9b, 0x3e, 0x1c, 0x8f, 0xc1, 0x58, 0xff, 0x35, 0xbd, 0x55, 0x99, 0x9a, 0x14, + 0x13, 0x03, 0xec, 0x29, 0x6d, 0xa5, 0xf9, 0xe4, 0x36, 0xe9, 0x92, 0xcd, 0x1b, 0xbb, 0x5c, 0xfc, + 0x3d, 0xb1, 0x70, 0xbc, 0xde, 0xd5, 0xd3, 0xf3, 0xf5, 0x46, 0xbf, 0xe0, 0xf8, 0x9d, 0x42, 0xb4, + 0xa7, 0x0c, 0x3c, 0x03, 0x28, 0xbd, 0xf6, 0x69, 0xbb, 0x3a, 0x2e, 0xcc, 0x9e, 0xd0, 0xd5, 0x40, + 0x19, 0x38, 0x38, 0x02, 0xc8, 0xed, 0xae, 0xf7, 0xee, 0x7c, 0x3f, 0x5f, 0xef, 0x84, 0x68, 0x62, + 0x34, 0xe6, 0x70, 0x28, 0x34, 0xca, 0x58, 0xd9, 0x81, 0xd8, 0x4b, 0x6c, 0x7f, 0x25, 0x70, 0x6c, + 0x7f, 0xad, 0x54, 0x1b, 0x61, 0x38, 0x7c, 0xae, 0x16, 0x1b, 0x6d, 0xd1, 0xce, 0x6f, 0xf3, 0xc2, + 0xe6, 0x26, 0x6d, 0x46, 0xca, 0x2d, 0xd4, 0xec, 0xcf, 0x9f, 0xbb, 0x5f, 0x9a, 0xf4, 0x5a, 0x8e, + 0x65, 0xef, 0x09, 0x6d, 0xb9, 0x55, 0xd8, 0x83, 0xba, 0x55, 0xff, 0x6c, 0xcf, 0x7b, 0xb8, 0x14, + 0xd6, 0xf9, 0xfb, 0x1b, 0xef, 0xbe, 0xfe, 0xfc, 0x7c, 0xa5, 0xcb, 0xb8, 0xac, 0xb9, 0xa7, 0x6b, + 0x8f, 0x7d, 0x20, 0x74, 0xa5, 0xa8, 0x88, 0xfd, 0xdb, 0xa0, 0xda, 0xaf, 0xf7, 0x68, 0x39, 0x70, + 0x11, 0x67, 0x33, 0x8f, 0xe3, 0xb3, 0x6e, 0x5d, 0x9c, 0xf2, 0x26, 0xec, 0x13, 0xa1, 0xab, 0x65, + 0x9b, 0xec, 0x3f, 0x26, 0xd5, 0x63, 0x78, 0xdb, 0x4b, 0xa2, 0x8b, 0x4c, 0x5b, 0x79, 0xa6, 0xfb, + 0xec, 0x5e, 0x6d, 0xa6, 0x39, 0xe3, 0x20, 0x52, 0xa6, 0xa7, 0x4f, 0xa7, 0x9c, 0x9c, 0x4d, 0x39, + 0xf9, 0x31, 0xe5, 0xe4, 0xe3, 0x8c, 0x37, 0xce, 0x66, 0xbc, 0xf1, 0x6d, 0xc6, 0x1b, 0x6f, 0x5e, + 0x44, 0xda, 0x0e, 0xc6, 0x81, 0x08, 0x31, 0x96, 0x7b, 0xa5, 0xcc, 0xbe, 0x0a, 0xcc, 0x85, 0xe8, + 0x76, 0x88, 0x19, 0x5c, 0xfe, 0x39, 0x50, 0x3a, 0x91, 0x31, 0x1e, 0x8e, 0x47, 0x60, 0x2e, 0x39, + 0xda, 0x93, 0x14, 0x4c, 0xd0, 0xca, 0x3f, 0xa0, 0xc7, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc5, + 0x1a, 0x43, 0xd9, 0xda, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Params queries the parameters of x/feemarket module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // BaseFee queries the base fee of the parent block of the current block. + BaseFee(ctx context.Context, in *QueryBaseFeeRequest, opts ...grpc.CallOption) (*QueryBaseFeeResponse, error) + // BlockGas queries the gas used at a given block height + BlockGas(ctx context.Context, in *QueryBlockGasRequest, opts ...grpc.CallOption) (*QueryBlockGasResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/injective.feemarket.v1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BaseFee(ctx context.Context, in *QueryBaseFeeRequest, opts ...grpc.CallOption) (*QueryBaseFeeResponse, error) { + out := new(QueryBaseFeeResponse) + err := c.cc.Invoke(ctx, "/injective.feemarket.v1.Query/BaseFee", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BlockGas(ctx context.Context, in *QueryBlockGasRequest, opts ...grpc.CallOption) (*QueryBlockGasResponse, error) { + out := new(QueryBlockGasResponse) + err := c.cc.Invoke(ctx, "/injective.feemarket.v1.Query/BlockGas", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Params queries the parameters of x/feemarket module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // BaseFee queries the base fee of the parent block of the current block. + BaseFee(context.Context, *QueryBaseFeeRequest) (*QueryBaseFeeResponse, error) + // BlockGas queries the gas used at a given block height + BlockGas(context.Context, *QueryBlockGasRequest) (*QueryBlockGasResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) BaseFee(ctx context.Context, req *QueryBaseFeeRequest) (*QueryBaseFeeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BaseFee not implemented") +} +func (*UnimplementedQueryServer) BlockGas(ctx context.Context, req *QueryBlockGasRequest) (*QueryBlockGasResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BlockGas not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.feemarket.v1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BaseFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBaseFeeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BaseFee(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.feemarket.v1.Query/BaseFee", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BaseFee(ctx, req.(*QueryBaseFeeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BlockGas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBlockGasRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BlockGas(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.feemarket.v1.Query/BlockGas", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BlockGas(ctx, req.(*QueryBlockGasRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "injective.feemarket.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "BaseFee", + Handler: _Query_BaseFee_Handler, + }, + { + MethodName: "BlockGas", + Handler: _Query_BlockGas_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "injective/feemarket/v1/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryBaseFeeRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBaseFeeRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBaseFeeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryBaseFeeResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBaseFeeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBaseFeeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BaseFee != nil { + { + size := m.BaseFee.Size() + i -= size + if _, err := m.BaseFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBlockGasRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBlockGasRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBlockGasRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryBlockGasResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBlockGasResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBlockGasResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Gas != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Gas)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryBaseFeeRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryBaseFeeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BaseFee != nil { + l = m.BaseFee.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBlockGasRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryBlockGasResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Gas != 0 { + n += 1 + sovQuery(uint64(m.Gas)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBaseFeeRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBaseFeeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBaseFeeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBaseFeeResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBaseFeeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBaseFeeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.BaseFee = &v + if err := m.BaseFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBlockGasRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBlockGasRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBlockGasRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBlockGasResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBlockGasResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBlockGasResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Gas", wireType) + } + m.Gas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Gas |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/chain/feemarket/types/tx.pb.go b/chain/feemarket/types/tx.pb.go new file mode 100644 index 00000000..dac1c7db --- /dev/null +++ b/chain/feemarket/types/tx.pb.go @@ -0,0 +1,596 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: injective/feemarket/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgUpdateParams defines a Msg for updating the x/feemarket module parameters. +type MsgUpdateParams struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/feemarket parameters to update. + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_c06065f3188e9c7e, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c06065f3188e9c7e, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "injective.feemarket.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "injective.feemarket.v1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("injective/feemarket/v1/tx.proto", fileDescriptor_c06065f3188e9c7e) } + +var fileDescriptor_c06065f3188e9c7e = []byte{ + // 348 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcf, 0xcc, 0xcb, 0x4a, + 0x4d, 0x2e, 0xc9, 0x2c, 0x4b, 0xd5, 0x4f, 0x4b, 0x4d, 0xcd, 0x4d, 0x2c, 0xca, 0x4e, 0x2d, 0xd1, + 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x83, 0x2b, 0xd0, + 0x83, 0x2b, 0xd0, 0x2b, 0x33, 0x94, 0x12, 0x4f, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0xcf, 0x2d, + 0x4e, 0x07, 0xa9, 0xcf, 0x2d, 0x4e, 0x87, 0x68, 0x90, 0x92, 0x84, 0x48, 0xc4, 0x83, 0x79, 0xfa, + 0x10, 0x0e, 0x54, 0x4a, 0x0d, 0x87, 0x65, 0x08, 0x83, 0x21, 0xea, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, + 0x21, 0xfa, 0x41, 0x2c, 0x88, 0xa8, 0xd2, 0x74, 0x46, 0x2e, 0x7e, 0xdf, 0xe2, 0xf4, 0xd0, 0x82, + 0x94, 0xc4, 0x92, 0xd4, 0x80, 0xc4, 0xa2, 0xc4, 0xdc, 0x62, 0x21, 0x33, 0x2e, 0xce, 0xc4, 0xd2, + 0x92, 0x8c, 0xfc, 0xa2, 0xcc, 0x92, 0x4a, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0x89, 0x4b, + 0x5b, 0x74, 0x45, 0xa0, 0xd6, 0x3a, 0xa6, 0xa4, 0x14, 0xa5, 0x16, 0x17, 0x07, 0x97, 0x14, 0x65, + 0xe6, 0xa5, 0x07, 0x21, 0x94, 0x0a, 0xd9, 0x70, 0xb1, 0x15, 0x80, 0x4d, 0x90, 0x60, 0x52, 0x60, + 0xd4, 0xe0, 0x36, 0x92, 0xd3, 0xc3, 0xee, 0x4d, 0x3d, 0x88, 0x3d, 0x4e, 0x2c, 0x27, 0xee, 0xc9, + 0x33, 0x04, 0x41, 0xf5, 0x58, 0xf1, 0x35, 0x3d, 0xdf, 0xa0, 0x85, 0x30, 0x4d, 0x49, 0x92, 0x4b, + 0x1c, 0xcd, 0x61, 0x41, 0xa9, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x46, 0x65, 0x5c, 0xcc, 0xbe, + 0xc5, 0xe9, 0x42, 0x19, 0x5c, 0x3c, 0x28, 0xee, 0x56, 0xc7, 0x65, 0x1f, 0x9a, 0x39, 0x52, 0xfa, + 0x44, 0x2a, 0x84, 0x59, 0x28, 0xc5, 0xda, 0xf0, 0x7c, 0x83, 0x16, 0xa3, 0x53, 0xe6, 0x89, 0x47, + 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, + 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xf9, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, + 0x25, 0xe7, 0xe7, 0xea, 0x7b, 0xc2, 0xcc, 0xf6, 0x49, 0x4c, 0x2a, 0xd6, 0x87, 0xdb, 0xa4, 0x9b, + 0x9c, 0x5f, 0x94, 0x8a, 0xcc, 0xcd, 0x48, 0xcc, 0xcc, 0xd3, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, + 0x2d, 0x46, 0x8a, 0xba, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0xf4, 0x18, 0x03, 0x02, + 0x00, 0x00, 0xff, 0xff, 0x92, 0x14, 0xb6, 0x7b, 0x4b, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defined a governance operation for updating the x/feemarket module parameters. + // The authority is hard-coded to the Cosmos SDK x/gov module account + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/injective.feemarket.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defined a governance operation for updating the x/feemarket module parameters. + // The authority is hard-coded to the Cosmos SDK x/gov module account + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/injective.feemarket.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "injective.feemarket.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "injective/feemarket/v1/tx.proto", +} + +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/proto/injective/evm/v1/access_tuple.proto b/proto/injective/evm/v1/access_tuple.proto new file mode 100644 index 00000000..b2030cf5 --- /dev/null +++ b/proto/injective/evm/v1/access_tuple.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package injective.evm.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/evm/types"; + +// AccessTuple is the element type of an access list. +message AccessTuple { + option (gogoproto.goproto_getters) = false; + + // address is a hex formatted ethereum address + string address = 1; + // storage_keys are hex formatted hashes of the storage keys + repeated string storage_keys = 2 [(gogoproto.jsontag) = "storageKeys"]; +} diff --git a/proto/injective/evm/v1/chain_config.proto b/proto/injective/evm/v1/chain_config.proto new file mode 100644 index 00000000..673bf58b --- /dev/null +++ b/proto/injective/evm/v1/chain_config.proto @@ -0,0 +1,117 @@ +syntax = "proto3"; +package injective.evm.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/evm/types"; + +// ChainConfig defines the Ethereum ChainConfig parameters using *sdkmath.Int values +// instead of *big.Int. +message ChainConfig { + // homestead_block switch (nil no fork, 0 = already homestead) + string homestead_block = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"homestead_block\"" + ]; + // dao_fork_block corresponds to TheDAO hard-fork switch block (nil no fork) + string dao_fork_block = 2 [ + (gogoproto.customname) = "DAOForkBlock", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"dao_fork_block\"" + ]; + // dao_fork_support defines whether the nodes supports or opposes the DAO hard-fork + bool dao_fork_support = 3 + [(gogoproto.customname) = "DAOForkSupport", (gogoproto.moretags) = "yaml:\"dao_fork_support\""]; + // eip150_block: EIP150 implements the Gas price changes + // (https://github.com/ethereum/EIPs/issues/150) EIP150 HF block (nil no fork) + string eip150_block = 4 [ + (gogoproto.customname) = "EIP150Block", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"eip150_block\"" + ]; + // eip150_hash: EIP150 HF hash (needed for header only clients as only gas pricing changed) + string eip150_hash = 5 [(gogoproto.customname) = "EIP150Hash", (gogoproto.moretags) = "yaml:\"byzantium_block\""]; + // eip155_block: EIP155Block HF block + string eip155_block = 6 [ + (gogoproto.customname) = "EIP155Block", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"eip155_block\"" + ]; + // eip158_block: EIP158 HF block + string eip158_block = 7 [ + (gogoproto.customname) = "EIP158Block", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"eip158_block\"" + ]; + // byzantium_block: Byzantium switch block (nil no fork, 0 = already on byzantium) + string byzantium_block = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"byzantium_block\"" + ]; + // constantinople_block: Constantinople switch block (nil no fork, 0 = already activated) + string constantinople_block = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"constantinople_block\"" + ]; + // petersburg_block: Petersburg switch block (nil same as Constantinople) + string petersburg_block = 10 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"petersburg_block\"" + ]; + // istanbul_block: Istanbul switch block (nil no fork, 0 = already on istanbul) + string istanbul_block = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"istanbul_block\"" + ]; + // muir_glacier_block: Eip-2384 (bomb delay) switch block (nil no fork, 0 = already activated) + string muir_glacier_block = 12 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"muir_glacier_block\"" + ]; + // berlin_block: Berlin switch block (nil = no fork, 0 = already on berlin) + string berlin_block = 13 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"berlin_block\"" + ]; + // DEPRECATED: EWASM, YOLOV3 and Catalyst block have been deprecated + reserved 14, 15, 16; + reserved "yolo_v3_block", "ewasm_block", "catalyst_block"; + // london_block: London switch block (nil = no fork, 0 = already on london) + string london_block = 17 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"london_block\"" + ]; + // arrow_glacier_block: Eip-4345 (bomb delay) switch block (nil = no fork, 0 = already activated) + string arrow_glacier_block = 18 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"arrow_glacier_block\"" + ]; + // DEPRECATED: merge fork block was deprecated: https://github.com/ethereum/go-ethereum/pull/24904 + reserved 19; + reserved "merge_fork_block"; + // gray_glacier_block: EIP-5133 (bomb delay) switch block (nil = no fork, 0 = already activated) + string gray_glacier_block = 20 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"gray_glacier_block\"" + ]; + // merge_netsplit_block: Virtual fork after The Merge to use as a network splitter + string merge_netsplit_block = 21 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"merge_netsplit_block\"" + ]; + // shanghai switch time (nil = no fork, 0 = already on shanghai) + string shanghai_time = 22 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"shanghai_time\"" + ]; + // cancun switch time (nil = no fork, 0 = already on cancun) + string cancun_time = 23 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"cancun_time\"" + ]; + // prague switch time (nil = no fork, 0 = already on prague) + string prague_time = 24 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "yaml:\"prague_time\"" + ]; +} \ No newline at end of file diff --git a/proto/injective/evm/v1/events.proto b/proto/injective/evm/v1/events.proto new file mode 100644 index 00000000..8c034d60 --- /dev/null +++ b/proto/injective/evm/v1/events.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +package injective.evm.v1; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/evm/types"; + +// EventEthereumTx defines the event for an Ethereum transaction +message EventEthereumTx { + // amount + string amount = 1; + // eth_hash is the Ethereum hash of the transaction + string eth_hash = 2; + // index of the transaction in the block + string index = 3; + // gas_used is the amount of gas used by the transaction + string gas_used = 4; + // hash is the Tendermint hash of the transaction + string hash = 5; + // recipient of the transaction + string recipient = 6; + // eth_tx_failed contains a VM error should it occur + string eth_tx_failed = 7; +} + +// EventTxLog defines the event for an Ethereum transaction log +message EventTxLog { + // tx_logs is an array of transaction logs + repeated string tx_logs = 1; +} + +// EventMessage +message EventMessage { + // module which emits the event + string module = 1; + // sender of the message + string sender = 2; + // tx_type is the type of the message + string tx_type = 3; +} + +// EventBlockBloom defines an Ethereum block bloom filter event +message EventBlockBloom { + // bloom is the bloom filter of the block + string bloom = 1; +} diff --git a/proto/injective/evm/v1/genesis.proto b/proto/injective/evm/v1/genesis.proto new file mode 100644 index 00000000..e97142fe --- /dev/null +++ b/proto/injective/evm/v1/genesis.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package injective.evm.v1; + +import "injective/evm/v1/params.proto"; +import "injective/evm/v1/state.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/evm/types"; + +// GenesisState defines the evm module's genesis state. +message GenesisState { + // accounts is an array containing the ethereum genesis accounts. + repeated GenesisAccount accounts = 1 [(gogoproto.nullable) = false]; + // params defines all the parameters of the module. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// GenesisAccount defines an account to be initialized in the genesis state. +// Its main difference between with Geth's GenesisAccount is that it uses a +// custom storage type and that it doesn't contain the private key field. +message GenesisAccount { + // address defines an ethereum hex formated address of an account + string address = 1; + // code defines the hex bytes of the account code. + string code = 2; + // storage defines the set of state key values for the account. + repeated State storage = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "Storage"]; +} diff --git a/proto/injective/evm/v1/log.proto b/proto/injective/evm/v1/log.proto new file mode 100644 index 00000000..44817be7 --- /dev/null +++ b/proto/injective/evm/v1/log.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package injective.evm.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/evm/types"; + +// Log represents an protobuf compatible Ethereum Log that defines a contract +// log event. These events are generated by the LOG opcode and stored/indexed by +// the node. +// +// NOTE: address, topics and data are consensus fields. The rest of the fields +// are derived, i.e. filled in by the nodes, but not secured by consensus. +message Log { + // address of the contract that generated the event + string address = 1; + // topics is a list of topics provided by the contract. + repeated string topics = 2; + // data which is supplied by the contract, usually ABI-encoded + bytes data = 3; + + // block_number of the block in which the transaction was included + uint64 block_number = 4 [(gogoproto.jsontag) = "blockNumber"]; + // tx_hash is the transaction hash + string tx_hash = 5 [(gogoproto.jsontag) = "transactionHash"]; + // tx_index of the transaction in the block + uint64 tx_index = 6 [(gogoproto.jsontag) = "transactionIndex"]; + // block_hash of the block in which the transaction was included + string block_hash = 7 [(gogoproto.jsontag) = "blockHash"]; + // index of the log in the block + uint64 index = 8 [(gogoproto.jsontag) = "logIndex"]; + + // removed is true if this log was reverted due to a chain + // reorganisation. You must pay attention to this field if you receive logs + // through a filter query. + bool removed = 9; +} \ No newline at end of file diff --git a/proto/injective/evm/v1/params.proto b/proto/injective/evm/v1/params.proto new file mode 100644 index 00000000..a7634931 --- /dev/null +++ b/proto/injective/evm/v1/params.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package injective.evm.v1; + +import "gogoproto/gogo.proto"; +import "injective/evm/v1/chain_config.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/evm/types"; + +// Params defines the EVM module parameters +message Params { + // evm_denom represents the token denomination used to run the EVM state + // transitions. + string evm_denom = 1 [(gogoproto.moretags) = "yaml:\"evm_denom\""]; + // enable_create toggles state transitions that use the vm.Create function + bool enable_create = 2 [(gogoproto.moretags) = "yaml:\"enable_create\""]; + // enable_call toggles state transitions that use the vm.Call function + bool enable_call = 3 [(gogoproto.moretags) = "yaml:\"enable_call\""]; + // extra_eips defines the additional EIPs for the vm.Config + repeated int64 extra_eips = 4 [(gogoproto.customname) = "ExtraEIPs", (gogoproto.moretags) = "yaml:\"extra_eips\""]; + // chain_config defines the EVM chain configuration parameters + ChainConfig chain_config = 5 [(gogoproto.nullable) = false]; + // allow_unprotected_txs defines if replay-protected (i.e non EIP155 + // signed) transactions can be executed on the state machine. + bool allow_unprotected_txs = 6; +} \ No newline at end of file diff --git a/proto/injective/evm/v1/query.proto b/proto/injective/evm/v1/query.proto new file mode 100644 index 00000000..28c7c423 --- /dev/null +++ b/proto/injective/evm/v1/query.proto @@ -0,0 +1,338 @@ +syntax = "proto3"; +package injective.evm.v1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "injective/evm/v1/tx.proto"; +import "injective/evm/v1/log.proto"; +import "injective/evm/v1/params.proto"; +import "injective/evm/v1/trace_config.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/evm/types"; + +// Query defines the gRPC querier service. +service Query { + // Account queries an Ethereum account. + rpc Account(QueryAccountRequest) returns (QueryAccountResponse) { + option (google.api.http).get = "/injective/evm/v1/account/{address}"; + } + + // CosmosAccount queries an Ethereum account's Cosmos Address. + rpc CosmosAccount(QueryCosmosAccountRequest) returns (QueryCosmosAccountResponse) { + option (google.api.http).get = "/injective/evm/v1/cosmos_account/{address}"; + } + + // ValidatorAccount queries an Ethereum account's from a validator consensus + // Address. + rpc ValidatorAccount(QueryValidatorAccountRequest) returns (QueryValidatorAccountResponse) { + option (google.api.http).get = "/injective/evm/v1/validator_account/{cons_address}"; + } + + // Balance queries the balance of a the EVM denomination for a single + // EthAccount. + rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { + option (google.api.http).get = "/injective/evm/v1/balances/{address}"; + } + + // Storage queries the balance of all coins for a single account. + rpc Storage(QueryStorageRequest) returns (QueryStorageResponse) { + option (google.api.http).get = "/injective/evm/v1/storage/{address}/{key}"; + } + + // Code queries the balance of all coins for a single account. + rpc Code(QueryCodeRequest) returns (QueryCodeResponse) { + option (google.api.http).get = "/injective/evm/v1/codes/{address}"; + } + + // Params queries the parameters of x/evm module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/injective/evm/v1/params"; + } + + // EthCall implements the `eth_call` rpc api + rpc EthCall(EthCallRequest) returns (MsgEthereumTxResponse) { + option (google.api.http).get = "/injective/evm/v1/eth_call"; + } + + // EstimateGas implements the `eth_estimateGas` rpc api + rpc EstimateGas(EthCallRequest) returns (EstimateGasResponse) { + option (google.api.http).get = "/injective/evm/v1/estimate_gas"; + } + + // TraceTx implements the `debug_traceTransaction` rpc api + rpc TraceTx(QueryTraceTxRequest) returns (QueryTraceTxResponse) { + option (google.api.http).get = "/injective/evm/v1/trace_tx"; + } + + // TraceBlock implements the `debug_traceBlockByNumber` and `debug_traceBlockByHash` rpc api + rpc TraceBlock(QueryTraceBlockRequest) returns (QueryTraceBlockResponse) { + option (google.api.http).get = "/injective/evm/v1/trace_block"; + } + + // TraceCall implements the `debug_traceCall` rpc api + rpc TraceCall(QueryTraceCallRequest) returns (QueryTraceCallResponse) { + option (google.api.http).get = "/injective/evm/v1/trace_call"; + } + + // BaseFee queries the base fee of the parent block of the current block, + // it's similar to feemarket module's method, but also checks london hardfork status. + rpc BaseFee(QueryBaseFeeRequest) returns (QueryBaseFeeResponse) { + option (google.api.http).get = "/injective/evm/v1/base_fee"; + } +} + +// QueryAccountRequest is the request type for the Query/Account RPC method. +message QueryAccountRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the ethereum hex address to query the account for. + string address = 1; +} + +// QueryAccountResponse is the response type for the Query/Account RPC method. +message QueryAccountResponse { + // balance is the balance of the EVM denomination. + string balance = 1; + // code_hash is the hex-formatted code bytes from the EOA. + string code_hash = 2; + // nonce is the account's sequence number. + uint64 nonce = 3; +} + +// QueryCosmosAccountRequest is the request type for the Query/CosmosAccount RPC +// method. +message QueryCosmosAccountRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the ethereum hex address to query the account for. + string address = 1; +} + +// QueryCosmosAccountResponse is the response type for the Query/CosmosAccount +// RPC method. +message QueryCosmosAccountResponse { + // cosmos_address is the cosmos address of the account. + string cosmos_address = 1; + // sequence is the account's sequence number. + uint64 sequence = 2; + // account_number is the account number + uint64 account_number = 3; +} + +// QueryValidatorAccountRequest is the request type for the +// Query/ValidatorAccount RPC method. +message QueryValidatorAccountRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // cons_address is the validator cons address to query the account for. + string cons_address = 1; +} + +// QueryValidatorAccountResponse is the response type for the +// Query/ValidatorAccount RPC method. +message QueryValidatorAccountResponse { + // account_address is the cosmos address of the account in bech32 format. + string account_address = 1; + // sequence is the account's sequence number. + uint64 sequence = 2; + // account_number is the account number + uint64 account_number = 3; +} + +// QueryBalanceRequest is the request type for the Query/Balance RPC method. +message QueryBalanceRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the ethereum hex address to query the balance for. + string address = 1; +} + +// QueryBalanceResponse is the response type for the Query/Balance RPC method. +message QueryBalanceResponse { + // balance is the balance of the EVM denomination. + string balance = 1; +} + +// QueryStorageRequest is the request type for the Query/Storage RPC method. +message QueryStorageRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the ethereum hex address to query the storage state for. + string address = 1; + + // key defines the key of the storage state + string key = 2; +} + +// QueryStorageResponse is the response type for the Query/Storage RPC +// method. +message QueryStorageResponse { + // value defines the storage state value hash associated with the given key. + string value = 1; +} + +// QueryCodeRequest is the request type for the Query/Code RPC method. +message QueryCodeRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the ethereum hex address to query the code for. + string address = 1; +} + +// QueryCodeResponse is the response type for the Query/Code RPC +// method. +message QueryCodeResponse { + // code represents the code bytes from an ethereum address. + bytes code = 1; +} + +// QueryTxLogsRequest is the request type for the Query/TxLogs RPC method. +message QueryTxLogsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // hash is the ethereum transaction hex hash to query the logs for. + string hash = 1; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryTxLogsResponse is the response type for the Query/TxLogs RPC method. +message QueryTxLogsResponse { + // logs represents the ethereum logs generated from the given transaction. + repeated Log logs = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest defines the request type for querying x/evm parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/evm parameters. +message QueryParamsResponse { + // params define the evm module parameters. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// EthCallRequest defines EthCall request +message EthCallRequest { + // args uses the same json format as the json rpc api. + bytes args = 1; + // gas_cap defines the default gas cap to be used + uint64 gas_cap = 2; + // proposer_address of the requested block in hex format + bytes proposer_address = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"]; + // chain_id is the eip155 chain id parsed from the requested block header + int64 chain_id = 4; + // state overrides encoded as json + bytes overrides = 5; +} + +// EstimateGasResponse defines EstimateGas response +message EstimateGasResponse { + // gas returns the estimated gas + uint64 gas = 1; + // ret is the returned data from evm function (result or data supplied with revert + // opcode) + bytes ret = 2; + // vm_error is the error returned by vm execution + string vm_error = 3; +} + +// QueryTraceTxRequest defines TraceTx request +message QueryTraceTxRequest { + // msg is the MsgEthereumTx for the requested transaction + MsgEthereumTx msg = 1; + // tx_index is not necessary anymore + reserved 2; + reserved "tx_index"; + // trace_config holds extra parameters to trace functions. + TraceConfig trace_config = 3; + // predecessors is an array of transactions included in the same block + // need to be replayed first to get correct context for tracing. + repeated MsgEthereumTx predecessors = 4; + // block_number of requested transaction + int64 block_number = 5; + // block_hash of requested transaction + string block_hash = 6; + // block_time of requested transaction + google.protobuf.Timestamp block_time = 7 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + // proposer_address is the proposer of the requested block + bytes proposer_address = 8 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"]; + // chain_id is the the eip155 chain id parsed from the requested block header + int64 chain_id = 9; +} + +// QueryTraceTxResponse defines TraceTx response +message QueryTraceTxResponse { + // data is the response serialized in bytes + bytes data = 1; +} + +// QueryTraceCallRequest defines TraceCall request +message QueryTraceCallRequest { + // args uses the same json format as the json rpc api. + bytes args = 1; + // gas_cap defines the default gas cap to be used + uint64 gas_cap = 2; + // proposer_address of the requested block in hex format + bytes proposer_address = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"]; + // trace_config holds extra parameters to trace functions. + TraceConfig trace_config = 4; + // block_number of requested transaction + int64 block_number = 5; + // block_hash of requested transaction + string block_hash = 6; + // block_time of requested transaction + google.protobuf.Timestamp block_time = 7 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + // chain_id is the the eip155 chain id parsed from the requested block header + int64 chain_id = 8; +} + +// QueryTraceCallResponse defines TraceCallResponse +message QueryTraceCallResponse { + // data is the response serialized in bytes + bytes data = 1; +} + +// QueryTraceBlockRequest defines TraceTx request +message QueryTraceBlockRequest { + // txs is an array of messages in the block + repeated MsgEthereumTx txs = 1; + // trace_config holds extra parameters to trace functions. + TraceConfig trace_config = 3; + // block_number of the traced block + int64 block_number = 5; + // block_hash (hex) of the traced block + string block_hash = 6; + // block_time of the traced block + google.protobuf.Timestamp block_time = 7 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + // proposer_address is the address of the requested block + bytes proposer_address = 8 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"]; + // chain_id is the eip155 chain id parsed from the requested block header + int64 chain_id = 9; +} + +// QueryTraceBlockResponse defines TraceBlock response +message QueryTraceBlockResponse { + // data is the response serialized in bytes + bytes data = 1; +} + +// QueryBaseFeeRequest defines the request type for querying the EIP1559 base +// fee. +message QueryBaseFeeRequest {} + +// QueryBaseFeeResponse returns the EIP1559 base fee. +message QueryBaseFeeResponse { + // base_fee is the EIP1559 base fee + string base_fee = 1 [(gogoproto.customtype) = "cosmossdk.io/math.Int"]; +} diff --git a/proto/injective/evm/v1/state.proto b/proto/injective/evm/v1/state.proto new file mode 100644 index 00000000..d7752f7c --- /dev/null +++ b/proto/injective/evm/v1/state.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package injective.evm.v1; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/evm/types"; + +// State represents a single Storage key value pair item. +message State { + // key is the stored key + string key = 1; + // value is the stored value for the given key + string value = 2; +} \ No newline at end of file diff --git a/proto/injective/evm/v1/trace_config.proto b/proto/injective/evm/v1/trace_config.proto new file mode 100644 index 00000000..dc2b2848 --- /dev/null +++ b/proto/injective/evm/v1/trace_config.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package injective.evm.v1; + +import "gogoproto/gogo.proto"; +import "injective/evm/v1/chain_config.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/evm/types"; + +// TraceConfig holds extra parameters to trace functions. +message TraceConfig { + // DEPRECATED: DisableMemory and DisableReturnData have been renamed to + // Enable*. + reserved 4, 7; + reserved "disable_memory", "disable_return_data"; + + // tracer is a custom javascript tracer + string tracer = 1; + // timeout overrides the default timeout of 5 seconds for JavaScript-based tracing + // calls + string timeout = 2; + // reexec defines the number of blocks the tracer is willing to go back + uint64 reexec = 3; + // disable_stack switches stack capture + bool disable_stack = 5 [(gogoproto.jsontag) = "disableStack"]; + // disable_storage switches storage capture + bool disable_storage = 6 [(gogoproto.jsontag) = "disableStorage"]; + // debug can be used to print output during capture end + bool debug = 8; + // limit defines the maximum length of output, but zero means unlimited + int32 limit = 9; + // overrides can be used to execute a trace using future fork rules + ChainConfig overrides = 10; + // enable_memory switches memory capture + bool enable_memory = 11 [(gogoproto.jsontag) = "enableMemory"]; + // enable_return_data switches the capture of return data + bool enable_return_data = 12 [(gogoproto.jsontag) = "enableReturnData"]; + // tracer_json_config configures the tracer using a JSON string + string tracer_json_config = 13 [(gogoproto.jsontag) = "tracerConfig"]; + // temporary state modifications to Geth in order to simulate the effects of eth_call + bytes state_overrides = 14 [(gogoproto.jsontag) = "stateOverrides"]; + // block overrides block context fields encoded as json + bytes block_overrides = 15 [(gogoproto.jsontag) = "blockOverrides"]; +} \ No newline at end of file diff --git a/proto/injective/evm/v1/transaction_logs.proto b/proto/injective/evm/v1/transaction_logs.proto new file mode 100644 index 00000000..a63a8879 --- /dev/null +++ b/proto/injective/evm/v1/transaction_logs.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package injective.evm.v1; + +import "injective/evm/v1/log.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/evm/types"; + +// TransactionLogs define the logs generated from a transaction execution +// with a given hash. It it used for import/export data as transactions are not +// persisted on blockchain state after an upgrade. +message TransactionLogs { + // hash of the transaction + string hash = 1; + // logs is an array of Logs for the given transaction hash + repeated Log logs = 2; +} diff --git a/proto/injective/evm/v1/tx.proto b/proto/injective/evm/v1/tx.proto new file mode 100644 index 00000000..8b60d4cf --- /dev/null +++ b/proto/injective/evm/v1/tx.proto @@ -0,0 +1,189 @@ +syntax = "proto3"; +package injective.evm.v1; + +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "injective/evm/v1/access_tuple.proto"; +import "injective/evm/v1/log.proto"; +import "injective/evm/v1/params.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/evm/types"; + +// Msg defines the evm Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + // EthereumTx defines a method submitting Ethereum transactions. + rpc EthereumTx(MsgEthereumTx) returns (MsgEthereumTxResponse) { + option (google.api.http).post = "/injective/evm/v1/ethereum_tx"; + }; + // UpdateParams defined a governance operation for updating the x/evm module parameters. + // The authority is hard-coded to the Cosmos SDK x/gov module account + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgEthereumTx encapsulates an Ethereum transaction as an SDK message. +message MsgEthereumTx { + option (cosmos.msg.v1.signer) = "from"; + option (gogoproto.goproto_getters) = false; + + // data is inner transaction data of the Ethereum transaction + google.protobuf.Any data = 1; + + // size is the encoded storage size of the transaction (DEPRECATED) + double size = 2 [(gogoproto.jsontag) = "-"]; + // hash of the transaction in hex format + string deprecated_hash = 3 [(gogoproto.moretags) = "rlp:\"-\""]; + string deprecated_from = 4 [deprecated = true]; + // from is the bytes of ethereum signer address. This address value is checked + // against the address derived from the signature (V, R, S) using the + // secp256k1 elliptic curve + bytes from = 5; + // raw is the raw bytes of the ethereum transaction + bytes raw = 6 [(gogoproto.customtype) = "EthereumTx", (gogoproto.nullable) = false]; +} + +// LegacyTx is the transaction data of regular Ethereum transactions. +// NOTE: All non-protected transactions (i.e non EIP155 signed) will fail if the +// AllowUnprotectedTxs parameter is disabled. +message LegacyTx { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "TxData"; + + // nonce corresponds to the account nonce (transaction sequence). + uint64 nonce = 1; + // gas_price defines the value for each gas unit + string gas_price = 2 [(gogoproto.customtype) = "cosmossdk.io/math.Int"]; + // gas defines the gas limit defined for the transaction. + uint64 gas = 3 [(gogoproto.customname) = "GasLimit"]; + // to is the hex formatted address of the recipient + string to = 4; + // value defines the unsigned integer value of the transaction amount. + string value = 5 + [(gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.customname) = "Amount"]; + // data is the data payload bytes of the transaction. + bytes data = 6; + // v defines the signature value + bytes v = 7; + // r defines the signature value + bytes r = 8; + // s define the signature value + bytes s = 9; +} + +// AccessListTx is the data of EIP-2930 access list transactions. +message AccessListTx { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "TxData"; + + // chain_id of the destination EVM chain + string chain_id = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.customname) = "ChainID", + (gogoproto.jsontag) = "chainID" + ]; + // nonce corresponds to the account nonce (transaction sequence). + uint64 nonce = 2; + // gas_price defines the value for each gas unit + string gas_price = 3 [(gogoproto.customtype) = "cosmossdk.io/math.Int"]; + // gas defines the gas limit defined for the transaction. + uint64 gas = 4 [(gogoproto.customname) = "GasLimit"]; + // to is the recipient address in hex format + string to = 5; + // value defines the unsigned integer value of the transaction amount. + string value = 6 + [(gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.customname) = "Amount"]; + // data is the data payload bytes of the transaction. + bytes data = 7; + // accesses is an array of access tuples + repeated AccessTuple accesses = 8 + [(gogoproto.castrepeated) = "AccessList", (gogoproto.jsontag) = "accessList", (gogoproto.nullable) = false]; + // v defines the signature value + bytes v = 9; + // r defines the signature value + bytes r = 10; + // s define the signature value + bytes s = 11; +} + +// DynamicFeeTx is the data of EIP-1559 dinamic fee transactions. +message DynamicFeeTx { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "TxData"; + + // chain_id of the destination EVM chain + string chain_id = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.customname) = "ChainID", + (gogoproto.jsontag) = "chainID" + ]; + // nonce corresponds to the account nonce (transaction sequence). + uint64 nonce = 2; + // gas_tip_cap defines the max value for the gas tip + string gas_tip_cap = 3 [(gogoproto.customtype) = "cosmossdk.io/math.Int"]; + // gas_fee_cap defines the max value for the gas fee + string gas_fee_cap = 4 [(gogoproto.customtype) = "cosmossdk.io/math.Int"]; + // gas defines the gas limit defined for the transaction. + uint64 gas = 5 [(gogoproto.customname) = "GasLimit"]; + // to is the hex formatted address of the recipient + string to = 6; + // value defines the the transaction amount. + string value = 7 + [(gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.customname) = "Amount"]; + // data is the data payload bytes of the transaction. + bytes data = 8; + // accesses is an array of access tuples + repeated AccessTuple accesses = 9 + [(gogoproto.castrepeated) = "AccessList", (gogoproto.jsontag) = "accessList", (gogoproto.nullable) = false]; + // v defines the signature value + bytes v = 10; + // r defines the signature value + bytes r = 11; + // s define the signature value + bytes s = 12; +} + +// ExtensionOptionsEthereumTx is an extension option for ethereum transactions +message ExtensionOptionsEthereumTx { + option (gogoproto.goproto_getters) = false; +} + +// MsgEthereumTxResponse defines the Msg/EthereumTx response type. +message MsgEthereumTxResponse { + option (gogoproto.goproto_getters) = false; + + // hash of the ethereum transaction in hex format. This hash differs from the + // Tendermint sha256 hash of the transaction bytes. See + // https://github.com/tendermint/tendermint/issues/6539 for reference + string hash = 1; + // logs contains the transaction hash and the proto-compatible ethereum + // logs. + repeated Log logs = 2; + // ret is the returned data from evm function (result or data supplied with revert + // opcode) + bytes ret = 3; + // vm_error is the error returned by vm execution + string vm_error = 4; + // gas_used specifies how much gas was consumed by the transaction + uint64 gas_used = 5; + // include the block hash for json-rpc to use + bytes block_hash = 6; +} + +// MsgUpdateParams defines a Msg for updating the x/evm module parameters. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/evm parameters to update. + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} diff --git a/proto/injective/evm/v1/tx_result.proto b/proto/injective/evm/v1/tx_result.proto new file mode 100644 index 00000000..4db31f80 --- /dev/null +++ b/proto/injective/evm/v1/tx_result.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package injective.evm.v1; + +import "gogoproto/gogo.proto"; +import "injective/evm/v1/transaction_logs.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/evm/types"; + +// TxResult stores results of Tx execution. +message TxResult { + option (gogoproto.goproto_getters) = false; + + // contract_address contains the ethereum address of the created contract (if + // any). If the state transition is an evm.Call, the contract address will be + // empty. + string contract_address = 1 [(gogoproto.moretags) = "yaml:\"contract_address\""]; + // bloom represents the bloom filter bytes + bytes bloom = 2; + // tx_logs contains the transaction hash and the proto-compatible ethereum + // logs. + TransactionLogs tx_logs = 3 [(gogoproto.moretags) = "yaml:\"tx_logs\"", (gogoproto.nullable) = false]; + // ret defines the bytes from the execution. + bytes ret = 4; + // reverted flag is set to true when the call has been reverted + bool reverted = 5; + // gas_used notes the amount of gas consumed while execution + uint64 gas_used = 6; +} diff --git a/proto/injective/feemarket/v1/events.proto b/proto/injective/feemarket/v1/events.proto new file mode 100644 index 00000000..6148b074 --- /dev/null +++ b/proto/injective/feemarket/v1/events.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package injective.feemarket.v1; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/feemarket/types"; + +// EventFeeMarket is the event type for the fee market module +message EventFeeMarket { + // base_fee for EIP-1559 blocks + string base_fee = 1; +} + +// EventBlockGas defines an Ethereum block gas event +message EventBlockGas { + // height of the block + string height = 1; + // amount of gas wanted by the block + string amount = 2; +} diff --git a/proto/injective/feemarket/v1/feemarket.proto b/proto/injective/feemarket/v1/feemarket.proto new file mode 100644 index 00000000..5c7dc00f --- /dev/null +++ b/proto/injective/feemarket/v1/feemarket.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package injective.feemarket.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/feemarket/types"; + +// Params defines the EVM module parameters +message Params { + // no_base_fee forces the EIP-1559 base fee to 0 (needed for 0 price calls) + bool no_base_fee = 1; + // base_fee_change_denominator bounds the amount the base fee can change + // between blocks. + uint32 base_fee_change_denominator = 2; + // elasticity_multiplier bounds the maximum gas limit an EIP-1559 block may + // have. + uint32 elasticity_multiplier = 3; + // DEPRECATED: initial base fee for EIP-1559 blocks. + reserved 4; + reserved "initial_base_fee"; + // enable_height defines at which block height the base fee calculation is enabled. + int64 enable_height = 5; + // base_fee for EIP-1559 blocks. + string base_fee = 6 [(gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; + // min_gas_price defines the minimum gas price value for cosmos and eth transactions + string min_gas_price = 7 + [(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false]; + // min_gas_multiplier bounds the minimum gas used to be charged + // to senders based on gas limit + string min_gas_multiplier = 8 + [(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false]; +} diff --git a/proto/injective/feemarket/v1/genesis.proto b/proto/injective/feemarket/v1/genesis.proto new file mode 100644 index 00000000..16e3e1bb --- /dev/null +++ b/proto/injective/feemarket/v1/genesis.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package injective.feemarket.v1; + +import "injective/feemarket/v1/feemarket.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/feemarket/types"; + +// GenesisState defines the feemarket module's genesis state. +message GenesisState { + // params defines all the parameters of the feemarket module. + Params params = 1 [(gogoproto.nullable) = false]; + // DEPRECATED: base fee is the exported value from previous software version. + // Zero by default. + reserved 2; + reserved "base_fee"; + // block_gas is the amount of gas wanted on the last block before the upgrade. + // Zero by default. + uint64 block_gas = 3; +} \ No newline at end of file diff --git a/proto/injective/feemarket/v1/query.proto b/proto/injective/feemarket/v1/query.proto new file mode 100644 index 00000000..6d1750cc --- /dev/null +++ b/proto/injective/feemarket/v1/query.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; +package injective.feemarket.v1; + +import "gogoproto/gogo.proto"; +// import "cosmos/base/query/v1beta1/pagination.proto"; +import "injective/feemarket/v1/feemarket.proto"; +import "google/api/annotations.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/feemarket/types"; + +// Query defines the gRPC querier service. +service Query { + // Params queries the parameters of x/feemarket module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/injective/feemarket/v1/params"; + } + + // BaseFee queries the base fee of the parent block of the current block. + rpc BaseFee(QueryBaseFeeRequest) returns (QueryBaseFeeResponse) { + option (google.api.http).get = "/injective/feemarket/v1/base_fee"; + } + + // BlockGas queries the gas used at a given block height + rpc BlockGas(QueryBlockGasRequest) returns (QueryBlockGasResponse) { + option (google.api.http).get = "/injective/feemarket/v1/block_gas"; + } +} + +// QueryParamsRequest defines the request type for querying x/evm parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/evm parameters. +message QueryParamsResponse { + // params define the evm module parameters. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QueryBaseFeeRequest defines the request type for querying the EIP1559 base +// fee. +message QueryBaseFeeRequest {} + +// QueryBaseFeeResponse returns the EIP1559 base fee. +message QueryBaseFeeResponse { + // base_fee is the EIP1559 base fee + string base_fee = 1 [(gogoproto.customtype) = "cosmossdk.io/math.Int"]; +} + +// QueryBlockGasRequest defines the request type for querying the EIP1559 base +// fee. +message QueryBlockGasRequest {} + +// QueryBlockGasResponse returns block gas used for a given height. +message QueryBlockGasResponse { + // gas is the returned block gas + int64 gas = 1; +} diff --git a/proto/injective/feemarket/v1/tx.proto b/proto/injective/feemarket/v1/tx.proto new file mode 100644 index 00000000..927b1c53 --- /dev/null +++ b/proto/injective/feemarket/v1/tx.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package injective.feemarket.v1; + +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "injective/feemarket/v1/feemarket.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/InjectiveLabs/injective-core/injective-chain/modules/feemarket/types"; + +// Msg defines the erc20 Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + // UpdateParams defined a governance operation for updating the x/feemarket module parameters. + // The authority is hard-coded to the Cosmos SDK x/gov module account + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams defines a Msg for updating the x/feemarket module parameters. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // params defines the x/feemarket parameters to update. + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} From e0c8441bb160f6859e428a5da5582916e127bbf7 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 26 Nov 2024 04:07:54 -0500 Subject: [PATCH 2/4] chore: migrate evm precompiled contracts (part of the type static) --- chain/evm/types/ERC20Contract.json | 4 ++++ chain/evm/types/SimpleStorageContract.json | 4 ++++ chain/evm/types/TestMessageCall.json | 4 ++++ 3 files changed, 12 insertions(+) create mode 100644 chain/evm/types/ERC20Contract.json create mode 100644 chain/evm/types/SimpleStorageContract.json create mode 100644 chain/evm/types/TestMessageCall.json diff --git a/chain/evm/types/ERC20Contract.json b/chain/evm/types/ERC20Contract.json new file mode 100644 index 00000000..50764e3d --- /dev/null +++ b/chain/evm/types/ERC20Contract.json @@ -0,0 +1,4 @@ +{ + "abi": "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"initialAccount\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"initialBalance\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"i\",\"type\":\"uint256\"}],\"name\":\"TestLog\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"benchmarkLogs\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseApproval\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseApproval\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + "bin": "608060405234801561001057600080fd5b506040516114543803806114548339818101604052604081101561003357600080fd5b810190808051906020019092919080519060200190929190505050806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508060028190555050506113ab806100a96000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80636618846311610066578063661884631461022957806370a082311461028f578063a9059cbb146102e7578063d73dd6231461034d578063dd62ed3e146103b35761009e565b8063095ea7b3146100a357806318160ddd1461010957806323b872dd1461012757806340c10f19146101ad57806357807d7f146101fb575b600080fd5b6100ef600480360360408110156100b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061042b565b604051808215151515815260200191505060405180910390f35b61011161051d565b6040518082815260200191505060405180910390f35b6101936004803603606081101561013d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610527565b604051808215151515815260200191505060405180910390f35b6101f9600480360360408110156101c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108dc565b005b6102276004803603602081101561021157600080fd5b810190808035906020019092919050505061098e565b005b6102756004803603604081101561023f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a18565b604051808215151515815260200191505060405180910390f35b6102d1600480360360208110156102a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ca8565b6040518082815260200191505060405180910390f35b610333600480360360408110156102fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cf0565b604051808215151515815260200191505060405180910390f35b6103996004803603604081101561036357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0c565b604051808215151515815260200191505060405180910390f35b610415600480360360408110156103c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611108565b6040518082815260200191505060405180910390f35b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561057457600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156105fd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561063757600080fd5b610688826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461118f90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061071b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461128390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107ec82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461118f90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b61092d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461128390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109848160025461128390919063ffffffff16565b6002819055505050565b60008090505b81811015610a14577fb2abdf6dca7f5665e93ea2262744f2159b5c45ff1a9dacadb090ceb00c2a302f3382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a18080600101915050610994565b5050565b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808310610b28576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bbc565b610b3b838261118f90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115610d3d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d7757600080fd5b610dc8826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461118f90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e5b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461128390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000610f9d82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461128390919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000828211156040518060400160405280601281526020017f4d4154485f5355425f554e444552464c4f57000000000000000000000000000081525090611271576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561123657808201518184015260208101905061121b565b50505050905090810190601f1680156112635780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600082840390508091505092915050565b6000808284019050838110156040518060400160405280601181526020017f4d4154485f4144445f4f564552464c4f570000000000000000000000000000008152509061136b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611330578082015181840152602081019050611315565b50505050905090810190601f16801561135d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50809150509291505056fea265627a7a723158201835ad3fdb84f43ad0d79c6875a0f5521dc5110fc373c9f0597547aff6d9971764736f6c63430005110032" +} diff --git a/chain/evm/types/SimpleStorageContract.json b/chain/evm/types/SimpleStorageContract.json new file mode 100644 index 00000000..4d8bb0af --- /dev/null +++ b/chain/evm/types/SimpleStorageContract.json @@ -0,0 +1,4 @@ +{ + "abi": "[\n\t{\n\t\t\"inputs\": [],\n\t\t\"name\": \"get\",\n\t\t\"outputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"uint160\",\n\t\t\t\t\"name\": \"\",\n\t\t\t\t\"type\": \"uint160\"\n\t\t\t}\n\t\t],\n\t\t\"stateMutability\": \"view\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"uint160\",\n\t\t\t\t\"name\": \"input\",\n\t\t\t\t\"type\": \"uint160\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"store\",\n\t\t\"outputs\": [],\n\t\t\"stateMutability\": \"nonpayable\",\n\t\t\"type\": \"function\"\n\t}\n]", + "bin": "608060405234801561001057600080fd5b506101bf806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80636d4ce63c1461003b578063d04ad49514610059575b600080fd5b610043610075565b6040516100509190610132565b60405180910390f35b610073600480360381019061006e91906100f6565b61009e565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000813590506100f081610172565b92915050565b60006020828403121561010c5761010b61016d565b5b600061011a848285016100e1565b91505092915050565b61012c8161014d565b82525050565b60006020820190506101476000830184610123565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600080fd5b61017b8161014d565b811461018657600080fd5b5056fea26469706673582212204c98c8f28598d29acc328cb34578de54cbed70b20bf9364897d48b2381f0c78b64736f6c63430008070033" +} diff --git a/chain/evm/types/TestMessageCall.json b/chain/evm/types/TestMessageCall.json new file mode 100644 index 00000000..616ae16a --- /dev/null +++ b/chain/evm/types/TestMessageCall.json @@ -0,0 +1,4 @@ +{ + "abi": "[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"iterations\",\"type\":\"uint256\"}],\"name\":\"benchmarkMessageCall\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + "bin": "608060405234801561001057600080fd5b5060405161001d9061007e565b604051809103906000f080158015610039573d6000803e3d6000fd5b506000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061008a565b60dd8061021483390190565b61017b806100996000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c806376e489f014610030575b600080fd5b61005c6004803603602081101561004657600080fd5b8101908080359060200190929190505050610072565b6040518082815260200191505060405180910390f35b6000806000905060008090505b8381101561013c576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f8a8fd6d6040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156100f057600080fd5b505af1158015610104573d6000803e3d6000fd5b505050506040513d602081101561011a57600080fd5b810190808051906020019092919050505082019150808060010191505061007f565b508091505091905056fea265627a7a723158203bb5ea1d2b128eb07e834f8b4cab93aab73270ef20cb80c1d5e0e2ee4f10b7c264736f6c634300051100326080604052348015600f57600080fd5b5060bf8061001e6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063f8a8fd6d14602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60007f1440c4dd67b4344ea1905ec0318995133b550f168b4ee959a0da6b503d7d2414602a6040518082815260200191505060405180910390a1602a90509056fea265627a7a723158209236549244199cceaef9525385c8b6fccaf6390440ece080e2046d9f4a0035f564736f6c63430005110032" +} From afaf354ae1ce937e332f8581e58749ddf27a9461 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 26 Nov 2024 04:17:45 -0500 Subject: [PATCH 3/4] fix: missing functions from chain types & bump go mod deps (for evm) --- chain/types/int.go | 73 ++++++++++++++- chain/types/validation.go | 42 +++++++++ go.mod | 91 +++++++++++-------- go.sum | 183 ++++++++++++++++++++++---------------- 4 files changed, 273 insertions(+), 116 deletions(-) create mode 100644 chain/types/validation.go diff --git a/chain/types/int.go b/chain/types/int.go index af991c40..9140a415 100644 --- a/chain/types/int.go +++ b/chain/types/int.go @@ -1,6 +1,15 @@ package types -import "math/big" +import ( + "fmt" + "math" + "math/big" + "math/bits" + + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + errortypes "github.com/cosmos/cosmos-sdk/types/errors" +) // MarshalBigInt marshals big int into text string for consistent encoding func MarshalBigInt(i *big.Int) (string, error) { @@ -20,3 +29,65 @@ func UnmarshalBigInt(s string) (*big.Int, error) { } return ret, nil } + +const ( + maxWordLen = sdkmath.MaxBitLen / bits.UintSize +) + +var MaxInt256 *big.Int + +func init() { + var tmp big.Int + MaxInt256 = tmp.Lsh(big.NewInt(1), sdkmath.MaxBitLen).Sub(&tmp, big.NewInt(1)) +} + +// SafeInt64 checks for overflows while casting a uint64 to int64 value. +func SafeInt64(value uint64) (int64, error) { + if value > uint64(math.MaxInt64) { + return 0, errorsmod.Wrapf(errortypes.ErrInvalidHeight, "uint64 value %v cannot exceed %v", value, int64(math.MaxInt64)) + } + + return int64(value), nil +} + +func SafeInt(value uint) (int, error) { + if value > uint(math.MaxInt64) { + return 0, errorsmod.Wrapf(errortypes.ErrInvalidHeight, "uint value %v cannot exceed %v", value, int(math.MaxInt64)) + } + + return int(value), nil +} + +// SafeNewIntFromBigInt constructs Int from big.Int, return error if more than 256bits +func SafeNewIntFromBigInt(i *big.Int) (sdkmath.Int, error) { + if !IsValidInt256(i) { + return sdkmath.NewInt(0), fmt.Errorf("big int out of bound: %s", i) + } + return sdkmath.NewIntFromBigInt(i), nil +} + +// SaturatedNewInt constructs Int from big.Int, truncate if more than 256bits +func SaturatedNewInt(i *big.Int) sdkmath.Int { + if !IsValidInt256(i) { + i = MaxInt256 + } + return sdkmath.NewIntFromBigInt(i) +} + +// IsValidInt256 check the bound of 256 bit number +func IsValidInt256(i *big.Int) bool { + return i == nil || !bigIntOverflows(i) +} + +// check if the big int overflows, +// NOTE: copied from cosmos-sdk. +func bigIntOverflows(i *big.Int) bool { + // overflow is defined as i.BitLen() > MaxBitLen + // however this check can be expensive when doing many operations. + // So we first check if the word length is greater than maxWordLen. + // However the most significant word could be zero, hence we still do the bitlen check. + if len(i.Bits()) > maxWordLen { + return i.BitLen() > sdkmath.MaxBitLen + } + return false +} diff --git a/chain/types/validation.go b/chain/types/validation.go new file mode 100644 index 00000000..348598e5 --- /dev/null +++ b/chain/types/validation.go @@ -0,0 +1,42 @@ +package types + +import ( + "bytes" + + errorsmod "cosmossdk.io/errors" + errortypes "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/ethereum/go-ethereum/common" +) + +// IsEmptyHash returns true if the hash corresponds to an empty ethereum hex hash. +func IsEmptyHash(hash string) bool { + return bytes.Equal(common.HexToHash(hash).Bytes(), common.Hash{}.Bytes()) +} + +// IsZeroAddress returns true if the address corresponds to an empty ethereum hex address. +func IsZeroAddress(address string) bool { + return bytes.Equal(common.HexToAddress(address).Bytes(), common.Address{}.Bytes()) +} + +// ValidateAddress returns an error if the provided string is either not a hex formatted string address +func ValidateAddress(address string) error { + if !common.IsHexAddress(address) { + return errorsmod.Wrapf( + errortypes.ErrInvalidAddress, "address '%s' is not a valid ethereum hex address", + address, + ) + } + return nil +} + +// ValidateNonZeroAddress returns an error if the provided string is not a hex +// formatted string address or is equal to zero +func ValidateNonZeroAddress(address string) error { + if IsZeroAddress(address) { + return errorsmod.Wrapf( + errortypes.ErrInvalidAddress, "address '%s' must not be zero", + address, + ) + } + return ValidateAddress(address) +} diff --git a/go.mod b/go.mod index 411a8b43..282467f8 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/InjectiveLabs/sdk-go -go 1.22 +go 1.22.2 + +toolchain go1.23.3 require ( cosmossdk.io/errors v1.0.1 @@ -8,21 +10,21 @@ require ( cosmossdk.io/store v1.1.0 cosmossdk.io/x/evidence v0.1.0 cosmossdk.io/x/feegrant v0.1.0 - cosmossdk.io/x/tx v0.13.3 + cosmossdk.io/x/tx v0.13.4 cosmossdk.io/x/upgrade v0.1.1 github.com/CosmWasm/wasmd v0.40.2 github.com/InjectiveLabs/suplog v1.3.3 github.com/bandprotocol/bandchain-packet v0.0.4 github.com/btcsuite/btcd v0.23.4 github.com/btcsuite/btcd/btcutil v1.1.3 - github.com/cometbft/cometbft v0.38.9 + github.com/cometbft/cometbft v0.38.10 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.50.7 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.5.0 github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/cosmos/ibc-go/v8 v8.2.0 - github.com/ethereum/go-ethereum v1.11.5 + github.com/ethereum/go-ethereum v1.14.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/google/uuid v1.6.0 @@ -33,11 +35,10 @@ require ( github.com/shopspring/decimal v1.2.0 github.com/stretchr/testify v1.9.0 github.com/tyler-smith/go-bip39 v1.1.0 - golang.org/x/crypto v0.24.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de - google.golang.org/grpc v1.63.2 - google.golang.org/protobuf v1.33.0 - gopkg.in/ini.v1 v1.67.0 + golang.org/x/crypto v0.25.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 + google.golang.org/grpc v1.64.1 + google.golang.org/protobuf v1.34.2 gopkg.in/yaml.v2 v2.4.0 gotest.tools/v3 v3.5.1 ) @@ -45,8 +46,8 @@ require ( require ( cosmossdk.io/api v0.7.5 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/core v0.11.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/core v0.11.1 // indirect + cosmossdk.io/depinject v1.0.0 // indirect cosmossdk.io/log v1.3.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -62,14 +63,16 @@ require ( github.com/DataDog/sketches-go v1.4.2 // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/InjectiveLabs/metrics v0.0.10 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect github.com/StackExchange/wmi v1.2.1 // indirect + github.com/VictoriaMetrics/fastcache v1.12.2 // indirect github.com/alexcesaro/statsd v2.0.0+incompatible // indirect github.com/aws/aws-sdk-go v1.44.327 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/bitly/go-simplejson v0.5.1 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/bits-and-blooms/bitset v1.13.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect github.com/bugsnag/bugsnag-go v2.1.2+incompatible // indirect github.com/bugsnag/panicwrap v1.3.4 // indirect @@ -78,21 +81,26 @@ require ( github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect - github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cometbft/cometbft-db v0.9.1 // indirect + github.com/consensys/bavard v0.1.13 // indirect + github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect + github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect + github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/deckarep/golang-set/v2 v2.1.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect @@ -103,24 +111,26 @@ require ( github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/ebitengine/purego v0.6.0-alpha.5 // indirect github.com/emicklei/dot v1.6.1 // indirect - github.com/fatih/color v1.15.0 // indirect + github.com/ethereum/c-kzg-4844 v1.0.0 // indirect + github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect + github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-stack/stack v1.8.1 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect + github.com/gofrs/flock v0.8.1 // indirect github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.2.0 // indirect - github.com/golang/snappy v0.0.4 // indirect + github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/gorilla/handlers v1.5.2 // indirect @@ -139,11 +149,14 @@ require ( github.com/hashicorp/hcl v1.0.1-vault-5 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect - github.com/holiman/uint256 v1.2.2 // indirect + github.com/holiman/bloomfilter/v2 v2.0.3 // indirect + github.com/holiman/uint256 v1.3.1 // indirect github.com/huandu/skiplist v1.2.0 // indirect + github.com/huin/goupnp v1.3.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect @@ -158,6 +171,7 @@ require ( github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect @@ -189,54 +203,59 @@ require ( github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.18.2 // indirect + github.com/status-im/keycard-go v0.2.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect + github.com/supranational/blst v0.3.13 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.7.0 // indirect github.com/tinylib/msgp v1.1.8 // indirect - github.com/tklauser/go-sysconf v0.3.10 // indirect - github.com/tklauser/numcpus v0.4.0 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.etcd.io/bbolt v1.3.8 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/mod v0.18.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect gopkg.in/DataDog/dd-trace-go.v1 v1.62.0 // indirect - gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect pgregory.net/rapid v1.1.0 // indirect + rsc.io/tmplfunc v0.0.3 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) replace ( - cosmossdk.io/store => github.com/InjectiveLabs/cosmos-sdk/store v0.50.6-inj-0 + cosmossdk.io/store => github.com/InjectiveLabs/cosmos-sdk/store v1.1.1-0.20240725163010-dee892be6d18 cosmossdk.io/x/evidence => github.com/InjectiveLabs/cosmos-sdk/x/evidence v0.50.6-inj-0 cosmossdk.io/x/feegrant => github.com/InjectiveLabs/cosmos-sdk/x/feegrant v0.50.6-inj-0 + cosmossdk.io/x/tx => github.com/InjectiveLabs/cosmos-sdk/x/tx v0.8.1-0.20240904140803-b4127ecb5410 cosmossdk.io/x/upgrade => github.com/InjectiveLabs/cosmos-sdk/x/upgrade v0.50.6-inj-0 + github.com/CosmWasm/wasmd => github.com/InjectiveLabs/wasmd v0.51.1-0.20240726173838-0d2109692416 - github.com/CosmWasm/wasmd => github.com/InjectiveLabs/wasmd v0.51.0-inj-0 github.com/bandprotocol/bandchain-packet => github.com/InjectiveLabs/bandchain-packet v0.0.4-inj-1 - github.com/cometbft/cometbft => github.com/InjectiveLabs/cometbft v0.38.10-inj-1 - github.com/cosmos/cosmos-sdk => github.com/InjectiveLabs/cosmos-sdk v0.50.8-inj-0 + github.com/cometbft/cometbft => github.com/Injectivelabs/cometbft v0.38.11-inj-5 + github.com/cosmos/cosmos-sdk => github.com/InjectiveLabs/cosmos-sdk v0.50.10-0.20241014111010-224eb95c9eb1 github.com/cosmos/ibc-apps/modules/ibc-hooks/v8 => github.com/InjectiveLabs/ibc-apps/modules/ibc-hooks/v8 v8.0.0-inj-0 github.com/cosmos/ibc-go/v8 => github.com/InjectiveLabs/ibc-go/v8 v8.3.2-inj-0 + + // geth dev + github.com/ethereum/go-ethereum => github.com/InjectiveLabs/go-ethereum v1.9.22-0.20240923100242-5e28e23d353e github.com/miguelmota/go-ethereum-hdwallet => github.com/InjectiveLabs/go-ethereum-hdwallet v0.1.2 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) diff --git a/go.sum b/go.sum index a9b25d4b..14789f12 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= -cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= -cloud.google.com/go/compute v1.24.0/go.mod h1:kw1/T+h/+tK2LJK0wiPPx1intgdAM3j/g3hFDlscY40= +cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= +cloud.google.com/go/compute v1.25.1/go.mod h1:oopOIR53ly6viBYxaDhBfJwzUAxf1zE//uf3IB011ls= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= @@ -16,10 +16,10 @@ cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA cosmossdk.io/client/v2 v2.0.0-beta.1/go.mod h1:JEUSu9moNZQ4kU3ir1DKD5eU4bllmAexrGWjmb9k8qU= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= -cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= @@ -28,8 +28,6 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/x/circuit v0.1.0 h1:IAej8aRYeuOMritczqTlljbUVHq1E85CpBqaCTwYgXs= cosmossdk.io/x/circuit v0.1.0/go.mod h1:YDzblVE8+E+urPYQq5kq5foRY/IzhXovSYXb4nwd39w= -cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= -cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -63,38 +61,42 @@ github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/InjectiveLabs/bandchain-packet v0.0.4-inj-1 h1:ZnvCV/lzjWmBwuGbkAz+okucfJEyEzkU9GYK3tKU9cU= github.com/InjectiveLabs/bandchain-packet v0.0.4-inj-1/go.mod h1:QELTDYiwnbAqIgTF9zeKr+hVlK6eVyt6Nxmh6/1mmzQ= -github.com/InjectiveLabs/cometbft v0.38.10-inj-1 h1:k4I22d5KcXEluYFSVfuSepkibyUesMD+UGOpBwqjXbo= -github.com/InjectiveLabs/cometbft v0.38.10-inj-1/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= -github.com/InjectiveLabs/cosmos-sdk v0.50.8-inj-0 h1:Jf+0AEdUUNG1mNARompZWTFI/UltAUGX66owYks7TAs= -github.com/InjectiveLabs/cosmos-sdk v0.50.8-inj-0/go.mod h1:igpF5mgbiTmaS3hO/yoIIv7+ICbzMBIowFWSw5aOrKA= -github.com/InjectiveLabs/cosmos-sdk/store v0.50.6-inj-0 h1:75YtRrju3R21u/VXttzuBoh49o28xABR2OUqioT9hMQ= -github.com/InjectiveLabs/cosmos-sdk/store v0.50.6-inj-0/go.mod h1:ZW4eIE98wivInyQyhxU2nHqEielc/iZAcr41qNyWSrw= +github.com/InjectiveLabs/cosmos-sdk v0.50.10-0.20241014111010-224eb95c9eb1 h1:j+uBBPJZ2ibYui/pbRHNtfOxPtSNhMmNWVpKlGSLkIQ= +github.com/InjectiveLabs/cosmos-sdk v0.50.10-0.20241014111010-224eb95c9eb1/go.mod h1:tUXtOv0qMZDlPa6OQE+mPRF4RpMMoT39gR/q3+IbK7s= +github.com/InjectiveLabs/cosmos-sdk/store v1.1.1-0.20240725163010-dee892be6d18 h1:1re5ltZK+Nz0QRbtfWlBXMfWtOw3Qtny1yY7OTMRZhg= +github.com/InjectiveLabs/cosmos-sdk/store v1.1.1-0.20240725163010-dee892be6d18/go.mod h1:Bm6h8ZkYgVTytHK5vhHOMKw9OHyiumm3b1UbkYIJ/Ug= github.com/InjectiveLabs/cosmos-sdk/x/evidence v0.50.6-inj-0 h1:rb73cHJPCTwnBq96WC9L1ymqnHe5i4of1wjpXFAOUe4= github.com/InjectiveLabs/cosmos-sdk/x/evidence v0.50.6-inj-0/go.mod h1:/5BJ6rqcaDZgfdhFGHsqwoD3sCqMPU6M/RMhKTPxV6Y= github.com/InjectiveLabs/cosmos-sdk/x/feegrant v0.50.6-inj-0 h1:2ZHZP06FVWvmzqk+L6GUE2LwEG4GO5b5iWWr1daTe8c= github.com/InjectiveLabs/cosmos-sdk/x/feegrant v0.50.6-inj-0/go.mod h1:Tnwfp0+AmtSF3sktmOwt5Sk4PbRMrDAWsJTr6cX1Hj8= +github.com/InjectiveLabs/cosmos-sdk/x/tx v0.8.1-0.20240904140803-b4127ecb5410 h1:MnhIA5WOnGUF8SgOUuhg1zq8D1oAnteRmlOeJmVVrWk= +github.com/InjectiveLabs/cosmos-sdk/x/tx v0.8.1-0.20240904140803-b4127ecb5410/go.mod h1:tznUEgiR483yNMAUuuvB0Ps6ie+ZYXYCsk8DuzBY6Qk= github.com/InjectiveLabs/cosmos-sdk/x/upgrade v0.50.6-inj-0 h1:fgiPag7wJJ0nX0Bnjm9Q0VuQLJTMV7U5nOyE82f/ed4= github.com/InjectiveLabs/cosmos-sdk/x/upgrade v0.50.6-inj-0/go.mod h1:Cn5qF2yRpXZcd+yJM6mu0UGt1p75IherhBhfeAvkmPc= +github.com/InjectiveLabs/go-ethereum v1.9.22-0.20240923100242-5e28e23d353e h1:yXR4E5tMbPlCNedDzwlO01qjtkFhl8Gq/Z4etmqbXS0= +github.com/InjectiveLabs/go-ethereum v1.9.22-0.20240923100242-5e28e23d353e/go.mod h1:PHp+ZPjvQGBT2/iU18sro79JX+Ffy8IIqU7lnuVX3oE= github.com/InjectiveLabs/ibc-go/v8 v8.3.2-inj-0 h1:ABUXDLG1crwZHtCUUPnX8vZMlcRByhWq7ZawKVpnkYc= github.com/InjectiveLabs/ibc-go/v8 v8.3.2-inj-0/go.mod h1:TGEIiuEAjZH11VCehlYjmx6RTUjv4vbkKFL9s2r+VRg= github.com/InjectiveLabs/metrics v0.0.10 h1:BoOwXnCtRRIPmq06jcI20pXZYE758eusaCI5jDOoN4U= github.com/InjectiveLabs/metrics v0.0.10/go.mod h1:eYu++0DVUjk/jjV9WgvCo8gQU+16Yoyhp1iu+ghKNME= github.com/InjectiveLabs/suplog v1.3.3 h1:ARIR3lWD9BxcrmqTwgcGBt8t7e10gwOqllUAXa/MfxI= github.com/InjectiveLabs/suplog v1.3.3/go.mod h1:+I9WRgUhzmo1V/n7IkW24kFBFB9ZTPAiXXXCogWxmTM= -github.com/InjectiveLabs/wasmd v0.51.0-inj-0 h1:5YvS+OWjein0p3APDqLok/DjLmxJ4XAi8FXrmzhjjXo= -github.com/InjectiveLabs/wasmd v0.51.0-inj-0/go.mod h1:CGIOxbGca/pOiZ+Q7e6aMoNnnSPXrV5/hV1dK3H8FUo= +github.com/InjectiveLabs/wasmd v0.51.1-0.20240726173838-0d2109692416 h1:7wukS5zERTlEGBNX/TAi+0tli1mNqhxZop+2T3GzjGo= +github.com/InjectiveLabs/wasmd v0.51.1-0.20240726173838-0d2109692416/go.mod h1:7TSaj5HoolghujuVWeExqmcUKgpcYWEySGLSODbnnwY= +github.com/Injectivelabs/cometbft v0.38.11-inj-5 h1:VrfeIvIEhdHwF7KfMZ1KmQRiT0TseSVRmx0NDoQc0Dw= +github.com/Injectivelabs/cometbft v0.38.11-inj-5/go.mod h1:WreBJKC7CtZ9cNsb5p6uNpfCBwNWDu+risVb58GTLfY= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= -github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= -github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= +github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= +github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= @@ -106,6 +108,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alexcesaro/statsd v2.0.0+incompatible h1:HG17k1Qk8V1F4UOoq6tx+IUoAbOcI5PHzzEUGeDD72w= github.com/alexcesaro/statsd v2.0.0+incompatible/go.mod h1:vNepIbQAiyLe1j480173M6NYYaAsGwEcvuDTU3OCUGY= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -132,8 +136,8 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.1 h1:xgwPbetQScXt1gh9BmoJ6j9JMr3TElvuIyjR8pgdoow= github.com/bitly/go-simplejson v0.5.1/go.mod h1:YOPVLzCfwK14b4Sff3oP1AmGhI9T9Vsg84etUnlyp+Q= -github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= -github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= +github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= @@ -141,8 +145,8 @@ github.com/btcsuite/btcd v0.23.4 h1:IzV6qqkfwbItOS/sg/aDfPDsjPP8twrCOE2R93hxMlQ= github.com/btcsuite/btcd v0.23.4/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= @@ -180,6 +184,7 @@ github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= @@ -211,12 +216,14 @@ github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOG github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= -github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= -github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= @@ -224,6 +231,10 @@ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1: github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= +github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= +github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= +github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= +github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -256,6 +267,10 @@ github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwc github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c h1:uQYC5Z1mdLRPrZhHjHxufI8+2UG/i25QG92j0Er9p6I= +github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= +github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= +github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= @@ -265,8 +280,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= -github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -298,7 +313,6 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/ebitengine/purego v0.6.0-alpha.5 h1:EYID3JOAdmQ4SNZYJHu9V6IqOeRQDBYxqKAg9PyoHFY= github.com/ebitengine/purego v0.6.0-alpha.5/go.mod h1:ah1In8AOtksoNK6yk5z1HTJeUkC1Ez4Wk2idgGslMwQ= -github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= @@ -310,16 +324,16 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.11.5 h1:3M1uan+LAUvdn+7wCEFrcMM4LJTeuxDrPTg/f31a5QQ= -github.com/ethereum/go-ethereum v1.11.5/go.mod h1:it7x0DWnTDMfVFdXcU6Ti4KEFQynLHVRarcSlPr0HBo= +github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= +github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 h1:8NfxH2iXvJ60YRB8ChToFTUzl8awsc3cJ8CbLjGIl/A= +github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -332,8 +346,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= -github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= -github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -364,8 +378,8 @@ github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ4 github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= -github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -378,8 +392,6 @@ github.com/go-playground/validator/v10 v10.15.1 h1:BSe8uhN+xQ4r5guV/ywQI4gO59C2r github.com/go-playground/validator/v10 v10.15.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= @@ -407,8 +419,8 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= -github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= @@ -439,8 +451,9 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= @@ -466,6 +479,7 @@ github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b/go.mod h1:czg5+yv1E0Z github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= +github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -555,18 +569,20 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.2 h1:TXKcSGc2WaxPD2+bmzAsVthL4+pEN0YwXcL5qED83vk= -github.com/holiman/uint256 v1.2.2/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/holiman/uint256 v1.3.1 h1:JfTzmih28bittyHM8z360dCjIA9dbPIBlcTI6lmctQs= +github.com/holiman/uint256 v1.3.1/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= -github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= +github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= +github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= @@ -627,6 +643,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= +github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= @@ -678,6 +696,9 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= +github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= +github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= +github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -901,6 +922,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/supranational/blst v0.3.13 h1:AYeSxdOMacwu7FBmpfloBz5pbFXDmJL33RuwnKtmTjk= +github.com/supranational/blst v0.3.13/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= @@ -909,10 +932,10 @@ github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= -github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= -github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= -github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= -github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= @@ -930,8 +953,8 @@ github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0o github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q= -github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI= +github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= +github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= @@ -945,8 +968,8 @@ github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWp github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -996,8 +1019,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -1019,8 +1042,6 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1053,8 +1074,8 @@ golang.org/x/net v0.0.0-20220517181318-183a9ca12b87/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1120,7 +1141,6 @@ golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1133,15 +1153,18 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -1207,10 +1230,10 @@ google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= -google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1228,8 +1251,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= -google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1245,8 +1268,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/DataDog/dd-trace-go.v1 v1.62.0 h1:jeZxE4ZlfAc+R0zO5TEmJBwOLet3NThsOfYJeSQg1x0= gopkg.in/DataDog/dd-trace-go.v1 v1.62.0/go.mod h1:YTvYkk3PTsfw0OWrRFxV/IQ5Gy4nZ5TRvxTAP3JcIzs= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -1264,8 +1287,8 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1296,6 +1319,8 @@ nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= +rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= From 6a088d022e1f9986707b55f7b5e31f33c238d460 Mon Sep 17 00:00:00 2001 From: Maxim Date: Wed, 27 Nov 2024 15:18:20 -0500 Subject: [PATCH 4/4] Update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 261555bf..e0b6b297 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,3 @@ coverage.out .anima .vscode -