diff --git a/ante/evm/04_validate.go b/ante/evm/04_validate.go index d7f8e632f..611d78459 100644 --- a/ante/evm/04_validate.go +++ b/ante/evm/04_validate.go @@ -4,6 +4,8 @@ import ( "errors" "math/big" + ethtypes "github.com/ethereum/go-ethereum/core/types" + anteinterfaces "github.com/cosmos/evm/ante/interfaces" evmtypes "github.com/cosmos/evm/x/vm/types" @@ -17,18 +19,16 @@ import ( // ValidateMsg validates an Ethereum specific message type and returns an error // if invalid. It checks the following requirements: -// - nil MUST be passed as the from address // - If the transaction is a contract creation or call, the corresponding operation must be enabled in the EVM parameters func ValidateMsg( evmParams evmtypes.Params, - txData evmtypes.TxData, - from sdktypes.AccAddress, + ethTx *ethtypes.Transaction, ) error { - if txData == nil { + if ethTx == nil { return errorsmod.Wrap(errortypes.ErrInvalidRequest, "transaction is nil") } return checkDisabledCreateCall( - txData, + ethTx, &evmParams.AccessControl, ) } @@ -36,10 +36,10 @@ func ValidateMsg( // checkDisabledCreateCall checks if the transaction is a contract creation or call, // and if those actions are disabled through governance. func checkDisabledCreateCall( - txData evmtypes.TxData, + ethTx *ethtypes.Transaction, permissions *evmtypes.AccessControl, ) error { - to := txData.GetTo() + to := ethTx.To() blockCreate := permissions.Create.AccessType == evmtypes.AccessTypeRestricted blockCall := permissions.Call.AccessType == evmtypes.AccessTypeRestricted diff --git a/ante/evm/05_signature_verification.go b/ante/evm/05_signature_verification.go index d5490419a..1558d15d2 100644 --- a/ante/evm/05_signature_verification.go +++ b/ante/evm/05_signature_verification.go @@ -86,5 +86,6 @@ func SignatureVerification( if err := msg.VerifySender(signer); err != nil { return errorsmod.Wrapf(errortypes.ErrorInvalidSigner, "signature verification failed: %s", err.Error()) } + return nil } diff --git a/ante/evm/06_account_verification.go b/ante/evm/06_account_verification.go index 9efeeed33..e4b8551a0 100644 --- a/ante/evm/06_account_verification.go +++ b/ante/evm/06_account_verification.go @@ -2,11 +2,11 @@ package evm import ( "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" anteinterfaces "github.com/cosmos/evm/ante/interfaces" "github.com/cosmos/evm/x/vm/keeper" "github.com/cosmos/evm/x/vm/statedb" - evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" @@ -22,26 +22,31 @@ import ( // - account balance is lower than the transaction cost func VerifyAccountBalance( ctx sdk.Context, + evmKeeper anteinterfaces.EVMKeeper, accountKeeper anteinterfaces.AccountKeeper, account *statedb.Account, from common.Address, - txData evmtypes.TxData, + ethTx *ethtypes.Transaction, ) error { // Only EOA are allowed to send transactions. if account != nil && account.IsContract() { - return errorsmod.Wrapf( - errortypes.ErrInvalidType, - "the sender is not EOA: address %s", from, - ) + // check eip-7702 + code := evmKeeper.GetCode(ctx, common.BytesToHash(account.CodeHash)) + _, delegated := ethtypes.ParseDelegation(code) + if len(code) > 0 && !delegated { + return errorsmod.Wrapf( + errortypes.ErrInvalidType, + "the sender is not EOA: address %s", from, + ) + } } - if account == nil { acc := accountKeeper.NewAccountWithAddress(ctx, from.Bytes()) accountKeeper.SetAccount(ctx, acc) account = statedb.NewEmptyAccount() } - if err := keeper.CheckSenderBalance(sdkmath.NewIntFromBigInt(account.Balance.ToBig()), txData); err != nil { + if err := keeper.CheckSenderBalance(sdkmath.NewIntFromBigInt(account.Balance.ToBig()), ethTx); err != nil { return errorsmod.Wrap(err, "failed to check sender balance") } diff --git a/ante/evm/08_gas_consume.go b/ante/evm/08_gas_consume.go index 79368c051..6580d43e2 100644 --- a/ante/evm/08_gas_consume.go +++ b/ante/evm/08_gas_consume.go @@ -4,6 +4,7 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" anteinterfaces "github.com/cosmos/evm/ante/interfaces" "github.com/cosmos/evm/types" @@ -84,11 +85,11 @@ func deductFees( // GetMsgPriority returns the priority of an Eth Tx capped by the minimum priority func GetMsgPriority( - txData evmtypes.TxData, + ethTx *ethtypes.Transaction, minPriority int64, baseFee *big.Int, ) int64 { - priority := evmtypes.GetTxPriority(txData, baseFee) + priority := evmtypes.GetTxPriority(ethTx, baseFee) if priority < minPriority { minPriority = priority diff --git a/ante/evm/11_emit_event.go b/ante/evm/11_emit_event.go index 2448b096a..ec47ee630 100644 --- a/ante/evm/11_emit_event.go +++ b/ante/evm/11_emit_event.go @@ -57,7 +57,7 @@ func EmitTxHashEvent(ctx sdk.Context, msg *evmtypes.MsgEthereumTx, blockTxIndex, ctx.EventManager().EmitEvent( sdk.NewEvent( evmtypes.EventTypeEthereumTx, - sdk.NewAttribute(evmtypes.AttributeKeyEthereumTxHash, msg.Hash), + sdk.NewAttribute(evmtypes.AttributeKeyEthereumTxHash, msg.Hash().String()), sdk.NewAttribute(evmtypes.AttributeKeyTxIndex, strconv.FormatUint(blockTxIndex+msgIndex, 10)), // #nosec G115 ), ) diff --git a/ante/evm/mono_decorator.go b/ante/evm/mono_decorator.go index ccd0a3194..3971b071c 100644 --- a/ante/evm/mono_decorator.go +++ b/ante/evm/mono_decorator.go @@ -83,13 +83,13 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne } msgIndex := 0 - ethMsg, txData, err := evmtypes.UnpackEthMsg(msgs[msgIndex]) + ethMsg, ethTx, err := evmtypes.UnpackEthMsg(msgs[msgIndex]) if err != nil { return ctx, err } - feeAmt := txData.Fee() - gas := txData.GetGas() + feeAmt := ethMsg.GetFee() + gas := ethTx.Gas() fee := sdkmath.LegacyNewDecFromBigInt(feeAmt) gasLimit := sdkmath.LegacyNewDecFromBigInt(new(big.Int).SetUint64(gas)) @@ -104,13 +104,13 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne } } - if txData.TxType() == ethtypes.DynamicFeeTxType && decUtils.BaseFee != nil { + if ethTx.Type() >= ethtypes.DynamicFeeTxType && decUtils.BaseFee != nil { // If the base fee is not empty, we compute the effective gas price // according to current base fee price. The gas limit is specified // by the user, while the price is given by the minimum between the // max price paid for the entire tx, and the sum between the price // for the tip and the base fee. - feeAmt = txData.EffectiveFee(decUtils.BaseFee) + feeAmt = ethMsg.GetEffectiveFee(decUtils.BaseFee) fee = sdkmath.LegacyNewDecFromBigInt(feeAmt) } @@ -122,8 +122,7 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne // 4. validate msg contents if err := ValidateMsg( decUtils.EvmParams, - txData, - ethMsg.GetFrom(), + ethTx, ); err != nil { return ctx, err } @@ -147,23 +146,17 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne account := md.evmKeeper.GetAccount(ctx, fromAddr) if err := VerifyAccountBalance( ctx, + md.evmKeeper, md.accountKeeper, account, fromAddr, - txData, + ethTx, ); err != nil { return ctx, err } // 7. can transfer - coreMsg, err := ethMsg.AsMessage(decUtils.BaseFee) - if err != nil { - return ctx, errorsmod.Wrapf( - err, - "failed to create an ethereum core.Message from signer %T", decUtils.Signer, - ) - } - + coreMsg := ethMsg.AsMessage(decUtils.BaseFee) if err := CanTransfer( ctx, md.evmKeeper, @@ -177,7 +170,7 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne // 8. gas consumption msgFees, err := evmkeeper.VerifyFee( - txData, + ethTx, evmDenom, decUtils.BaseFee, decUtils.Rules.IsHomestead, @@ -208,7 +201,7 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne decUtils.GasWanted = gasWanted minPriority := GetMsgPriority( - txData, + ethTx, decUtils.MinPriority, decUtils.BaseFee, ) @@ -216,7 +209,7 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne // Update the fee to be paid for the tx adding the fee specified for the // current message. - decUtils.TxFee.Add(decUtils.TxFee, txData.Fee()) + decUtils.TxFee.Add(decUtils.TxFee, ethMsg.GetFee()) // Update the transaction gas limit adding the gas specified in the // current message. @@ -233,7 +226,7 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne ) } - if err := IncrementNonce(ctx, md.accountKeeper, acc, txData.GetNonce()); err != nil { + if err := IncrementNonce(ctx, md.accountKeeper, acc, ethTx.Nonce()); err != nil { return ctx, err } diff --git a/api/cosmos/evm/vm/v1/access_list_tx.go b/api/cosmos/evm/vm/v1/access_list_tx.go deleted file mode 100644 index 4bbb5c1c1..000000000 --- a/api/cosmos/evm/vm/v1/access_list_tx.go +++ /dev/null @@ -1,63 +0,0 @@ -package vmv1 - -import ( - "math/big" - - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - - ethutils "github.com/cosmos/evm/utils/eth" -) - -// GetChainID returns the chain id field from the AccessListTx -func (tx *AccessListTx) GetChainID() *big.Int { - return stringToBigInt(tx.GetChainId()) -} - -// GetAccessList returns the AccessList field. -func (tx *AccessListTx) GetAccessList() ethtypes.AccessList { - if tx.Accesses == nil { - return nil - } - var ethAccessList ethtypes.AccessList - - for _, tuple := range tx.Accesses { - 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 ethAccessList -} - -// 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: stringToBigInt(tx.GetGasPrice()), - Gas: tx.GetGas(), - To: stringToAddress(tx.GetTo()), - Value: stringToBigInt(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 ethutils.RawSignatureValues(tx.V, tx.R, tx.S) -} diff --git a/api/cosmos/evm/vm/v1/dynamic_fee_tx.go b/api/cosmos/evm/vm/v1/dynamic_fee_tx.go deleted file mode 100644 index 75536abe2..000000000 --- a/api/cosmos/evm/vm/v1/dynamic_fee_tx.go +++ /dev/null @@ -1,64 +0,0 @@ -package vmv1 - -import ( - "math/big" - - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - - ethutils "github.com/cosmos/evm/utils/eth" -) - -// GetChainID returns the chain id field from the DynamicFeeTx -func (tx *DynamicFeeTx) GetChainID() *big.Int { - return stringToBigInt(tx.GetChainId()) -} - -// 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: stringToBigInt(tx.GetGasTipCap()), - GasFeeCap: stringToBigInt(tx.GetGasFeeCap()), - Gas: tx.GetGas(), - To: stringToAddress(tx.GetTo()), - Value: stringToBigInt(tx.GetValue()), - Data: tx.GetData(), - AccessList: tx.GetAccessList(), - V: v, - R: r, - S: s, - } -} - -// GetAccessList returns the AccessList field. -func (tx *DynamicFeeTx) GetAccessList() ethtypes.AccessList { - if tx.Accesses == nil { - return nil - } - var ethAccessList ethtypes.AccessList - - for _, tuple := range tx.Accesses { - 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 ethAccessList -} - -// 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 ethutils.RawSignatureValues(tx.V, tx.R, tx.S) -} diff --git a/api/cosmos/evm/vm/v1/legacy_tx.go b/api/cosmos/evm/vm/v1/legacy_tx.go deleted file mode 100644 index aa791f4e9..000000000 --- a/api/cosmos/evm/vm/v1/legacy_tx.go +++ /dev/null @@ -1,43 +0,0 @@ -package vmv1 - -import ( - "math/big" - - ethtypes "github.com/ethereum/go-ethereum/core/types" - - ethutils "github.com/cosmos/evm/utils/eth" -) - -// GetChainID returns the chain id field from the derived signature values -func (tx *LegacyTx) GetChainID() *big.Int { - v, _, _ := tx.GetRawSignatureValues() - return ethutils.DeriveChainID(v) -} - -// AsEthereumData returns an LegacyTx 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: stringToBigInt(tx.GetGasPrice()), - Gas: tx.GetGas(), - To: stringToAddress(tx.GetTo()), - Value: stringToBigInt(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 ethutils.RawSignatureValues(tx.V, tx.R, tx.S) -} - -// GetAccessList returns nil -func (tx *LegacyTx) GetAccessList() ethtypes.AccessList { - return nil -} diff --git a/api/cosmos/evm/vm/v1/msg.go b/api/cosmos/evm/vm/v1/msg.go index 1cc844086..63600b3bb 100644 --- a/api/cosmos/evm/vm/v1/msg.go +++ b/api/cosmos/evm/vm/v1/msg.go @@ -3,38 +3,9 @@ package vmv1 import ( "fmt" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" protov2 "google.golang.org/protobuf/proto" ) -// supportedTxs holds the Ethereum transaction types -// supported by Cosmos EVM -// -// Use a function to return a new pointer and avoid -// possible reuse or racing conditions when using the same pointer -var supportedTxs = map[string]func() TxDataV2{ - "/cosmos.evm.vm.v1.DynamicFeeTx": func() TxDataV2 { return &DynamicFeeTx{} }, - "/cosmos.evm.vm.v1.AccessListTx": func() TxDataV2 { return &AccessListTx{} }, - "/cosmos.evm.vm.v1.LegacyTx": func() TxDataV2 { return &LegacyTx{} }, -} - -// getSender extracts the sender address from the signature values using the latest signer for the given chainID. -func getSender(txData TxDataV2) (common.Address, error) { - chainID := txData.GetChainID() - // legacy tx returns `0` as chainID when EIP-155 is not used - // see: DeriveChainID - if chainID != nil && chainID.Sign() == 0 { - chainID = nil - } - signer := ethtypes.LatestSignerForChainID(chainID) - from, err := signer.Sender(ethtypes.NewTx(txData.AsEthereumData())) - if err != nil { - return common.Address{}, err - } - return from, nil -} - // GetSigners is the custom function to get signers on Ethereum transactions // Gets the signer's address from the Ethereum tx signature func GetSigners(msg protov2.Message) ([][]byte, error) { @@ -43,21 +14,5 @@ func GetSigners(msg protov2.Message) ([][]byte, error) { return nil, fmt.Errorf("invalid type, expected MsgEthereumTx and got %T", msg) } - txDataFn, found := supportedTxs[msgEthTx.Data.TypeUrl] - if !found { - return nil, fmt.Errorf("invalid TypeUrl %s", msgEthTx.Data.TypeUrl) - } - txData := txDataFn() - - // msgEthTx.Data is a message (DynamicFeeTx, LegacyTx or AccessListTx) - if err := msgEthTx.Data.UnmarshalTo(txData); err != nil { - return nil, err - } - - sender, err := getSender(txData) - if err != nil { - return nil, err - } - - return [][]byte{sender.Bytes()}, nil + return [][]byte{msgEthTx.From}, nil } diff --git a/api/cosmos/evm/vm/v1/tx.pulsar.go b/api/cosmos/evm/vm/v1/tx.pulsar.go index 904d9782c..ba95091ed 100644 --- a/api/cosmos/evm/vm/v1/tx.pulsar.go +++ b/api/cosmos/evm/vm/v1/tx.pulsar.go @@ -4,7 +4,6 @@ package vmv1 import ( _ "cosmossdk.io/api/amino" _ "cosmossdk.io/api/cosmos/msg/v1" - binary "encoding/binary" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" @@ -13,30 +12,22 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" io "io" - math "math" reflect "reflect" sync "sync" ) var ( - md_MsgEthereumTx protoreflect.MessageDescriptor - fd_MsgEthereumTx_data protoreflect.FieldDescriptor - fd_MsgEthereumTx_size protoreflect.FieldDescriptor - fd_MsgEthereumTx_hash protoreflect.FieldDescriptor - fd_MsgEthereumTx_deprecated_from protoreflect.FieldDescriptor - fd_MsgEthereumTx_from protoreflect.FieldDescriptor + md_MsgEthereumTx protoreflect.MessageDescriptor + fd_MsgEthereumTx_from protoreflect.FieldDescriptor + fd_MsgEthereumTx_raw protoreflect.FieldDescriptor ) func init() { file_cosmos_evm_vm_v1_tx_proto_init() md_MsgEthereumTx = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("MsgEthereumTx") - fd_MsgEthereumTx_data = md_MsgEthereumTx.Fields().ByName("data") - fd_MsgEthereumTx_size = md_MsgEthereumTx.Fields().ByName("size") - fd_MsgEthereumTx_hash = md_MsgEthereumTx.Fields().ByName("hash") - fd_MsgEthereumTx_deprecated_from = md_MsgEthereumTx.Fields().ByName("deprecated_from") fd_MsgEthereumTx_from = md_MsgEthereumTx.Fields().ByName("from") + fd_MsgEthereumTx_raw = md_MsgEthereumTx.Fields().ByName("raw") } var _ protoreflect.Message = (*fastReflection_MsgEthereumTx)(nil) @@ -104,36 +95,18 @@ func (x *fastReflection_MsgEthereumTx) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgEthereumTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Data != nil { - value := protoreflect.ValueOfMessage(x.Data.ProtoReflect()) - if !f(fd_MsgEthereumTx_data, value) { - return - } - } - if x.Size != float64(0) || math.Signbit(x.Size) { - value := protoreflect.ValueOfFloat64(x.Size) - if !f(fd_MsgEthereumTx_size, value) { - return - } - } - if x.Hash != "" { - value := protoreflect.ValueOfString(x.Hash) - if !f(fd_MsgEthereumTx_hash, value) { - return - } - } - if x.DeprecatedFrom != "" { - value := protoreflect.ValueOfString(x.DeprecatedFrom) - if !f(fd_MsgEthereumTx_deprecated_from, value) { - return - } - } if len(x.From) != 0 { value := protoreflect.ValueOfBytes(x.From) if !f(fd_MsgEthereumTx_from, value) { return } } + if len(x.Raw) != 0 { + value := protoreflect.ValueOfBytes(x.Raw) + if !f(fd_MsgEthereumTx_raw, value) { + return + } + } } // Has reports whether a field is populated. @@ -149,16 +122,10 @@ func (x *fastReflection_MsgEthereumTx) Range(f func(protoreflect.FieldDescriptor // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgEthereumTx) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgEthereumTx.data": - return x.Data != nil - case "cosmos.evm.vm.v1.MsgEthereumTx.size": - return x.Size != float64(0) || math.Signbit(x.Size) - case "cosmos.evm.vm.v1.MsgEthereumTx.hash": - return x.Hash != "" - case "cosmos.evm.vm.v1.MsgEthereumTx.deprecated_from": - return x.DeprecatedFrom != "" case "cosmos.evm.vm.v1.MsgEthereumTx.from": return len(x.From) != 0 + case "cosmos.evm.vm.v1.MsgEthereumTx.raw": + return len(x.Raw) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTx")) @@ -175,16 +142,10 @@ func (x *fastReflection_MsgEthereumTx) Has(fd protoreflect.FieldDescriptor) bool // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgEthereumTx) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgEthereumTx.data": - x.Data = nil - case "cosmos.evm.vm.v1.MsgEthereumTx.size": - x.Size = float64(0) - case "cosmos.evm.vm.v1.MsgEthereumTx.hash": - x.Hash = "" - case "cosmos.evm.vm.v1.MsgEthereumTx.deprecated_from": - x.DeprecatedFrom = "" case "cosmos.evm.vm.v1.MsgEthereumTx.from": x.From = nil + case "cosmos.evm.vm.v1.MsgEthereumTx.raw": + x.Raw = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTx")) @@ -201,21 +162,12 @@ func (x *fastReflection_MsgEthereumTx) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgEthereumTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.evm.vm.v1.MsgEthereumTx.data": - value := x.Data - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.evm.vm.v1.MsgEthereumTx.size": - value := x.Size - return protoreflect.ValueOfFloat64(value) - case "cosmos.evm.vm.v1.MsgEthereumTx.hash": - value := x.Hash - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.MsgEthereumTx.deprecated_from": - value := x.DeprecatedFrom - return protoreflect.ValueOfString(value) case "cosmos.evm.vm.v1.MsgEthereumTx.from": value := x.From return protoreflect.ValueOfBytes(value) + case "cosmos.evm.vm.v1.MsgEthereumTx.raw": + value := x.Raw + return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTx")) @@ -236,16 +188,10 @@ func (x *fastReflection_MsgEthereumTx) Get(descriptor protoreflect.FieldDescript // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgEthereumTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgEthereumTx.data": - x.Data = value.Message().Interface().(*anypb.Any) - case "cosmos.evm.vm.v1.MsgEthereumTx.size": - x.Size = value.Float() - case "cosmos.evm.vm.v1.MsgEthereumTx.hash": - x.Hash = value.Interface().(string) - case "cosmos.evm.vm.v1.MsgEthereumTx.deprecated_from": - x.DeprecatedFrom = value.Interface().(string) case "cosmos.evm.vm.v1.MsgEthereumTx.from": x.From = value.Bytes() + case "cosmos.evm.vm.v1.MsgEthereumTx.raw": + x.Raw = value.Bytes() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTx")) @@ -266,19 +212,10 @@ func (x *fastReflection_MsgEthereumTx) Set(fd protoreflect.FieldDescriptor, valu // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgEthereumTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgEthereumTx.data": - if x.Data == nil { - x.Data = new(anypb.Any) - } - return protoreflect.ValueOfMessage(x.Data.ProtoReflect()) - case "cosmos.evm.vm.v1.MsgEthereumTx.size": - panic(fmt.Errorf("field size of message cosmos.evm.vm.v1.MsgEthereumTx is not mutable")) - case "cosmos.evm.vm.v1.MsgEthereumTx.hash": - panic(fmt.Errorf("field hash of message cosmos.evm.vm.v1.MsgEthereumTx is not mutable")) - case "cosmos.evm.vm.v1.MsgEthereumTx.deprecated_from": - panic(fmt.Errorf("field deprecated_from of message cosmos.evm.vm.v1.MsgEthereumTx is not mutable")) case "cosmos.evm.vm.v1.MsgEthereumTx.from": panic(fmt.Errorf("field from of message cosmos.evm.vm.v1.MsgEthereumTx is not mutable")) + case "cosmos.evm.vm.v1.MsgEthereumTx.raw": + panic(fmt.Errorf("field raw of message cosmos.evm.vm.v1.MsgEthereumTx is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTx")) @@ -292,17 +229,10 @@ func (x *fastReflection_MsgEthereumTx) Mutable(fd protoreflect.FieldDescriptor) // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgEthereumTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgEthereumTx.data": - m := new(anypb.Any) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.evm.vm.v1.MsgEthereumTx.size": - return protoreflect.ValueOfFloat64(float64(0)) - case "cosmos.evm.vm.v1.MsgEthereumTx.hash": - return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.MsgEthereumTx.deprecated_from": - return protoreflect.ValueOfString("") case "cosmos.evm.vm.v1.MsgEthereumTx.from": return protoreflect.ValueOfBytes(nil) + case "cosmos.evm.vm.v1.MsgEthereumTx.raw": + return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTx")) @@ -372,22 +302,11 @@ func (x *fastReflection_MsgEthereumTx) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.Data != nil { - l = options.Size(x.Data) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Size != 0 || math.Signbit(x.Size) { - n += 9 - } - l = len(x.Hash) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.DeprecatedFrom) + l = len(x.From) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.From) + l = len(x.Raw) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -420,6 +339,13 @@ func (x *fastReflection_MsgEthereumTx) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Raw) > 0 { + i -= len(x.Raw) + copy(dAtA[i:], x.Raw) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Raw))) + i-- + dAtA[i] = 0x32 + } if len(x.From) > 0 { i -= len(x.From) copy(dAtA[i:], x.From) @@ -427,40 +353,6 @@ func (x *fastReflection_MsgEthereumTx) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x2a } - if len(x.DeprecatedFrom) > 0 { - i -= len(x.DeprecatedFrom) - copy(dAtA[i:], x.DeprecatedFrom) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DeprecatedFrom))) - i-- - dAtA[i] = 0x22 - } - if len(x.Hash) > 0 { - i -= len(x.Hash) - copy(dAtA[i:], x.Hash) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Hash))) - i-- - dAtA[i] = 0x1a - } - if x.Size != 0 || math.Signbit(x.Size) { - i -= 8 - binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(x.Size)))) - i-- - dAtA[i] = 0x11 - } - if x.Data != nil { - encoded, err := options.Marshal(x.Data) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -510,58 +402,11 @@ func (x *fastReflection_MsgEthereumTx) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEthereumTx: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Data == nil { - x.Data = &anypb.Any{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Data); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 1 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - x.Size = float64(math.Float64frombits(v)) - case 3: + case 5: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -571,59 +416,29 @@ func (x *fastReflection_MsgEthereumTx) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Hash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DeprecatedFrom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + x.From = append(x.From[:0], dAtA[iNdEx:postIndex]...) + if x.From == nil { + x.From = []byte{} } - x.DeprecatedFrom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -650,9 +465,9 @@ func (x *fastReflection_MsgEthereumTx) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.From = append(x.From[:0], dAtA[iNdEx:postIndex]...) - if x.From == nil { - x.From = []byte{} + x.Raw = append(x.Raw[:0], dAtA[iNdEx:postIndex]...) + if x.Raw == nil { + x.Raw = []byte{} } iNdEx = postIndex default: @@ -691,41 +506,23 @@ func (x *fastReflection_MsgEthereumTx) ProtoMethods() *protoiface.Methods { } var ( - md_LegacyTx protoreflect.MessageDescriptor - fd_LegacyTx_nonce protoreflect.FieldDescriptor - fd_LegacyTx_gas_price protoreflect.FieldDescriptor - fd_LegacyTx_gas protoreflect.FieldDescriptor - fd_LegacyTx_to protoreflect.FieldDescriptor - fd_LegacyTx_value protoreflect.FieldDescriptor - fd_LegacyTx_data protoreflect.FieldDescriptor - fd_LegacyTx_v protoreflect.FieldDescriptor - fd_LegacyTx_r protoreflect.FieldDescriptor - fd_LegacyTx_s protoreflect.FieldDescriptor + md_ExtensionOptionsEthereumTx protoreflect.MessageDescriptor ) func init() { file_cosmos_evm_vm_v1_tx_proto_init() - md_LegacyTx = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("LegacyTx") - fd_LegacyTx_nonce = md_LegacyTx.Fields().ByName("nonce") - fd_LegacyTx_gas_price = md_LegacyTx.Fields().ByName("gas_price") - fd_LegacyTx_gas = md_LegacyTx.Fields().ByName("gas") - fd_LegacyTx_to = md_LegacyTx.Fields().ByName("to") - fd_LegacyTx_value = md_LegacyTx.Fields().ByName("value") - fd_LegacyTx_data = md_LegacyTx.Fields().ByName("data") - fd_LegacyTx_v = md_LegacyTx.Fields().ByName("v") - fd_LegacyTx_r = md_LegacyTx.Fields().ByName("r") - fd_LegacyTx_s = md_LegacyTx.Fields().ByName("s") + md_ExtensionOptionsEthereumTx = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("ExtensionOptionsEthereumTx") } -var _ protoreflect.Message = (*fastReflection_LegacyTx)(nil) +var _ protoreflect.Message = (*fastReflection_ExtensionOptionsEthereumTx)(nil) -type fastReflection_LegacyTx LegacyTx +type fastReflection_ExtensionOptionsEthereumTx ExtensionOptionsEthereumTx -func (x *LegacyTx) ProtoReflect() protoreflect.Message { - return (*fastReflection_LegacyTx)(x) +func (x *ExtensionOptionsEthereumTx) ProtoReflect() protoreflect.Message { + return (*fastReflection_ExtensionOptionsEthereumTx)(x) } -func (x *LegacyTx) slowProtoReflect() protoreflect.Message { +func (x *ExtensionOptionsEthereumTx) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -737,43 +534,43 @@ func (x *LegacyTx) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_LegacyTx_messageType fastReflection_LegacyTx_messageType -var _ protoreflect.MessageType = fastReflection_LegacyTx_messageType{} +var _fastReflection_ExtensionOptionsEthereumTx_messageType fastReflection_ExtensionOptionsEthereumTx_messageType +var _ protoreflect.MessageType = fastReflection_ExtensionOptionsEthereumTx_messageType{} -type fastReflection_LegacyTx_messageType struct{} +type fastReflection_ExtensionOptionsEthereumTx_messageType struct{} -func (x fastReflection_LegacyTx_messageType) Zero() protoreflect.Message { - return (*fastReflection_LegacyTx)(nil) +func (x fastReflection_ExtensionOptionsEthereumTx_messageType) Zero() protoreflect.Message { + return (*fastReflection_ExtensionOptionsEthereumTx)(nil) } -func (x fastReflection_LegacyTx_messageType) New() protoreflect.Message { - return new(fastReflection_LegacyTx) +func (x fastReflection_ExtensionOptionsEthereumTx_messageType) New() protoreflect.Message { + return new(fastReflection_ExtensionOptionsEthereumTx) } -func (x fastReflection_LegacyTx_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_LegacyTx +func (x fastReflection_ExtensionOptionsEthereumTx_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ExtensionOptionsEthereumTx } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_LegacyTx) Descriptor() protoreflect.MessageDescriptor { - return md_LegacyTx +func (x *fastReflection_ExtensionOptionsEthereumTx) Descriptor() protoreflect.MessageDescriptor { + return md_ExtensionOptionsEthereumTx } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_LegacyTx) Type() protoreflect.MessageType { - return _fastReflection_LegacyTx_messageType +func (x *fastReflection_ExtensionOptionsEthereumTx) Type() protoreflect.MessageType { + return _fastReflection_ExtensionOptionsEthereumTx_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_LegacyTx) New() protoreflect.Message { - return new(fastReflection_LegacyTx) +func (x *fastReflection_ExtensionOptionsEthereumTx) New() protoreflect.Message { + return new(fastReflection_ExtensionOptionsEthereumTx) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_LegacyTx) Interface() protoreflect.ProtoMessage { - return (*LegacyTx)(x) +func (x *fastReflection_ExtensionOptionsEthereumTx) Interface() protoreflect.ProtoMessage { + return (*ExtensionOptionsEthereumTx)(x) } // Range iterates over every populated field in an undefined order, @@ -781,61 +578,7 @@ func (x *fastReflection_LegacyTx) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_LegacyTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Nonce != uint64(0) { - value := protoreflect.ValueOfUint64(x.Nonce) - if !f(fd_LegacyTx_nonce, value) { - return - } - } - if x.GasPrice != "" { - value := protoreflect.ValueOfString(x.GasPrice) - if !f(fd_LegacyTx_gas_price, value) { - return - } - } - if x.Gas != uint64(0) { - value := protoreflect.ValueOfUint64(x.Gas) - if !f(fd_LegacyTx_gas, value) { - return - } - } - if x.To != "" { - value := protoreflect.ValueOfString(x.To) - if !f(fd_LegacyTx_to, value) { - return - } - } - if x.Value != "" { - value := protoreflect.ValueOfString(x.Value) - if !f(fd_LegacyTx_value, value) { - return - } - } - if len(x.Data) != 0 { - value := protoreflect.ValueOfBytes(x.Data) - if !f(fd_LegacyTx_data, value) { - return - } - } - if len(x.V) != 0 { - value := protoreflect.ValueOfBytes(x.V) - if !f(fd_LegacyTx_v, value) { - return - } - } - if len(x.R) != 0 { - value := protoreflect.ValueOfBytes(x.R) - if !f(fd_LegacyTx_r, value) { - return - } - } - if len(x.S) != 0 { - value := protoreflect.ValueOfBytes(x.S) - if !f(fd_LegacyTx_s, value) { - return - } - } +func (x *fastReflection_ExtensionOptionsEthereumTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -849,31 +592,13 @@ func (x *fastReflection_LegacyTx) Range(f func(protoreflect.FieldDescriptor, pro // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_LegacyTx) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_ExtensionOptionsEthereumTx) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.evm.vm.v1.LegacyTx.nonce": - return x.Nonce != uint64(0) - case "cosmos.evm.vm.v1.LegacyTx.gas_price": - return x.GasPrice != "" - case "cosmos.evm.vm.v1.LegacyTx.gas": - return x.Gas != uint64(0) - case "cosmos.evm.vm.v1.LegacyTx.to": - return x.To != "" - case "cosmos.evm.vm.v1.LegacyTx.value": - return x.Value != "" - case "cosmos.evm.vm.v1.LegacyTx.data": - return len(x.Data) != 0 - case "cosmos.evm.vm.v1.LegacyTx.v": - return len(x.V) != 0 - case "cosmos.evm.vm.v1.LegacyTx.r": - return len(x.R) != 0 - case "cosmos.evm.vm.v1.LegacyTx.s": - return len(x.S) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.LegacyTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.LegacyTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) } } @@ -883,31 +608,13 @@ func (x *fastReflection_LegacyTx) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_LegacyTx) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_ExtensionOptionsEthereumTx) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.evm.vm.v1.LegacyTx.nonce": - x.Nonce = uint64(0) - case "cosmos.evm.vm.v1.LegacyTx.gas_price": - x.GasPrice = "" - case "cosmos.evm.vm.v1.LegacyTx.gas": - x.Gas = uint64(0) - case "cosmos.evm.vm.v1.LegacyTx.to": - x.To = "" - case "cosmos.evm.vm.v1.LegacyTx.value": - x.Value = "" - case "cosmos.evm.vm.v1.LegacyTx.data": - x.Data = nil - case "cosmos.evm.vm.v1.LegacyTx.v": - x.V = nil - case "cosmos.evm.vm.v1.LegacyTx.r": - x.R = nil - case "cosmos.evm.vm.v1.LegacyTx.s": - x.S = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.LegacyTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.LegacyTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) } } @@ -917,40 +624,13 @@ func (x *fastReflection_LegacyTx) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_LegacyTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ExtensionOptionsEthereumTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.evm.vm.v1.LegacyTx.nonce": - value := x.Nonce - return protoreflect.ValueOfUint64(value) - case "cosmos.evm.vm.v1.LegacyTx.gas_price": - value := x.GasPrice - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.LegacyTx.gas": - value := x.Gas - return protoreflect.ValueOfUint64(value) - case "cosmos.evm.vm.v1.LegacyTx.to": - value := x.To - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.LegacyTx.value": - value := x.Value - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.LegacyTx.data": - value := x.Data - return protoreflect.ValueOfBytes(value) - case "cosmos.evm.vm.v1.LegacyTx.v": - value := x.V - return protoreflect.ValueOfBytes(value) - case "cosmos.evm.vm.v1.LegacyTx.r": - value := x.R - return protoreflect.ValueOfBytes(value) - case "cosmos.evm.vm.v1.LegacyTx.s": - value := x.S - return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.LegacyTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.LegacyTx does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtensionOptionsEthereumTx does not contain field %s", descriptor.FullName())) } } @@ -964,31 +644,13 @@ func (x *fastReflection_LegacyTx) Get(descriptor protoreflect.FieldDescriptor) p // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_LegacyTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_ExtensionOptionsEthereumTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.evm.vm.v1.LegacyTx.nonce": - x.Nonce = value.Uint() - case "cosmos.evm.vm.v1.LegacyTx.gas_price": - x.GasPrice = value.Interface().(string) - case "cosmos.evm.vm.v1.LegacyTx.gas": - x.Gas = value.Uint() - case "cosmos.evm.vm.v1.LegacyTx.to": - x.To = value.Interface().(string) - case "cosmos.evm.vm.v1.LegacyTx.value": - x.Value = value.Interface().(string) - case "cosmos.evm.vm.v1.LegacyTx.data": - x.Data = value.Bytes() - case "cosmos.evm.vm.v1.LegacyTx.v": - x.V = value.Bytes() - case "cosmos.evm.vm.v1.LegacyTx.r": - x.R = value.Bytes() - case "cosmos.evm.vm.v1.LegacyTx.s": - x.S = value.Bytes() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.LegacyTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.LegacyTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) } } @@ -1002,72 +664,36 @@ func (x *fastReflection_LegacyTx) Set(fd protoreflect.FieldDescriptor, value pro // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_LegacyTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ExtensionOptionsEthereumTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.vm.v1.LegacyTx.nonce": - panic(fmt.Errorf("field nonce of message cosmos.evm.vm.v1.LegacyTx is not mutable")) - case "cosmos.evm.vm.v1.LegacyTx.gas_price": - panic(fmt.Errorf("field gas_price of message cosmos.evm.vm.v1.LegacyTx is not mutable")) - case "cosmos.evm.vm.v1.LegacyTx.gas": - panic(fmt.Errorf("field gas of message cosmos.evm.vm.v1.LegacyTx is not mutable")) - case "cosmos.evm.vm.v1.LegacyTx.to": - panic(fmt.Errorf("field to of message cosmos.evm.vm.v1.LegacyTx is not mutable")) - case "cosmos.evm.vm.v1.LegacyTx.value": - panic(fmt.Errorf("field value of message cosmos.evm.vm.v1.LegacyTx is not mutable")) - case "cosmos.evm.vm.v1.LegacyTx.data": - panic(fmt.Errorf("field data of message cosmos.evm.vm.v1.LegacyTx is not mutable")) - case "cosmos.evm.vm.v1.LegacyTx.v": - panic(fmt.Errorf("field v of message cosmos.evm.vm.v1.LegacyTx is not mutable")) - case "cosmos.evm.vm.v1.LegacyTx.r": - panic(fmt.Errorf("field r of message cosmos.evm.vm.v1.LegacyTx is not mutable")) - case "cosmos.evm.vm.v1.LegacyTx.s": - panic(fmt.Errorf("field s of message cosmos.evm.vm.v1.LegacyTx is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.LegacyTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.LegacyTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_LegacyTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ExtensionOptionsEthereumTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.vm.v1.LegacyTx.nonce": - return protoreflect.ValueOfUint64(uint64(0)) - case "cosmos.evm.vm.v1.LegacyTx.gas_price": - return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.LegacyTx.gas": - return protoreflect.ValueOfUint64(uint64(0)) - case "cosmos.evm.vm.v1.LegacyTx.to": - return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.LegacyTx.value": - return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.LegacyTx.data": - return protoreflect.ValueOfBytes(nil) - case "cosmos.evm.vm.v1.LegacyTx.v": - return protoreflect.ValueOfBytes(nil) - case "cosmos.evm.vm.v1.LegacyTx.r": - return protoreflect.ValueOfBytes(nil) - case "cosmos.evm.vm.v1.LegacyTx.s": - return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.LegacyTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.LegacyTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_LegacyTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_ExtensionOptionsEthereumTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.LegacyTx", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.ExtensionOptionsEthereumTx", d.FullName())) } panic("unreachable") } @@ -1075,7 +701,7 @@ func (x *fastReflection_LegacyTx) WhichOneof(d protoreflect.OneofDescriptor) pro // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_LegacyTx) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_ExtensionOptionsEthereumTx) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1086,7 +712,7 @@ func (x *fastReflection_LegacyTx) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_LegacyTx) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_ExtensionOptionsEthereumTx) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1098,7 +724,7 @@ func (x *fastReflection_LegacyTx) SetUnknown(fields protoreflect.RawFields) { // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_LegacyTx) IsValid() bool { +func (x *fastReflection_ExtensionOptionsEthereumTx) IsValid() bool { return x != nil } @@ -1108,9 +734,9 @@ func (x *fastReflection_LegacyTx) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_LegacyTx) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_ExtensionOptionsEthereumTx) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*LegacyTx) + x := input.Message.Interface().(*ExtensionOptionsEthereumTx) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1122,51 +748,17 @@ func (x *fastReflection_LegacyTx) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.Nonce != 0 { - n += 1 + runtime.Sov(uint64(x.Nonce)) - } - l = len(x.GasPrice) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if x.unknownFields != nil { + n += len(x.unknownFields) } - if x.Gas != 0 { - n += 1 + runtime.Sov(uint64(x.Gas)) - } - l = len(x.To) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Value) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Data) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.V) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.R) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.S) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, } } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*LegacyTx) + x := input.Message.Interface().(*ExtensionOptionsEthereumTx) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1185,65 +777,6 @@ func (x *fastReflection_LegacyTx) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.S) > 0 { - i -= len(x.S) - copy(dAtA[i:], x.S) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.S))) - i-- - dAtA[i] = 0x4a - } - if len(x.R) > 0 { - i -= len(x.R) - copy(dAtA[i:], x.R) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.R))) - i-- - dAtA[i] = 0x42 - } - if len(x.V) > 0 { - i -= len(x.V) - copy(dAtA[i:], x.V) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.V))) - i-- - dAtA[i] = 0x3a - } - if len(x.Data) > 0 { - i -= len(x.Data) - copy(dAtA[i:], x.Data) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) - i-- - dAtA[i] = 0x32 - } - if len(x.Value) > 0 { - i -= len(x.Value) - copy(dAtA[i:], x.Value) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Value))) - i-- - dAtA[i] = 0x2a - } - if len(x.To) > 0 { - i -= len(x.To) - copy(dAtA[i:], x.To) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.To))) - i-- - dAtA[i] = 0x22 - } - if x.Gas != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Gas)) - i-- - dAtA[i] = 0x18 - } - if len(x.GasPrice) > 0 { - i -= len(x.GasPrice) - copy(dAtA[i:], x.GasPrice) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GasPrice))) - i-- - dAtA[i] = 0x12 - } - if x.Nonce != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Nonce)) - i-- - dAtA[i] = 0x8 - } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -1255,7 +788,7 @@ func (x *fastReflection_LegacyTx) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*LegacyTx) + x := input.Message.Interface().(*ExtensionOptionsEthereumTx) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1287,296 +820,26 @@ func (x *fastReflection_LegacyTx) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: LegacyTx: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExtensionOptionsEthereumTx: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: LegacyTx: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExtensionOptionsEthereumTx: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) - } - x.Nonce = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Nonce |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.GasPrice = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Gas", wireType) - } - x.Gas = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Gas |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.To = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Data = append(x.Data[:0], dAtA[iNdEx:postIndex]...) - if x.Data == nil { - x.Data = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field V", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } - postIndex := iNdEx + byteLen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - if postIndex > l { + if (iNdEx + skippy) > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.V = append(x.V[:0], dAtA[iNdEx:postIndex]...) - if x.V == nil { - x.V = []byte{} - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field R", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.R = append(x.R[:0], dAtA[iNdEx:postIndex]...) - if x.R == nil { - x.R = []byte{} - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field S", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.S = append(x.S[:0], dAtA[iNdEx:postIndex]...) - if x.S == nil { - x.S = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) } iNdEx += skippy } @@ -1598,97 +861,85 @@ func (x *fastReflection_LegacyTx) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_AccessListTx_8_list)(nil) +var _ protoreflect.List = (*_MsgEthereumTxResponse_2_list)(nil) -type _AccessListTx_8_list struct { - list *[]*AccessTuple +type _MsgEthereumTxResponse_2_list struct { + list *[]*Log } -func (x *_AccessListTx_8_list) Len() int { +func (x *_MsgEthereumTxResponse_2_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_AccessListTx_8_list) Get(i int) protoreflect.Value { +func (x *_MsgEthereumTxResponse_2_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (x *_AccessListTx_8_list) Set(i int, value protoreflect.Value) { +func (x *_MsgEthereumTxResponse_2_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*AccessTuple) + concreteValue := valueUnwrapped.Interface().(*Log) (*x.list)[i] = concreteValue } -func (x *_AccessListTx_8_list) Append(value protoreflect.Value) { +func (x *_MsgEthereumTxResponse_2_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*AccessTuple) + concreteValue := valueUnwrapped.Interface().(*Log) *x.list = append(*x.list, concreteValue) } -func (x *_AccessListTx_8_list) AppendMutable() protoreflect.Value { - v := new(AccessTuple) +func (x *_MsgEthereumTxResponse_2_list) AppendMutable() protoreflect.Value { + v := new(Log) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_AccessListTx_8_list) Truncate(n int) { +func (x *_MsgEthereumTxResponse_2_list) Truncate(n int) { for i := n; i < len(*x.list); i++ { (*x.list)[i] = nil } *x.list = (*x.list)[:n] } -func (x *_AccessListTx_8_list) NewElement() protoreflect.Value { - v := new(AccessTuple) +func (x *_MsgEthereumTxResponse_2_list) NewElement() protoreflect.Value { + v := new(Log) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_AccessListTx_8_list) IsValid() bool { +func (x *_MsgEthereumTxResponse_2_list) IsValid() bool { return x.list != nil } var ( - md_AccessListTx protoreflect.MessageDescriptor - fd_AccessListTx_chain_id protoreflect.FieldDescriptor - fd_AccessListTx_nonce protoreflect.FieldDescriptor - fd_AccessListTx_gas_price protoreflect.FieldDescriptor - fd_AccessListTx_gas protoreflect.FieldDescriptor - fd_AccessListTx_to protoreflect.FieldDescriptor - fd_AccessListTx_value protoreflect.FieldDescriptor - fd_AccessListTx_data protoreflect.FieldDescriptor - fd_AccessListTx_accesses protoreflect.FieldDescriptor - fd_AccessListTx_v protoreflect.FieldDescriptor - fd_AccessListTx_r protoreflect.FieldDescriptor - fd_AccessListTx_s protoreflect.FieldDescriptor + md_MsgEthereumTxResponse protoreflect.MessageDescriptor + fd_MsgEthereumTxResponse_hash protoreflect.FieldDescriptor + fd_MsgEthereumTxResponse_logs protoreflect.FieldDescriptor + fd_MsgEthereumTxResponse_ret protoreflect.FieldDescriptor + fd_MsgEthereumTxResponse_vm_error protoreflect.FieldDescriptor + fd_MsgEthereumTxResponse_gas_used protoreflect.FieldDescriptor ) func init() { file_cosmos_evm_vm_v1_tx_proto_init() - md_AccessListTx = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("AccessListTx") - fd_AccessListTx_chain_id = md_AccessListTx.Fields().ByName("chain_id") - fd_AccessListTx_nonce = md_AccessListTx.Fields().ByName("nonce") - fd_AccessListTx_gas_price = md_AccessListTx.Fields().ByName("gas_price") - fd_AccessListTx_gas = md_AccessListTx.Fields().ByName("gas") - fd_AccessListTx_to = md_AccessListTx.Fields().ByName("to") - fd_AccessListTx_value = md_AccessListTx.Fields().ByName("value") - fd_AccessListTx_data = md_AccessListTx.Fields().ByName("data") - fd_AccessListTx_accesses = md_AccessListTx.Fields().ByName("accesses") - fd_AccessListTx_v = md_AccessListTx.Fields().ByName("v") - fd_AccessListTx_r = md_AccessListTx.Fields().ByName("r") - fd_AccessListTx_s = md_AccessListTx.Fields().ByName("s") + md_MsgEthereumTxResponse = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("MsgEthereumTxResponse") + fd_MsgEthereumTxResponse_hash = md_MsgEthereumTxResponse.Fields().ByName("hash") + fd_MsgEthereumTxResponse_logs = md_MsgEthereumTxResponse.Fields().ByName("logs") + fd_MsgEthereumTxResponse_ret = md_MsgEthereumTxResponse.Fields().ByName("ret") + fd_MsgEthereumTxResponse_vm_error = md_MsgEthereumTxResponse.Fields().ByName("vm_error") + fd_MsgEthereumTxResponse_gas_used = md_MsgEthereumTxResponse.Fields().ByName("gas_used") } -var _ protoreflect.Message = (*fastReflection_AccessListTx)(nil) +var _ protoreflect.Message = (*fastReflection_MsgEthereumTxResponse)(nil) -type fastReflection_AccessListTx AccessListTx +type fastReflection_MsgEthereumTxResponse MsgEthereumTxResponse -func (x *AccessListTx) ProtoReflect() protoreflect.Message { - return (*fastReflection_AccessListTx)(x) +func (x *MsgEthereumTxResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgEthereumTxResponse)(x) } -func (x *AccessListTx) slowProtoReflect() protoreflect.Message { +func (x *MsgEthereumTxResponse) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1700,43 +951,43 @@ func (x *AccessListTx) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_AccessListTx_messageType fastReflection_AccessListTx_messageType -var _ protoreflect.MessageType = fastReflection_AccessListTx_messageType{} +var _fastReflection_MsgEthereumTxResponse_messageType fastReflection_MsgEthereumTxResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgEthereumTxResponse_messageType{} -type fastReflection_AccessListTx_messageType struct{} +type fastReflection_MsgEthereumTxResponse_messageType struct{} -func (x fastReflection_AccessListTx_messageType) Zero() protoreflect.Message { - return (*fastReflection_AccessListTx)(nil) +func (x fastReflection_MsgEthereumTxResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgEthereumTxResponse)(nil) } -func (x fastReflection_AccessListTx_messageType) New() protoreflect.Message { - return new(fastReflection_AccessListTx) +func (x fastReflection_MsgEthereumTxResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgEthereumTxResponse) } -func (x fastReflection_AccessListTx_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_AccessListTx +func (x fastReflection_MsgEthereumTxResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEthereumTxResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_AccessListTx) Descriptor() protoreflect.MessageDescriptor { - return md_AccessListTx +func (x *fastReflection_MsgEthereumTxResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgEthereumTxResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_AccessListTx) Type() protoreflect.MessageType { - return _fastReflection_AccessListTx_messageType +func (x *fastReflection_MsgEthereumTxResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgEthereumTxResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_AccessListTx) New() protoreflect.Message { - return new(fastReflection_AccessListTx) +func (x *fastReflection_MsgEthereumTxResponse) New() protoreflect.Message { + return new(fastReflection_MsgEthereumTxResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_AccessListTx) Interface() protoreflect.ProtoMessage { - return (*AccessListTx)(x) +func (x *fastReflection_MsgEthereumTxResponse) Interface() protoreflect.ProtoMessage { + return (*MsgEthereumTxResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -1744,70 +995,34 @@ func (x *fastReflection_AccessListTx) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_AccessListTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.ChainId != "" { - value := protoreflect.ValueOfString(x.ChainId) - if !f(fd_AccessListTx_chain_id, value) { - return - } - } - if x.Nonce != uint64(0) { - value := protoreflect.ValueOfUint64(x.Nonce) - if !f(fd_AccessListTx_nonce, value) { - return - } - } - if x.GasPrice != "" { - value := protoreflect.ValueOfString(x.GasPrice) - if !f(fd_AccessListTx_gas_price, value) { - return - } - } - if x.Gas != uint64(0) { - value := protoreflect.ValueOfUint64(x.Gas) - if !f(fd_AccessListTx_gas, value) { - return - } - } - if x.To != "" { - value := protoreflect.ValueOfString(x.To) - if !f(fd_AccessListTx_to, value) { - return - } - } - if x.Value != "" { - value := protoreflect.ValueOfString(x.Value) - if !f(fd_AccessListTx_value, value) { - return - } - } - if len(x.Data) != 0 { - value := protoreflect.ValueOfBytes(x.Data) - if !f(fd_AccessListTx_data, value) { +func (x *fastReflection_MsgEthereumTxResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Hash != "" { + value := protoreflect.ValueOfString(x.Hash) + if !f(fd_MsgEthereumTxResponse_hash, value) { return } } - if len(x.Accesses) != 0 { - value := protoreflect.ValueOfList(&_AccessListTx_8_list{list: &x.Accesses}) - if !f(fd_AccessListTx_accesses, value) { + if len(x.Logs) != 0 { + value := protoreflect.ValueOfList(&_MsgEthereumTxResponse_2_list{list: &x.Logs}) + if !f(fd_MsgEthereumTxResponse_logs, value) { return } } - if len(x.V) != 0 { - value := protoreflect.ValueOfBytes(x.V) - if !f(fd_AccessListTx_v, value) { + if len(x.Ret) != 0 { + value := protoreflect.ValueOfBytes(x.Ret) + if !f(fd_MsgEthereumTxResponse_ret, value) { return } } - if len(x.R) != 0 { - value := protoreflect.ValueOfBytes(x.R) - if !f(fd_AccessListTx_r, value) { + if x.VmError != "" { + value := protoreflect.ValueOfString(x.VmError) + if !f(fd_MsgEthereumTxResponse_vm_error, value) { return } } - if len(x.S) != 0 { - value := protoreflect.ValueOfBytes(x.S) - if !f(fd_AccessListTx_s, value) { + if x.GasUsed != uint64(0) { + value := protoreflect.ValueOfUint64(x.GasUsed) + if !f(fd_MsgEthereumTxResponse_gas_used, value) { return } } @@ -1824,35 +1039,23 @@ func (x *fastReflection_AccessListTx) Range(f func(protoreflect.FieldDescriptor, // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_AccessListTx) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgEthereumTxResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.evm.vm.v1.AccessListTx.chain_id": - return x.ChainId != "" - case "cosmos.evm.vm.v1.AccessListTx.nonce": - return x.Nonce != uint64(0) - case "cosmos.evm.vm.v1.AccessListTx.gas_price": - return x.GasPrice != "" - case "cosmos.evm.vm.v1.AccessListTx.gas": - return x.Gas != uint64(0) - case "cosmos.evm.vm.v1.AccessListTx.to": - return x.To != "" - case "cosmos.evm.vm.v1.AccessListTx.value": - return x.Value != "" - case "cosmos.evm.vm.v1.AccessListTx.data": - return len(x.Data) != 0 - case "cosmos.evm.vm.v1.AccessListTx.accesses": - return len(x.Accesses) != 0 - case "cosmos.evm.vm.v1.AccessListTx.v": - return len(x.V) != 0 - case "cosmos.evm.vm.v1.AccessListTx.r": - return len(x.R) != 0 - case "cosmos.evm.vm.v1.AccessListTx.s": - return len(x.S) != 0 + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.hash": + return x.Hash != "" + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.logs": + return len(x.Logs) != 0 + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.ret": + return len(x.Ret) != 0 + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.vm_error": + return x.VmError != "" + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.gas_used": + return x.GasUsed != uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.AccessListTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTxResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.AccessListTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) } } @@ -1862,35 +1065,23 @@ func (x *fastReflection_AccessListTx) Has(fd protoreflect.FieldDescriptor) bool // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_AccessListTx) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgEthereumTxResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.evm.vm.v1.AccessListTx.chain_id": - x.ChainId = "" - case "cosmos.evm.vm.v1.AccessListTx.nonce": - x.Nonce = uint64(0) - case "cosmos.evm.vm.v1.AccessListTx.gas_price": - x.GasPrice = "" - case "cosmos.evm.vm.v1.AccessListTx.gas": - x.Gas = uint64(0) - case "cosmos.evm.vm.v1.AccessListTx.to": - x.To = "" - case "cosmos.evm.vm.v1.AccessListTx.value": - x.Value = "" - case "cosmos.evm.vm.v1.AccessListTx.data": - x.Data = nil - case "cosmos.evm.vm.v1.AccessListTx.accesses": - x.Accesses = nil - case "cosmos.evm.vm.v1.AccessListTx.v": - x.V = nil - case "cosmos.evm.vm.v1.AccessListTx.r": - x.R = nil - case "cosmos.evm.vm.v1.AccessListTx.s": - x.S = nil + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.hash": + x.Hash = "" + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.logs": + x.Logs = nil + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.ret": + x.Ret = nil + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.vm_error": + x.VmError = "" + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.gas_used": + x.GasUsed = uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.AccessListTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTxResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.AccessListTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) } } @@ -1900,49 +1091,31 @@ func (x *fastReflection_AccessListTx) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_AccessListTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgEthereumTxResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.evm.vm.v1.AccessListTx.chain_id": - value := x.ChainId - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.AccessListTx.nonce": - value := x.Nonce - return protoreflect.ValueOfUint64(value) - case "cosmos.evm.vm.v1.AccessListTx.gas_price": - value := x.GasPrice - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.AccessListTx.gas": - value := x.Gas - return protoreflect.ValueOfUint64(value) - case "cosmos.evm.vm.v1.AccessListTx.to": - value := x.To - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.AccessListTx.value": - value := x.Value + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.hash": + value := x.Hash return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.AccessListTx.data": - value := x.Data - return protoreflect.ValueOfBytes(value) - case "cosmos.evm.vm.v1.AccessListTx.accesses": - if len(x.Accesses) == 0 { - return protoreflect.ValueOfList(&_AccessListTx_8_list{}) + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.logs": + if len(x.Logs) == 0 { + return protoreflect.ValueOfList(&_MsgEthereumTxResponse_2_list{}) } - listValue := &_AccessListTx_8_list{list: &x.Accesses} + listValue := &_MsgEthereumTxResponse_2_list{list: &x.Logs} return protoreflect.ValueOfList(listValue) - case "cosmos.evm.vm.v1.AccessListTx.v": - value := x.V - return protoreflect.ValueOfBytes(value) - case "cosmos.evm.vm.v1.AccessListTx.r": - value := x.R - return protoreflect.ValueOfBytes(value) - case "cosmos.evm.vm.v1.AccessListTx.s": - value := x.S + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.ret": + value := x.Ret return protoreflect.ValueOfBytes(value) + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.vm_error": + value := x.VmError + return protoreflect.ValueOfString(value) + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.gas_used": + value := x.GasUsed + return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.AccessListTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTxResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.AccessListTx does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgEthereumTxResponse does not contain field %s", descriptor.FullName())) } } @@ -1956,37 +1129,25 @@ func (x *fastReflection_AccessListTx) Get(descriptor protoreflect.FieldDescripto // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_AccessListTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgEthereumTxResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.evm.vm.v1.AccessListTx.chain_id": - x.ChainId = value.Interface().(string) - case "cosmos.evm.vm.v1.AccessListTx.nonce": - x.Nonce = value.Uint() - case "cosmos.evm.vm.v1.AccessListTx.gas_price": - x.GasPrice = value.Interface().(string) - case "cosmos.evm.vm.v1.AccessListTx.gas": - x.Gas = value.Uint() - case "cosmos.evm.vm.v1.AccessListTx.to": - x.To = value.Interface().(string) - case "cosmos.evm.vm.v1.AccessListTx.value": - x.Value = value.Interface().(string) - case "cosmos.evm.vm.v1.AccessListTx.data": - x.Data = value.Bytes() - case "cosmos.evm.vm.v1.AccessListTx.accesses": + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.hash": + x.Hash = value.Interface().(string) + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.logs": lv := value.List() - clv := lv.(*_AccessListTx_8_list) - x.Accesses = *clv.list - case "cosmos.evm.vm.v1.AccessListTx.v": - x.V = value.Bytes() - case "cosmos.evm.vm.v1.AccessListTx.r": - x.R = value.Bytes() - case "cosmos.evm.vm.v1.AccessListTx.s": - x.S = value.Bytes() + clv := lv.(*_MsgEthereumTxResponse_2_list) + x.Logs = *clv.list + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.ret": + x.Ret = value.Bytes() + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.vm_error": + x.VmError = value.Interface().(string) + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.gas_used": + x.GasUsed = value.Uint() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.AccessListTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTxResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.AccessListTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) } } @@ -2000,85 +1161,61 @@ func (x *fastReflection_AccessListTx) Set(fd protoreflect.FieldDescriptor, value // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_AccessListTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgEthereumTxResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.vm.v1.AccessListTx.accesses": - if x.Accesses == nil { - x.Accesses = []*AccessTuple{} + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.logs": + if x.Logs == nil { + x.Logs = []*Log{} } - value := &_AccessListTx_8_list{list: &x.Accesses} + value := &_MsgEthereumTxResponse_2_list{list: &x.Logs} return protoreflect.ValueOfList(value) - case "cosmos.evm.vm.v1.AccessListTx.chain_id": - panic(fmt.Errorf("field chain_id of message cosmos.evm.vm.v1.AccessListTx is not mutable")) - case "cosmos.evm.vm.v1.AccessListTx.nonce": - panic(fmt.Errorf("field nonce of message cosmos.evm.vm.v1.AccessListTx is not mutable")) - case "cosmos.evm.vm.v1.AccessListTx.gas_price": - panic(fmt.Errorf("field gas_price of message cosmos.evm.vm.v1.AccessListTx is not mutable")) - case "cosmos.evm.vm.v1.AccessListTx.gas": - panic(fmt.Errorf("field gas of message cosmos.evm.vm.v1.AccessListTx is not mutable")) - case "cosmos.evm.vm.v1.AccessListTx.to": - panic(fmt.Errorf("field to of message cosmos.evm.vm.v1.AccessListTx is not mutable")) - case "cosmos.evm.vm.v1.AccessListTx.value": - panic(fmt.Errorf("field value of message cosmos.evm.vm.v1.AccessListTx is not mutable")) - case "cosmos.evm.vm.v1.AccessListTx.data": - panic(fmt.Errorf("field data of message cosmos.evm.vm.v1.AccessListTx is not mutable")) - case "cosmos.evm.vm.v1.AccessListTx.v": - panic(fmt.Errorf("field v of message cosmos.evm.vm.v1.AccessListTx is not mutable")) - case "cosmos.evm.vm.v1.AccessListTx.r": - panic(fmt.Errorf("field r of message cosmos.evm.vm.v1.AccessListTx is not mutable")) - case "cosmos.evm.vm.v1.AccessListTx.s": - panic(fmt.Errorf("field s of message cosmos.evm.vm.v1.AccessListTx is not mutable")) + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.hash": + panic(fmt.Errorf("field hash of message cosmos.evm.vm.v1.MsgEthereumTxResponse is not mutable")) + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.ret": + panic(fmt.Errorf("field ret of message cosmos.evm.vm.v1.MsgEthereumTxResponse is not mutable")) + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.vm_error": + panic(fmt.Errorf("field vm_error of message cosmos.evm.vm.v1.MsgEthereumTxResponse is not mutable")) + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.gas_used": + panic(fmt.Errorf("field gas_used of message cosmos.evm.vm.v1.MsgEthereumTxResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.AccessListTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTxResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.AccessListTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_AccessListTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgEthereumTxResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.vm.v1.AccessListTx.chain_id": + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.hash": return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.AccessListTx.nonce": - return protoreflect.ValueOfUint64(uint64(0)) - case "cosmos.evm.vm.v1.AccessListTx.gas_price": + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.logs": + list := []*Log{} + return protoreflect.ValueOfList(&_MsgEthereumTxResponse_2_list{list: &list}) + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.ret": + return protoreflect.ValueOfBytes(nil) + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.vm_error": return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.AccessListTx.gas": + case "cosmos.evm.vm.v1.MsgEthereumTxResponse.gas_used": return protoreflect.ValueOfUint64(uint64(0)) - case "cosmos.evm.vm.v1.AccessListTx.to": - return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.AccessListTx.value": - return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.AccessListTx.data": - return protoreflect.ValueOfBytes(nil) - case "cosmos.evm.vm.v1.AccessListTx.accesses": - list := []*AccessTuple{} - return protoreflect.ValueOfList(&_AccessListTx_8_list{list: &list}) - case "cosmos.evm.vm.v1.AccessListTx.v": - return protoreflect.ValueOfBytes(nil) - case "cosmos.evm.vm.v1.AccessListTx.r": - return protoreflect.ValueOfBytes(nil) - case "cosmos.evm.vm.v1.AccessListTx.s": - return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.AccessListTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTxResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.AccessListTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_AccessListTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgEthereumTxResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.AccessListTx", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.MsgEthereumTxResponse", d.FullName())) } panic("unreachable") } @@ -2086,7 +1223,7 @@ func (x *fastReflection_AccessListTx) WhichOneof(d protoreflect.OneofDescriptor) // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_AccessListTx) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgEthereumTxResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -2097,7 +1234,7 @@ func (x *fastReflection_AccessListTx) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_AccessListTx) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgEthereumTxResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -2109,7 +1246,7 @@ func (x *fastReflection_AccessListTx) SetUnknown(fields protoreflect.RawFields) // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_AccessListTx) IsValid() bool { +func (x *fastReflection_MsgEthereumTxResponse) IsValid() bool { return x != nil } @@ -2119,9 +1256,9 @@ func (x *fastReflection_AccessListTx) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgEthereumTxResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*AccessListTx) + x := input.Message.Interface().(*MsgEthereumTxResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2133,49 +1270,26 @@ func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.ChainId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Nonce != 0 { - n += 1 + runtime.Sov(uint64(x.Nonce)) - } - l = len(x.GasPrice) + l = len(x.Hash) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Gas != 0 { - n += 1 + runtime.Sov(uint64(x.Gas)) + if len(x.Logs) > 0 { + for _, e := range x.Logs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } } - l = len(x.To) + l = len(x.Ret) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Value) + l = len(x.VmError) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Data) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Accesses) > 0 { - for _, e := range x.Accesses { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - l = len(x.V) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.R) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.S) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if x.GasUsed != 0 { + n += 1 + runtime.Sov(uint64(x.GasUsed)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -2187,7 +1301,7 @@ func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*AccessListTx) + x := input.Message.Interface().(*MsgEthereumTxResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2206,30 +1320,28 @@ func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.S) > 0 { - i -= len(x.S) - copy(dAtA[i:], x.S) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.S))) + if x.GasUsed != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.GasUsed)) i-- - dAtA[i] = 0x5a + dAtA[i] = 0x28 } - if len(x.R) > 0 { - i -= len(x.R) - copy(dAtA[i:], x.R) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.R))) + if len(x.VmError) > 0 { + i -= len(x.VmError) + copy(dAtA[i:], x.VmError) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VmError))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x22 } - if len(x.V) > 0 { - i -= len(x.V) - copy(dAtA[i:], x.V) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.V))) + if len(x.Ret) > 0 { + i -= len(x.Ret) + copy(dAtA[i:], x.Ret) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Ret))) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x1a } - if len(x.Accesses) > 0 { - for iNdEx := len(x.Accesses) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Accesses[iNdEx]) + if len(x.Logs) > 0 { + for iNdEx := len(x.Logs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Logs[iNdEx]) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2240,51 +1352,13 @@ func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x12 } } - if len(x.Data) > 0 { - i -= len(x.Data) - copy(dAtA[i:], x.Data) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) - i-- - dAtA[i] = 0x3a - } - if len(x.Value) > 0 { - i -= len(x.Value) - copy(dAtA[i:], x.Value) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Value))) - i-- - dAtA[i] = 0x32 - } - if len(x.To) > 0 { - i -= len(x.To) - copy(dAtA[i:], x.To) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.To))) - i-- - dAtA[i] = 0x2a - } - if x.Gas != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Gas)) - i-- - dAtA[i] = 0x20 - } - if len(x.GasPrice) > 0 { - i -= len(x.GasPrice) - copy(dAtA[i:], x.GasPrice) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GasPrice))) - i-- - dAtA[i] = 0x1a - } - if x.Nonce != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Nonce)) - i-- - dAtA[i] = 0x10 - } - if len(x.ChainId) > 0 { - i -= len(x.ChainId) - copy(dAtA[i:], x.ChainId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) + if len(x.Hash) > 0 { + i -= len(x.Hash) + copy(dAtA[i:], x.Hash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Hash))) i-- dAtA[i] = 0xa } @@ -2299,7 +1373,7 @@ func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*AccessListTx) + x := input.Message.Interface().(*MsgEthereumTxResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2331,15 +1405,15 @@ func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccessListTx: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEthereumTxResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccessListTx: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEthereumTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2367,179 +1441,11 @@ func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.ChainId = string(dAtA[iNdEx:postIndex]) + x.Hash = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) - } - x.Nonce = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Nonce |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.GasPrice = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Gas", wireType) - } - x.Gas = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Gas |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.To = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Data = append(x.Data[:0], dAtA[iNdEx:postIndex]...) - if x.Data == nil { - x.Data = []byte{} - } - iNdEx = postIndex - case 8: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Accesses", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2566,14 +1472,14 @@ func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Accesses = append(x.Accesses, &AccessTuple{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Accesses[len(x.Accesses)-1]); err != nil { + x.Logs = append(x.Logs, &Log{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Logs[len(x.Logs)-1]); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 9: + case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field V", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Ret", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -2600,16 +1506,16 @@ func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.V = append(x.V[:0], dAtA[iNdEx:postIndex]...) - if x.V == nil { - x.V = []byte{} + x.Ret = append(x.Ret[:0], dAtA[iNdEx:postIndex]...) + if x.Ret == nil { + x.Ret = []byte{} } iNdEx = postIndex - case 10: + case 4: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field R", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VmError", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2619,31 +1525,29 @@ func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.R = append(x.R[:0], dAtA[iNdEx:postIndex]...) - if x.R == nil { - x.R = []byte{} - } + x.VmError = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 11: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field S", wireType) + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) } - var byteLen int + x.GasUsed = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2653,26 +1557,11 @@ func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + x.GasUsed |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.S = append(x.S[:0], dAtA[iNdEx:postIndex]...) - if x.S == nil { - x.S = []byte{} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2708,99 +1597,28 @@ func (x *fastReflection_AccessListTx) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_DynamicFeeTx_9_list)(nil) +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) -type _DynamicFeeTx_9_list struct { - list *[]*AccessTuple +func init() { + file_cosmos_evm_vm_v1_tx_proto_init() + md_MsgUpdateParams = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") } -func (x *_DynamicFeeTx_9_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_DynamicFeeTx_9_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_DynamicFeeTx_9_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*AccessTuple) - (*x.list)[i] = concreteValue -} - -func (x *_DynamicFeeTx_9_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*AccessTuple) - *x.list = append(*x.list, concreteValue) -} - -func (x *_DynamicFeeTx_9_list) AppendMutable() protoreflect.Value { - v := new(AccessTuple) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_DynamicFeeTx_9_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_DynamicFeeTx_9_list) NewElement() protoreflect.Value { - v := new(AccessTuple) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_DynamicFeeTx_9_list) IsValid() bool { - return x.list != nil -} - -var ( - md_DynamicFeeTx protoreflect.MessageDescriptor - fd_DynamicFeeTx_chain_id protoreflect.FieldDescriptor - fd_DynamicFeeTx_nonce protoreflect.FieldDescriptor - fd_DynamicFeeTx_gas_tip_cap protoreflect.FieldDescriptor - fd_DynamicFeeTx_gas_fee_cap protoreflect.FieldDescriptor - fd_DynamicFeeTx_gas protoreflect.FieldDescriptor - fd_DynamicFeeTx_to protoreflect.FieldDescriptor - fd_DynamicFeeTx_value protoreflect.FieldDescriptor - fd_DynamicFeeTx_data protoreflect.FieldDescriptor - fd_DynamicFeeTx_accesses protoreflect.FieldDescriptor - fd_DynamicFeeTx_v protoreflect.FieldDescriptor - fd_DynamicFeeTx_r protoreflect.FieldDescriptor - fd_DynamicFeeTx_s protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_evm_vm_v1_tx_proto_init() - md_DynamicFeeTx = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("DynamicFeeTx") - fd_DynamicFeeTx_chain_id = md_DynamicFeeTx.Fields().ByName("chain_id") - fd_DynamicFeeTx_nonce = md_DynamicFeeTx.Fields().ByName("nonce") - fd_DynamicFeeTx_gas_tip_cap = md_DynamicFeeTx.Fields().ByName("gas_tip_cap") - fd_DynamicFeeTx_gas_fee_cap = md_DynamicFeeTx.Fields().ByName("gas_fee_cap") - fd_DynamicFeeTx_gas = md_DynamicFeeTx.Fields().ByName("gas") - fd_DynamicFeeTx_to = md_DynamicFeeTx.Fields().ByName("to") - fd_DynamicFeeTx_value = md_DynamicFeeTx.Fields().ByName("value") - fd_DynamicFeeTx_data = md_DynamicFeeTx.Fields().ByName("data") - fd_DynamicFeeTx_accesses = md_DynamicFeeTx.Fields().ByName("accesses") - fd_DynamicFeeTx_v = md_DynamicFeeTx.Fields().ByName("v") - fd_DynamicFeeTx_r = md_DynamicFeeTx.Fields().ByName("r") - fd_DynamicFeeTx_s = md_DynamicFeeTx.Fields().ByName("s") -} - -var _ protoreflect.Message = (*fastReflection_DynamicFeeTx)(nil) +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) -type fastReflection_DynamicFeeTx DynamicFeeTx +type fastReflection_MsgUpdateParams MsgUpdateParams -func (x *DynamicFeeTx) ProtoReflect() protoreflect.Message { - return (*fastReflection_DynamicFeeTx)(x) +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) } -func (x *DynamicFeeTx) slowProtoReflect() protoreflect.Message { +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2812,43 +1630,43 @@ func (x *DynamicFeeTx) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_DynamicFeeTx_messageType fastReflection_DynamicFeeTx_messageType -var _ protoreflect.MessageType = fastReflection_DynamicFeeTx_messageType{} +var _fastReflection_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} -type fastReflection_DynamicFeeTx_messageType struct{} +type fastReflection_MsgUpdateParams_messageType struct{} -func (x fastReflection_DynamicFeeTx_messageType) Zero() protoreflect.Message { - return (*fastReflection_DynamicFeeTx)(nil) +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) } -func (x fastReflection_DynamicFeeTx_messageType) New() protoreflect.Message { - return new(fastReflection_DynamicFeeTx) +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) } -func (x fastReflection_DynamicFeeTx_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_DynamicFeeTx +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_DynamicFeeTx) Descriptor() protoreflect.MessageDescriptor { - return md_DynamicFeeTx +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_DynamicFeeTx) Type() protoreflect.MessageType { - return _fastReflection_DynamicFeeTx_messageType +func (x *fastReflection_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_DynamicFeeTx) New() protoreflect.Message { - return new(fastReflection_DynamicFeeTx) +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_DynamicFeeTx) Interface() protoreflect.ProtoMessage { - return (*DynamicFeeTx)(x) +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(x) } // Range iterates over every populated field in an undefined order, @@ -2856,76 +1674,16 @@ func (x *fastReflection_DynamicFeeTx) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_DynamicFeeTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.ChainId != "" { - value := protoreflect.ValueOfString(x.ChainId) - if !f(fd_DynamicFeeTx_chain_id, value) { - return - } - } - if x.Nonce != uint64(0) { - value := protoreflect.ValueOfUint64(x.Nonce) - if !f(fd_DynamicFeeTx_nonce, value) { - return - } - } - if x.GasTipCap != "" { - value := protoreflect.ValueOfString(x.GasTipCap) - if !f(fd_DynamicFeeTx_gas_tip_cap, value) { - return - } - } - if x.GasFeeCap != "" { - value := protoreflect.ValueOfString(x.GasFeeCap) - if !f(fd_DynamicFeeTx_gas_fee_cap, value) { - return - } - } - if x.Gas != uint64(0) { - value := protoreflect.ValueOfUint64(x.Gas) - if !f(fd_DynamicFeeTx_gas, value) { - return - } - } - if x.To != "" { - value := protoreflect.ValueOfString(x.To) - if !f(fd_DynamicFeeTx_to, value) { - return - } - } - if x.Value != "" { - value := protoreflect.ValueOfString(x.Value) - if !f(fd_DynamicFeeTx_value, value) { - return - } - } - if len(x.Data) != 0 { - value := protoreflect.ValueOfBytes(x.Data) - if !f(fd_DynamicFeeTx_data, value) { - return - } - } - if len(x.Accesses) != 0 { - value := protoreflect.ValueOfList(&_DynamicFeeTx_9_list{list: &x.Accesses}) - if !f(fd_DynamicFeeTx_accesses, value) { - return - } - } - if len(x.V) != 0 { - value := protoreflect.ValueOfBytes(x.V) - if !f(fd_DynamicFeeTx_v, value) { - return - } - } - if len(x.R) != 0 { - value := protoreflect.ValueOfBytes(x.R) - if !f(fd_DynamicFeeTx_r, value) { +func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { return } } - if len(x.S) != 0 { - value := protoreflect.ValueOfBytes(x.S) - if !f(fd_DynamicFeeTx_s, value) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, value) { return } } @@ -2942,37 +1700,17 @@ func (x *fastReflection_DynamicFeeTx) Range(f func(protoreflect.FieldDescriptor, // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_DynamicFeeTx) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.evm.vm.v1.DynamicFeeTx.chain_id": - return x.ChainId != "" - case "cosmos.evm.vm.v1.DynamicFeeTx.nonce": - return x.Nonce != uint64(0) - case "cosmos.evm.vm.v1.DynamicFeeTx.gas_tip_cap": - return x.GasTipCap != "" - case "cosmos.evm.vm.v1.DynamicFeeTx.gas_fee_cap": - return x.GasFeeCap != "" - case "cosmos.evm.vm.v1.DynamicFeeTx.gas": - return x.Gas != uint64(0) - case "cosmos.evm.vm.v1.DynamicFeeTx.to": - return x.To != "" - case "cosmos.evm.vm.v1.DynamicFeeTx.value": - return x.Value != "" - case "cosmos.evm.vm.v1.DynamicFeeTx.data": - return len(x.Data) != 0 - case "cosmos.evm.vm.v1.DynamicFeeTx.accesses": - return len(x.Accesses) != 0 - case "cosmos.evm.vm.v1.DynamicFeeTx.v": - return len(x.V) != 0 - case "cosmos.evm.vm.v1.DynamicFeeTx.r": - return len(x.R) != 0 - case "cosmos.evm.vm.v1.DynamicFeeTx.s": - return len(x.S) != 0 + case "cosmos.evm.vm.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "cosmos.evm.vm.v1.MsgUpdateParams.params": + return x.Params != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.DynamicFeeTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.DynamicFeeTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } @@ -2982,37 +1720,17 @@ func (x *fastReflection_DynamicFeeTx) Has(fd protoreflect.FieldDescriptor) bool // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_DynamicFeeTx) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.evm.vm.v1.DynamicFeeTx.chain_id": - x.ChainId = "" - case "cosmos.evm.vm.v1.DynamicFeeTx.nonce": - x.Nonce = uint64(0) - case "cosmos.evm.vm.v1.DynamicFeeTx.gas_tip_cap": - x.GasTipCap = "" - case "cosmos.evm.vm.v1.DynamicFeeTx.gas_fee_cap": - x.GasFeeCap = "" - case "cosmos.evm.vm.v1.DynamicFeeTx.gas": - x.Gas = uint64(0) - case "cosmos.evm.vm.v1.DynamicFeeTx.to": - x.To = "" - case "cosmos.evm.vm.v1.DynamicFeeTx.value": - x.Value = "" - case "cosmos.evm.vm.v1.DynamicFeeTx.data": - x.Data = nil - case "cosmos.evm.vm.v1.DynamicFeeTx.accesses": - x.Accesses = nil - case "cosmos.evm.vm.v1.DynamicFeeTx.v": - x.V = nil - case "cosmos.evm.vm.v1.DynamicFeeTx.r": - x.R = nil - case "cosmos.evm.vm.v1.DynamicFeeTx.s": - x.S = nil + case "cosmos.evm.vm.v1.MsgUpdateParams.authority": + x.Authority = "" + case "cosmos.evm.vm.v1.MsgUpdateParams.params": + x.Params = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.DynamicFeeTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.DynamicFeeTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } @@ -3022,52 +1740,19 @@ func (x *fastReflection_DynamicFeeTx) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_DynamicFeeTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.evm.vm.v1.DynamicFeeTx.chain_id": - value := x.ChainId - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.DynamicFeeTx.nonce": - value := x.Nonce - return protoreflect.ValueOfUint64(value) - case "cosmos.evm.vm.v1.DynamicFeeTx.gas_tip_cap": - value := x.GasTipCap - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.DynamicFeeTx.gas_fee_cap": - value := x.GasFeeCap - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.DynamicFeeTx.gas": - value := x.Gas - return protoreflect.ValueOfUint64(value) - case "cosmos.evm.vm.v1.DynamicFeeTx.to": - value := x.To - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.DynamicFeeTx.value": - value := x.Value + case "cosmos.evm.vm.v1.MsgUpdateParams.authority": + value := x.Authority return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.DynamicFeeTx.data": - value := x.Data - return protoreflect.ValueOfBytes(value) - case "cosmos.evm.vm.v1.DynamicFeeTx.accesses": - if len(x.Accesses) == 0 { - return protoreflect.ValueOfList(&_DynamicFeeTx_9_list{}) - } - listValue := &_DynamicFeeTx_9_list{list: &x.Accesses} - return protoreflect.ValueOfList(listValue) - case "cosmos.evm.vm.v1.DynamicFeeTx.v": - value := x.V - return protoreflect.ValueOfBytes(value) - case "cosmos.evm.vm.v1.DynamicFeeTx.r": - value := x.R - return protoreflect.ValueOfBytes(value) - case "cosmos.evm.vm.v1.DynamicFeeTx.s": - value := x.S - return protoreflect.ValueOfBytes(value) + case "cosmos.evm.vm.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.DynamicFeeTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.DynamicFeeTx does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) } } @@ -3081,39 +1766,17 @@ func (x *fastReflection_DynamicFeeTx) Get(descriptor protoreflect.FieldDescripto // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_DynamicFeeTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.evm.vm.v1.DynamicFeeTx.chain_id": - x.ChainId = value.Interface().(string) - case "cosmos.evm.vm.v1.DynamicFeeTx.nonce": - x.Nonce = value.Uint() - case "cosmos.evm.vm.v1.DynamicFeeTx.gas_tip_cap": - x.GasTipCap = value.Interface().(string) - case "cosmos.evm.vm.v1.DynamicFeeTx.gas_fee_cap": - x.GasFeeCap = value.Interface().(string) - case "cosmos.evm.vm.v1.DynamicFeeTx.gas": - x.Gas = value.Uint() - case "cosmos.evm.vm.v1.DynamicFeeTx.to": - x.To = value.Interface().(string) - case "cosmos.evm.vm.v1.DynamicFeeTx.value": - x.Value = value.Interface().(string) - case "cosmos.evm.vm.v1.DynamicFeeTx.data": - x.Data = value.Bytes() - case "cosmos.evm.vm.v1.DynamicFeeTx.accesses": - lv := value.List() - clv := lv.(*_DynamicFeeTx_9_list) - x.Accesses = *clv.list - case "cosmos.evm.vm.v1.DynamicFeeTx.v": - x.V = value.Bytes() - case "cosmos.evm.vm.v1.DynamicFeeTx.r": - x.R = value.Bytes() - case "cosmos.evm.vm.v1.DynamicFeeTx.s": - x.S = value.Bytes() + case "cosmos.evm.vm.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "cosmos.evm.vm.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.DynamicFeeTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.DynamicFeeTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } @@ -3127,89 +1790,48 @@ func (x *fastReflection_DynamicFeeTx) Set(fd protoreflect.FieldDescriptor, value // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_DynamicFeeTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.vm.v1.DynamicFeeTx.accesses": - if x.Accesses == nil { - x.Accesses = []*AccessTuple{} + case "cosmos.evm.vm.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) } - value := &_DynamicFeeTx_9_list{list: &x.Accesses} - return protoreflect.ValueOfList(value) - case "cosmos.evm.vm.v1.DynamicFeeTx.chain_id": - panic(fmt.Errorf("field chain_id of message cosmos.evm.vm.v1.DynamicFeeTx is not mutable")) - case "cosmos.evm.vm.v1.DynamicFeeTx.nonce": - panic(fmt.Errorf("field nonce of message cosmos.evm.vm.v1.DynamicFeeTx is not mutable")) - case "cosmos.evm.vm.v1.DynamicFeeTx.gas_tip_cap": - panic(fmt.Errorf("field gas_tip_cap of message cosmos.evm.vm.v1.DynamicFeeTx is not mutable")) - case "cosmos.evm.vm.v1.DynamicFeeTx.gas_fee_cap": - panic(fmt.Errorf("field gas_fee_cap of message cosmos.evm.vm.v1.DynamicFeeTx is not mutable")) - case "cosmos.evm.vm.v1.DynamicFeeTx.gas": - panic(fmt.Errorf("field gas of message cosmos.evm.vm.v1.DynamicFeeTx is not mutable")) - case "cosmos.evm.vm.v1.DynamicFeeTx.to": - panic(fmt.Errorf("field to of message cosmos.evm.vm.v1.DynamicFeeTx is not mutable")) - case "cosmos.evm.vm.v1.DynamicFeeTx.value": - panic(fmt.Errorf("field value of message cosmos.evm.vm.v1.DynamicFeeTx is not mutable")) - case "cosmos.evm.vm.v1.DynamicFeeTx.data": - panic(fmt.Errorf("field data of message cosmos.evm.vm.v1.DynamicFeeTx is not mutable")) - case "cosmos.evm.vm.v1.DynamicFeeTx.v": - panic(fmt.Errorf("field v of message cosmos.evm.vm.v1.DynamicFeeTx is not mutable")) - case "cosmos.evm.vm.v1.DynamicFeeTx.r": - panic(fmt.Errorf("field r of message cosmos.evm.vm.v1.DynamicFeeTx is not mutable")) - case "cosmos.evm.vm.v1.DynamicFeeTx.s": - panic(fmt.Errorf("field s of message cosmos.evm.vm.v1.DynamicFeeTx is not mutable")) + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "cosmos.evm.vm.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message cosmos.evm.vm.v1.MsgUpdateParams is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.DynamicFeeTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.DynamicFeeTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_DynamicFeeTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.vm.v1.DynamicFeeTx.chain_id": - return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.DynamicFeeTx.nonce": - return protoreflect.ValueOfUint64(uint64(0)) - case "cosmos.evm.vm.v1.DynamicFeeTx.gas_tip_cap": - return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.DynamicFeeTx.gas_fee_cap": - return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.DynamicFeeTx.gas": - return protoreflect.ValueOfUint64(uint64(0)) - case "cosmos.evm.vm.v1.DynamicFeeTx.to": - return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.DynamicFeeTx.value": + case "cosmos.evm.vm.v1.MsgUpdateParams.authority": return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.DynamicFeeTx.data": - return protoreflect.ValueOfBytes(nil) - case "cosmos.evm.vm.v1.DynamicFeeTx.accesses": - list := []*AccessTuple{} - return protoreflect.ValueOfList(&_DynamicFeeTx_9_list{list: &list}) - case "cosmos.evm.vm.v1.DynamicFeeTx.v": - return protoreflect.ValueOfBytes(nil) - case "cosmos.evm.vm.v1.DynamicFeeTx.r": - return protoreflect.ValueOfBytes(nil) - case "cosmos.evm.vm.v1.DynamicFeeTx.s": - return protoreflect.ValueOfBytes(nil) + case "cosmos.evm.vm.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.DynamicFeeTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParams")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.DynamicFeeTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_DynamicFeeTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.DynamicFeeTx", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.MsgUpdateParams", d.FullName())) } panic("unreachable") } @@ -3217,7 +1839,7 @@ func (x *fastReflection_DynamicFeeTx) WhichOneof(d protoreflect.OneofDescriptor) // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_DynamicFeeTx) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -3228,7 +1850,7 @@ func (x *fastReflection_DynamicFeeTx) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_DynamicFeeTx) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -3240,7 +1862,7 @@ func (x *fastReflection_DynamicFeeTx) SetUnknown(fields protoreflect.RawFields) // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_DynamicFeeTx) IsValid() bool { +func (x *fastReflection_MsgUpdateParams) IsValid() bool { return x != nil } @@ -3250,9 +1872,9 @@ func (x *fastReflection_DynamicFeeTx) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_DynamicFeeTx) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*DynamicFeeTx) + x := input.Message.Interface().(*MsgUpdateParams) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3264,52 +1886,12 @@ func (x *fastReflection_DynamicFeeTx) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.ChainId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Nonce != 0 { - n += 1 + runtime.Sov(uint64(x.Nonce)) - } - l = len(x.GasTipCap) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.GasFeeCap) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Gas != 0 { - n += 1 + runtime.Sov(uint64(x.Gas)) - } - l = len(x.To) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Value) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Data) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Accesses) > 0 { - for _, e := range x.Accesses { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - l = len(x.V) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.R) + l = len(x.Authority) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.S) - if l > 0 { + if x.Params != nil { + l = options.Size(x.Params) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -3322,7 +1904,7 @@ func (x *fastReflection_DynamicFeeTx) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*DynamicFeeTx) + x := input.Message.Interface().(*MsgUpdateParams) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3341,92 +1923,24 @@ func (x *fastReflection_DynamicFeeTx) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.S) > 0 { - i -= len(x.S) - copy(dAtA[i:], x.S) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.S))) - i-- - dAtA[i] = 0x62 - } - if len(x.R) > 0 { - i -= len(x.R) - copy(dAtA[i:], x.R) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.R))) - i-- - dAtA[i] = 0x5a - } - if len(x.V) > 0 { - i -= len(x.V) - copy(dAtA[i:], x.V) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.V))) - i-- - dAtA[i] = 0x52 - } - if len(x.Accesses) > 0 { - for iNdEx := len(x.Accesses) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Accesses[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x4a + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err } - } - if len(x.Data) > 0 { - i -= len(x.Data) - copy(dAtA[i:], x.Data) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) - i-- - dAtA[i] = 0x42 - } - if len(x.Value) > 0 { - i -= len(x.Value) - copy(dAtA[i:], x.Value) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Value))) - i-- - dAtA[i] = 0x3a - } - if len(x.To) > 0 { - i -= len(x.To) - copy(dAtA[i:], x.To) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.To))) - i-- - dAtA[i] = 0x32 - } - if x.Gas != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Gas)) - i-- - dAtA[i] = 0x28 - } - if len(x.GasFeeCap) > 0 { - i -= len(x.GasFeeCap) - copy(dAtA[i:], x.GasFeeCap) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GasFeeCap))) - i-- - dAtA[i] = 0x22 - } - if len(x.GasTipCap) > 0 { - i -= len(x.GasTipCap) - copy(dAtA[i:], x.GasTipCap) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.GasTipCap))) - i-- - dAtA[i] = 0x1a - } - if x.Nonce != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Nonce)) + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } - if len(x.ChainId) > 0 { - i -= len(x.ChainId) - copy(dAtA[i:], x.ChainId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) i-- dAtA[i] = 0xa } @@ -3441,7 +1955,7 @@ func (x *fastReflection_DynamicFeeTx) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*DynamicFeeTx) + x := input.Message.Interface().(*MsgUpdateParams) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3473,15 +1987,15 @@ func (x *fastReflection_DynamicFeeTx) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DynamicFeeTx: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DynamicFeeTx: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3509,211 +2023,11 @@ func (x *fastReflection_DynamicFeeTx) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.ChainId = string(dAtA[iNdEx:postIndex]) + x.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) - } - x.Nonce = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Nonce |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasTipCap", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.GasTipCap = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasFeeCap", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.GasFeeCap = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Gas", wireType) - } - x.Gas = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Gas |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.To = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Data = append(x.Data[:0], dAtA[iNdEx:postIndex]...) - if x.Data == nil { - x.Data = []byte{} - } - iNdEx = postIndex - case 9: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Accesses", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3740,127 +2054,27 @@ func (x *fastReflection_DynamicFeeTx) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Accesses = append(x.Accesses, &AccessTuple{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Accesses[len(x.Accesses)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field V", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + if x.Params == nil { + x.Params = &Params{} } - x.V = append(x.V[:0], dAtA[iNdEx:postIndex]...) - if x.V == nil { - x.V = []byte{} + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 11: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field R", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } - postIndex := iNdEx + byteLen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - if postIndex > l { + if (iNdEx + skippy) > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.R = append(x.R[:0], dAtA[iNdEx:postIndex]...) - if x.R == nil { - x.R = []byte{} - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field S", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.S = append(x.S[:0], dAtA[iNdEx:postIndex]...) - if x.S == nil { - x.S = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) } iNdEx += skippy } @@ -3883,23 +2097,23 @@ func (x *fastReflection_DynamicFeeTx) ProtoMethods() *protoiface.Methods { } var ( - md_ExtensionOptionsEthereumTx protoreflect.MessageDescriptor + md_MsgUpdateParamsResponse protoreflect.MessageDescriptor ) func init() { file_cosmos_evm_vm_v1_tx_proto_init() - md_ExtensionOptionsEthereumTx = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("ExtensionOptionsEthereumTx") + md_MsgUpdateParamsResponse = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") } -var _ protoreflect.Message = (*fastReflection_ExtensionOptionsEthereumTx)(nil) +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) -type fastReflection_ExtensionOptionsEthereumTx ExtensionOptionsEthereumTx +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse -func (x *ExtensionOptionsEthereumTx) ProtoReflect() protoreflect.Message { - return (*fastReflection_ExtensionOptionsEthereumTx)(x) +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) } -func (x *ExtensionOptionsEthereumTx) slowProtoReflect() protoreflect.Message { +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3911,43 +2125,43 @@ func (x *ExtensionOptionsEthereumTx) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_ExtensionOptionsEthereumTx_messageType fastReflection_ExtensionOptionsEthereumTx_messageType -var _ protoreflect.MessageType = fastReflection_ExtensionOptionsEthereumTx_messageType{} +var _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} -type fastReflection_ExtensionOptionsEthereumTx_messageType struct{} +type fastReflection_MsgUpdateParamsResponse_messageType struct{} -func (x fastReflection_ExtensionOptionsEthereumTx_messageType) Zero() protoreflect.Message { - return (*fastReflection_ExtensionOptionsEthereumTx)(nil) +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) } -func (x fastReflection_ExtensionOptionsEthereumTx_messageType) New() protoreflect.Message { - return new(fastReflection_ExtensionOptionsEthereumTx) +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) } -func (x fastReflection_ExtensionOptionsEthereumTx_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ExtensionOptionsEthereumTx +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_ExtensionOptionsEthereumTx) Descriptor() protoreflect.MessageDescriptor { - return md_ExtensionOptionsEthereumTx +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_ExtensionOptionsEthereumTx) Type() protoreflect.MessageType { - return _fastReflection_ExtensionOptionsEthereumTx_messageType +func (x *fastReflection_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_ExtensionOptionsEthereumTx) New() protoreflect.Message { - return new(fastReflection_ExtensionOptionsEthereumTx) +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_ExtensionOptionsEthereumTx) Interface() protoreflect.ProtoMessage { - return (*ExtensionOptionsEthereumTx)(x) +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -3955,7 +2169,7 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) Interface() protoreflect.Pro // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_ExtensionOptionsEthereumTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -3969,13 +2183,13 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) Range(f func(protoreflect.Fi // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_ExtensionOptionsEthereumTx) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } @@ -3985,13 +2199,13 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) Has(fd protoreflect.FieldDes // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ExtensionOptionsEthereumTx) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } @@ -4001,13 +2215,13 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) Clear(fd protoreflect.FieldD // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_ExtensionOptionsEthereumTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtensionOptionsEthereumTx does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) } } @@ -4021,13 +2235,13 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) Get(descriptor protoreflect. // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ExtensionOptionsEthereumTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } @@ -4041,36 +2255,36 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) Set(fd protoreflect.FieldDes // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ExtensionOptionsEthereumTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_ExtensionOptionsEthereumTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParamsResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtensionOptionsEthereumTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_ExtensionOptionsEthereumTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.ExtensionOptionsEthereumTx", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.MsgUpdateParamsResponse", d.FullName())) } panic("unreachable") } @@ -4078,7 +2292,7 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) WhichOneof(d protoreflect.On // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_ExtensionOptionsEthereumTx) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgUpdateParamsResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -4089,7 +2303,7 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) GetUnknown() protoreflect.Ra // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ExtensionOptionsEthereumTx) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgUpdateParamsResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -4101,7 +2315,7 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) SetUnknown(fields protorefle // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_ExtensionOptionsEthereumTx) IsValid() bool { +func (x *fastReflection_MsgUpdateParamsResponse) IsValid() bool { return x != nil } @@ -4111,9 +2325,9 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_ExtensionOptionsEthereumTx) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ExtensionOptionsEthereumTx) + x := input.Message.Interface().(*MsgUpdateParamsResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4135,7 +2349,7 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) ProtoMethods() *protoiface.M } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*ExtensionOptionsEthereumTx) + x := input.Message.Interface().(*MsgUpdateParamsResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4165,7 +2379,7 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) ProtoMethods() *protoiface.M }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ExtensionOptionsEthereumTx) + x := input.Message.Interface().(*MsgUpdateParamsResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4197,10 +2411,10 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) ProtoMethods() *protoiface.M fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExtensionOptionsEthereumTx: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExtensionOptionsEthereumTx: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -4238,85 +2452,79 @@ func (x *fastReflection_ExtensionOptionsEthereumTx) ProtoMethods() *protoiface.M } } -var _ protoreflect.List = (*_MsgEthereumTxResponse_2_list)(nil) +var _ protoreflect.List = (*_MsgRegisterPreinstalls_2_list)(nil) -type _MsgEthereumTxResponse_2_list struct { - list *[]*Log +type _MsgRegisterPreinstalls_2_list struct { + list *[]*Preinstall } -func (x *_MsgEthereumTxResponse_2_list) Len() int { +func (x *_MsgRegisterPreinstalls_2_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_MsgEthereumTxResponse_2_list) Get(i int) protoreflect.Value { +func (x *_MsgRegisterPreinstalls_2_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (x *_MsgEthereumTxResponse_2_list) Set(i int, value protoreflect.Value) { +func (x *_MsgRegisterPreinstalls_2_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Log) + concreteValue := valueUnwrapped.Interface().(*Preinstall) (*x.list)[i] = concreteValue } -func (x *_MsgEthereumTxResponse_2_list) Append(value protoreflect.Value) { +func (x *_MsgRegisterPreinstalls_2_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Log) + concreteValue := valueUnwrapped.Interface().(*Preinstall) *x.list = append(*x.list, concreteValue) } -func (x *_MsgEthereumTxResponse_2_list) AppendMutable() protoreflect.Value { - v := new(Log) +func (x *_MsgRegisterPreinstalls_2_list) AppendMutable() protoreflect.Value { + v := new(Preinstall) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_MsgEthereumTxResponse_2_list) Truncate(n int) { +func (x *_MsgRegisterPreinstalls_2_list) Truncate(n int) { for i := n; i < len(*x.list); i++ { (*x.list)[i] = nil } *x.list = (*x.list)[:n] } -func (x *_MsgEthereumTxResponse_2_list) NewElement() protoreflect.Value { - v := new(Log) +func (x *_MsgRegisterPreinstalls_2_list) NewElement() protoreflect.Value { + v := new(Preinstall) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_MsgEthereumTxResponse_2_list) IsValid() bool { +func (x *_MsgRegisterPreinstalls_2_list) IsValid() bool { return x.list != nil } var ( - md_MsgEthereumTxResponse protoreflect.MessageDescriptor - fd_MsgEthereumTxResponse_hash protoreflect.FieldDescriptor - fd_MsgEthereumTxResponse_logs protoreflect.FieldDescriptor - fd_MsgEthereumTxResponse_ret protoreflect.FieldDescriptor - fd_MsgEthereumTxResponse_vm_error protoreflect.FieldDescriptor - fd_MsgEthereumTxResponse_gas_used protoreflect.FieldDescriptor + md_MsgRegisterPreinstalls protoreflect.MessageDescriptor + fd_MsgRegisterPreinstalls_authority protoreflect.FieldDescriptor + fd_MsgRegisterPreinstalls_preinstalls protoreflect.FieldDescriptor ) func init() { file_cosmos_evm_vm_v1_tx_proto_init() - md_MsgEthereumTxResponse = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("MsgEthereumTxResponse") - fd_MsgEthereumTxResponse_hash = md_MsgEthereumTxResponse.Fields().ByName("hash") - fd_MsgEthereumTxResponse_logs = md_MsgEthereumTxResponse.Fields().ByName("logs") - fd_MsgEthereumTxResponse_ret = md_MsgEthereumTxResponse.Fields().ByName("ret") - fd_MsgEthereumTxResponse_vm_error = md_MsgEthereumTxResponse.Fields().ByName("vm_error") - fd_MsgEthereumTxResponse_gas_used = md_MsgEthereumTxResponse.Fields().ByName("gas_used") + md_MsgRegisterPreinstalls = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("MsgRegisterPreinstalls") + fd_MsgRegisterPreinstalls_authority = md_MsgRegisterPreinstalls.Fields().ByName("authority") + fd_MsgRegisterPreinstalls_preinstalls = md_MsgRegisterPreinstalls.Fields().ByName("preinstalls") } -var _ protoreflect.Message = (*fastReflection_MsgEthereumTxResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgRegisterPreinstalls)(nil) -type fastReflection_MsgEthereumTxResponse MsgEthereumTxResponse +type fastReflection_MsgRegisterPreinstalls MsgRegisterPreinstalls -func (x *MsgEthereumTxResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgEthereumTxResponse)(x) +func (x *MsgRegisterPreinstalls) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRegisterPreinstalls)(x) } -func (x *MsgEthereumTxResponse) slowProtoReflect() protoreflect.Message { +func (x *MsgRegisterPreinstalls) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4328,43 +2536,43 @@ func (x *MsgEthereumTxResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgEthereumTxResponse_messageType fastReflection_MsgEthereumTxResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgEthereumTxResponse_messageType{} +var _fastReflection_MsgRegisterPreinstalls_messageType fastReflection_MsgRegisterPreinstalls_messageType +var _ protoreflect.MessageType = fastReflection_MsgRegisterPreinstalls_messageType{} -type fastReflection_MsgEthereumTxResponse_messageType struct{} +type fastReflection_MsgRegisterPreinstalls_messageType struct{} -func (x fastReflection_MsgEthereumTxResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgEthereumTxResponse)(nil) +func (x fastReflection_MsgRegisterPreinstalls_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRegisterPreinstalls)(nil) } -func (x fastReflection_MsgEthereumTxResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgEthereumTxResponse) +func (x fastReflection_MsgRegisterPreinstalls_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRegisterPreinstalls) } -func (x fastReflection_MsgEthereumTxResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgEthereumTxResponse +func (x fastReflection_MsgRegisterPreinstalls_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterPreinstalls } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgEthereumTxResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgEthereumTxResponse +func (x *fastReflection_MsgRegisterPreinstalls) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterPreinstalls } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgEthereumTxResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgEthereumTxResponse_messageType +func (x *fastReflection_MsgRegisterPreinstalls) Type() protoreflect.MessageType { + return _fastReflection_MsgRegisterPreinstalls_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgEthereumTxResponse) New() protoreflect.Message { - return new(fastReflection_MsgEthereumTxResponse) +func (x *fastReflection_MsgRegisterPreinstalls) New() protoreflect.Message { + return new(fastReflection_MsgRegisterPreinstalls) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgEthereumTxResponse) Interface() protoreflect.ProtoMessage { - return (*MsgEthereumTxResponse)(x) +func (x *fastReflection_MsgRegisterPreinstalls) Interface() protoreflect.ProtoMessage { + return (*MsgRegisterPreinstalls)(x) } // Range iterates over every populated field in an undefined order, @@ -4372,34 +2580,16 @@ func (x *fastReflection_MsgEthereumTxResponse) Interface() protoreflect.ProtoMes // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgEthereumTxResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Hash != "" { - value := protoreflect.ValueOfString(x.Hash) - if !f(fd_MsgEthereumTxResponse_hash, value) { +func (x *fastReflection_MsgRegisterPreinstalls) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgRegisterPreinstalls_authority, value) { return } } - if len(x.Logs) != 0 { - value := protoreflect.ValueOfList(&_MsgEthereumTxResponse_2_list{list: &x.Logs}) - if !f(fd_MsgEthereumTxResponse_logs, value) { - return - } - } - if len(x.Ret) != 0 { - value := protoreflect.ValueOfBytes(x.Ret) - if !f(fd_MsgEthereumTxResponse_ret, value) { - return - } - } - if x.VmError != "" { - value := protoreflect.ValueOfString(x.VmError) - if !f(fd_MsgEthereumTxResponse_vm_error, value) { - return - } - } - if x.GasUsed != uint64(0) { - value := protoreflect.ValueOfUint64(x.GasUsed) - if !f(fd_MsgEthereumTxResponse_gas_used, value) { + if len(x.Preinstalls) != 0 { + value := protoreflect.ValueOfList(&_MsgRegisterPreinstalls_2_list{list: &x.Preinstalls}) + if !f(fd_MsgRegisterPreinstalls_preinstalls, value) { return } } @@ -4416,23 +2606,17 @@ func (x *fastReflection_MsgEthereumTxResponse) Range(f func(protoreflect.FieldDe // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgEthereumTxResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgRegisterPreinstalls) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.hash": - return x.Hash != "" - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.logs": - return len(x.Logs) != 0 - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.ret": - return len(x.Ret) != 0 - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.vm_error": - return x.VmError != "" - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.gas_used": - return x.GasUsed != uint64(0) + case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.authority": + return x.Authority != "" + case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls": + return len(x.Preinstalls) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTxResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstalls")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstalls does not contain field %s", fd.FullName())) } } @@ -4442,23 +2626,17 @@ func (x *fastReflection_MsgEthereumTxResponse) Has(fd protoreflect.FieldDescript // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgEthereumTxResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgRegisterPreinstalls) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.hash": - x.Hash = "" - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.logs": - x.Logs = nil - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.ret": - x.Ret = nil - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.vm_error": - x.VmError = "" - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.gas_used": - x.GasUsed = uint64(0) + case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.authority": + x.Authority = "" + case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls": + x.Preinstalls = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTxResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstalls")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstalls does not contain field %s", fd.FullName())) } } @@ -4468,31 +2646,22 @@ func (x *fastReflection_MsgEthereumTxResponse) Clear(fd protoreflect.FieldDescri // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgEthereumTxResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRegisterPreinstalls) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.hash": - value := x.Hash + case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.authority": + value := x.Authority return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.logs": - if len(x.Logs) == 0 { - return protoreflect.ValueOfList(&_MsgEthereumTxResponse_2_list{}) + case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls": + if len(x.Preinstalls) == 0 { + return protoreflect.ValueOfList(&_MsgRegisterPreinstalls_2_list{}) } - listValue := &_MsgEthereumTxResponse_2_list{list: &x.Logs} + listValue := &_MsgRegisterPreinstalls_2_list{list: &x.Preinstalls} return protoreflect.ValueOfList(listValue) - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.ret": - value := x.Ret - return protoreflect.ValueOfBytes(value) - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.vm_error": - value := x.VmError - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.gas_used": - value := x.GasUsed - return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTxResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstalls")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgEthereumTxResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstalls does not contain field %s", descriptor.FullName())) } } @@ -4506,25 +2675,19 @@ func (x *fastReflection_MsgEthereumTxResponse) Get(descriptor protoreflect.Field // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgEthereumTxResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgRegisterPreinstalls) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.hash": - x.Hash = value.Interface().(string) - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.logs": + case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.authority": + x.Authority = value.Interface().(string) + case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls": lv := value.List() - clv := lv.(*_MsgEthereumTxResponse_2_list) - x.Logs = *clv.list - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.ret": - x.Ret = value.Bytes() - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.vm_error": - x.VmError = value.Interface().(string) - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.gas_used": - x.GasUsed = value.Uint() + clv := lv.(*_MsgRegisterPreinstalls_2_list) + x.Preinstalls = *clv.list default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTxResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstalls")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstalls does not contain field %s", fd.FullName())) } } @@ -4538,61 +2701,49 @@ func (x *fastReflection_MsgEthereumTxResponse) Set(fd protoreflect.FieldDescript // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgEthereumTxResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRegisterPreinstalls) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.logs": - if x.Logs == nil { - x.Logs = []*Log{} + case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls": + if x.Preinstalls == nil { + x.Preinstalls = []*Preinstall{} } - value := &_MsgEthereumTxResponse_2_list{list: &x.Logs} + value := &_MsgRegisterPreinstalls_2_list{list: &x.Preinstalls} return protoreflect.ValueOfList(value) - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.hash": - panic(fmt.Errorf("field hash of message cosmos.evm.vm.v1.MsgEthereumTxResponse is not mutable")) - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.ret": - panic(fmt.Errorf("field ret of message cosmos.evm.vm.v1.MsgEthereumTxResponse is not mutable")) - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.vm_error": - panic(fmt.Errorf("field vm_error of message cosmos.evm.vm.v1.MsgEthereumTxResponse is not mutable")) - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.gas_used": - panic(fmt.Errorf("field gas_used of message cosmos.evm.vm.v1.MsgEthereumTxResponse is not mutable")) + case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.authority": + panic(fmt.Errorf("field authority of message cosmos.evm.vm.v1.MsgRegisterPreinstalls is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTxResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstalls")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstalls does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgEthereumTxResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRegisterPreinstalls) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.hash": - return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.logs": - list := []*Log{} - return protoreflect.ValueOfList(&_MsgEthereumTxResponse_2_list{list: &list}) - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.ret": - return protoreflect.ValueOfBytes(nil) - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.vm_error": + case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.authority": return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.MsgEthereumTxResponse.gas_used": - return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls": + list := []*Preinstall{} + return protoreflect.ValueOfList(&_MsgRegisterPreinstalls_2_list{list: &list}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgEthereumTxResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstalls")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgEthereumTxResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstalls does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgEthereumTxResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgRegisterPreinstalls) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.MsgEthereumTxResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.MsgRegisterPreinstalls", d.FullName())) } panic("unreachable") } @@ -4600,7 +2751,7 @@ func (x *fastReflection_MsgEthereumTxResponse) WhichOneof(d protoreflect.OneofDe // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgEthereumTxResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgRegisterPreinstalls) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -4611,7 +2762,7 @@ func (x *fastReflection_MsgEthereumTxResponse) GetUnknown() protoreflect.RawFiel // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgEthereumTxResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgRegisterPreinstalls) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -4623,7 +2774,7 @@ func (x *fastReflection_MsgEthereumTxResponse) SetUnknown(fields protoreflect.Ra // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgEthereumTxResponse) IsValid() bool { +func (x *fastReflection_MsgRegisterPreinstalls) IsValid() bool { return x != nil } @@ -4633,9 +2784,9 @@ func (x *fastReflection_MsgEthereumTxResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgEthereumTxResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgRegisterPreinstalls) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgEthereumTxResponse) + x := input.Message.Interface().(*MsgRegisterPreinstalls) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4647,27 +2798,16 @@ func (x *fastReflection_MsgEthereumTxResponse) ProtoMethods() *protoiface.Method var n int var l int _ = l - l = len(x.Hash) + l = len(x.Authority) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.Logs) > 0 { - for _, e := range x.Logs { + if len(x.Preinstalls) > 0 { + for _, e := range x.Preinstalls { l = options.Size(e) n += 1 + l + runtime.Sov(uint64(l)) } } - l = len(x.Ret) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.VmError) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.GasUsed != 0 { - n += 1 + runtime.Sov(uint64(x.GasUsed)) - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -4678,7 +2818,7 @@ func (x *fastReflection_MsgEthereumTxResponse) ProtoMethods() *protoiface.Method } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgEthereumTxResponse) + x := input.Message.Interface().(*MsgRegisterPreinstalls) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4697,28 +2837,9 @@ func (x *fastReflection_MsgEthereumTxResponse) ProtoMethods() *protoiface.Method i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.GasUsed != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.GasUsed)) - i-- - dAtA[i] = 0x28 - } - if len(x.VmError) > 0 { - i -= len(x.VmError) - copy(dAtA[i:], x.VmError) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VmError))) - i-- - dAtA[i] = 0x22 - } - if len(x.Ret) > 0 { - i -= len(x.Ret) - copy(dAtA[i:], x.Ret) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Ret))) - i-- - dAtA[i] = 0x1a - } - if len(x.Logs) > 0 { - for iNdEx := len(x.Logs) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Logs[iNdEx]) + if len(x.Preinstalls) > 0 { + for iNdEx := len(x.Preinstalls) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Preinstalls[iNdEx]) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4732,10 +2853,10 @@ func (x *fastReflection_MsgEthereumTxResponse) ProtoMethods() *protoiface.Method dAtA[i] = 0x12 } } - if len(x.Hash) > 0 { - i -= len(x.Hash) - copy(dAtA[i:], x.Hash) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Hash))) + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) i-- dAtA[i] = 0xa } @@ -4750,7 +2871,7 @@ func (x *fastReflection_MsgEthereumTxResponse) ProtoMethods() *protoiface.Method }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgEthereumTxResponse) + x := input.Message.Interface().(*MsgRegisterPreinstalls) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4782,15 +2903,15 @@ func (x *fastReflection_MsgEthereumTxResponse) ProtoMethods() *protoiface.Method fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEthereumTxResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterPreinstalls: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgEthereumTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterPreinstalls: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4818,11 +2939,11 @@ func (x *fastReflection_MsgEthereumTxResponse) ProtoMethods() *protoiface.Method if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Hash = string(dAtA[iNdEx:postIndex]) + x.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Preinstalls", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4849,103 +2970,18 @@ func (x *fastReflection_MsgEthereumTxResponse) ProtoMethods() *protoiface.Method if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Logs = append(x.Logs, &Log{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Logs[len(x.Logs)-1]); err != nil { + x.Preinstalls = append(x.Preinstalls, &Preinstall{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Preinstalls[len(x.Preinstalls)-1]); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Ret", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Ret = append(x.Ret[:0], dAtA[iNdEx:postIndex]...) - if x.Ret == nil { - x.Ret = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VmError", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.VmError = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) - } - x.GasUsed = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.GasUsed |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if (iNdEx + skippy) > l { @@ -4975,27 +3011,23 @@ func (x *fastReflection_MsgEthereumTxResponse) ProtoMethods() *protoiface.Method } var ( - md_MsgUpdateParams protoreflect.MessageDescriptor - fd_MsgUpdateParams_authority protoreflect.FieldDescriptor - fd_MsgUpdateParams_params protoreflect.FieldDescriptor + md_MsgRegisterPreinstallsResponse protoreflect.MessageDescriptor ) func init() { file_cosmos_evm_vm_v1_tx_proto_init() - md_MsgUpdateParams = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("MsgUpdateParams") - fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") - fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") + md_MsgRegisterPreinstallsResponse = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("MsgRegisterPreinstallsResponse") } -var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) +var _ protoreflect.Message = (*fastReflection_MsgRegisterPreinstallsResponse)(nil) -type fastReflection_MsgUpdateParams MsgUpdateParams +type fastReflection_MsgRegisterPreinstallsResponse MsgRegisterPreinstallsResponse -func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateParams)(x) +func (x *MsgRegisterPreinstallsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRegisterPreinstallsResponse)(x) } -func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { +func (x *MsgRegisterPreinstallsResponse) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5007,43 +3039,43 @@ func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} +var _fastReflection_MsgRegisterPreinstallsResponse_messageType fastReflection_MsgRegisterPreinstallsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgRegisterPreinstallsResponse_messageType{} -type fastReflection_MsgUpdateParams_messageType struct{} +type fastReflection_MsgRegisterPreinstallsResponse_messageType struct{} -func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateParams)(nil) +func (x fastReflection_MsgRegisterPreinstallsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRegisterPreinstallsResponse)(nil) } -func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateParams) +func (x fastReflection_MsgRegisterPreinstallsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRegisterPreinstallsResponse) } -func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateParams +func (x fastReflection_MsgRegisterPreinstallsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterPreinstallsResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateParams +func (x *fastReflection_MsgRegisterPreinstallsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterPreinstallsResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgUpdateParams) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateParams_messageType +func (x *fastReflection_MsgRegisterPreinstallsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgRegisterPreinstallsResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { - return new(fastReflection_MsgUpdateParams) +func (x *fastReflection_MsgRegisterPreinstallsResponse) New() protoreflect.Message { + return new(fastReflection_MsgRegisterPreinstallsResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateParams)(x) +func (x *fastReflection_MsgRegisterPreinstallsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgRegisterPreinstallsResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -5051,19 +3083,7 @@ func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_MsgUpdateParams_authority, value) { - return - } - } - if x.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_MsgUpdateParams_params, value) { - return - } - } +func (x *fastReflection_MsgRegisterPreinstallsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -5077,17 +3097,13 @@ func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescript // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgRegisterPreinstallsResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgUpdateParams.authority": - return x.Authority != "" - case "cosmos.evm.vm.v1.MsgUpdateParams.params": - return x.Params != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse does not contain field %s", fd.FullName())) } } @@ -5097,17 +3113,13 @@ func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgRegisterPreinstallsResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgUpdateParams.authority": - x.Authority = "" - case "cosmos.evm.vm.v1.MsgUpdateParams.params": - x.Params = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse does not contain field %s", fd.FullName())) } } @@ -5117,19 +3129,13 @@ func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRegisterPreinstallsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.evm.vm.v1.MsgUpdateParams.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.MsgUpdateParams.params": - value := x.Params - return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse does not contain field %s", descriptor.FullName())) } } @@ -5143,17 +3149,13 @@ func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescri // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgRegisterPreinstallsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgUpdateParams.authority": - x.Authority = value.Interface().(string) - case "cosmos.evm.vm.v1.MsgUpdateParams.params": - x.Params = value.Message().Interface().(*Params) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse does not contain field %s", fd.FullName())) } } @@ -5167,48 +3169,36 @@ func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, va // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRegisterPreinstallsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgUpdateParams.params": - if x.Params == nil { - x.Params = new(Params) - } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "cosmos.evm.vm.v1.MsgUpdateParams.authority": - panic(fmt.Errorf("field authority of message cosmos.evm.vm.v1.MsgUpdateParams is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRegisterPreinstallsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgUpdateParams.authority": - return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.MsgUpdateParams.params": - m := new(Params) - return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse")) } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgRegisterPreinstallsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.MsgUpdateParams", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse", d.FullName())) } panic("unreachable") } @@ -5216,7 +3206,7 @@ func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescript // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgRegisterPreinstallsResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -5227,7 +3217,7 @@ func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgRegisterPreinstallsResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -5239,7 +3229,7 @@ func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawField // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgUpdateParams) IsValid() bool { +func (x *fastReflection_MsgRegisterPreinstallsResponse) IsValid() bool { return x != nil } @@ -5249,9 +3239,9 @@ func (x *fastReflection_MsgUpdateParams) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgRegisterPreinstallsResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateParams) + x := input.Message.Interface().(*MsgRegisterPreinstallsResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5263,14 +3253,6 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Authority) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Params != nil { - l = options.Size(x.Params) - n += 1 + l + runtime.Sov(uint64(l)) - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -5280,1928 +3262,167 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { } } - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateParams) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Params != nil { - encoded, err := options.Marshal(x.Params) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if len(x.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateParams) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Params == nil { - x.Params = &Params{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgUpdateParamsResponse protoreflect.MessageDescriptor -) - -func init() { - file_cosmos_evm_vm_v1_tx_proto_init() - md_MsgUpdateParamsResponse = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) - -type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse - -func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateParamsResponse)(x) -} - -func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} - -type fastReflection_MsgUpdateParamsResponse_messageType struct{} - -func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateParamsResponse)(nil) -} -func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateParamsResponse) -} -func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateParamsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateParamsResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgUpdateParamsResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateParamsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { - return new(fastReflection_MsgUpdateParamsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateParamsResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.MsgUpdateParamsResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgUpdateParamsResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateParamsResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_MsgUpdateParamsResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateParamsResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateParamsResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateParamsResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.List = (*_MsgRegisterPreinstalls_2_list)(nil) - -type _MsgRegisterPreinstalls_2_list struct { - list *[]*Preinstall -} - -func (x *_MsgRegisterPreinstalls_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgRegisterPreinstalls_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_MsgRegisterPreinstalls_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Preinstall) - (*x.list)[i] = concreteValue -} - -func (x *_MsgRegisterPreinstalls_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Preinstall) - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgRegisterPreinstalls_2_list) AppendMutable() protoreflect.Value { - v := new(Preinstall) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgRegisterPreinstalls_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_MsgRegisterPreinstalls_2_list) NewElement() protoreflect.Value { - v := new(Preinstall) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgRegisterPreinstalls_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_MsgRegisterPreinstalls protoreflect.MessageDescriptor - fd_MsgRegisterPreinstalls_authority protoreflect.FieldDescriptor - fd_MsgRegisterPreinstalls_preinstalls protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_evm_vm_v1_tx_proto_init() - md_MsgRegisterPreinstalls = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("MsgRegisterPreinstalls") - fd_MsgRegisterPreinstalls_authority = md_MsgRegisterPreinstalls.Fields().ByName("authority") - fd_MsgRegisterPreinstalls_preinstalls = md_MsgRegisterPreinstalls.Fields().ByName("preinstalls") -} - -var _ protoreflect.Message = (*fastReflection_MsgRegisterPreinstalls)(nil) - -type fastReflection_MsgRegisterPreinstalls MsgRegisterPreinstalls - -func (x *MsgRegisterPreinstalls) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgRegisterPreinstalls)(x) -} - -func (x *MsgRegisterPreinstalls) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgRegisterPreinstalls_messageType fastReflection_MsgRegisterPreinstalls_messageType -var _ protoreflect.MessageType = fastReflection_MsgRegisterPreinstalls_messageType{} - -type fastReflection_MsgRegisterPreinstalls_messageType struct{} - -func (x fastReflection_MsgRegisterPreinstalls_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgRegisterPreinstalls)(nil) -} -func (x fastReflection_MsgRegisterPreinstalls_messageType) New() protoreflect.Message { - return new(fastReflection_MsgRegisterPreinstalls) -} -func (x fastReflection_MsgRegisterPreinstalls_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRegisterPreinstalls -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgRegisterPreinstalls) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRegisterPreinstalls -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgRegisterPreinstalls) Type() protoreflect.MessageType { - return _fastReflection_MsgRegisterPreinstalls_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgRegisterPreinstalls) New() protoreflect.Message { - return new(fastReflection_MsgRegisterPreinstalls) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgRegisterPreinstalls) Interface() protoreflect.ProtoMessage { - return (*MsgRegisterPreinstalls)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgRegisterPreinstalls) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_MsgRegisterPreinstalls_authority, value) { - return - } - } - if len(x.Preinstalls) != 0 { - value := protoreflect.ValueOfList(&_MsgRegisterPreinstalls_2_list{list: &x.Preinstalls}) - if !f(fd_MsgRegisterPreinstalls_preinstalls, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgRegisterPreinstalls) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.authority": - return x.Authority != "" - case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls": - return len(x.Preinstalls) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstalls")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstalls does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRegisterPreinstalls) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.authority": - x.Authority = "" - case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls": - x.Preinstalls = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstalls")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstalls does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgRegisterPreinstalls) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls": - if len(x.Preinstalls) == 0 { - return protoreflect.ValueOfList(&_MsgRegisterPreinstalls_2_list{}) - } - listValue := &_MsgRegisterPreinstalls_2_list{list: &x.Preinstalls} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstalls")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstalls does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRegisterPreinstalls) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.authority": - x.Authority = value.Interface().(string) - case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls": - lv := value.List() - clv := lv.(*_MsgRegisterPreinstalls_2_list) - x.Preinstalls = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstalls")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstalls does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRegisterPreinstalls) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls": - if x.Preinstalls == nil { - x.Preinstalls = []*Preinstall{} - } - value := &_MsgRegisterPreinstalls_2_list{list: &x.Preinstalls} - return protoreflect.ValueOfList(value) - case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.authority": - panic(fmt.Errorf("field authority of message cosmos.evm.vm.v1.MsgRegisterPreinstalls is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstalls")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstalls does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgRegisterPreinstalls) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.authority": - return protoreflect.ValueOfString("") - case "cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls": - list := []*Preinstall{} - return protoreflect.ValueOfList(&_MsgRegisterPreinstalls_2_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstalls")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstalls does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgRegisterPreinstalls) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.MsgRegisterPreinstalls", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgRegisterPreinstalls) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRegisterPreinstalls) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_MsgRegisterPreinstalls) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgRegisterPreinstalls) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgRegisterPreinstalls) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Authority) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Preinstalls) > 0 { - for _, e := range x.Preinstalls { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgRegisterPreinstalls) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Preinstalls) > 0 { - for iNdEx := len(x.Preinstalls) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Preinstalls[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - } - if len(x.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgRegisterPreinstalls) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterPreinstalls: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterPreinstalls: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Preinstalls", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Preinstalls = append(x.Preinstalls, &Preinstall{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Preinstalls[len(x.Preinstalls)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgRegisterPreinstallsResponse protoreflect.MessageDescriptor -) - -func init() { - file_cosmos_evm_vm_v1_tx_proto_init() - md_MsgRegisterPreinstallsResponse = File_cosmos_evm_vm_v1_tx_proto.Messages().ByName("MsgRegisterPreinstallsResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgRegisterPreinstallsResponse)(nil) - -type fastReflection_MsgRegisterPreinstallsResponse MsgRegisterPreinstallsResponse - -func (x *MsgRegisterPreinstallsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgRegisterPreinstallsResponse)(x) -} - -func (x *MsgRegisterPreinstallsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgRegisterPreinstallsResponse_messageType fastReflection_MsgRegisterPreinstallsResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgRegisterPreinstallsResponse_messageType{} - -type fastReflection_MsgRegisterPreinstallsResponse_messageType struct{} - -func (x fastReflection_MsgRegisterPreinstallsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgRegisterPreinstallsResponse)(nil) -} -func (x fastReflection_MsgRegisterPreinstallsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgRegisterPreinstallsResponse) -} -func (x fastReflection_MsgRegisterPreinstallsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRegisterPreinstallsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgRegisterPreinstallsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRegisterPreinstallsResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgRegisterPreinstallsResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgRegisterPreinstallsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgRegisterPreinstallsResponse) New() protoreflect.Message { - return new(fastReflection_MsgRegisterPreinstallsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgRegisterPreinstallsResponse) Interface() protoreflect.ProtoMessage { - return (*MsgRegisterPreinstallsResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgRegisterPreinstallsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgRegisterPreinstallsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRegisterPreinstallsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgRegisterPreinstallsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRegisterPreinstallsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRegisterPreinstallsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgRegisterPreinstallsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse")) - } - panic(fmt.Errorf("message cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgRegisterPreinstallsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgRegisterPreinstallsResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgRegisterPreinstallsResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_MsgRegisterPreinstallsResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgRegisterPreinstallsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgRegisterPreinstallsResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgRegisterPreinstallsResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgRegisterPreinstallsResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterPreinstallsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterPreinstallsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: cosmos/evm/vm/v1/tx.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// MsgEthereumTx encapsulates an Ethereum transaction as an SDK message. -type MsgEthereumTx struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // data is inner transaction data of the Ethereum transaction - Data *anypb.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:"size,omitempty"` - // hash of the transaction in hex format - Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` - // Deprecated: Do not use. - DeprecatedFrom string `protobuf:"bytes,4,opt,name=deprecated_from,json=deprecatedFrom,proto3" json:"deprecated_from,omitempty"` - // 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"` -} - -func (x *MsgEthereumTx) Reset() { - *x = MsgEthereumTx{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgEthereumTx) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgEthereumTx) ProtoMessage() {} - -// Deprecated: Use MsgEthereumTx.ProtoReflect.Descriptor instead. -func (*MsgEthereumTx) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{0} -} - -func (x *MsgEthereumTx) GetData() *anypb.Any { - if x != nil { - return x.Data - } - return nil -} - -func (x *MsgEthereumTx) GetSize() float64 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *MsgEthereumTx) GetHash() string { - if x != nil { - return x.Hash - } - return "" -} - -// Deprecated: Do not use. -func (x *MsgEthereumTx) GetDeprecatedFrom() string { - if x != nil { - return x.DeprecatedFrom - } - return "" -} - -func (x *MsgEthereumTx) GetFrom() []byte { - if x != nil { - return x.From - } - return nil -} - -// 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 { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 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 string `protobuf:"bytes,2,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` - // gas defines the gas limit defined for the transaction. - Gas 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. - Value string `protobuf:"bytes,5,opt,name=value,proto3" 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 (x *LegacyTx) Reset() { - *x = LegacyTx{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LegacyTx) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LegacyTx) ProtoMessage() {} - -// Deprecated: Use LegacyTx.ProtoReflect.Descriptor instead. -func (*LegacyTx) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{1} -} - -func (x *LegacyTx) GetNonce() uint64 { - if x != nil { - return x.Nonce - } - return 0 -} - -func (x *LegacyTx) GetGasPrice() string { - if x != nil { - return x.GasPrice - } - return "" -} - -func (x *LegacyTx) GetGas() uint64 { - if x != nil { - return x.Gas - } - return 0 -} - -func (x *LegacyTx) GetTo() string { - if x != nil { - return x.To - } - return "" -} - -func (x *LegacyTx) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *LegacyTx) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *LegacyTx) GetV() []byte { - if x != nil { - return x.V - } - return nil -} - -func (x *LegacyTx) GetR() []byte { - if x != nil { - return x.R - } - return nil -} - -func (x *LegacyTx) GetS() []byte { - if x != nil { - return x.S - } - return nil -} - -// AccessListTx is the data of EIP-2930 access list transactions. -type AccessListTx struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // chain_id of the destination EVM chain - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - // 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 string `protobuf:"bytes,3,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` - // gas defines the gas limit defined for the transaction. - Gas 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. - Value string `protobuf:"bytes,6,opt,name=value,proto3" 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 []*AccessTuple `protobuf:"bytes,8,rep,name=accesses,proto3" json:"accesses,omitempty"` - // 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 (x *AccessListTx) Reset() { - *x = AccessListTx{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AccessListTx) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccessListTx) ProtoMessage() {} - -// Deprecated: Use AccessListTx.ProtoReflect.Descriptor instead. -func (*AccessListTx) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{2} -} - -func (x *AccessListTx) GetChainId() string { - if x != nil { - return x.ChainId - } - return "" -} - -func (x *AccessListTx) GetNonce() uint64 { - if x != nil { - return x.Nonce - } - return 0 -} - -func (x *AccessListTx) GetGasPrice() string { - if x != nil { - return x.GasPrice - } - return "" -} - -func (x *AccessListTx) GetGas() uint64 { - if x != nil { - return x.Gas - } - return 0 -} - -func (x *AccessListTx) GetTo() string { - if x != nil { - return x.To - } - return "" -} - -func (x *AccessListTx) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *AccessListTx) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *AccessListTx) GetAccesses() []*AccessTuple { - if x != nil { - return x.Accesses + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgRegisterPreinstallsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil } - return nil -} + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgRegisterPreinstallsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterPreinstallsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterPreinstallsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } -func (x *AccessListTx) GetV() []byte { - if x != nil { - return x.V + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil } - return nil -} - -func (x *AccessListTx) GetR() []byte { - if x != nil { - return x.R + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, } - return nil } -func (x *AccessListTx) GetS() []byte { - if x != nil { - return x.S - } - return nil -} +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/evm/vm/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// DynamicFeeTx is the data of EIP-1559 dynamic fee transactions. -type DynamicFeeTx struct { +// MsgEthereumTx encapsulates an Ethereum transaction as an SDK message. +type MsgEthereumTx struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // chain_id of the destination EVM chain - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - // 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 string `protobuf:"bytes,3,opt,name=gas_tip_cap,json=gasTipCap,proto3" json:"gas_tip_cap,omitempty"` - // gas_fee_cap defines the max value for the gas fee - GasFeeCap string `protobuf:"bytes,4,opt,name=gas_fee_cap,json=gasFeeCap,proto3" json:"gas_fee_cap,omitempty"` - // gas defines the gas limit defined for the transaction. - Gas 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 transaction amount. - Value string `protobuf:"bytes,7,opt,name=value,proto3" 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 []*AccessTuple `protobuf:"bytes,9,rep,name=accesses,proto3" json:"accesses,omitempty"` - // 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 (x *DynamicFeeTx) Reset() { - *x = DynamicFeeTx{} + // 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 ethereum transaction + Raw []byte `protobuf:"bytes,6,opt,name=raw,proto3" json:"raw,omitempty"` +} + +func (x *MsgEthereumTx) Reset() { + *x = MsgEthereumTx{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[3] + mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *DynamicFeeTx) String() string { +func (x *MsgEthereumTx) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DynamicFeeTx) ProtoMessage() {} - -// Deprecated: Use DynamicFeeTx.ProtoReflect.Descriptor instead. -func (*DynamicFeeTx) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{3} -} - -func (x *DynamicFeeTx) GetChainId() string { - if x != nil { - return x.ChainId - } - return "" -} - -func (x *DynamicFeeTx) GetNonce() uint64 { - if x != nil { - return x.Nonce - } - return 0 -} - -func (x *DynamicFeeTx) GetGasTipCap() string { - if x != nil { - return x.GasTipCap - } - return "" -} - -func (x *DynamicFeeTx) GetGasFeeCap() string { - if x != nil { - return x.GasFeeCap - } - return "" -} - -func (x *DynamicFeeTx) GetGas() uint64 { - if x != nil { - return x.Gas - } - return 0 -} - -func (x *DynamicFeeTx) GetTo() string { - if x != nil { - return x.To - } - return "" -} - -func (x *DynamicFeeTx) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *DynamicFeeTx) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *DynamicFeeTx) GetAccesses() []*AccessTuple { - if x != nil { - return x.Accesses - } - return nil -} +func (*MsgEthereumTx) ProtoMessage() {} -func (x *DynamicFeeTx) GetV() []byte { - if x != nil { - return x.V - } - return nil +// Deprecated: Use MsgEthereumTx.ProtoReflect.Descriptor instead. +func (*MsgEthereumTx) Descriptor() ([]byte, []int) { + return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{0} } -func (x *DynamicFeeTx) GetR() []byte { +func (x *MsgEthereumTx) GetFrom() []byte { if x != nil { - return x.R + return x.From } return nil } -func (x *DynamicFeeTx) GetS() []byte { +func (x *MsgEthereumTx) GetRaw() []byte { if x != nil { - return x.S + return x.Raw } return nil } @@ -7216,7 +3437,7 @@ type ExtensionOptionsEthereumTx struct { func (x *ExtensionOptionsEthereumTx) Reset() { *x = ExtensionOptionsEthereumTx{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[4] + mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7230,7 +3451,7 @@ func (*ExtensionOptionsEthereumTx) ProtoMessage() {} // Deprecated: Use ExtensionOptionsEthereumTx.ProtoReflect.Descriptor instead. func (*ExtensionOptionsEthereumTx) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{4} + return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{1} } // MsgEthereumTxResponse defines the Msg/EthereumTx response type. @@ -7258,7 +3479,7 @@ type MsgEthereumTxResponse struct { func (x *MsgEthereumTxResponse) Reset() { *x = MsgEthereumTxResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[5] + mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7272,7 +3493,7 @@ func (*MsgEthereumTxResponse) ProtoMessage() {} // Deprecated: Use MsgEthereumTxResponse.ProtoReflect.Descriptor instead. func (*MsgEthereumTxResponse) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{5} + return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{2} } func (x *MsgEthereumTxResponse) GetHash() string { @@ -7326,7 +3547,7 @@ type MsgUpdateParams struct { func (x *MsgUpdateParams) Reset() { *x = MsgUpdateParams{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[6] + mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7340,7 +3561,7 @@ func (*MsgUpdateParams) ProtoMessage() {} // Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{6} + return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{3} } func (x *MsgUpdateParams) GetAuthority() string { @@ -7368,7 +3589,7 @@ type MsgUpdateParamsResponse struct { func (x *MsgUpdateParamsResponse) Reset() { *x = MsgUpdateParamsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[7] + mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7382,7 +3603,7 @@ func (*MsgUpdateParamsResponse) ProtoMessage() {} // Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{7} + return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{4} } // MsgRegisterPreinstalls defines a Msg for creating preinstalls in evm state. @@ -7400,7 +3621,7 @@ type MsgRegisterPreinstalls struct { func (x *MsgRegisterPreinstalls) Reset() { *x = MsgRegisterPreinstalls{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[8] + mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7414,7 +3635,7 @@ func (*MsgRegisterPreinstalls) ProtoMessage() {} // Deprecated: Use MsgRegisterPreinstalls.ProtoReflect.Descriptor instead. func (*MsgRegisterPreinstalls) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{8} + return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{5} } func (x *MsgRegisterPreinstalls) GetAuthority() string { @@ -7442,7 +3663,7 @@ type MsgRegisterPreinstallsResponse struct { func (x *MsgRegisterPreinstallsResponse) Reset() { *x = MsgRegisterPreinstallsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[9] + mi := &file_cosmos_evm_vm_v1_tx_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7456,7 +3677,7 @@ func (*MsgRegisterPreinstallsResponse) ProtoMessage() {} // Deprecated: Use MsgRegisterPreinstallsResponse.ProtoReflect.Descriptor instead. func (*MsgRegisterPreinstallsResponse) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{9} + return file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP(), []int{6} } var File_cosmos_evm_vm_v1_tx_proto protoreflect.FileDescriptor @@ -7474,181 +3695,90 @@ var file_cosmos_evm_vm_v1_tx_proto_rawDesc = []byte{ 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xe3, 0x01, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, - 0x78, 0x12, 0x28, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x04, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x01, 0x2d, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xf2, 0xde, 0x1f, 0x07, 0x72, - 0x6c, 0x70, 0x3a, 0x22, 0x2d, 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x68, 0x61, 0x73, - 0x68, 0x12, 0x2b, 0x0a, 0x0f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0e, - 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x12, - 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66, 0x72, - 0x6f, 0x6d, 0x3a, 0x21, 0x88, 0xa0, 0x1f, 0x00, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x4d, 0x73, 0x67, 0x45, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x54, 0x78, 0x22, 0xa9, 0x02, 0x0a, 0x08, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, - 0x54, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xda, 0xde, 0x1f, - 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x08, 0x67, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, - 0x12, 0x1e, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0c, 0xe2, - 0xde, 0x1f, 0x08, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x03, 0x67, 0x61, 0x73, - 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, - 0x12, 0x39, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x23, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xe2, 0xde, 0x1f, 0x06, 0x41, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x0c, 0x0a, 0x01, 0x76, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x76, 0x12, 0x0c, 0x0a, - 0x01, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x73, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x73, 0x3a, 0x26, 0x88, 0xa0, 0x1f, 0x00, 0xca, - 0xb4, 0x2d, 0x06, 0x54, 0x78, 0x44, 0x61, 0x74, 0x61, 0x8a, 0xe7, 0xb0, 0x2a, 0x13, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x54, - 0x78, 0x22, 0xdf, 0x03, 0x0a, 0x0c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, - 0x54, 0x78, 0x12, 0x4a, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xe2, - 0xde, 0x1f, 0x07, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0xea, 0xde, 0x1f, 0x07, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x49, 0x44, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x14, - 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6e, - 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, - 0x6e, 0x74, 0x52, 0x08, 0x67, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x03, - 0x67, 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0c, 0xe2, 0xde, 0x1f, 0x08, 0x47, - 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x0e, 0x0a, 0x02, - 0x74, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x39, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0xda, 0xde, 0x1f, - 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xe2, 0xde, 0x1f, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x60, 0x0a, 0x08, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, - 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x42, 0x25, 0xc8, 0xde, - 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, - 0xaa, 0xdf, 0x1f, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x0c, 0x0a, - 0x01, 0x76, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x72, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x73, 0x3a, 0x2a, 0x88, 0xa0, 0x1f, 0x00, 0xca, 0xb4, 0x2d, - 0x06, 0x54, 0x78, 0x44, 0x61, 0x74, 0x61, 0x8a, 0xe7, 0xb0, 0x2a, 0x17, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, - 0x74, 0x54, 0x78, 0x22, 0x9d, 0x04, 0x0a, 0x0c, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x46, - 0x65, 0x65, 0x54, 0x78, 0x12, 0x4a, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, - 0x74, 0xe2, 0xde, 0x1f, 0x07, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0xea, 0xde, 0x1f, 0x07, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, - 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x67, 0x61, 0x73, 0x5f, 0x74, 0x69, - 0x70, 0x5f, 0x63, 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xda, 0xde, 0x1f, - 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x09, 0x67, 0x61, 0x73, 0x54, 0x69, 0x70, 0x43, 0x61, - 0x70, 0x12, 0x39, 0x0a, 0x0b, 0x67, 0x61, 0x73, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x63, 0x61, 0x70, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, - 0x74, 0x52, 0x09, 0x67, 0x61, 0x73, 0x46, 0x65, 0x65, 0x43, 0x61, 0x70, 0x12, 0x1e, 0x0a, 0x03, - 0x67, 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0c, 0xe2, 0xde, 0x1f, 0x08, 0x47, - 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x0e, 0x0a, 0x02, - 0x74, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x39, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0xda, 0xde, 0x1f, - 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xe2, 0xde, 0x1f, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x60, 0x0a, 0x08, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, - 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x42, 0x25, 0xc8, 0xde, - 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, - 0xaa, 0xdf, 0x1f, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x0c, 0x0a, - 0x01, 0x76, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x72, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x73, 0x3a, 0x2a, 0x88, 0xa0, 0x1f, 0x00, 0xca, 0xb4, 0x2d, - 0x06, 0x54, 0x78, 0x44, 0x61, 0x74, 0x61, 0x8a, 0xe7, 0xb0, 0x2a, 0x17, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x46, 0x65, - 0x65, 0x54, 0x78, 0x22, 0x22, 0x0a, 0x1a, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, - 0x78, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xa4, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x45, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x29, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, - 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, - 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x72, - 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x6d, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x19, 0x0a, - 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xba, - 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x32, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x78, 0x2f, 0x76, 0x6d, 0x2f, 0x4d, 0x73, 0x67, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xd6, 0x01, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x52, 0x65, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x84, 0x01, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x45, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x24, 0x0a, 0x03, 0x72, 0x61, + 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x12, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, + 0x0a, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x52, 0x03, 0x72, 0x61, 0x77, + 0x3a, 0x21, 0x88, 0xa0, 0x1f, 0x00, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x4d, 0x73, 0x67, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x54, 0x78, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x4a, + 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, 0x22, 0x0a, 0x1a, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, + 0xa4, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, + 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x29, 0x0a, + 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x72, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x6d, + 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x6d, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, + 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xba, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, + 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, + 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, + 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, + 0x32, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, + 0xe7, 0xb0, 0x2a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x78, + 0x2f, 0x76, 0x6d, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xd6, + 0x01, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, + 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, + 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x12, 0x49, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x0b, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x73, 0x3a, 0x39, 0x82, 0xe7, + 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, + 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x78, 0x2f, 0x76, 0x6d, + 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x65, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x73, 0x22, 0x20, 0x0a, 0x1e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x49, 0x0a, 0x0b, 0x70, 0x72, 0x65, - 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x42, 0x09, 0xc8, 0xde, - 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, - 0x61, 0x6c, 0x6c, 0x73, 0x3a, 0x39, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x65, 0x76, 0x6d, 0x2f, 0x78, 0x2f, 0x76, 0x6d, 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x73, 0x22, - 0x20, 0x0a, 0x1e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xdc, 0x02, 0x0a, 0x03, 0x4d, 0x73, + 0x67, 0x12, 0x7d, 0x0a, 0x0a, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x12, + 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, + 0x1a, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, + 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1f, 0x22, 0x1d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, + 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x74, 0x78, + 0x12, 0x5c, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, + 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, + 0x0a, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, + 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x73, 0x1a, + 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x32, 0xdc, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x7d, 0x0a, 0x0a, 0x45, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x12, 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x1a, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x22, 0x1d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x74, 0x78, 0x12, 0x5c, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x29, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, 0x0a, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x28, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x65, 0x69, - 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x73, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, - 0x42, 0xaa, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, - 0x6d, 0x2f, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, - 0x45, 0x56, 0xaa, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x76, 0x6d, 0x2e, - 0x56, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, - 0x76, 0x6d, 0x5c, 0x56, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x56, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xaa, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, + 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x3b, + 0x76, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x45, 0x56, 0xaa, 0x02, 0x10, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x76, 0x6d, 0x2e, 0x56, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x6d, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x1c, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x6d, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x56, + 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -7663,42 +3793,34 @@ func file_cosmos_evm_vm_v1_tx_proto_rawDescGZIP() []byte { return file_cosmos_evm_vm_v1_tx_proto_rawDescData } -var file_cosmos_evm_vm_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_cosmos_evm_vm_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_cosmos_evm_vm_v1_tx_proto_goTypes = []interface{}{ (*MsgEthereumTx)(nil), // 0: cosmos.evm.vm.v1.MsgEthereumTx - (*LegacyTx)(nil), // 1: cosmos.evm.vm.v1.LegacyTx - (*AccessListTx)(nil), // 2: cosmos.evm.vm.v1.AccessListTx - (*DynamicFeeTx)(nil), // 3: cosmos.evm.vm.v1.DynamicFeeTx - (*ExtensionOptionsEthereumTx)(nil), // 4: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx - (*MsgEthereumTxResponse)(nil), // 5: cosmos.evm.vm.v1.MsgEthereumTxResponse - (*MsgUpdateParams)(nil), // 6: cosmos.evm.vm.v1.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 7: cosmos.evm.vm.v1.MsgUpdateParamsResponse - (*MsgRegisterPreinstalls)(nil), // 8: cosmos.evm.vm.v1.MsgRegisterPreinstalls - (*MsgRegisterPreinstallsResponse)(nil), // 9: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse - (*anypb.Any)(nil), // 10: google.protobuf.Any - (*AccessTuple)(nil), // 11: cosmos.evm.vm.v1.AccessTuple - (*Log)(nil), // 12: cosmos.evm.vm.v1.Log - (*Params)(nil), // 13: cosmos.evm.vm.v1.Params - (*Preinstall)(nil), // 14: cosmos.evm.vm.v1.Preinstall + (*ExtensionOptionsEthereumTx)(nil), // 1: cosmos.evm.vm.v1.ExtensionOptionsEthereumTx + (*MsgEthereumTxResponse)(nil), // 2: cosmos.evm.vm.v1.MsgEthereumTxResponse + (*MsgUpdateParams)(nil), // 3: cosmos.evm.vm.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 4: cosmos.evm.vm.v1.MsgUpdateParamsResponse + (*MsgRegisterPreinstalls)(nil), // 5: cosmos.evm.vm.v1.MsgRegisterPreinstalls + (*MsgRegisterPreinstallsResponse)(nil), // 6: cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse + (*Log)(nil), // 7: cosmos.evm.vm.v1.Log + (*Params)(nil), // 8: cosmos.evm.vm.v1.Params + (*Preinstall)(nil), // 9: cosmos.evm.vm.v1.Preinstall } var file_cosmos_evm_vm_v1_tx_proto_depIdxs = []int32{ - 10, // 0: cosmos.evm.vm.v1.MsgEthereumTx.data:type_name -> google.protobuf.Any - 11, // 1: cosmos.evm.vm.v1.AccessListTx.accesses:type_name -> cosmos.evm.vm.v1.AccessTuple - 11, // 2: cosmos.evm.vm.v1.DynamicFeeTx.accesses:type_name -> cosmos.evm.vm.v1.AccessTuple - 12, // 3: cosmos.evm.vm.v1.MsgEthereumTxResponse.logs:type_name -> cosmos.evm.vm.v1.Log - 13, // 4: cosmos.evm.vm.v1.MsgUpdateParams.params:type_name -> cosmos.evm.vm.v1.Params - 14, // 5: cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls:type_name -> cosmos.evm.vm.v1.Preinstall - 0, // 6: cosmos.evm.vm.v1.Msg.EthereumTx:input_type -> cosmos.evm.vm.v1.MsgEthereumTx - 6, // 7: cosmos.evm.vm.v1.Msg.UpdateParams:input_type -> cosmos.evm.vm.v1.MsgUpdateParams - 8, // 8: cosmos.evm.vm.v1.Msg.RegisterPreinstalls:input_type -> cosmos.evm.vm.v1.MsgRegisterPreinstalls - 5, // 9: cosmos.evm.vm.v1.Msg.EthereumTx:output_type -> cosmos.evm.vm.v1.MsgEthereumTxResponse - 7, // 10: cosmos.evm.vm.v1.Msg.UpdateParams:output_type -> cosmos.evm.vm.v1.MsgUpdateParamsResponse - 9, // 11: cosmos.evm.vm.v1.Msg.RegisterPreinstalls:output_type -> cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse - 9, // [9:12] is the sub-list for method output_type - 6, // [6:9] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 7, // 0: cosmos.evm.vm.v1.MsgEthereumTxResponse.logs:type_name -> cosmos.evm.vm.v1.Log + 8, // 1: cosmos.evm.vm.v1.MsgUpdateParams.params:type_name -> cosmos.evm.vm.v1.Params + 9, // 2: cosmos.evm.vm.v1.MsgRegisterPreinstalls.preinstalls:type_name -> cosmos.evm.vm.v1.Preinstall + 0, // 3: cosmos.evm.vm.v1.Msg.EthereumTx:input_type -> cosmos.evm.vm.v1.MsgEthereumTx + 3, // 4: cosmos.evm.vm.v1.Msg.UpdateParams:input_type -> cosmos.evm.vm.v1.MsgUpdateParams + 5, // 5: cosmos.evm.vm.v1.Msg.RegisterPreinstalls:input_type -> cosmos.evm.vm.v1.MsgRegisterPreinstalls + 2, // 6: cosmos.evm.vm.v1.Msg.EthereumTx:output_type -> cosmos.evm.vm.v1.MsgEthereumTxResponse + 4, // 7: cosmos.evm.vm.v1.Msg.UpdateParams:output_type -> cosmos.evm.vm.v1.MsgUpdateParamsResponse + 6, // 8: cosmos.evm.vm.v1.Msg.RegisterPreinstalls:output_type -> cosmos.evm.vm.v1.MsgRegisterPreinstallsResponse + 6, // [6:9] is the sub-list for method output_type + 3, // [3:6] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_cosmos_evm_vm_v1_tx_proto_init() } @@ -7721,42 +3843,6 @@ func file_cosmos_evm_vm_v1_tx_proto_init() { } } file_cosmos_evm_vm_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LegacyTx); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_evm_vm_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AccessListTx); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_evm_vm_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DynamicFeeTx); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_evm_vm_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExtensionOptionsEthereumTx); i { case 0: return &v.state @@ -7768,7 +3854,7 @@ func file_cosmos_evm_vm_v1_tx_proto_init() { return nil } } - file_cosmos_evm_vm_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_evm_vm_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgEthereumTxResponse); i { case 0: return &v.state @@ -7780,7 +3866,7 @@ func file_cosmos_evm_vm_v1_tx_proto_init() { return nil } } - file_cosmos_evm_vm_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_evm_vm_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParams); i { case 0: return &v.state @@ -7792,7 +3878,7 @@ func file_cosmos_evm_vm_v1_tx_proto_init() { return nil } } - file_cosmos_evm_vm_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_evm_vm_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParamsResponse); i { case 0: return &v.state @@ -7804,7 +3890,7 @@ func file_cosmos_evm_vm_v1_tx_proto_init() { return nil } } - file_cosmos_evm_vm_v1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_evm_vm_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRegisterPreinstalls); i { case 0: return &v.state @@ -7816,7 +3902,7 @@ func file_cosmos_evm_vm_v1_tx_proto_init() { return nil } } - file_cosmos_evm_vm_v1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_evm_vm_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRegisterPreinstallsResponse); i { case 0: return &v.state @@ -7835,7 +3921,7 @@ func file_cosmos_evm_vm_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_evm_vm_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 7, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/evm/vm/v1/tx_data.go b/api/cosmos/evm/vm/v1/tx_data.go deleted file mode 100644 index 8a4e6534b..000000000 --- a/api/cosmos/evm/vm/v1/tx_data.go +++ /dev/null @@ -1,46 +0,0 @@ -package vmv1 - -import ( - "math/big" - - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - "google.golang.org/protobuf/reflect/protoreflect" - - sdkmath "cosmossdk.io/math" -) - -var ( - _ TxDataV2 = &LegacyTx{} - _ TxDataV2 = &AccessListTx{} - _ TxDataV2 = &DynamicFeeTx{} -) - -// TxDataV2 implements the Ethereum transaction tx structure. It is used -// solely to define the custom logic for getting signers on Ethereum transactions. -type TxDataV2 interface { - GetChainID() *big.Int - AsEthereumData() ethtypes.TxData - - ProtoReflect() protoreflect.Message -} - -// helper function to parse string to bigInt -func stringToBigInt(str string) *big.Int { - if str == "" { - return nil - } - res, ok := sdkmath.NewIntFromString(str) - if !ok { - return nil - } - return res.BigInt() -} - -func stringToAddress(toStr string) *common.Address { - if toStr == "" { - return nil - } - addr := common.HexToAddress(toStr) - return &addr -} diff --git a/evmd/ante/tx_listener.go b/evmd/ante/tx_listener.go index b5fceea04..be16cc739 100644 --- a/evmd/ante/tx_listener.go +++ b/evmd/ante/tx_listener.go @@ -25,7 +25,7 @@ func (d TxListenerDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate boo if ctx.IsCheckTx() && !simulate && d.pendingTxListener != nil { for _, msg := range tx.GetMsgs() { if ethTx, ok := msg.(*evmtypes.MsgEthereumTx); ok { - d.pendingTxListener(common.HexToHash(ethTx.Hash)) + d.pendingTxListener(ethTx.Hash()) } } } diff --git a/indexer/kv_indexer.go b/indexer/kv_indexer.go index 79e2159be..ae8941acf 100644 --- a/indexer/kv_indexer.go +++ b/indexer/kv_indexer.go @@ -82,7 +82,7 @@ func (kv *KVIndexer) IndexBlock(block *cmttypes.Block, txResults []*abci.ExecTxR var cumulativeGasUsed uint64 for msgIndex, msg := range tx.GetMsgs() { ethMsg := msg.(*evmtypes.MsgEthereumTx) - txHash := common.HexToHash(ethMsg.Hash) + txHash := ethMsg.Hash() txResult := cosmosevmtypes.TxResult{ Height: height, diff --git a/proto/cosmos/evm/vm/v1/tx.proto b/proto/cosmos/evm/vm/v1/tx.proto index 7ee8d3004..94272bf25 100644 --- a/proto/cosmos/evm/vm/v1/tx.proto +++ b/proto/cosmos/evm/vm/v1/tx.proto @@ -9,7 +9,6 @@ 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"; option go_package = "github.com/cosmos/evm/x/vm/types"; @@ -38,139 +37,14 @@ message MsgEthereumTx { option (gogoproto.goproto_getters) = false; - // data is inner transaction data of the Ethereum transaction - google.protobuf.Any data = 1; + reserved 1,2,3,4; - // size is the encoded storage size of the transaction (DEPRECATED) - double size = 2 [ (gogoproto.jsontag) = "-", (amino.dont_omitempty) = true ]; - // hash of the transaction in hex format - string hash = 3 - [ (gogoproto.moretags) = "rlp:\"-\"", (amino.dont_omitempty) = true ]; - 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; -} - -// 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 (amino.name) = "cosmos/evm/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 (amino.name) = "cosmos/evm/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, - (amino.dont_omitempty) = true - ]; - // 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 dynamic fee transactions. -message DynamicFeeTx { - option (amino.name) = "cosmos/evm/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 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, - (amino.dont_omitempty) = true - ]; - // v defines the signature value - bytes v = 10; - // r defines the signature value - bytes r = 11; - // s define the signature value - bytes s = 12; + // raw is the raw ethereum transaction + bytes raw = 6 [(gogoproto.customtype) = "EthereumTx", (gogoproto.nullable) = false]; } // ExtensionOptionsEthereumTx is an extension option for ethereum transactions diff --git a/rpc/backend/blocks.go b/rpc/backend/blocks.go index 25fae0ea9..30eb58400 100644 --- a/rpc/backend/blocks.go +++ b/rpc/backend/blocks.go @@ -293,7 +293,6 @@ func (b *Backend) EthMsgsFromTendermintBlock( continue } - ethMsg.Hash = ethMsg.AsTransaction().Hash().Hex() result = append(result, ethMsg) } } @@ -400,7 +399,7 @@ func (b *Backend) RPCBlockFromTendermintBlock( msgs := b.EthMsgsFromTendermintBlock(resBlock, blockRes) for txIndex, ethMsg := range msgs { if !fullTx { - hash := common.HexToHash(ethMsg.Hash) + hash := ethMsg.Hash() ethRPCTxs = append(ethRPCTxs, hash) continue } @@ -558,32 +557,33 @@ func (b *Backend) GetBlockReceipts( msgs := b.EthMsgsFromTendermintBlock(resBlock, blockRes) result := make([]map[string]interface{}, len(msgs)) + blockHash := common.BytesToHash(resBlock.Block.Header.Hash()).Hex() for i, msg := range msgs { + txResult, err := b.GetTxByEthHash(msg.Hash()) + if err != nil { + return nil, fmt.Errorf("tx not found: hash=%s, error=%s", msg.Hash(), err.Error()) + } result[i], err = b.formatTxReceipt( msg, - msgs, + txResult, blockRes, - common.BytesToHash(resBlock.Block.Header.Hash()).Hex(), + blockHash, ) if err != nil { - return nil, fmt.Errorf("failed to get transaction receipt for tx %s: %w", msg.Hash, err) + return nil, fmt.Errorf("failed to get transaction receipt for tx %s: %w", msg.Hash().Hex(), err) } } return result, nil } -func (b *Backend) formatTxReceipt(ethMsg *evmtypes.MsgEthereumTx, blockMsgs []*evmtypes.MsgEthereumTx, blockRes *tmrpctypes.ResultBlockResults, blockHeaderHash string) (map[string]interface{}, error) { - txResult, err := b.GetTxByEthHash(common.HexToHash(ethMsg.Hash)) - if err != nil { - return nil, fmt.Errorf("tx not found: hash=%s, error=%s", ethMsg.Hash, err.Error()) - } - - txData, err := evmtypes.UnpackTxData(ethMsg.Data) - if err != nil { - return nil, fmt.Errorf("failed to unpack tx data: %w", err) - } - +func (b *Backend) formatTxReceipt( + ethMsg *evmtypes.MsgEthereumTx, + txResult *cosmosevmtypes.TxResult, + blockRes *tmrpctypes.ResultBlockResults, + blockHeaderHash string, +) (map[string]interface{}, error) { + ethTx := ethMsg.AsTransaction() cumulativeGasUsed := uint64(0) for _, txResult := range blockRes.TxsResults[0:txResult.TxIndex] { @@ -613,18 +613,9 @@ func (b *Backend) formatTxReceipt(ethMsg *evmtypes.MsgEthereumTx, blockMsgs []*e msgIndex := int(txResult.MsgIndex) // #nosec G115 -- checked for int overflow already logs, err := evmtypes.TxLogsFromEvents(blockRes.TxsResults[txResult.TxIndex].Events, msgIndex) if err != nil { - b.Logger.Debug("failed to parse logs", "hash", ethMsg.Hash, "error", err.Error()) + b.Logger.Debug("failed to parse logs", "hash", ethMsg.Hash().String(), "error", err.Error()) } - if txResult.EthTxIndex == -1 { - // Fallback to find tx index by iterating all valid eth transactions - for i := range blockMsgs { - if blockMsgs[i].Hash == ethMsg.Hash { - txResult.EthTxIndex = int32(i) // #nosec G115 - break - } - } - } // return error if still unable to find the eth tx index if txResult.EthTxIndex == -1 { return nil, fmt.Errorf("can't find index of ethereum tx") @@ -639,9 +630,9 @@ func (b *Backend) formatTxReceipt(ethMsg *evmtypes.MsgEthereumTx, blockMsgs []*e // Implementation fields: These fields are added by geth when processing a transaction. // They are stored in the chain database. - "transactionHash": common.HexToHash(ethMsg.Hash), + "transactionHash": ethMsg.Hash(), "contractAddress": nil, - "gasUsed": hexutil.Uint64(b.GetGasUsed(txResult, txData.GetGasPrice(), txData.GetGas())), + "gasUsed": hexutil.Uint64(b.GetGasUsed(txResult, ethTx.GasPrice(), ethTx.Gas())), // Inclusion information: These fields provide information about the inclusion of the // transaction corresponding to this receipt. @@ -650,11 +641,11 @@ func (b *Backend) formatTxReceipt(ethMsg *evmtypes.MsgEthereumTx, blockMsgs []*e "transactionIndex": hexutil.Uint64(txResult.EthTxIndex), //nolint:gosec // G115 // no int overflow expected here // https://github.com/foundry-rs/foundry/issues/7640 - "effectiveGasPrice": (*hexutil.Big)(txData.GetGasPrice()), + "effectiveGasPrice": (*hexutil.Big)(ethTx.GasPrice()), // sender and receiver (contract or EOA) addreses "from": from, - "to": txData.GetTo(), + "to": ethTx.To(), "type": hexutil.Uint(ethMsg.AsTransaction().Type()), } @@ -663,17 +654,19 @@ func (b *Backend) formatTxReceipt(ethMsg *evmtypes.MsgEthereumTx, blockMsgs []*e } // If the ContractAddress is 20 0x0 bytes, assume it is not a contract creation - if txData.GetTo() == nil { - receipt["contractAddress"] = crypto.CreateAddress(from, txData.GetNonce()) + if ethTx.To() == nil { + receipt["contractAddress"] = crypto.CreateAddress(from, ethTx.Nonce()) } - if dynamicTx, ok := txData.(*evmtypes.DynamicFeeTx); ok { + if ethTx.Type() >= ethtypes.DynamicFeeTxType { baseFee, err := b.BaseFee(blockRes) if err != nil { // tolerate the error for pruned node. b.Logger.Error("fetch basefee failed, node is pruned?", "height", txResult.Height, "error", err) } else { - receipt["effectiveGasPrice"] = hexutil.Big(*dynamicTx.EffectiveGasPrice(baseFee)) + gasTip, _ := ethTx.EffectiveGasTip(baseFee) + effectiveGasPrice := new(big.Int).Add(gasTip, baseFee) + receipt["effectiveGasPrice"] = hexutil.Big(*effectiveGasPrice) } } diff --git a/rpc/backend/call_tx.go b/rpc/backend/call_tx.go index fbc1554b7..fb10453f6 100644 --- a/rpc/backend/call_tx.go +++ b/rpc/backend/call_tx.go @@ -45,7 +45,7 @@ func (b *Backend) Resend(args evmtypes.TransactionArgs, gasPrice *hexutil.Big, g signer := ethtypes.LatestSigner(cfg) - matchTx := args.ToTransaction().AsTransaction() + matchTx := args.ToTransaction(ethtypes.LegacyTxType) // Before replacing the old transaction, ensure the _new_ transaction fee is reasonable. price := matchTx.GasPrice() @@ -118,14 +118,15 @@ func (b *Backend) SendRawTransaction(data hexutil.Bytes) (common.Hash, error) { } ethereumTx := &evmtypes.MsgEthereumTx{} - if err := ethereumTx.FromSignedEthereumTx(tx, ethtypes.LatestSignerForChainID(b.EvmChainID)); err != nil { + ethSigner := ethtypes.LatestSigner(b.ChainConfig()) + if err := ethereumTx.FromSignedEthereumTx(tx, ethSigner); err != nil { b.Logger.Error("transaction converting failed", "error", err.Error()) - return common.Hash{}, err + return common.Hash{}, fmt.Errorf("failed to convert ethereum transaction: %w", err) } if err := ethereumTx.ValidateBasic(); err != nil { b.Logger.Debug("tx failed basic validation", "error", err.Error()) - return common.Hash{}, err + return common.Hash{}, fmt.Errorf("failed to validate transaction: %w", err) } baseDenom := evmtypes.GetEVMCoinDenom() @@ -133,14 +134,14 @@ func (b *Backend) SendRawTransaction(data hexutil.Bytes) (common.Hash, error) { cosmosTx, err := ethereumTx.BuildTx(b.ClientCtx.TxConfig.NewTxBuilder(), baseDenom) if err != nil { b.Logger.Error("failed to build cosmos tx", "error", err.Error()) - return common.Hash{}, err + return common.Hash{}, fmt.Errorf("failed to build cosmos tx: %w", err) } // Encode transaction by default Tx encoder txBytes, err := b.ClientCtx.TxConfig.TxEncoder()(cosmosTx) if err != nil { b.Logger.Error("failed to encode eth tx using default encoder", "error", err.Error()) - return common.Hash{}, err + return common.Hash{}, fmt.Errorf("failed to encode transaction: %w", err) } txHash := ethereumTx.AsTransaction().Hash() @@ -152,7 +153,7 @@ func (b *Backend) SendRawTransaction(data hexutil.Bytes) (common.Hash, error) { } if err != nil { b.Logger.Error("failed to broadcast tx", "error", err.Error()) - return txHash, err + return txHash, fmt.Errorf("failed to broadcast transaction: %w", err) } return txHash, nil diff --git a/rpc/backend/sign_tx.go b/rpc/backend/sign_tx.go index b1c6bbbdc..bb5558308 100644 --- a/rpc/backend/sign_tx.go +++ b/rpc/backend/sign_tx.go @@ -61,7 +61,7 @@ func (b *Backend) SendTransaction(args evmtypes.TransactionArgs) (common.Hash, e // the corresponding EvmChainID validation, we need to sign the transaction before calling it // Sign transaction - msg := args.ToTransaction() + msg := evmtypes.NewTxFromArgs(&args) if err := msg.Sign(signer, b.ClientCtx.Keyring); err != nil { b.Logger.Debug("failed to sign tx", "error", err.Error()) return common.Hash{}, err diff --git a/rpc/backend/tx_info.go b/rpc/backend/tx_info.go index 96ffddcf3..88981e2c8 100644 --- a/rpc/backend/tx_info.go +++ b/rpc/backend/tx_info.go @@ -8,7 +8,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" "github.com/pkg/errors" tmrpcclient "github.com/cometbft/cometbft/rpc/client" @@ -26,8 +25,6 @@ import ( // GetTransactionByHash returns the Ethereum format transaction identified by Ethereum transaction hash func (b *Backend) GetTransactionByHash(txHash common.Hash) (*rpctypes.RPCTransaction, error) { res, err := b.GetTxByEthHash(txHash) - hexTx := txHash.Hex() - if err != nil { return b.GetTransactionByHashPending(txHash) } @@ -58,7 +55,7 @@ func (b *Backend) GetTransactionByHash(txHash common.Hash) (*rpctypes.RPCTransac // Fallback to find tx index by iterating all valid eth transactions msgs := b.EthMsgsFromTendermintBlock(block, blockRes) for i := range msgs { - if msgs[i].Hash == hexTx { + if msgs[i].Hash() == txHash { if i > math.MaxInt32 { return nil, errors.New("tx index overflow") } @@ -107,7 +104,7 @@ func (b *Backend) GetTransactionByHashPending(txHash common.Hash) (*rpctypes.RPC continue } - if msg.Hash == hexTx { + if msg.Hash() == txHash { // use zero block values since it's not included in a block yet rpctx, err := rpctypes.NewTransactionFromMsg( msg, @@ -162,123 +159,15 @@ func (b *Backend) GetTransactionReceipt(hash common.Hash) (map[string]interface{ return nil, fmt.Errorf("failed to decode tx: %w", err) } - ethMsg := tx.GetMsgs()[res.MsgIndex].(*evmtypes.MsgEthereumTx) - - txData, err := evmtypes.UnpackTxData(ethMsg.Data) - if err != nil { - b.Logger.Error("failed to unpack tx data", "error", err.Error()) - return nil, err - } - - cumulativeGasUsed := uint64(0) blockRes, err := b.RPCClient.BlockResults(b.Ctx, &res.Height) if err != nil { b.Logger.Debug("failed to retrieve block results", "height", res.Height, "error", err.Error()) return nil, fmt.Errorf("block result not found at height %d: %w", res.Height, err) } - for _, txResult := range blockRes.TxsResults[0:res.TxIndex] { - cumulativeGasUsed += uint64(txResult.GasUsed) // #nosec G115 -- checked for int overflow already - } - - cumulativeGasUsed += res.CumulativeGasUsed - - var status hexutil.Uint - if res.Failed { - status = hexutil.Uint(ethtypes.ReceiptStatusFailed) - } else { - status = hexutil.Uint(ethtypes.ReceiptStatusSuccessful) - } - - chainID, err := b.ChainID() - if err != nil { - return nil, err - } - - from, err := ethMsg.GetSenderLegacy(ethtypes.LatestSignerForChainID(chainID.ToInt())) - if err != nil { - return nil, err - } - - // parse tx logs from events - msgIndex := int(res.MsgIndex) // #nosec G115 -- checked for int overflow already - logs, err := evmtypes.TxLogsFromEvents(blockRes.TxsResults[res.TxIndex].Events, msgIndex) - if err != nil { - b.Logger.Debug("failed to parse logs", "hash", hexTx, "error", err.Error()) - } - - if res.EthTxIndex == -1 { - // Fallback to find tx index by iterating all valid eth transactions - msgs := b.EthMsgsFromTendermintBlock(resBlock, blockRes) - for i := range msgs { - if msgs[i].Hash == hexTx { - res.EthTxIndex = int32(i) // #nosec G115 - break - } - } - } - // return error if still unable to find the eth tx index - if res.EthTxIndex == -1 { - return nil, errors.New("can't find index of ethereum tx") - } - - // create the logs bloom - var bin ethtypes.Bloom - for _, log := range logs { - bin.Add(log.Address.Bytes()) - for _, b := range log.Topics { - bin.Add(b[:]) - } - } - - receipt := map[string]interface{}{ - // Consensus fields: These fields are defined by the Yellow Paper - "status": status, - "cumulativeGasUsed": hexutil.Uint64(cumulativeGasUsed), - "logsBloom": ethtypes.BytesToBloom(bin.Bytes()), - "logs": logs, - - // Implementation fields: These fields are added by geth when processing a transaction. - // They are stored in the chain database. - "transactionHash": hash, - "contractAddress": nil, - "gasUsed": hexutil.Uint64(b.GetGasUsed(res, txData.GetGasPrice(), txData.GetGas())), - - // Inclusion information: These fields provide information about the inclusion of the - // transaction corresponding to this receipt. - "blockHash": common.BytesToHash(resBlock.Block.Header.Hash()).Hex(), - "blockNumber": hexutil.Uint64(res.Height), //nolint:gosec // G115 // won't exceed uint64 - "transactionIndex": hexutil.Uint64(res.EthTxIndex), //nolint:gosec // G115 // no int overflow expected here - - // https://github.com/foundry-rs/foundry/issues/7640 - "effectiveGasPrice": (*hexutil.Big)(txData.GetGasPrice()), - - // sender and receiver (contract or EOA) addreses - "from": from, - "to": txData.GetTo(), - "type": hexutil.Uint(ethMsg.AsTransaction().Type()), - } - - if logs == nil { - receipt["logs"] = [][]*ethtypes.Log{} - } - - // If the ContractAddress is 20 0x0 bytes, assume it is not a contract creation - if txData.GetTo() == nil { - receipt["contractAddress"] = crypto.CreateAddress(from, txData.GetNonce()) - } - - if dynamicTx, ok := txData.(*evmtypes.DynamicFeeTx); ok { - baseFee, err := b.BaseFee(blockRes) - if err != nil { - // tolerate the error for pruned node. - b.Logger.Error("fetch basefee failed, node is pruned?", "height", res.Height, "error", err) - } else { - receipt["effectiveGasPrice"] = hexutil.Big(*dynamicTx.EffectiveGasPrice(baseFee)) - } - } - - return receipt, nil + ethMsg := tx.GetMsgs()[res.MsgIndex].(*evmtypes.MsgEthereumTx) + blockHeaderHash := common.BytesToHash(resBlock.Block.Header.Hash()).Hex() + return b.formatTxReceipt(ethMsg, res, blockRes, blockHeaderHash) } // GetTransactionLogs returns the transaction logs identified by hash. diff --git a/rpc/namespaces/ethereum/eth/api.go b/rpc/namespaces/ethereum/eth/api.go index 98bb89138..53a2d45fc 100644 --- a/rpc/namespaces/ethereum/eth/api.go +++ b/rpc/namespaces/ethereum/eth/api.go @@ -220,7 +220,7 @@ func (e *PublicAPI) SendRawTransaction(data hexutil.Bytes) (common.Hash, error) // SendTransaction sends an Ethereum transaction. func (e *PublicAPI) SendTransaction(args evmtypes.TransactionArgs) (common.Hash, error) { - e.logger.Debug("eth_sendTransaction", "args", args.String()) + e.logger.Debug("eth_sendTransaction", "args", args) return e.backend.SendTransaction(args) } @@ -270,7 +270,7 @@ func (e *PublicAPI) Call(args evmtypes.TransactionArgs, blockNrOrHash rpctypes.BlockNumberOrHash, override *rpctypes.StateOverride, ) (hexutil.Bytes, error) { - e.logger.Debug("eth_call", "args", args.String(), "block number or hash", blockNrOrHash) + e.logger.Debug("eth_call", "args", args, "block number or hash", blockNrOrHash) if override != nil { e.logger.Debug("eth_call", "error", "overrides are unsupported in call queries") @@ -443,7 +443,7 @@ func (e *PublicAPI) FillTransaction(args evmtypes.TransactionArgs) (*rpctypes.Si } // Assemble the transaction and obtain rlp - tx := args.ToTransaction().AsTransaction() + tx := args.ToTransaction(ethtypes.LegacyTxType) data, err := tx.MarshalBinary() if err != nil { @@ -463,7 +463,7 @@ func (e *PublicAPI) Resend(_ context.Context, gasPrice *hexutil.Big, gasLimit *hexutil.Uint64, ) (common.Hash, error) { - e.logger.Debug("eth_resend", "args", args.String()) + e.logger.Debug("eth_resend", "args", args) return e.backend.Resend(args, gasPrice, gasLimit) } diff --git a/rpc/types/types.go b/rpc/types/types.go index d118247f6..905124b7c 100644 --- a/rpc/types/types.go +++ b/rpc/types/types.go @@ -34,25 +34,29 @@ type StorageResult struct { // RPCTransaction represents a transaction that will serialize to the RPC representation of a transaction type RPCTransaction struct { - BlockHash *common.Hash `json:"blockHash"` - BlockNumber *hexutil.Big `json:"blockNumber"` - From common.Address `json:"from"` - Gas hexutil.Uint64 `json:"gas"` - GasPrice *hexutil.Big `json:"gasPrice"` - GasFeeCap *hexutil.Big `json:"maxFeePerGas,omitempty"` - GasTipCap *hexutil.Big `json:"maxPriorityFeePerGas,omitempty"` - Hash common.Hash `json:"hash"` - Input hexutil.Bytes `json:"input"` - Nonce hexutil.Uint64 `json:"nonce"` - To *common.Address `json:"to"` - TransactionIndex *hexutil.Uint64 `json:"transactionIndex"` - Value *hexutil.Big `json:"value"` - Type hexutil.Uint64 `json:"type"` - Accesses *ethtypes.AccessList `json:"accessList,omitempty"` - ChainID *hexutil.Big `json:"chainId,omitempty"` - V *hexutil.Big `json:"v"` - R *hexutil.Big `json:"r"` - S *hexutil.Big `json:"s"` + BlockHash *common.Hash `json:"blockHash"` + BlockNumber *hexutil.Big `json:"blockNumber"` + From common.Address `json:"from"` + Gas hexutil.Uint64 `json:"gas"` + GasPrice *hexutil.Big `json:"gasPrice"` + GasFeeCap *hexutil.Big `json:"maxFeePerGas,omitempty"` + GasTipCap *hexutil.Big `json:"maxPriorityFeePerGas,omitempty"` + MaxFeePerBlobGas *hexutil.Big `json:"maxFeePerBlobGas,omitempty"` + Hash common.Hash `json:"hash"` + Input hexutil.Bytes `json:"input"` + Nonce hexutil.Uint64 `json:"nonce"` + To *common.Address `json:"to"` + TransactionIndex *hexutil.Uint64 `json:"transactionIndex"` + Value *hexutil.Big `json:"value"` + Type hexutil.Uint64 `json:"type"` + Accesses *ethtypes.AccessList `json:"accessList,omitempty"` + ChainID *hexutil.Big `json:"chainId,omitempty"` + BlobVersionedHashes []common.Hash `json:"blobVersionedHashes,omitempty"` + AuthorizationList []ethtypes.SetCodeAuthorization `json:"authorizationList,omitempty"` + V *hexutil.Big `json:"v"` + R *hexutil.Big `json:"r"` + S *hexutil.Big `json:"s"` + YParity *hexutil.Uint64 `json:"yParity,omitempty"` } // StateOverride is the collection of overridden accounts. diff --git a/rpc/types/utils.go b/rpc/types/utils.go index 86dd29bb4..dd78608b5 100644 --- a/rpc/types/utils.go +++ b/rpc/types/utils.go @@ -46,7 +46,6 @@ func RawTxToEthTx(clientCtx client.Context, txBz cmttypes.Tx) ([]*evmtypes.MsgEt if !ok { return nil, fmt.Errorf("invalid message type %T, expected %T", msg, &evmtypes.MsgEthereumTx{}) } - ethTx.Hash = ethTx.AsTransaction().Hash().Hex() ethTxs[i] = ethTx } return ethTxs, nil @@ -229,11 +228,56 @@ func NewRPCTransaction( } else { result.GasPrice = (*hexutil.Big)(tx.GasFeeCap()) } + + case ethtypes.BlobTxType: + al := tx.AccessList() + yparity := hexutil.Uint64(v.Sign()) //nolint:gosec + result.Accesses = &al + result.ChainID = (*hexutil.Big)(tx.ChainId()) + result.YParity = &yparity + result.GasFeeCap = (*hexutil.Big)(tx.GasFeeCap()) + result.GasTipCap = (*hexutil.Big)(tx.GasTipCap()) + // if the transaction has been mined, compute the effective gas price + if baseFee != nil && blockHash != (common.Hash{}) { + result.GasPrice = (*hexutil.Big)(effectiveGasPrice(tx, baseFee)) + } else { + result.GasPrice = (*hexutil.Big)(tx.GasFeeCap()) + } + result.MaxFeePerBlobGas = (*hexutil.Big)(tx.BlobGasFeeCap()) + result.BlobVersionedHashes = tx.BlobHashes() + + case ethtypes.SetCodeTxType: + al := tx.AccessList() + yparity := hexutil.Uint64(v.Sign()) //nolint:gosec + result.Accesses = &al + result.ChainID = (*hexutil.Big)(tx.ChainId()) + result.YParity = &yparity + result.GasFeeCap = (*hexutil.Big)(tx.GasFeeCap()) + result.GasTipCap = (*hexutil.Big)(tx.GasTipCap()) + // if the transaction has been mined, compute the effective gas price + if baseFee != nil && blockHash != (common.Hash{}) { + result.GasPrice = (*hexutil.Big)(effectiveGasPrice(tx, baseFee)) + } else { + result.GasPrice = (*hexutil.Big)(tx.GasFeeCap()) + } + result.AuthorizationList = tx.SetCodeAuthorizations() } return result, nil } +// effectiveGasPrice computes the transaction gas fee, based on the given basefee value. +// +// price = min(gasTipCap + baseFee, gasFeeCap) +func effectiveGasPrice(tx *ethtypes.Transaction, baseFee *big.Int) *big.Int { + fee := tx.GasTipCap() + fee = fee.Add(fee, baseFee) + if tx.GasFeeCapIntCmp(fee) < 0 { + return tx.GasFeeCap() + } + return fee +} + // BaseFeeFromEvents parses the feemarket basefee from cosmos events func BaseFeeFromEvents(events []abci.Event) *big.Int { for _, event := range events { diff --git a/tests/integration/ante/evm_ante_test_suite.go b/tests/integration/ante/evm_ante_test_suite.go index 58efd7aea..361071447 100644 --- a/tests/integration/ante/evm_ante_test_suite.go +++ b/tests/integration/ante/evm_ante_test_suite.go @@ -83,10 +83,10 @@ func (s *EvmAnteTestSuite) CreateTxBuilder(privKey cryptotypes.PrivKey, txArgs e err = builder.SetMsgs(&signedMsg) s.Require().NoError(err) - txData, err := evmtypes.UnpackTxData(signedMsg.Data) - s.Require().NoError(err) + ethTx := signedMsg.AsTransaction() + s.Require().NotNil(ethTx) - fees := sdk.NewCoins(sdk.NewCoin(s.GetNetwork().GetBaseDenom(), sdkmath.NewIntFromBigInt(txData.Fee()))) + fees := sdk.NewCoins(sdk.NewCoin(s.GetNetwork().GetBaseDenom(), sdkmath.NewIntFromBigInt(signedMsg.GetFee()))) builder.SetFeeAmount(fees) builder.SetGasLimit(signedMsg.GetGas()) return builder diff --git a/tests/integration/ante/test_evm_ante.go b/tests/integration/ante/test_evm_ante.go index a5f8e1334..776641e09 100644 --- a/tests/integration/ante/test_evm_ante.go +++ b/tests/integration/ante/test_evm_ante.go @@ -1334,18 +1334,6 @@ func (s *EvmAnteTestSuite) TestSignatures() { s.Require().Equal(len(sigs), 0) msg := tx.GetMsgs()[0] - msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx) + _, ok := msg.(*evmtypes.MsgEthereumTx) s.Require().True(ok) - txData, err := evmtypes.UnpackTxData(msgEthTx.Data) - s.Require().NoError(err) - - msgV, msgR, msgS := txData.GetRawSignatureValues() - - ethTx := msgEthTx.AsTransaction() - ethV, ethR, ethS := ethTx.RawSignatureValues() - - // The signatures of MsgEthereumTx should be the same with the corresponding eth tx - s.Require().Equal(msgV, ethV) - s.Require().Equal(msgR, ethR) - s.Require().Equal(msgS, ethS) } diff --git a/tests/integration/ante/test_evm_unit_04_validate.go b/tests/integration/ante/test_evm_unit_04_validate.go index 7ef1a69ac..8e87308cd 100644 --- a/tests/integration/ante/test_evm_unit_04_validate.go +++ b/tests/integration/ante/test_evm_unit_04_validate.go @@ -5,6 +5,7 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/cosmos/evm/ante/evm" testconstants "github.com/cosmos/evm/testutil/constants" @@ -21,7 +22,7 @@ import ( type validateMsgParams struct { evmParams evmtypes.Params from sdktypes.AccAddress - txData evmtypes.TxData + ethTx *ethtypes.Transaction } func (s *EvmUnitAnteTestSuite) TestValidateMsg() { @@ -38,7 +39,7 @@ func (s *EvmUnitAnteTestSuite) TestValidateMsg() { getFunctionParams: func() validateMsgParams { return validateMsgParams{ evmParams: evmtypes.DefaultParams(), - txData: nil, + ethTx: nil, from: keyring.GetAccAddr(0), } }, @@ -48,11 +49,10 @@ func (s *EvmUnitAnteTestSuite) TestValidateMsg() { expectedError: nil, getFunctionParams: func() validateMsgParams { txArgs := getTxByType("transfer", keyring.GetAddr(1)) - txData, err := txArgs.ToTxData() - s.Require().NoError(err) + ethTx := txArgs.ToTx() return validateMsgParams{ evmParams: evmtypes.DefaultParams(), - txData: txData, + ethTx: ethTx, from: nil, } }, @@ -62,16 +62,14 @@ func (s *EvmUnitAnteTestSuite) TestValidateMsg() { expectedError: evmtypes.ErrCallDisabled, getFunctionParams: func() validateMsgParams { txArgs := getTxByType("transfer", keyring.GetAddr(1)) - txData, err := txArgs.ToTxData() - s.Require().NoError(err) - + ethTx := txArgs.ToTx() params := evmtypes.DefaultParams() params.AccessControl.Call.AccessType = evmtypes.AccessTypeRestricted params.AccessControl.Create.AccessType = evmtypes.AccessTypeRestricted return validateMsgParams{ evmParams: params, - txData: txData, + ethTx: ethTx, from: nil, } }, @@ -81,11 +79,10 @@ func (s *EvmUnitAnteTestSuite) TestValidateMsg() { expectedError: nil, getFunctionParams: func() validateMsgParams { txArgs := getTxByType("call", keyring.GetAddr(1)) - txData, err := txArgs.ToTxData() - s.Require().NoError(err) + ethTx := txArgs.ToTx() return validateMsgParams{ evmParams: evmtypes.DefaultParams(), - txData: txData, + ethTx: ethTx, from: nil, } }, @@ -95,15 +92,14 @@ func (s *EvmUnitAnteTestSuite) TestValidateMsg() { expectedError: nil, getFunctionParams: func() validateMsgParams { txArgs := getTxByType("call", keyring.GetAddr(1)) - txData, err := txArgs.ToTxData() - s.Require().NoError(err) + ethTx := txArgs.ToTx() params := evmtypes.DefaultParams() params.AccessControl.Create.AccessType = evmtypes.AccessTypeRestricted return validateMsgParams{ evmParams: params, - txData: txData, + ethTx: ethTx, from: nil, } }, @@ -113,15 +109,14 @@ func (s *EvmUnitAnteTestSuite) TestValidateMsg() { expectedError: evmtypes.ErrCallDisabled, getFunctionParams: func() validateMsgParams { txArgs := getTxByType("call", keyring.GetAddr(1)) - txData, err := txArgs.ToTxData() - s.Require().NoError(err) + ethTx := txArgs.ToTx() params := evmtypes.DefaultParams() params.AccessControl.Call.AccessType = evmtypes.AccessTypeRestricted return validateMsgParams{ evmParams: params, - txData: txData, + ethTx: ethTx, from: nil, } }, @@ -131,11 +126,10 @@ func (s *EvmUnitAnteTestSuite) TestValidateMsg() { expectedError: nil, getFunctionParams: func() validateMsgParams { txArgs := getTxByType("create", keyring.GetAddr(1)) - txData, err := txArgs.ToTxData() - s.Require().NoError(err) + ethTx := txArgs.ToTx() return validateMsgParams{ evmParams: evmtypes.DefaultParams(), - txData: txData, + ethTx: ethTx, from: nil, } }, @@ -145,15 +139,14 @@ func (s *EvmUnitAnteTestSuite) TestValidateMsg() { expectedError: nil, getFunctionParams: func() validateMsgParams { txArgs := getTxByType("create", keyring.GetAddr(1)) - txData, err := txArgs.ToTxData() - s.Require().NoError(err) + ethTx := txArgs.ToTx() params := evmtypes.DefaultParams() params.AccessControl.Call.AccessType = evmtypes.AccessTypeRestricted return validateMsgParams{ evmParams: params, - txData: txData, + ethTx: ethTx, from: nil, } }, @@ -163,15 +156,14 @@ func (s *EvmUnitAnteTestSuite) TestValidateMsg() { expectedError: evmtypes.ErrCreateDisabled, getFunctionParams: func() validateMsgParams { txArgs := getTxByType("create", keyring.GetAddr(1)) - txData, err := txArgs.ToTxData() - s.Require().NoError(err) + ethTx := txArgs.ToTx() params := evmtypes.DefaultParams() params.AccessControl.Create.AccessType = evmtypes.AccessTypeRestricted return validateMsgParams{ evmParams: params, - txData: txData, + ethTx: ethTx, from: nil, } }, @@ -185,8 +177,7 @@ func (s *EvmUnitAnteTestSuite) TestValidateMsg() { // Function under test err := evm.ValidateMsg( params.evmParams, - params.txData, - params.from, + params.ethTx, ) if tc.expectedError != nil { diff --git a/tests/integration/ante/test_evm_unit_06_account_verification.go b/tests/integration/ante/test_evm_unit_06_account_verification.go index ae5458eae..b9e248afd 100644 --- a/tests/integration/ante/test_evm_unit_06_account_verification.go +++ b/tests/integration/ante/test_evm_unit_06_account_verification.go @@ -39,6 +39,10 @@ func (s *EvmUnitAnteTestSuite) TestVerifyAccountBalance() { txFactory := factory.New(unitNetwork, grpcHandler) senderKey := keyring.GetKey(1) + testCodeHash := common.BytesToHash([]byte("test_code_hash")) + keeper := unitNetwork.App.GetEVMKeeper() + keeper.SetCode(unitNetwork.GetContext(), testCodeHash.Bytes(), []byte("test_code")) + testCases := []struct { name string expectedError error @@ -52,7 +56,7 @@ func (s *EvmUnitAnteTestSuite) TestVerifyAccountBalance() { txArgs, err := txFactory.GenerateDefaultTxTypeArgs(senderKey.Addr, s.EthTxType) s.Require().NoError(err) - statedbAccount.CodeHash = []byte("test") + statedbAccount.CodeHash = testCodeHash.Bytes() s.Require().NoError(err) return statedbAccount, txArgs }, @@ -214,16 +218,16 @@ func (s *EvmUnitAnteTestSuite) TestVerifyAccountBalance() { s.Run(fmt.Sprintf("%v_%v_%v", evmtypes.GetTxTypeName(s.EthTxType), s.ChainID, tc.name), func() { // Perform test logic statedbAccount, txArgs := tc.generateAccountAndArgs() - txData, err := txArgs.ToTxData() - s.Require().NoError(err) + ethTx := txArgs.ToTx() // Function to be tested - err = evm.VerifyAccountBalance( + err := evm.VerifyAccountBalance( unitNetwork.GetContext(), + unitNetwork.App.GetEVMKeeper(), unitNetwork.App.GetAccountKeeper(), statedbAccount, senderKey.Addr, - txData, + ethTx, ) if tc.expectedError != nil { diff --git a/tests/integration/ante/test_evm_unit_07_can_transfer.go b/tests/integration/ante/test_evm_unit_07_can_transfer.go index a71be5a02..18a9b6fd5 100644 --- a/tests/integration/ante/test_evm_unit_07_can_transfer.go +++ b/tests/integration/ante/test_evm_unit_07_can_transfer.go @@ -41,6 +41,7 @@ func (s *EvmUnitAnteTestSuite) TestCanTransfer() { expectedError: errortypes.ErrInsufficientFee, isLondon: true, malleate: func(txArgs *evmtypes.EvmTxArgs) { + txArgs.GasPrice = nil // make sure it's not legacy tx txArgs.GasFeeCap = big.NewInt(0) }, }, @@ -176,8 +177,7 @@ func (s *EvmUnitAnteTestSuite) TestCanTransfer() { msg.From = senderKey.Addr.Bytes() signMsg, err := txFactory.SignMsgEthereumTx(senderKey.Priv, *msg) s.Require().NoError(err) - coreMsg, err := signMsg.AsMessage(baseFeeResp.BaseFee.BigInt()) - s.Require().NoError(err) + coreMsg := signMsg.AsMessage(baseFeeResp.BaseFee.BigInt()) // Function under test err = evm.CanTransfer( diff --git a/tests/integration/precompiles/distribution/test_distribution.go b/tests/integration/precompiles/distribution/test_distribution.go index 58587a21d..c749828b5 100644 --- a/tests/integration/precompiles/distribution/test_distribution.go +++ b/tests/integration/precompiles/distribution/test_distribution.go @@ -268,8 +268,7 @@ func (s *PrecompileTestSuite) TestRun() { cfg, err := s.network.App.GetEVMKeeper().EVMConfig(ctx, proposerAddress) s.Require().NoError(err, "failed to instantiate EVM config") - msg, err := signedMsg.AsMessage(baseFee) - s.Require().NoError(err, "failed to instantiate Ethereum message") + msg := signedMsg.AsMessage(baseFee) // Instantiate EVM evm := s.network.App.GetEVMKeeper().NewEVM( diff --git a/tests/integration/precompiles/distribution/test_setup.go b/tests/integration/precompiles/distribution/test_setup.go index 8776767c1..2fe56f434 100644 --- a/tests/integration/precompiles/distribution/test_setup.go +++ b/tests/integration/precompiles/distribution/test_setup.go @@ -12,9 +12,12 @@ import ( evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/math" + sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec/address" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -52,6 +55,18 @@ func (s *PrecompileTestSuite) SetupTest() { s.validatorsKeys = generateKeys(3) customGen := network.CustomGenesisState{} + // mint some coin to fee collector + coins := sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(1000000000000000000))) + balances := []banktypes.Balance{ + { + Address: authtypes.NewModuleAddress(authtypes.FeeCollectorName).String(), + Coins: coins, + }, + } + bankGenesis := banktypes.DefaultGenesisState() + bankGenesis.Balances = balances + customGen[banktypes.ModuleName] = bankGenesis + // set some slashing events for integration test distrGen := distrtypes.DefaultGenesisState() if s.withValidatorSlashes { diff --git a/tests/integration/precompiles/staking/test_setup.go b/tests/integration/precompiles/staking/test_setup.go index 7bba26f4a..c20d7d42e 100644 --- a/tests/integration/precompiles/staking/test_setup.go +++ b/tests/integration/precompiles/staking/test_setup.go @@ -18,6 +18,8 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) +const InitialTestBalance = 1000000000000000000 // 1 atom + type PrecompileTestSuite struct { suite.Suite @@ -44,7 +46,7 @@ func (s *PrecompileTestSuite) SetupTest() { keyring := testkeyring.New(2) customGenesis := network.CustomGenesisState{} // mint some coin to fee collector - coins := sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(1000000000000000))) + coins := sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, sdkmath.NewInt(InitialTestBalance))) balances := []banktypes.Balance{ { Address: authtypes.NewModuleAddress(authtypes.FeeCollectorName).String(), diff --git a/tests/integration/rpc/backend/test_backend_suite.go b/tests/integration/rpc/backend/test_backend_suite.go index 24015623d..053bd93c8 100644 --- a/tests/integration/rpc/backend/test_backend_suite.go +++ b/tests/integration/rpc/backend/test_backend_suite.go @@ -125,7 +125,14 @@ func (s *TestSuite) buildEthereumTx() (*evmtypes.MsgEthereumTx, []byte) { bz, err := s.backend.ClientCtx.TxConfig.TxEncoder()(txBuilder.GetTx()) s.Require().NoError(err) - return msgEthereumTx, bz + + // decode again to get canonical representation + tx, err := s.backend.ClientCtx.TxConfig.TxDecoder()(bz) + s.Require().NoError(err) + + msgs := tx.GetMsgs() + s.Require().NotEmpty(msgs) + return msgs[0].(*evmtypes.MsgEthereumTx), bz } // buildEthereumTx returns an example legacy Ethereum transaction @@ -181,7 +188,7 @@ func (s *TestSuite) buildFormattedBlock( s.Require().NoError(err) ethRPCTxs = []interface{}{rpcTx} } else { - ethRPCTxs = []interface{}{common.HexToHash(tx.Hash)} + ethRPCTxs = []interface{}{tx.Hash()} } } diff --git a/tests/integration/rpc/backend/test_blocks.go b/tests/integration/rpc/backend/test_blocks.go index 184f31fdf..bac322d0f 100644 --- a/tests/integration/rpc/backend/test_blocks.go +++ b/tests/integration/rpc/backend/test_blocks.go @@ -1,6 +1,7 @@ package backend import ( + "encoding/json" "fmt" "math/big" @@ -1109,7 +1110,7 @@ func (s *TestSuite) TestGetEthBlockFromTendermint() { s.Require().NoError(err) ethRPCTxs = []interface{}{rpcTx} } else { - ethRPCTxs = []interface{}{common.HexToHash(msgEthereumTx.Hash)} + ethRPCTxs = []interface{}{msgEthereumTx.Hash()} } } @@ -1193,7 +1194,13 @@ func (s *TestSuite) TestEthMsgsFromTendermintBlock() { s.SetupTest() // reset test and queries msgs := s.backend.EthMsgsFromTendermintBlock(tc.resBlock, tc.blockRes) - s.Require().Equal(tc.expMsgs, msgs) + for i, expMsg := range tc.expMsgs { + expBytes, err := json.Marshal(expMsg) + s.Require().Nil(err) + bytes, err := json.Marshal(msgs[i]) + s.Require().Nil(err) + s.Require().Equal(expBytes, bytes) + } }) } } diff --git a/tests/integration/rpc/backend/test_call_tx.go b/tests/integration/rpc/backend/test_call_tx.go index 66eb99140..a35eaba75 100644 --- a/tests/integration/rpc/backend/test_call_tx.go +++ b/tests/integration/rpc/backend/test_call_tx.go @@ -293,7 +293,8 @@ func (s *TestSuite) TestSendRawTransaction() { err := ethTx.Sign(ethSigner, s.signer) s.Require().NoError(err) - rlpEncodedBz, _ := rlp.EncodeToBytes(ethTx.AsTransaction()) + rlpEncodedBz, err := ethTx.AsTransaction().MarshalBinary() + s.Require().NoError(err) evmDenom := evmtypes.GetEVMCoinDenom() testCases := []struct { @@ -366,7 +367,7 @@ func (s *TestSuite) TestSendRawTransaction() { bytes, _ := rlp.EncodeToBytes(ethTx.AsTransaction()) return bytes }, - common.HexToHash(ethTx.Hash), + ethTx.Hash(), errortypes.ErrInvalidRequest.Error(), false, }, @@ -381,7 +382,7 @@ func (s *TestSuite) TestSendRawTransaction() { RegisterBroadcastTx(client, txBytes) }, func() []byte { return rlpEncodedBz }, - common.HexToHash(ethTx.Hash), + ethTx.Hash(), "", true, }, diff --git a/tests/integration/rpc/backend/test_evm_query_client.go b/tests/integration/rpc/backend/test_evm_query_client.go index 6741180ba..cbeed91e9 100644 --- a/tests/integration/rpc/backend/test_evm_query_client.go +++ b/tests/integration/rpc/backend/test_evm_query_client.go @@ -1,6 +1,7 @@ package backend import ( + "bytes" "context" "encoding/json" "fmt" @@ -20,6 +21,7 @@ import ( "github.com/cosmos/evm/testutil/constants" utiltx "github.com/cosmos/evm/testutil/tx" evmtypes "github.com/cosmos/evm/x/vm/types" + proto "github.com/cosmos/gogoproto/proto" "cosmossdk.io/math" @@ -28,6 +30,21 @@ import ( grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" ) +func MatchByProto(exp proto.Message) any { + return mock.MatchedBy(func(req proto.Message) bool { + // compare protobuf encooded value, workaround for *ethtypes.Transaction + expBz, err := proto.Marshal(exp) + if err != nil { + panic(err) + } + bz, err := proto.Marshal(req) + if err != nil { + panic(err) + } + return bytes.Equal(expBz, bz) + }) +} + // QueryClient defines a mocked object that implements the Cosmos EVM GRPC // QueryClient interface. It allows for performing QueryClient queries without having // to run a Cosmos EVM GRPC server. @@ -39,26 +56,26 @@ var _ evmtypes.QueryClient = &mocks.EVMQueryClient{} func RegisterTraceTransactionWithPredecessors(queryClient *mocks.EVMQueryClient, msgEthTx *evmtypes.MsgEthereumTx, predecessors []*evmtypes.MsgEthereumTx) { data := []byte{0x7b, 0x22, 0x74, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x22, 0x7d} queryClient.On("TraceTx", rpc.ContextWithHeight(1), - &evmtypes.QueryTraceTxRequest{Msg: msgEthTx, BlockNumber: 1, Predecessors: predecessors, ChainId: int64(constants.ExampleChainID.EVMChainID), BlockMaxGas: -1}). //nolint:gosec // G115 + MatchByProto(&evmtypes.QueryTraceTxRequest{Msg: msgEthTx, BlockNumber: 1, Predecessors: predecessors, ChainId: int64(constants.ExampleChainID.EVMChainID), BlockMaxGas: -1})). //nolint:gosec // G115 Return(&evmtypes.QueryTraceTxResponse{Data: data}, nil) } func RegisterTraceTransaction(queryClient *mocks.EVMQueryClient, msgEthTx *evmtypes.MsgEthereumTx) { data := []byte{0x7b, 0x22, 0x74, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x22, 0x7d} - queryClient.On("TraceTx", rpc.ContextWithHeight(1), &evmtypes.QueryTraceTxRequest{Msg: msgEthTx, BlockNumber: 1, ChainId: int64(constants.ExampleChainID.EVMChainID), BlockMaxGas: -1}). //nolint:gosec // G115 - Return(&evmtypes.QueryTraceTxResponse{Data: data}, nil) + queryClient.On("TraceTx", rpc.ContextWithHeight(1), MatchByProto(&evmtypes.QueryTraceTxRequest{Msg: msgEthTx, BlockNumber: 1, ChainId: int64(constants.ExampleChainID.EVMChainID), BlockMaxGas: -1})). //nolint:gosec // G115 + Return(&evmtypes.QueryTraceTxResponse{Data: data}, nil) } func RegisterTraceTransactionError(queryClient *mocks.EVMQueryClient, msgEthTx *evmtypes.MsgEthereumTx) { - queryClient.On("TraceTx", rpc.ContextWithHeight(1), &evmtypes.QueryTraceTxRequest{Msg: msgEthTx, BlockNumber: 1, ChainId: int64(constants.ExampleChainID.EVMChainID)}). //nolint:gosec // G115 - Return(nil, errortypes.ErrInvalidRequest) + queryClient.On("TraceTx", rpc.ContextWithHeight(1), MatchByProto(&evmtypes.QueryTraceTxRequest{Msg: msgEthTx, BlockNumber: 1, ChainId: int64(constants.ExampleChainID.EVMChainID)})). //nolint:gosec // G115 + Return(nil, errortypes.ErrInvalidRequest) } // TraceBlock func RegisterTraceBlock(queryClient *mocks.EVMQueryClient, txs []*evmtypes.MsgEthereumTx) { data := []byte{0x7b, 0x22, 0x74, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x22, 0x7d} queryClient.On("TraceBlock", rpc.ContextWithHeight(1), - &evmtypes.QueryTraceBlockRequest{Txs: txs, BlockNumber: 1, TraceConfig: &evmtypes.TraceConfig{}, ChainId: int64(constants.ExampleChainID.EVMChainID), BlockMaxGas: -1}). //nolint:gosec // G115 + MatchByProto(&evmtypes.QueryTraceBlockRequest{Txs: txs, BlockNumber: 1, TraceConfig: &evmtypes.TraceConfig{}, ChainId: int64(constants.ExampleChainID.EVMChainID), BlockMaxGas: -1})). //nolint:gosec // G115 Return(&evmtypes.QueryTraceBlockResponse{Data: data}, nil) } diff --git a/tests/integration/rpc/backend/test_sign_tx.go b/tests/integration/rpc/backend/test_sign_tx.go index b804de5c6..d3df0a77a 100644 --- a/tests/integration/rpc/backend/test_sign_tx.go +++ b/tests/integration/rpc/backend/test_sign_tx.go @@ -22,9 +22,11 @@ import ( signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" ) +const MinIntrinsicGas = 21000 + func (s *TestSuite) TestSendTransaction() { gasPrice := new(hexutil.Big) - gas := hexutil.Uint64(1) + gas := hexutil.Uint64(MinIntrinsicGas) zeroGas := hexutil.Uint64(0) toAddr := utiltx.GenerateAddress() priv, _ := ethsecp256k1.GenerateKey() @@ -127,7 +129,7 @@ func (s *TestSuite) TestSendTransaction() { // Sign the transaction and get the hash ethSigner := ethtypes.LatestSigner(s.backend.ChainConfig()) - msg := callArgsDefault.ToTransaction() + msg := evmtypes.NewTxFromArgs(&callArgsDefault) err := msg.Sign(ethSigner, s.backend.ClientCtx.Keyring) s.Require().NoError(err) tc.expHash = msg.AsTransaction().Hash() @@ -253,7 +255,7 @@ func broadcastTx(suite *TestSuite, priv *ethsecp256k1.PrivKey, baseFee math.Int, suite.Require().NoError(err) RegisterBaseFee(QueryClient, baseFee) ethSigner := ethtypes.LatestSigner(suite.backend.ChainConfig()) - msg := callArgsDefault.ToTransaction() + msg := evmtypes.NewTxFromArgs(&callArgsDefault) err = msg.Sign(ethSigner, suite.backend.ClientCtx.Keyring) suite.Require().NoError(err) baseDenom := evmtypes.GetEVMCoinDenom() diff --git a/tests/integration/rpc/backend/test_tx_info.go b/tests/integration/rpc/backend/test_tx_info.go index c9dfb8344..969476b4f 100644 --- a/tests/integration/rpc/backend/test_tx_info.go +++ b/tests/integration/rpc/backend/test_tx_info.go @@ -120,7 +120,7 @@ func (s *TestSuite) TestGetTransactionByHash() { err := s.backend.Indexer.IndexBlock(block, responseDeliver) s.Require().NoError(err) - rpcTx, err := s.backend.GetTransactionByHash(common.HexToHash(tc.tx.Hash)) + rpcTx, err := s.backend.GetTransactionByHash(tc.tx.Hash()) if tc.expPass { s.Require().NoError(err) @@ -180,7 +180,7 @@ func (s *TestSuite) TestGetTransactionsByHashPending() { s.SetupTest() // reset tc.registerMock() - rpcTx, err := s.backend.GetTransactionByHashPending(common.HexToHash(tc.tx.Hash)) + rpcTx, err := s.backend.GetTransactionByHashPending(tc.tx.Hash()) if tc.expPass { s.Require().NoError(err) @@ -208,7 +208,7 @@ func (s *TestSuite) TestGetTxByEthHash() { func() { s.backend.Indexer = nil client := s.backend.ClientCtx.Client.(*mocks.Client) - query := fmt.Sprintf("%s.%s='%s'", evmtypes.TypeMsgEthereumTx, evmtypes.AttributeKeyEthereumTxHash, common.HexToHash(msgEthereumTx.Hash).Hex()) + query := fmt.Sprintf("%s.%s='%s'", evmtypes.TypeMsgEthereumTx, evmtypes.AttributeKeyEthereumTxHash, msgEthereumTx.Hash().Hex()) RegisterTxSearch(client, query, bz) }, msgEthereumTx, @@ -222,7 +222,7 @@ func (s *TestSuite) TestGetTxByEthHash() { s.SetupTest() // reset tc.registerMock() - rpcTx, err := s.backend.GetTxByEthHash(common.HexToHash(tc.tx.Hash)) + rpcTx, err := s.backend.GetTxByEthHash(tc.tx.Hash()) if tc.expPass { s.Require().NoError(err) @@ -294,7 +294,7 @@ func (s *TestSuite) TestGetTransactionByBlockAndIndex() { Code: 0, Events: []abci.Event{ {Type: evmtypes.EventTypeEthereumTx, Attributes: []abci.EventAttribute{ - {Key: "ethereumTxHash", Value: common.HexToHash(msgEthTx.Hash).Hex()}, + {Key: "ethereumTxHash", Value: msgEthTx.Hash().Hex()}, {Key: "txIndex", Value: "0"}, {Key: "amount", Value: "1000"}, {Key: "txGasUsed", Value: "21000"}, @@ -688,10 +688,9 @@ func (s *TestSuite) TestGetTransactionReceipt() { err := s.backend.Indexer.IndexBlock(tc.block, tc.blockResult) s.Require().NoError(err) - hash := common.HexToHash(tc.tx.Hash) - res, err := s.backend.GetTransactionReceipt(hash) + res, err := s.backend.GetTransactionReceipt(tc.tx.Hash()) if tc.expPass { - s.Require().Equal(res["transactionHash"], hash) + s.Require().Equal(res["transactionHash"], tc.tx.Hash()) s.Require().Equal(res["blockNumber"], hexutil.Uint64(tc.block.Height)) //nolint: gosec // G115 requiredFields := []string{"status", "cumulativeGasUsed", "logsBloom", "logs", "gasUsed", "blockHash", "blockNumber", "transactionIndex", "effectiveGasPrice", "from", "to", "type"} for _, field := range requiredFields { diff --git a/tests/integration/x/vm/state_transition_benchmark.go b/tests/integration/x/vm/state_transition_benchmark.go index b735d5e6d..e3e0a2c93 100644 --- a/tests/integration/x/vm/state_transition_benchmark.go +++ b/tests/integration/x/vm/state_transition_benchmark.go @@ -8,6 +8,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/holiman/uint256" "github.com/stretchr/testify/require" utiltx "github.com/cosmos/evm/testutil/tx" @@ -43,6 +44,16 @@ var templateDynamicFeeTx = ðtypes.DynamicFeeTx{ Data: []byte{}, } +var templateSetCodeTx = ðtypes.SetCodeTx{ + GasFeeCap: uint256.NewInt(10), + GasTipCap: uint256.NewInt(2), + Gas: 21000, + To: common.Address{}, + Value: uint256.NewInt(0), + Data: []byte{}, + AuthList: []ethtypes.SetCodeAuthorization{}, +} + func newSignedEthTx( txData ethtypes.TxData, nonce uint64, @@ -76,7 +87,7 @@ func newSignedEthTx( } var msg evmtypes.MsgEthereumTx - if err := msg.FromEthereumTx(ethTx); err != nil { + if err := msg.FromSignedEthereumTx(ethTx, ethSigner); err != nil { return nil, err } return &msg, nil @@ -90,6 +101,7 @@ func newEthMsgTx( txType byte, data []byte, accessList ethtypes.AccessList, + authList []ethtypes.SetCodeAuthorization, ) (*evmtypes.MsgEthereumTx, *big.Int, error) { var ( ethTx *ethtypes.Transaction @@ -123,16 +135,23 @@ func newEthMsgTx( templateAccessListTx.AccessList = accessList ethTx = ethtypes.NewTx(templateDynamicFeeTx) baseFee = big.NewInt(3) + case ethtypes.SetCodeTxType: + templateSetCodeTx.Nonce = nonce + + if data != nil { + templateSetCodeTx.Data = data + } else { + templateSetCodeTx.Data = []byte{} + } + templateSetCodeTx.AuthList = authList + ethTx = ethtypes.NewTx(templateSetCodeTx) + baseFee = big.NewInt(3) default: return nil, baseFee, errors.New("unsupported tx type") } msg := &evmtypes.MsgEthereumTx{} - err := msg.FromEthereumTx(ethTx) - if err != nil { - return nil, nil, err - } - + msg.FromEthereumTx(ethTx) msg.From = address.Bytes() return msg, baseFee, msg.Sign(ethSigner, krSigner) @@ -146,18 +165,14 @@ func newNativeMessage( txType byte, data []byte, accessList ethtypes.AccessList, + authorizationList []ethtypes.SetCodeAuthorization, //nolint:unparam ) (*core.Message, error) { - msg, baseFee, err := newEthMsgTx(nonce, address, krSigner, ethSigner, txType, data, accessList) + msg, baseFee, err := newEthMsgTx(nonce, address, krSigner, ethSigner, txType, data, accessList, authorizationList) if err != nil { return nil, err } - m, err := msg.AsMessage(baseFee) - if err != nil { - return nil, err - } - - return m, nil + return msg.AsMessage(baseFee), nil } func BenchmarkApplyTransaction(b *testing.B) { //nolint:dupl @@ -268,6 +283,7 @@ func BenchmarkApplyMessage(b *testing.B) { ethtypes.AccessListTxType, nil, nil, + nil, ) require.NoError(b, err) @@ -301,6 +317,7 @@ func BenchmarkApplyMessageWithLegacyTx(b *testing.B) { ethtypes.AccessListTxType, nil, nil, + nil, ) require.NoError(b, err) @@ -334,6 +351,7 @@ func BenchmarkApplyMessageWithDynamicFeeTx(b *testing.B) { ethtypes.DynamicFeeTxType, nil, nil, + nil, ) require.NoError(b, err) diff --git a/tests/integration/x/vm/test_benchmark.go b/tests/integration/x/vm/test_benchmark.go index dea5051ce..77847f070 100644 --- a/tests/integration/x/vm/test_benchmark.go +++ b/tests/integration/x/vm/test_benchmark.go @@ -72,11 +72,7 @@ func DoBenchmark(b *testing.B, txBuilder TxBuilder) { for i := 0; i < b.N; i++ { ctx, _ := suite.Network.GetContext().CacheContext() - // deduct fee first - txData, err := types.UnpackTxData(msg.Data) - require.NoError(b, err) - - fees := sdk.Coins{sdk.NewCoin(suite.EvmDenom(), sdkmath.NewIntFromBigInt(txData.Fee()))} + fees := sdk.Coins{sdk.NewCoin(suite.EvmDenom(), sdkmath.NewIntFromBigInt(msg.GetFee()))} err = authante.DeductFees(suite.Network.App.GetBankKeeper(), suite.Network.GetContext(), suite.Network.App.GetAccountKeeper().GetAccount(ctx, msg.GetFrom()), fees) require.NoError(b, err) @@ -201,11 +197,7 @@ func BenchmarkMessageCall(b *testing.B) { for i := 0; i < b.N; i++ { ctx, _ := suite.Network.GetContext().CacheContext() - // deduct fee first - txData, err := types.UnpackTxData(msg.Data) - require.NoError(b, err) - - fees := sdk.Coins{sdk.NewCoin(suite.EvmDenom(), sdkmath.NewIntFromBigInt(txData.Fee()))} + fees := sdk.Coins{sdk.NewCoin(suite.EvmDenom(), sdkmath.NewIntFromBigInt(msg.GetFee()))} err = authante.DeductFees(suite.Network.App.GetBankKeeper(), suite.Network.GetContext(), suite.Network.App.GetAccountKeeper().GetAccount(ctx, msg.GetFrom()), fees) require.NoError(b, err) diff --git a/tests/integration/x/vm/test_fees.go b/tests/integration/x/vm/test_fees.go index 2517488e1..f3cf852a6 100644 --- a/tests/integration/x/vm/test_fees.go +++ b/tests/integration/x/vm/test_fees.go @@ -249,14 +249,12 @@ func (s *KeeperTestSuite) TestCheckSenderBalance() { Accesses: tc.accessList, } tx := evmtypes.NewTx(ethTxParams) - tx.From = tc.from - - txData, _ := evmtypes.UnpackTxData(tx.Data) + tx.From = to.Bytes() acct := s.Network.App.GetEVMKeeper().GetAccountOrEmpty(s.Network.GetContext(), addr) err := keeper.CheckSenderBalance( sdkmath.NewIntFromBigInt(acct.Balance.ToBig()), - txData, + tx.AsTransaction(), ) if tc.expectPass { @@ -502,14 +500,14 @@ func (s *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { tx := evmtypes.NewTx(ethTxParams) tx.From = tc.from - txData, _ := evmtypes.UnpackTxData(tx.Data) + ethTx := tx.AsTransaction() baseFee := s.Network.App.GetEVMKeeper().GetBaseFee(s.Network.GetContext()) - priority := evmtypes.GetTxPriority(txData, baseFee) + priority := evmtypes.GetTxPriority(ethTx, baseFee) baseDenom := evmtypes.GetEVMCoinDenom() - fees, err := keeper.VerifyFee(txData, baseDenom, baseFee, false, false, false, s.Network.GetContext().IsCheckTx()) + fees, err := keeper.VerifyFee(ethTx, baseDenom, baseFee, false, false, false, s.Network.GetContext().IsCheckTx()) if tc.expectPassVerify { s.Require().NoError(err, "valid test %d failed - '%s'", i, tc.name) if tc.EnableFeemarket { @@ -517,7 +515,7 @@ func (s *KeeperTestSuite) TestVerifyFeeAndDeductTxCostsFromUserBalance() { s.Require().Equal( fees, sdk.NewCoins( - sdk.NewCoin(baseDenom, sdkmath.NewIntFromBigInt(txData.EffectiveFee(baseFee.TruncateInt().BigInt()))), + sdk.NewCoin(baseDenom, sdkmath.NewIntFromBigInt(tx.GetEffectiveFee(baseFee.TruncateInt().BigInt()))), ), "valid test %d failed, fee value is wrong - '%s'", i, tc.name, ) diff --git a/tests/integration/x/vm/test_msg_server.go b/tests/integration/x/vm/test_msg_server.go index 87c8fe158..510a3f1b6 100644 --- a/tests/integration/x/vm/test_msg_server.go +++ b/tests/integration/x/vm/test_msg_server.go @@ -15,24 +15,19 @@ func (s *KeeperTestSuite) TestEthereumTx() { s.EnableFeemarket = true defer func() { s.EnableFeemarket = false }() s.SetupTest() + + args := types.EvmTxArgs{ + // Have insufficient gas + GasLimit: 10, + } + _, err := s.Factory.GenerateSignedEthTx(s.Keyring.GetPrivKey(0), args) + s.Require().Error(err) + testCases := []struct { name string getMsg func() *types.MsgEthereumTx expectedErr error }{ - { - "fail - insufficient gas", - func() *types.MsgEthereumTx { - args := types.EvmTxArgs{ - // Have insufficient gas - GasLimit: 10, - } - tx, err := s.Factory.GenerateSignedEthTx(s.Keyring.GetPrivKey(0), args) - s.Require().NoError(err) - return tx.GetMsgs()[0].(*types.MsgEthereumTx) - }, - types.ErrInvalidGasCap, - }, { "success - transfer funds tx", func() *types.MsgEthereumTx { diff --git a/tests/integration/x/vm/test_state_transition.go b/tests/integration/x/vm/test_state_transition.go index d39e2f096..9f6f1e951 100644 --- a/tests/integration/x/vm/test_state_transition.go +++ b/tests/integration/x/vm/test_state_transition.go @@ -325,6 +325,7 @@ func (s *KeeperTestSuite) TestGetEthIntrinsicGas() { gethtypes.AccessListTxType, tc.data, tc.accessList, + nil, ) s.Require().NoError(err) diff --git a/tests/integration/x/vm/test_statedb.go b/tests/integration/x/vm/test_statedb.go index 4df90afdf..fe801ac04 100644 --- a/tests/integration/x/vm/test_statedb.go +++ b/tests/integration/x/vm/test_statedb.go @@ -828,7 +828,7 @@ func (s *KeeperTestSuite) TestAddAddressToAccessList() { vmdb := s.StateDB() vmdb.AddAddressToAccessList(tc.addr) addrOk := vmdb.AddressInAccessList(tc.addr) - s.Require().True(addrOk, tc.addr.Hex()) + s.Require().True(addrOk, tc.addr.Bytes()) }) } } @@ -850,7 +850,7 @@ func (s *KeeperTestSuite) TestAddSlotToAccessList() { vmdb := s.StateDB() vmdb.AddSlotToAccessList(tc.addr, tc.slot) addrOk, slotOk := vmdb.SlotInAccessList(tc.addr, tc.slot) - s.Require().True(addrOk, tc.addr.Hex()) + s.Require().True(addrOk, tc.addr.Bytes()) s.Require().True(slotOk, tc.slot.Hex()) }) } diff --git a/testutil/tx/eth.go b/testutil/tx/eth.go index 6bbb41bd8..9a6b65540 100644 --- a/testutil/tx/eth.go +++ b/testutil/tx/eth.go @@ -52,6 +52,7 @@ func PrepareEthTx( return nil, err } } + txGasLimit += msg.GetGas() txFee = txFee.Add(sdk.Coin{Denom: baseDenom, Amount: sdkmath.NewIntFromBigInt(msg.GetFee())}) } @@ -135,6 +136,7 @@ func CreateEthTx( } msgEthereumTx := evmtypes.NewTx(evmTxParams) msgEthereumTx.From = fromAddr.Bytes() + // If we are creating multiple eth Tx's with different senders, we need to sign here rather than later. if privKey != nil { signer := ethtypes.LatestSignerForChainID(evmtypes.GetEthChainConfig().ChainID) diff --git a/x/erc20/types/genesis.pb.go b/x/erc20/types/genesis.pb.go index 73858d713..45741d13e 100644 --- a/x/erc20/types/genesis.pb.go +++ b/x/erc20/types/genesis.pb.go @@ -5,13 +5,12 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "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. diff --git a/x/vm/keeper/fees.go b/x/vm/keeper/fees.go index c79c71bdf..a5569fa18 100644 --- a/x/vm/keeper/fees.go +++ b/x/vm/keeper/fees.go @@ -7,8 +7,6 @@ import ( "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/cosmos/evm/x/vm/types" - errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" @@ -21,9 +19,9 @@ import ( // sender has enough funds to pay for the fees and value of the transaction. func CheckSenderBalance( balance sdkmath.Int, - txData types.TxData, + ethTx *ethtypes.Transaction, ) error { - cost := txData.Cost() + cost := ethTx.Cost() if cost.Sign() < 0 { return errorsmod.Wrapf( @@ -67,27 +65,22 @@ func (k *Keeper) DeductTxCostsFromUserBalance( // gas limit is not reached, the gas limit is higher than the intrinsic gas and that the // base fee is higher than the gas fee cap. func VerifyFee( - txData types.TxData, + ethTx *ethtypes.Transaction, denom string, baseFee *big.Int, homestead, istanbul, shanghai, isCheckTx bool, ) (sdk.Coins, error) { - isContractCreation := txData.GetTo() == nil + isContractCreation := ethTx.To() == nil - gasLimit := txData.GetGas() + gasLimit := ethTx.Gas() var accessList ethtypes.AccessList - if txData.GetAccessList() != nil { - accessList = txData.GetAccessList() - } - - var authList []ethtypes.SetCodeAuthorization - ethTx := ethtypes.NewTx(txData.AsEthereumData()) - if ethTx != nil { - authList = ethTx.SetCodeAuthorizations() + if ethTx.AccessList() != nil { + accessList = ethTx.AccessList() } - intrinsicGas, err := core.IntrinsicGas(txData.GetData(), accessList, authList, isContractCreation, homestead, + authList := ethTx.SetCodeAuthorizations() + intrinsicGas, err := core.IntrinsicGas(ethTx.Data(), accessList, authList, isContractCreation, homestead, istanbul, shanghai) if err != nil { return nil, errorsmod.Wrapf( @@ -105,14 +98,17 @@ func VerifyFee( ) } - if baseFee != nil && txData.GetGasFeeCap().Cmp(baseFee) < 0 { + if baseFee != nil && ethTx.GasFeeCap().Cmp(baseFee) < 0 { return nil, errorsmod.Wrapf(errortypes.ErrInsufficientFee, "the tx gasfeecap is lower than the tx baseFee: %s (gasfeecap), %s (basefee) ", - txData.GetGasFeeCap(), + ethTx.GasFeeCap(), baseFee) } - feeAmt := txData.EffectiveFee(baseFee) + gasTip, _ := ethTx.EffectiveGasTip(baseFee) + price := new(big.Int).Add(gasTip, baseFee) + gas := new(big.Int).SetUint64(ethTx.Gas()) + feeAmt := gas.Mul(gas, price) if feeAmt.Sign() == 0 { // zero fee, no need to deduct return sdk.Coins{}, nil diff --git a/x/vm/keeper/grpc_query.go b/x/vm/keeper/grpc_query.go index 20589a835..e4bf7c2ff 100644 --- a/x/vm/keeper/grpc_query.go +++ b/x/vm/keeper/grpc_query.go @@ -246,15 +246,15 @@ func (k Keeper) EthCall(c context.Context, req *types.EthCallRequest) (*types.Ms nonce := k.GetNonce(ctx, args.GetFrom()) args.Nonce = (*hexutil.Uint64)(&nonce) - msg, err := args.ToMessage(req.GasCap, cfg.BaseFee, false, false) - if err != nil { + if err := args.CallDefaults(req.GasCap, cfg.BaseFee, types.GetEthChainConfig().ChainID); err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } + msg := args.ToMessage(cfg.BaseFee, false, false) txConfig := statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash())) // pass false to not commit StateDB - res, err := k.ApplyMessageWithConfig(ctx, msg, nil, false, cfg, txConfig, false) + res, err := k.ApplyMessageWithConfig(ctx, *msg, nil, false, cfg, txConfig, false) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } @@ -326,11 +326,15 @@ func (k Keeper) EstimateGasInternal(c context.Context, req *types.EthCallRequest txConfig := statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash())) - // convert the tx args to an ethereum message - msg, err := args.ToMessage(req.GasCap, cfg.BaseFee, true, true) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) + if args.Gas == nil { + args.Gas = new(hexutil.Uint64) } + if err := args.CallDefaults(req.GasCap, cfg.BaseFee, types.GetEthChainConfig().ChainID); err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + // convert the tx args to an ethereum message + msg := args.ToMessage(cfg.BaseFee, true, true) // Recap the highest gas limit with account's available balance. if msg.GasFeeCap.BitLen() != 0 { @@ -390,7 +394,7 @@ func (k Keeper) EstimateGasInternal(c context.Context, req *types.EthCallRequest tmpCtx = buildTraceCtx(tmpCtx, msg.GasLimit) } // pass false to not commit StateDB - rsp, err = k.ApplyMessageWithConfig(tmpCtx, msg, nil, false, cfg, txConfig, false) + rsp, err = k.ApplyMessageWithConfig(tmpCtx, *msg, nil, false, cfg, txConfig, false) if err != nil { if errors.Is(err, core.ErrIntrinsicGas) { return true, nil, nil // Special case, raise gas limit diff --git a/x/vm/keeper/state_transition.go b/x/vm/keeper/state_transition.go index 2c518878d..db49e80c1 100644 --- a/x/vm/keeper/state_transition.go +++ b/x/vm/keeper/state_transition.go @@ -1,6 +1,7 @@ package keeper import ( + "fmt" "math/big" "github.com/ethereum/go-ethereum/common" @@ -397,6 +398,24 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace ret, _, leftoverGas, vmErr = evm.Create(sender.Address(), msg.Data, leftoverGas, convertedValue) stateDB.SetNonce(sender.Address(), msg.Nonce+1, tracing.NonceChangeContractCreator) } else { + // Apply EIP-7702 authorizations. + if msg.SetCodeAuthorizations != nil { + for _, auth := range msg.SetCodeAuthorizations { + // Note errors are ignored, we simply skip invalid authorizations here. + if err := k.applyAuthorization(&auth, stateDB, ethCfg.ChainID); err != nil { + k.Logger(ctx).Debug("failed to apply authorization", "error", err, "authorization", auth) + } + } + } + + // Perform convenience warming of sender's delegation target. Although the + // sender is already warmed in Prepare(..), it's possible a delegation to + // the account was deployed during this transaction. To handle correctly, + // simply wait until the final state of delegations is determined before + // performing the resolution and warming. + if addr, ok := ethtypes.ParseDelegation(stateDB.GetCode(*msg.To)); ok { + stateDB.AddAddressToAccessList(addr) + } ret, leftoverGas, vmErr = evm.Call(sender.Address(), *msg.To, msg.Data, leftoverGas, convertedValue) } @@ -486,3 +505,61 @@ func (k *Keeper) SetConsensusParamsInCtx(ctx sdk.Context) sdk.Context { } return ctx.WithConsensusParams(*res.Params) } + +// applyAuthorization applies an EIP-7702 code delegation to the state. +func (k *Keeper) applyAuthorization(auth *ethtypes.SetCodeAuthorization, state vm.StateDB, chainID *big.Int) error { + authority, err := k.validateAuthorization(auth, state, chainID) + if err != nil { + return err + } + + // If the account already exists in state, refund the new account cost + // charged in the intrinsic calculation. + if state.Exist(authority) { + state.AddRefund(params.CallNewAccountGas - params.TxAuthTupleGas) + } + + // Update nonce and account code. + state.SetNonce(authority, auth.Nonce+1, tracing.NonceChangeAuthorization) + if auth.Address == (common.Address{}) { + // Delegation to zero address means clear. + state.SetCode(authority, nil) + return nil + } + + // Otherwise install delegation to auth.Address. + state.SetCode(authority, ethtypes.AddressToDelegation(auth.Address)) + + return nil +} + +// validateAuthorization validates an EIP-7702 authorization against the state. +func (k *Keeper) validateAuthorization(auth *ethtypes.SetCodeAuthorization, state vm.StateDB, chainID *big.Int) (authority common.Address, err error) { + // Verify chain ID is null or equal to current chain ID. + if !auth.ChainID.IsZero() && auth.ChainID.CmpBig(chainID) != 0 { + return authority, core.ErrAuthorizationWrongChainID + } + // Limit nonce to 2^64-1 per EIP-2681. + if auth.Nonce+1 < auth.Nonce { + return authority, core.ErrAuthorizationNonceOverflow + } + // Validate signature values and recover authority. + authority, err = auth.Authority() + if err != nil { + return authority, fmt.Errorf("%w: %v", core.ErrAuthorizationInvalidSignature, err) + } + // Check the authority account + // 1) doesn't have code or has exisiting delegation + // 2) matches the auth's nonce + // + // Note it is added to the access list even if the authorization is invalid. + state.AddAddressToAccessList(authority) + code := state.GetCode(authority) + if _, ok := ethtypes.ParseDelegation(code); len(code) != 0 && !ok { + return authority, core.ErrAuthorizationDestinationHasCode + } + if have := state.GetNonce(authority); have != auth.Nonce { + return authority, core.ErrAuthorizationNonceMismatch + } + return authority, nil +} diff --git a/x/vm/types/access_list.go b/x/vm/types/access_list.go deleted file mode 100644 index 9f099ff79..000000000 --- a/x/vm/types/access_list.go +++ /dev/null @@ -1,55 +0,0 @@ -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 := make(AccessList, 0, len(*ethAccessList)) - 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 { - ethAccessList := make(ethtypes.AccessList, 0, len(al)) - - 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/x/vm/types/access_list_test.go b/x/vm/types/access_list_test.go deleted file mode 100644 index b15e23f6f..000000000 --- a/x/vm/types/access_list_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package types_test - -import ( - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - - "github.com/cosmos/evm/x/vm/types" -) - -func (suite *TxDataTestSuite) TestTestNewAccessList() { - testCases := []struct { - name string - ethAccessList *ethtypes.AccessList - expAl types.AccessList - }{ - { - "ethAccessList is nil", - nil, - nil, - }, - { - "non-empty ethAccessList", - ðtypes.AccessList{{Address: suite.addr, StorageKeys: []common.Hash{{0}}}}, - types.AccessList{{Address: suite.hexAddr, StorageKeys: []string{common.Hash{}.Hex()}}}, - }, - } - for _, tc := range testCases { - al := types.NewAccessList(tc.ethAccessList) - - suite.Require().Equal(tc.expAl, al) - } -} - -func (suite *TxDataTestSuite) TestAccessListToEthAccessList() { - ethAccessList := ethtypes.AccessList{{Address: suite.addr, StorageKeys: []common.Hash{{0}}}} - al := types.NewAccessList(ðAccessList) - actual := al.ToEthAccessList() - - suite.Require().Equal(ðAccessList, actual) -} diff --git a/x/vm/types/access_list_tx.go b/x/vm/types/access_list_tx.go deleted file mode 100644 index 3b1e83587..000000000 --- a/x/vm/types/access_list_tx.go +++ /dev/null @@ -1,251 +0,0 @@ -package types - -import ( - "math/big" - - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - - "github.com/cosmos/evm/types" - ethutils "github.com/cosmos/evm/utils/eth" - - errorsmod "cosmossdk.io/errors" - sdkmath "cosmossdk.io/math" - - errortypes "github.com/cosmos/cosmos-sdk/types/errors" -) - -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 ethutils.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/x/vm/types/access_list_tx_test.go b/x/vm/types/access_list_tx_test.go deleted file mode 100644 index 15ef697af..000000000 --- a/x/vm/types/access_list_tx_test.go +++ /dev/null @@ -1,169 +0,0 @@ -package types_test - -import ( - "math/big" - - ethtypes "github.com/ethereum/go-ethereum/core/types" - - "github.com/cosmos/evm/x/vm/types" -) - -func (suite *TxDataTestSuite) TestAccessListTxCopy() { - tx := &types.AccessListTx{} - txCopy := tx.Copy() - - suite.Require().Equal(&types.AccessListTx{}, txCopy) -} - -func (suite *TxDataTestSuite) TestAccessListTxGetGasTipCap() { - testCases := []struct { - name string - tx types.AccessListTx - exp *big.Int - }{ - { - "non-empty gasPrice", - types.AccessListTx{ - GasPrice: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetGasTipCap() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestAccessListTxGetGasFeeCap() { - testCases := []struct { - name string - tx types.AccessListTx - exp *big.Int - }{ - { - "non-empty gasPrice", - types.AccessListTx{ - GasPrice: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetGasFeeCap() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestEmptyAccessList() { - testCases := []struct { - name string - tx types.AccessListTx - }{ - { - "empty access list tx", - types.AccessListTx{ - Accesses: nil, - }, - }, - } - for _, tc := range testCases { - actual := tc.tx.GetAccessList() - - suite.Require().Nil(actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestAccessListTxCost() { - testCases := []struct { - name string - tx types.AccessListTx - exp *big.Int - }{ - { - "non-empty access list tx", - types.AccessListTx{ - GasPrice: &suite.sdkInt, - GasLimit: uint64(1), - Amount: &suite.sdkZeroInt, - }, - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.Cost() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestAccessListEffectiveGasPrice() { - testCases := []struct { - name string - tx types.AccessListTx - baseFee *big.Int - }{ - { - "non-empty access list tx", - types.AccessListTx{ - GasPrice: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.EffectiveGasPrice(tc.baseFee) - - suite.Require().Equal(tc.tx.GetGasPrice(), actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestAccessListTxEffectiveCost() { - testCases := []struct { - name string - tx types.AccessListTx - baseFee *big.Int - exp *big.Int - }{ - { - "non-empty access list tx", - types.AccessListTx{ - GasPrice: &suite.sdkInt, - GasLimit: uint64(1), - Amount: &suite.sdkZeroInt, - }, - (&suite.sdkInt).BigInt(), - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.EffectiveCost(tc.baseFee) - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestAccessListTxType() { - testCases := []struct { - name string - tx types.AccessListTx - }{ - { - "non-empty access list tx", - types.AccessListTx{}, - }, - } - - for _, tc := range testCases { - actual := tc.tx.TxType() - - suite.Require().Equal(uint8(ethtypes.AccessListTxType), actual, tc.name) - } -} diff --git a/x/vm/types/codec.go b/x/vm/types/codec.go index 2772643df..12a73c656 100644 --- a/x/vm/types/codec.go +++ b/x/vm/types/codec.go @@ -1,14 +1,9 @@ package types import ( - proto "github.com/cosmos/gogoproto/proto" - - 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" ) @@ -45,49 +40,10 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MsgEthereumTx{}, &MsgUpdateParams{}, ) - registry.RegisterInterface( - "os.vm.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(anyTxData *codectypes.Any) (TxData, error) { - if anyTxData == nil { - return nil, errorsmod.Wrap(errortypes.ErrUnpackAny, "protobuf Any message cannot be nil") - } - - txData, ok := anyTxData.GetCachedValue().(TxData) - if !ok { - return nil, errorsmod.Wrapf(errortypes.ErrUnpackAny, "cannot unpack Any into TxData %T", anyTxData) - } - - return txData, nil -} - // RegisterLegacyAminoCodec required for EIP-712 func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgUpdateParams{}, updateParamsName, nil) diff --git a/x/vm/types/codec_test.go b/x/vm/types/codec_test.go deleted file mode 100644 index f1f58eda6..000000000 --- a/x/vm/types/codec_test.go +++ /dev/null @@ -1,62 +0,0 @@ -package types - -import ( - "testing" - - "github.com/stretchr/testify/require" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" -) - -type caseAny struct { - name string - any *codectypes.Any - expPass bool -} - -func TestPackTxData(t *testing.T) { - testCases := []struct { - name string - txData TxData - expPass bool - }{ - { - "access list tx", - &AccessListTx{}, - true, - }, - { - "legacy tx", - &LegacyTx{}, - true, - }, - { - "nil", - nil, - false, - }, - } - - testCasesAny := []caseAny{} - - for _, tc := range testCases { - txDataAny, err := PackTxData(tc.txData) - if tc.expPass { - require.NoError(t, err, tc.name) - } else { - require.Error(t, err, tc.name) - } - - testCasesAny = append(testCasesAny, caseAny{tc.name, txDataAny, tc.expPass}) - } - - for i, tc := range testCasesAny { - cs, err := UnpackTxData(tc.any) - if tc.expPass { - require.NoError(t, err, tc.name) - require.Equal(t, testCases[i].txData, cs, tc.name) - } else { - require.Error(t, err, tc.name) - } - } -} diff --git a/x/vm/types/dynamic_fee_tx.go b/x/vm/types/dynamic_fee_tx.go deleted file mode 100644 index 728af1e5a..000000000 --- a/x/vm/types/dynamic_fee_tx.go +++ /dev/null @@ -1,283 +0,0 @@ -package types - -import ( - "math/big" - - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - - "github.com/cosmos/evm/types" - ethutils "github.com/cosmos/evm/utils/eth" - - errorsmod "cosmossdk.io/errors" - sdkmath "cosmossdk.io/math" - - errortypes "github.com/cosmos/cosmos-sdk/types/errors" -) - -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 ethutils.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 DynamicFee txs", - ) - } - - return nil -} - -// Fee returns gasprice * gaslimit. -func (tx DynamicFeeTx) Fee() *big.Int { - return fee(tx.GetGasFeeCap(), tx.GetGas()) -} - -// 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.GetGas()) -} - -// 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/x/vm/types/dynamic_fee_tx_test.go b/x/vm/types/dynamic_fee_tx_test.go deleted file mode 100644 index 528e8c41c..000000000 --- a/x/vm/types/dynamic_fee_tx_test.go +++ /dev/null @@ -1,676 +0,0 @@ -package types_test - -import ( - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/stretchr/testify/suite" - - utiltx "github.com/cosmos/evm/testutil/tx" - "github.com/cosmos/evm/x/vm/types" - - sdkmath "cosmossdk.io/math" -) - -type TxDataTestSuite struct { - suite.Suite - - sdkInt sdkmath.Int - uint64 uint64 - hexUint64 hexutil.Uint64 - bigInt *big.Int - hexBigInt hexutil.Big - overflowBigInt *big.Int - sdkZeroInt sdkmath.Int - sdkMinusOneInt sdkmath.Int - invalidAddr string - addr common.Address - hexAddr string - hexDataBytes hexutil.Bytes - hexInputBytes hexutil.Bytes -} - -func (suite *TxDataTestSuite) SetupTest() { - suite.sdkInt = sdkmath.NewInt(9001) - suite.uint64 = suite.sdkInt.Uint64() - suite.hexUint64 = hexutil.Uint64(100) - suite.bigInt = big.NewInt(1) - suite.hexBigInt = hexutil.Big(*big.NewInt(1)) - suite.overflowBigInt = big.NewInt(0).Exp(big.NewInt(10), big.NewInt(256), nil) - suite.sdkZeroInt = sdkmath.ZeroInt() - suite.sdkMinusOneInt = sdkmath.NewInt(-1) - suite.invalidAddr = "123456" - suite.addr = utiltx.GenerateAddress() - suite.hexAddr = suite.addr.Hex() - suite.hexDataBytes = hexutil.Bytes([]byte("data")) - suite.hexInputBytes = hexutil.Bytes([]byte("input")) -} - -func TestTxDataTestSuite(t *testing.T) { - suite.Run(t, new(TxDataTestSuite)) -} - -func (suite *TxDataTestSuite) TestNewDynamicFeeTx() { - testCases := []struct { - name string - expError bool - tx *ethtypes.Transaction - }{ - { - "non-empty tx", - false, - ethtypes.NewTx(ðtypes.DynamicFeeTx{ - Nonce: 1, - Data: []byte("data"), - Gas: 100, - Value: big.NewInt(1), - AccessList: ethtypes.AccessList{}, - To: &suite.addr, - V: suite.bigInt, - R: suite.bigInt, - S: suite.bigInt, - }), - }, - { - "value out of bounds tx", - true, - ethtypes.NewTx(ðtypes.DynamicFeeTx{ - Nonce: 1, - Data: []byte("data"), - Gas: 100, - Value: suite.overflowBigInt, - AccessList: ethtypes.AccessList{}, - To: &suite.addr, - V: suite.bigInt, - R: suite.bigInt, - S: suite.bigInt, - }), - }, - { - "gas fee cap out of bounds tx", - true, - ethtypes.NewTx(ðtypes.DynamicFeeTx{ - Nonce: 1, - Data: []byte("data"), - Gas: 100, - GasFeeCap: suite.overflowBigInt, - Value: big.NewInt(1), - AccessList: ethtypes.AccessList{}, - To: &suite.addr, - V: suite.bigInt, - R: suite.bigInt, - S: suite.bigInt, - }), - }, - { - "gas tip cap out of bounds tx", - true, - ethtypes.NewTx(ðtypes.DynamicFeeTx{ - Nonce: 1, - Data: []byte("data"), - Gas: 100, - GasTipCap: suite.overflowBigInt, - Value: big.NewInt(1), - AccessList: ethtypes.AccessList{}, - To: &suite.addr, - V: suite.bigInt, - R: suite.bigInt, - S: suite.bigInt, - }), - }, - } - for _, tc := range testCases { - tx, err := types.NewDynamicFeeTx(tc.tx) - - if tc.expError { - suite.Require().Error(err) - } else { - suite.Require().NoError(err) - suite.Require().NotEmpty(tx) - suite.Require().Equal(uint8(2), tx.TxType()) - } - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxAsEthereumData() { - feeConfig := ðtypes.DynamicFeeTx{ - Nonce: 1, - Data: []byte("data"), - Gas: 100, - Value: big.NewInt(1), - AccessList: ethtypes.AccessList{}, - To: &suite.addr, - V: suite.bigInt, - R: suite.bigInt, - S: suite.bigInt, - } - - tx := ethtypes.NewTx(feeConfig) - - dynamicFeeTx, err := types.NewDynamicFeeTx(tx) - suite.Require().NoError(err) - - res := dynamicFeeTx.AsEthereumData() - resTx := ethtypes.NewTx(res) - - suite.Require().Equal(feeConfig.Nonce, resTx.Nonce()) - suite.Require().Equal(feeConfig.Data, resTx.Data()) - suite.Require().Equal(feeConfig.Gas, resTx.Gas()) - suite.Require().Equal(feeConfig.Value, resTx.Value()) - suite.Require().Equal(feeConfig.AccessList, resTx.AccessList()) - suite.Require().Equal(feeConfig.To, resTx.To()) -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxCopy() { - tx := &types.DynamicFeeTx{} - txCopy := tx.Copy() - - suite.Require().Equal(&types.DynamicFeeTx{}, txCopy) - // TODO: Test for different pointers -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxGetChainID() { - testCases := []struct { - name string - tx types.DynamicFeeTx - exp *big.Int - }{ - { - "empty chainID", - types.DynamicFeeTx{ - ChainID: nil, - }, - nil, - }, - { - "non-empty chainID", - types.DynamicFeeTx{ - ChainID: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetChainID() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxGetAccessList() { - testCases := []struct { - name string - tx types.DynamicFeeTx - exp ethtypes.AccessList - }{ - { - "empty accesses", - types.DynamicFeeTx{ - Accesses: nil, - }, - nil, - }, - { - "nil", - types.DynamicFeeTx{ - Accesses: types.NewAccessList(nil), - }, - nil, - }, - { - "non-empty accesses", - types.DynamicFeeTx{ - Accesses: types.AccessList{ - { - Address: suite.hexAddr, - StorageKeys: []string{}, - }, - }, - }, - ethtypes.AccessList{ - { - Address: suite.addr, - StorageKeys: []common.Hash{}, - }, - }, - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetAccessList() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxGetData() { - testCases := []struct { - name string - tx types.DynamicFeeTx - }{ - { - "non-empty transaction", - types.DynamicFeeTx{ - Data: nil, - }, - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetData() - - suite.Require().Equal(tc.tx.Data, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxGetGas() { - testCases := []struct { - name string - tx types.DynamicFeeTx - exp uint64 - }{ - { - "non-empty gas", - types.DynamicFeeTx{ - GasLimit: suite.uint64, - }, - suite.uint64, - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetGas() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxGetGasPrice() { - testCases := []struct { - name string - tx types.DynamicFeeTx - exp *big.Int - }{ - { - "non-empty gasFeeCap", - types.DynamicFeeTx{ - GasFeeCap: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetGasPrice() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxGetGasTipCap() { - testCases := []struct { - name string - tx types.DynamicFeeTx - exp *big.Int - }{ - { - "empty gasTipCap", - types.DynamicFeeTx{ - GasTipCap: nil, - }, - nil, - }, - { - "non-empty gasTipCap", - types.DynamicFeeTx{ - GasTipCap: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetGasTipCap() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxGetGasFeeCap() { - testCases := []struct { - name string - tx types.DynamicFeeTx - exp *big.Int - }{ - { - "empty gasFeeCap", - types.DynamicFeeTx{ - GasFeeCap: nil, - }, - nil, - }, - { - "non-empty gasFeeCap", - types.DynamicFeeTx{ - GasFeeCap: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetGasFeeCap() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxGetValue() { - testCases := []struct { - name string - tx types.DynamicFeeTx - exp *big.Int - }{ - { - "empty amount", - types.DynamicFeeTx{ - Amount: nil, - }, - nil, - }, - { - "non-empty amount", - types.DynamicFeeTx{ - Amount: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetValue() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxGetNonce() { - testCases := []struct { - name string - tx types.DynamicFeeTx - exp uint64 - }{ - { - "non-empty nonce", - types.DynamicFeeTx{ - Nonce: suite.uint64, - }, - suite.uint64, - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetNonce() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxGetTo() { - testCases := []struct { - name string - tx types.DynamicFeeTx - exp *common.Address - }{ - { - "empty suite.address", - types.DynamicFeeTx{ - To: "", - }, - nil, - }, - { - "non-empty suite.address", - types.DynamicFeeTx{ - To: suite.hexAddr, - }, - &suite.addr, - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetTo() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxSetSignatureValues() { - testCases := []struct { - name string - chainID *big.Int - r *big.Int - v *big.Int - s *big.Int - }{ - { - "empty values", - nil, - nil, - nil, - nil, - }, - { - "non-empty values", - suite.bigInt, - suite.bigInt, - suite.bigInt, - suite.bigInt, - }, - } - - for _, tc := range testCases { - tx := &types.DynamicFeeTx{} - tx.SetSignatureValues(tc.chainID, tc.v, tc.r, tc.s) - - v, r, s := tx.GetRawSignatureValues() - chainID := tx.GetChainID() - - suite.Require().Equal(tc.v, v, tc.name) - suite.Require().Equal(tc.r, r, tc.name) - suite.Require().Equal(tc.s, s, tc.name) - suite.Require().Equal(tc.chainID, chainID, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxValidate() { - testCases := []struct { - name string - tx types.DynamicFeeTx - expError bool - }{ - { - "empty", - types.DynamicFeeTx{}, - true, - }, - { - "gas tip cap is nil", - types.DynamicFeeTx{ - GasTipCap: nil, - }, - true, - }, - { - "gas fee cap is nil", - types.DynamicFeeTx{ - GasTipCap: &suite.sdkZeroInt, - }, - true, - }, - { - "gas tip cap is negative", - types.DynamicFeeTx{ - GasTipCap: &suite.sdkMinusOneInt, - GasFeeCap: &suite.sdkZeroInt, - }, - true, - }, - { - "gas tip cap is negative", - types.DynamicFeeTx{ - GasTipCap: &suite.sdkZeroInt, - GasFeeCap: &suite.sdkMinusOneInt, - }, - true, - }, - { - "gas fee cap < gas tip cap", - types.DynamicFeeTx{ - GasTipCap: &suite.sdkInt, - GasFeeCap: &suite.sdkZeroInt, - }, - true, - }, - { - "amount is negative", - types.DynamicFeeTx{ - GasTipCap: &suite.sdkInt, - GasFeeCap: &suite.sdkInt, - Amount: &suite.sdkMinusOneInt, - }, - true, - }, - { - "to suite.address is invalid", - types.DynamicFeeTx{ - GasTipCap: &suite.sdkInt, - GasFeeCap: &suite.sdkInt, - Amount: &suite.sdkInt, - To: suite.invalidAddr, - }, - true, - }, - { - "chain ID not present on AccessList txs", - types.DynamicFeeTx{ - GasTipCap: &suite.sdkInt, - GasFeeCap: &suite.sdkInt, - Amount: &suite.sdkInt, - To: suite.hexAddr, - ChainID: nil, - }, - true, - }, - { - "no errors", - types.DynamicFeeTx{ - GasTipCap: &suite.sdkInt, - GasFeeCap: &suite.sdkInt, - Amount: &suite.sdkInt, - To: suite.hexAddr, - ChainID: &suite.sdkInt, - }, - false, - }, - } - - for _, tc := range testCases { - err := tc.tx.Validate() - - if tc.expError { - suite.Require().Error(err, tc.name) - continue - } - - suite.Require().NoError(err, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxEffectiveGasPrice() { - testCases := []struct { - name string - tx types.DynamicFeeTx - baseFee *big.Int - exp *big.Int - }{ - { - "non-empty dynamic fee tx", - types.DynamicFeeTx{ - GasTipCap: &suite.sdkInt, - GasFeeCap: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.EffectiveGasPrice(tc.baseFee) - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxEffectiveFee() { - testCases := []struct { - name string - tx types.DynamicFeeTx - baseFee *big.Int - exp *big.Int - }{ - { - "non-empty dynamic fee tx", - types.DynamicFeeTx{ - GasTipCap: &suite.sdkInt, - GasFeeCap: &suite.sdkInt, - GasLimit: uint64(1), - }, - (&suite.sdkInt).BigInt(), - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.EffectiveFee(tc.baseFee) - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxEffectiveCost() { - testCases := []struct { - name string - tx types.DynamicFeeTx - baseFee *big.Int - exp *big.Int - }{ - { - "non-empty dynamic fee tx", - types.DynamicFeeTx{ - GasTipCap: &suite.sdkInt, - GasFeeCap: &suite.sdkInt, - GasLimit: uint64(1), - Amount: &suite.sdkZeroInt, - }, - (&suite.sdkInt).BigInt(), - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.EffectiveCost(tc.baseFee) - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestDynamicFeeTxFeeCost() { - tx := &types.DynamicFeeTx{} - suite.Require().Panics(func() { tx.Fee() }, "should panic") - suite.Require().Panics(func() { tx.Cost() }, "should panic") -} diff --git a/x/vm/types/eth.go b/x/vm/types/eth.go new file mode 100644 index 000000000..70d9a31e9 --- /dev/null +++ b/x/vm/types/eth.go @@ -0,0 +1,96 @@ +package types + +import ( + "encoding/json" + + "github.com/ethereum/go-ethereum/common/hexutil" + ethtypes "github.com/ethereum/go-ethereum/core/types" + + errorsmod "cosmossdk.io/errors" + + errortypes "github.com/cosmos/cosmos-sdk/types/errors" +) + +type EthereumTx struct { + *ethtypes.Transaction +} + +func (tx EthereumTx) Size() int { + if tx.Transaction == nil { + return 0 + } + return int(tx.Transaction.Size()) //nolint:gosec +} + +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) { + if tx.Transaction == nil { + return []byte("null"), nil + } + bz, err := tx.MarshalBinary() + if err != nil { + return nil, err + } + return json.Marshal(hexutil.Bytes(bz)) +} + +func (tx EthereumTx) Validate() error { + if tx.Transaction == nil { + return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "raw tx is missing") + } + + // 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 tx.GasPrice().BitLen() > 256 { + return errorsmod.Wrap(ErrInvalidGasPrice, "out of bound") + } + if tx.GasFeeCap().BitLen() > 256 { + return errorsmod.Wrap(ErrInvalidGasPrice, "out of bound") + } + if tx.GasTipCap().BitLen() > 256 { + return errorsmod.Wrap(ErrInvalidGasPrice, "out of bound") + } + if tx.Cost().BitLen() > 256 { + return errorsmod.Wrap(ErrInvalidGasFee, "out of bound") + } + if tx.GasFeeCapIntCmp(tx.GasTipCap()) < 0 { + return errorsmod.Wrapf( + ErrInvalidGasCap, + "max priority fee per gas higher than max fee per gas (%s > %s)", + tx.GasTipCap(), tx.GasFeeCap(), + ) + } + return nil +} diff --git a/x/vm/types/legacy_tx.go b/x/vm/types/legacy_tx.go deleted file mode 100644 index 8c28dc851..000000000 --- a/x/vm/types/legacy_tx.go +++ /dev/null @@ -1,229 +0,0 @@ -package types - -import ( - "math/big" - - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - - "github.com/cosmos/evm/types" - ethutils "github.com/cosmos/evm/utils/eth" - - errorsmod "cosmossdk.io/errors" - - errortypes "github.com/cosmos/cosmos-sdk/types/errors" -) - -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 ethutils.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 LegacyTx 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 ethutils.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") - } - } - - if tx.GetChainID() == nil { - return errorsmod.Wrap( - errortypes.ErrInvalidChainID, - "chain ID must be derived from LegacyTx txs", - ) - } - - 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/x/vm/types/legacy_tx_test.go b/x/vm/types/legacy_tx_test.go deleted file mode 100644 index 69735dfa8..000000000 --- a/x/vm/types/legacy_tx_test.go +++ /dev/null @@ -1,434 +0,0 @@ -package types_test - -import ( - "math/big" - - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - - "github.com/cosmos/evm/x/vm/types" -) - -func (suite *TxDataTestSuite) TestNewLegacyTx() { - testCases := []struct { - name string - tx *ethtypes.Transaction - }{ - { - "non-empty Transaction", - ethtypes.NewTx(ðtypes.AccessListTx{ - Nonce: 1, - Data: []byte("data"), - Gas: 100, - Value: big.NewInt(1), - AccessList: ethtypes.AccessList{}, - To: &suite.addr, - V: big.NewInt(1), - R: big.NewInt(1), - S: big.NewInt(1), - }), - }, - } - - for _, tc := range testCases { - tx, err := types.NewLegacyTx(tc.tx) - suite.Require().NoError(err) - - suite.Require().NotEmpty(tc.tx) - suite.Require().Equal(uint8(0), tx.TxType()) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxTxType() { - tx := types.LegacyTx{} - actual := tx.TxType() - - suite.Require().Equal(uint8(0), actual) -} - -func (suite *TxDataTestSuite) TestLegacyTxCopy() { - tx := &types.LegacyTx{} - txData := tx.Copy() - - suite.Require().Equal(&types.LegacyTx{}, txData) - // TODO: Test for different pointers -} - -func (suite *TxDataTestSuite) TestLegacyTxGetChainID() { - tx := types.LegacyTx{} - actual := tx.GetChainID() - - suite.Require().Nil(actual) -} - -func (suite *TxDataTestSuite) TestLegacyTxGetAccessList() { - tx := types.LegacyTx{} - actual := tx.GetAccessList() - - suite.Require().Nil(actual) -} - -func (suite *TxDataTestSuite) TestLegacyTxGetData() { - testCases := []struct { - name string - tx types.LegacyTx - }{ - { - "non-empty transaction", - types.LegacyTx{ - Data: nil, - }, - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetData() - - suite.Require().Equal(tc.tx.Data, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxGetGas() { - testCases := []struct { - name string - tx types.LegacyTx - exp uint64 - }{ - { - "non-empty gas", - types.LegacyTx{ - GasLimit: suite.uint64, - }, - suite.uint64, - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetGas() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxGetGasPrice() { - testCases := []struct { - name string - tx types.LegacyTx - exp *big.Int - }{ - { - "empty gasPrice", - types.LegacyTx{ - GasPrice: nil, - }, - nil, - }, - { - "non-empty gasPrice", - types.LegacyTx{ - GasPrice: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetGasFeeCap() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxGetGasTipCap() { - testCases := []struct { - name string - tx types.LegacyTx - exp *big.Int - }{ - { - "non-empty gasPrice", - types.LegacyTx{ - GasPrice: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetGasTipCap() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxGetGasFeeCap() { - testCases := []struct { - name string - tx types.LegacyTx - exp *big.Int - }{ - { - "non-empty gasPrice", - types.LegacyTx{ - GasPrice: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetGasFeeCap() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxGetValue() { - testCases := []struct { - name string - tx types.LegacyTx - exp *big.Int - }{ - { - "empty amount", - types.LegacyTx{ - Amount: nil, - }, - nil, - }, - { - "non-empty amount", - types.LegacyTx{ - Amount: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetValue() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxGetNonce() { - testCases := []struct { - name string - tx types.LegacyTx - exp uint64 - }{ - { - "none-empty nonce", - types.LegacyTx{ - Nonce: suite.uint64, - }, - suite.uint64, - }, - } - for _, tc := range testCases { - actual := tc.tx.GetNonce() - - suite.Require().Equal(tc.exp, actual) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxGetTo() { - testCases := []struct { - name string - tx types.LegacyTx - exp *common.Address - }{ - { - "empty address", - types.LegacyTx{ - To: "", - }, - nil, - }, - { - "non-empty address", - types.LegacyTx{ - To: suite.hexAddr, - }, - &suite.addr, - }, - } - - for _, tc := range testCases { - actual := tc.tx.GetTo() - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxAsEthereumData() { - tx := &types.LegacyTx{} - txData := tx.AsEthereumData() - - suite.Require().Equal(ðtypes.LegacyTx{}, txData) -} - -func (suite *TxDataTestSuite) TestLegacyTxSetSignatureValues() { - testCases := []struct { - name string - v *big.Int - r *big.Int - s *big.Int - }{ - { - "non-empty values", - suite.bigInt, - suite.bigInt, - suite.bigInt, - }, - } - for _, tc := range testCases { - tx := &types.LegacyTx{} - tx.SetSignatureValues(nil, tc.v, tc.r, tc.s) - - v, r, s := tx.GetRawSignatureValues() - - suite.Require().Equal(tc.v, v, tc.name) - suite.Require().Equal(tc.r, r, tc.name) - suite.Require().Equal(tc.s, s, tc.name) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxValidate() { - testCases := []struct { - name string - tx types.LegacyTx - expError bool - }{ - { - "empty", - types.LegacyTx{}, - true, - }, - { - "gas price is nil", - types.LegacyTx{ - GasPrice: nil, - }, - true, - }, - { - "gas price is negative", - types.LegacyTx{ - GasPrice: &suite.sdkMinusOneInt, - }, - true, - }, - { - "amount is negative", - types.LegacyTx{ - GasPrice: &suite.sdkInt, - Amount: &suite.sdkMinusOneInt, - }, - true, - }, - { - "to address is invalid", - types.LegacyTx{ - GasPrice: &suite.sdkInt, - Amount: &suite.sdkInt, - To: suite.invalidAddr, - }, - true, - }, - } - - for _, tc := range testCases { - err := tc.tx.Validate() - - if tc.expError { - suite.Require().Error(err, tc.name) - continue - } - - suite.Require().NoError(err, tc.name) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxEffectiveGasPrice() { - testCases := []struct { - name string - tx types.LegacyTx - baseFee *big.Int - exp *big.Int - }{ - { - "non-empty legacy tx", - types.LegacyTx{ - GasPrice: &suite.sdkInt, - }, - (&suite.sdkInt).BigInt(), - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.EffectiveGasPrice(tc.baseFee) - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxEffectiveFee() { - testCases := []struct { - name string - tx types.LegacyTx - baseFee *big.Int - exp *big.Int - }{ - { - "non-empty legacy tx", - types.LegacyTx{ - GasPrice: &suite.sdkInt, - GasLimit: uint64(1), - }, - (&suite.sdkInt).BigInt(), - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.EffectiveFee(tc.baseFee) - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxEffectiveCost() { - testCases := []struct { - name string - tx types.LegacyTx - baseFee *big.Int - exp *big.Int - }{ - { - "non-empty legacy tx", - types.LegacyTx{ - GasPrice: &suite.sdkInt, - GasLimit: uint64(1), - Amount: &suite.sdkZeroInt, - }, - (&suite.sdkInt).BigInt(), - (&suite.sdkInt).BigInt(), - }, - } - - for _, tc := range testCases { - actual := tc.tx.EffectiveCost(tc.baseFee) - - suite.Require().Equal(tc.exp, actual, tc.name) - } -} - -func (suite *TxDataTestSuite) TestLegacyTxFeeCost() { - tx := &types.LegacyTx{} - - suite.Require().Panics(func() { tx.Fee() }, "should panic") - suite.Require().Panics(func() { tx.Cost() }, "should panic") -} diff --git a/x/vm/types/msg.go b/x/vm/types/msg.go index 99d5e1e6f..169a7c16a 100644 --- a/x/vm/types/msg.go +++ b/x/vm/types/msg.go @@ -8,6 +8,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/txpool" ethtypes "github.com/ethereum/go-ethereum/core/types" protov2 "google.golang.org/protobuf/proto" @@ -33,8 +34,6 @@ var ( _ sdk.Tx = &MsgEthereumTx{} _ ante.GasTx = &MsgEthereumTx{} _ sdk.Msg = &MsgUpdateParams{} - - _ codectypes.UnpackInterfacesMessage = MsgEthereumTx{} ) // message type and route constants @@ -49,110 +48,27 @@ var MsgEthereumTxCustomGetSigner = txsigning.CustomGetSigner{ } // NewTx returns a reference to a new Ethereum transaction message. -func NewTx( - tx *EvmTxArgs, -) *MsgEthereumTx { - return newMsgEthereumTx(tx) +func NewTx(tx *EvmTxArgs) *MsgEthereumTx { + return NewTxFromArgs(tx.ToTxData()) } -func newMsgEthereumTx( - tx *EvmTxArgs, -) *MsgEthereumTx { - var ( - cid, amt, gp *sdkmath.Int - toAddr string - txData TxData - ) - - if tx.To != nil { - toAddr = tx.To.Hex() - } - - if tx.Amount != nil { - amountInt := sdkmath.NewIntFromBigInt(tx.Amount) - amt = &amountInt - } - - if tx.ChainID != nil { - chainIDInt := sdkmath.NewIntFromBigInt(tx.ChainID) - cid = &chainIDInt +func NewTxFromArgs(args *TransactionArgs) *MsgEthereumTx { + var msg MsgEthereumTx + msg.FromEthereumTx(args.ToTransaction(ethtypes.LegacyTxType)) + if args.From != nil { + msg.From = args.From.Bytes() } - - if tx.GasPrice != nil { - gasPriceInt := sdkmath.NewIntFromBigInt(tx.GasPrice) - gp = &gasPriceInt - } - - switch { - case tx.GasFeeCap != nil: - gtc := sdkmath.NewIntFromBigInt(tx.GasTipCap) - gfc := sdkmath.NewIntFromBigInt(tx.GasFeeCap) - - txData = &DynamicFeeTx{ - ChainID: cid, - Amount: amt, - To: toAddr, - GasTipCap: >c, - GasFeeCap: &gfc, - Nonce: tx.Nonce, - GasLimit: tx.GasLimit, - Data: tx.Input, - Accesses: NewAccessList(tx.Accesses), - } - case tx.Accesses != nil: - txData = &AccessListTx{ - ChainID: cid, - Nonce: tx.Nonce, - To: toAddr, - Amount: amt, - GasLimit: tx.GasLimit, - GasPrice: gp, - Data: tx.Input, - Accesses: NewAccessList(tx.Accesses), - } - default: - txData = &LegacyTx{ - To: toAddr, - Amount: amt, - GasPrice: gp, - Nonce: tx.Nonce, - GasLimit: tx.GasLimit, - Data: tx.Input, - } - } - - dataAny, err := PackTxData(txData) - if err != nil { - panic(err) - } - - msg := MsgEthereumTx{Data: dataAny} - msg.Hash = msg.AsTransaction().Hash().Hex() return &msg } // FromEthereumTx populates the message fields from the given ethereum transaction -func (msg *MsgEthereumTx) FromEthereumTx(tx *ethtypes.Transaction) error { - txData, err := NewTxDataFromTx(tx) - if err != nil { - return err - } - - anyTxData, err := PackTxData(txData) - if err != nil { - return err - } - - msg.Data = anyTxData - msg.Hash = tx.Hash().Hex() - return nil +func (msg *MsgEthereumTx) FromEthereumTx(tx *ethtypes.Transaction) { + msg.Raw = EthereumTx{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 { - if err := msg.FromEthereumTx(tx); err != nil { - return err - } + msg.Raw.Transaction = tx from, err := ethtypes.Sender(signer, tx) if err != nil { @@ -172,46 +88,50 @@ 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 { - if len(msg.DeprecatedFrom) != 0 { - return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "deprecated From field is not empty") + if msg.Raw.Transaction == nil { + return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "raw transaction is required") } if len(msg.From) == 0 { return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "sender address is missing") } - // Validate Size_ field, should be kept empty - if msg.Size_ != 0 { - return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "tx size is deprecated") - } + tx := msg.Raw.Transaction - txData, err := UnpackTxData(msg.Data) - if err != nil { - return errorsmod.Wrap(err, "failed to unpack tx data") + // validate the transaction + // Transactions can't be negative. This may never happen using RLP decoded + // transactions but may occur for transactions created using the RPC. + if tx.Value().Sign() < 0 { + return txpool.ErrNegativeValue } - - gas := txData.GetGas() - - // prevent txs with 0 gas to fill up the mempool - if gas == 0 { - return errorsmod.Wrap(ErrInvalidGasLimit, "gas limit must not be zero") + // Sanity check for extremely large numbers (supported by RLP or RPC) + if tx.GasFeeCap().BitLen() > 256 { + return core.ErrFeeCapVeryHigh } - - // prevent gas limit from overflow - if g := new(big.Int).SetUint64(gas); !g.IsInt64() { - return errorsmod.Wrap(ErrGasOverflow, "gas limit must be less than math.MaxInt64") + if tx.GasTipCap().BitLen() > 256 { + return core.ErrTipVeryHigh + } + if tx.GasTipCap().Sign() < 0 { + return fmt.Errorf("%w: gas tip cap %v, minimum needed 0", txpool.ErrTxGasPriceTooLow, tx.GasTipCap()) + } + // Ensure gasFeeCap is greater than or equal to gasTipCap + if tx.GasFeeCapIntCmp(tx.GasTipCap()) < 0 { + return core.ErrTipAboveFeeCap } - if err := txData.Validate(); err != nil { + intrGas, err := core.IntrinsicGas(tx.Data(), tx.AccessList(), tx.SetCodeAuthorizations(), tx.To() == nil, true, true, true) + if err != nil { return err } - - // Validate Hash field after validated txData to avoid panic - txHash := msg.AsTransaction().Hash().Hex() - if msg.Hash != txHash { - return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "invalid tx hash %s, expected: %s", msg.Hash, txHash) + if tx.Gas() < intrGas { + return fmt.Errorf("%w: gas %v, minimum needed %v", core.ErrIntrinsicGas, tx.Gas(), intrGas) } + if tx.Type() == ethtypes.SetCodeTxType { + if len(tx.SetCodeAuthorizations()) == 0 { + return fmt.Errorf("set code tx must have at least one authorization tuple") + } + } return nil } @@ -292,34 +212,26 @@ func (msg *MsgEthereumTx) Sign(ethSigner ethtypes.Signer, keyringSigner keyring. return err } - return msg.FromEthereumTx(tx) + return msg.FromSignedEthereumTx(tx, ethSigner) } // GetGas implements the GasTx interface. It returns the GasLimit of the transaction. func (msg MsgEthereumTx) GetGas() uint64 { - txData, err := UnpackTxData(msg.Data) - if err != nil { - return 0 - } - return txData.GetGas() + return msg.Raw.Gas() } // GetFee returns the fee for non dynamic fee tx func (msg MsgEthereumTx) GetFee() *big.Int { - txData, err := UnpackTxData(msg.Data) - if err != nil { - return nil - } - return txData.Fee() + i := new(big.Int).SetUint64(msg.Raw.Gas()) + return i.Mul(i, msg.Raw.GasPrice()) } // GetEffectiveFee returns the fee for dynamic fee tx func (msg MsgEthereumTx) GetEffectiveFee(baseFee *big.Int) *big.Int { - txData, err := UnpackTxData(msg.Data) - if err != nil { - return nil - } - return txData.EffectiveFee(baseFee) + i := new(big.Int).SetUint64(msg.Raw.Gas()) + gasTip, _ := msg.Raw.EffectiveGasTip(baseFee) + effectiveGasPrice := new(big.Int).Add(gasTip, baseFee) + return i.Mul(i, effectiveGasPrice) } // GetFrom loads the ethereum sender address from the sigcache and returns an @@ -330,45 +242,38 @@ func (msg *MsgEthereumTx) GetFrom() sdk.AccAddress { // AsTransaction creates an Ethereum Transaction type from the msg fields func (msg MsgEthereumTx) AsTransaction() *ethtypes.Transaction { - txData, err := UnpackTxData(msg.Data) - if err != nil { - return nil - } - - return ethtypes.NewTx(txData.AsEthereumData()) + return msg.Raw.Transaction } -func bigMin(x, y *big.Int) *big.Int { - if x.Cmp(y) > 0 { - return y - } - return x -} - -// AsMessage creates an Ethereum core.Message from the msg fields -func (msg MsgEthereumTx) AsMessage(baseFee *big.Int) (*core.Message, error) { - txData, err := UnpackTxData(msg.Data) - if err != nil { - return nil, err - } - - gasPrice, gasFeeCap, gasTipCap := txData.GetGasPrice(), txData.GetGasFeeCap(), txData.GetGasTipCap() +// AsMessage vendors the core.TransactionToMessage function to avoid sender recovery, +// assume the From field is set correctly in the MsgEthereumTx. +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(), + SetCodeAuthorizations: tx.SetCodeAuthorizations(), + SkipNonceChecks: false, + SkipFromEOACheck: false, + BlobHashes: tx.BlobHashes(), + BlobGasFeeCap: tx.BlobGasFeeCap(), + } + // If baseFee provided, set gasPrice to effectiveGasPrice. if baseFee != nil { - gasPrice = bigMin(gasPrice.Add(gasTipCap, baseFee), gasFeeCap) - } - ethMsg := core.Message{ - From: msg.GetSender(), - To: txData.GetTo(), - Nonce: txData.GetNonce(), - Value: txData.GetValue(), - GasLimit: txData.GetGas(), - GasPrice: gasPrice, - GasFeeCap: gasFeeCap, - GasTipCap: gasTipCap, - Data: txData.GetData(), - AccessList: txData.GetAccessList(), + ethMsg.GasPrice = ethMsg.GasPrice.Add(ethMsg.GasTipCap, baseFee) + if ethMsg.GasPrice.Cmp(ethMsg.GasFeeCap) > 0 { + ethMsg.GasPrice = ethMsg.GasFeeCap + } } - return ðMsg, nil + ethMsg.From = msg.GetSender() + return ethMsg } // VerifySender verify the sender address against the signature values using the latest signer for the given chainID. @@ -384,11 +289,6 @@ func (msg *MsgEthereumTx) VerifySender(signer ethtypes.Signer) error { return nil } -// UnpackInterfaces implements UnpackInterfacesMessage.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{} @@ -398,6 +298,10 @@ func (msg *MsgEthereumTx) UnmarshalBinary(b []byte, signer ethtypes.Signer) erro 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) (signing.Tx, error) { builder, ok := b.(authtx.ExtensionOptionsTxBuilder) @@ -410,12 +314,8 @@ func (msg *MsgEthereumTx) BuildTx(b client.TxBuilder, evmDenom string) (signing. return nil, err } - txData, err := UnpackTxData(msg.Data) - if err != nil { - return nil, err - } fees := make(sdk.Coins, 0, 1) - feeAmt := sdkmath.NewIntFromBigInt(txData.Fee()) + feeAmt := sdkmath.NewIntFromBigInt(msg.GetFee()) if feeAmt.Sign() > 0 { fees = append(fees, sdk.NewCoin(evmDenom, feeAmt)) fees = ConvertCoinsDenomToExtendedDenom(fees) @@ -423,7 +323,11 @@ func (msg *MsgEthereumTx) BuildTx(b client.TxBuilder, evmDenom string) (signing. builder.SetExtensionOptions(option) - err = builder.SetMsgs(msg) + // only keep the nessessary fields + err = builder.SetMsgs(&MsgEthereumTx{ + From: msg.From, + Raw: msg.Raw, + }) if err != nil { return nil, err } diff --git a/x/vm/types/msg_test.go b/x/vm/types/msg_test.go index 58c4ed303..2692b3edb 100644 --- a/x/vm/types/msg_test.go +++ b/x/vm/types/msg_test.go @@ -13,7 +13,6 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/suite" - "github.com/cosmos/evm/crypto/ethsecp256k1" "github.com/cosmos/evm/encoding" "github.com/cosmos/evm/testutil/config" testconstants "github.com/cosmos/evm/testutil/constants" @@ -107,9 +106,9 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_BuildTx() { false, }, { - "build tx - fail: nil data", + "build tx - nil data", types.NewTx(evmTx), - true, + false, }, } for _, coinInfo := range []types.EvmCoinInfo{ @@ -120,9 +119,6 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_BuildTx() { configurator := types.NewEVMConfigurator() configurator.ResetTestConfig() suite.Require().NoError(configurator.WithEVMCoinInfo(coinInfo).Configure()) - if strings.Contains(tc.name, "nil data") { - tc.msg.Data = nil - } baseDenom := types.GetEVMCoinDenom() extendedDenom := types.GetEVMCoinExtendedDenom() @@ -173,7 +169,7 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_ValidateBasic() { to: suite.to.Hex(), from: suite.from.Hex(), amount: hundredInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: hundredInt, gasFeeCap: nil, gasTipCap: nil, @@ -185,7 +181,7 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_ValidateBasic() { to: suite.to.Hex(), from: suite.from.Hex(), amount: hundredInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: zeroInt, gasFeeCap: nil, gasTipCap: nil, @@ -198,7 +194,7 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_ValidateBasic() { to: suite.to.Hex(), from: suite.from.Hex(), amount: hundredInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: zeroInt, gasFeeCap: hundredInt, gasTipCap: zeroInt, @@ -211,7 +207,7 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_ValidateBasic() { to: "", from: suite.from.Hex(), amount: hundredInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: hundredInt, gasFeeCap: nil, gasTipCap: nil, @@ -228,15 +224,14 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_ValidateBasic() { gasFeeCap: nil, gasTipCap: nil, chainID: validChainID, - expectPass: false, - errMsg: "gas limit must be less than math.MaxInt64", + expectPass: true, }, { msg: "nil amount - Legacy Tx", to: suite.to.Hex(), from: suite.from.Hex(), amount: nil, - gasLimit: 1000, + gasLimit: 21000, gasPrice: hundredInt, gasFeeCap: nil, gasTipCap: nil, @@ -248,13 +243,13 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_ValidateBasic() { to: suite.to.Hex(), from: suite.from.Hex(), amount: minusOneInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: hundredInt, gasFeeCap: nil, gasTipCap: nil, chainID: validChainID, expectPass: false, - errMsg: "amount cannot be negative", + errMsg: "negative value", }, { msg: "zero gas limit - Legacy Tx", @@ -267,64 +262,51 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_ValidateBasic() { gasTipCap: nil, chainID: validChainID, expectPass: false, - errMsg: "gas limit must not be zero", + errMsg: "intrinsic gas too low", }, { msg: "negative gas price - Legacy Tx", to: suite.to.Hex(), from: suite.from.Hex(), amount: hundredInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: minusOneInt, gasFeeCap: nil, gasTipCap: nil, chainID: validChainID, expectPass: false, - errMsg: "gas price cannot be negative", + errMsg: "transaction gas price below minimum", }, { msg: "zero gas price - Legacy Tx", to: suite.to.Hex(), from: suite.from.Hex(), amount: hundredInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: zeroInt, gasFeeCap: nil, gasTipCap: nil, chainID: validChainID, expectPass: true, }, - { - msg: "invalid from address - Legacy Tx", - to: suite.to.Hex(), - amount: hundredInt, - gasLimit: 1000, - gasPrice: zeroInt, - gasFeeCap: nil, - gasTipCap: nil, - chainID: validChainID, - expectPass: false, - errMsg: "sender address is missing", - }, { msg: "out of bound gas fee - Legacy Tx", to: suite.to.Hex(), from: suite.from.Hex(), amount: hundredInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: exp_2_255, gasFeeCap: nil, gasTipCap: nil, chainID: validChainID, - expectPass: false, - errMsg: "out of bound", + expectPass: true, }, { msg: "nil amount - AccessListTx", to: suite.to.Hex(), from: suite.from.Hex(), amount: nil, - gasLimit: 1000, + gasLimit: 21000, gasPrice: hundredInt, gasFeeCap: nil, gasTipCap: nil, @@ -337,14 +319,14 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_ValidateBasic() { to: suite.to.Hex(), from: suite.from.Hex(), amount: minusOneInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: hundredInt, gasFeeCap: nil, gasTipCap: nil, accessList: ðtypes.AccessList{}, chainID: validChainID, expectPass: false, - errMsg: "amount cannot be negative", + errMsg: "negative value", }, { msg: "zero gas limit - AccessListTx", @@ -352,48 +334,47 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_ValidateBasic() { from: suite.from.Hex(), amount: hundredInt, gasLimit: 0, - gasPrice: zeroInt, + gasPrice: big.NewInt(1), gasFeeCap: nil, gasTipCap: nil, accessList: ðtypes.AccessList{}, chainID: validChainID, expectPass: false, - errMsg: "gas limit must not be zero", + errMsg: "intrinsic gas too low", }, { msg: "nil gas price - AccessListTx", to: suite.to.Hex(), from: suite.from.Hex(), amount: hundredInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: nil, gasFeeCap: nil, gasTipCap: nil, accessList: ðtypes.AccessList{}, chainID: validChainID, - expectPass: false, - errMsg: "cannot be nil: invalid gas price", + expectPass: true, }, { msg: "negative gas price - AccessListTx", to: suite.to.Hex(), from: suite.from.Hex(), amount: hundredInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: minusOneInt, gasFeeCap: nil, gasTipCap: nil, accessList: ðtypes.AccessList{}, chainID: validChainID, expectPass: false, - errMsg: "gas price cannot be negative", + errMsg: "transaction gas price below minimum", }, { msg: "zero gas price - AccessListTx", to: suite.to.Hex(), from: suite.from.Hex(), amount: hundredInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: zeroInt, gasFeeCap: nil, gasTipCap: nil, @@ -401,45 +382,30 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_ValidateBasic() { chainID: validChainID, expectPass: true, }, - { - msg: "invalid from address - AccessListTx", - to: suite.to.Hex(), - amount: hundredInt, - gasLimit: 1000, - gasPrice: zeroInt, - gasFeeCap: nil, - gasTipCap: nil, - accessList: ðtypes.AccessList{}, - chainID: validChainID, - expectPass: false, - errMsg: "sender address is missing", - }, { msg: "chain ID not set on AccessListTx", to: suite.to.Hex(), from: suite.from.Hex(), amount: hundredInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: zeroInt, gasFeeCap: nil, gasTipCap: nil, accessList: ðtypes.AccessList{}, chainID: nil, - expectPass: false, - errMsg: "chain ID must be present on AccessList txs", + expectPass: true, }, { msg: "nil tx.Data - AccessList Tx", to: suite.to.Hex(), from: suite.from.Hex(), amount: hundredInt, - gasLimit: 1000, + gasLimit: 21000, gasPrice: zeroInt, gasFeeCap: nil, gasTipCap: nil, accessList: ðtypes.AccessList{}, - expectPass: false, - errMsg: "failed to unpack tx data", + expectPass: true, }, } @@ -457,14 +423,7 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_ValidateBasic() { Accesses: tc.accessList, } tx := types.NewTx(evmTx) - if tc.from != "" { - tx.From = common.HexToAddress(tc.from).Bytes() - } - - // apply nil assignment here to test ValidateBasic function instead of NewTx - if strings.Contains(tc.msg, "nil tx.Data") { - tx.Data = nil - } + tx.From = common.HexToAddress(tc.from).Bytes() // for legacy_Tx need to sign tx because the chainID is derived // from signature @@ -486,54 +445,6 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_ValidateBasic() { } } -func (suite *MsgsTestSuite) TestMsgEthereumTx_ValidateBasicAdvanced() { - hundredInt := big.NewInt(100) - evmTx := &types.EvmTxArgs{ - ChainID: hundredInt, - Nonce: 1, - Amount: big.NewInt(10), - GasLimit: 100000, - GasPrice: big.NewInt(150), - GasFeeCap: big.NewInt(200), - } - - testCases := []struct { - msg string - msgBuilder func() *types.MsgEthereumTx - expectPass bool - }{ - { - "fails - invalid tx hash", - func() *types.MsgEthereumTx { - msg := types.NewTx(evmTx) - msg.Hash = "0x00" - return msg - }, - false, - }, - { - "fails - invalid size", - func() *types.MsgEthereumTx { - msg := types.NewTx(evmTx) - msg.Size_ = 1 - return msg - }, - false, - }, - } - - for _, tc := range testCases { - suite.Run(tc.msg, func() { - err := tc.msgBuilder().ValidateBasic() - if tc.expectPass { - suite.Require().NoError(err) - } else { - suite.Require().Error(err) - } - }) - } -} - func (suite *MsgsTestSuite) TestMsgEthereumTx_Sign() { testCases := []struct { msg string @@ -656,25 +567,23 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_Getters() { }{ { "get fee - pass", - ethtypes.NewEIP2930Signer(suite.chainID), big.NewInt(5000), }, { - "get fee - fail: nil data", + "get fee - nil data", ethtypes.NewEIP2930Signer(suite.chainID), - nil, + big.NewInt(5000), }, { "get effective fee - pass", - ethtypes.NewEIP2930Signer(suite.chainID), big.NewInt(5000), }, { - "get effective fee - fail: nil data", + "get effective fee - nil data", ethtypes.NewEIP2930Signer(suite.chainID), - nil, + big.NewInt(5000), }, { "get gas - pass", @@ -682,137 +591,28 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_Getters() { big.NewInt(50), }, { - "get gas - fail: nil data", + "get gas - nil data", ethtypes.NewEIP2930Signer(suite.chainID), - big.NewInt(0), + big.NewInt(50), }, } var fee, effFee *big.Int for _, tc := range testCases { - tx := types.NewTx(evmTx) - if strings.Contains(tc.name, "nil data") { - tx.Data = nil - } - switch { - case strings.Contains(tc.name, "get fee"): - fee = tx.GetFee() - suite.Require().Equal(tc.exp, fee) - case strings.Contains(tc.name, "get effective fee"): - effFee = tx.GetEffectiveFee(big.NewInt(0)) - suite.Require().Equal(tc.exp, effFee) - case strings.Contains(tc.name, "get gas"): - gas := tx.GetGas() - suite.Require().Equal(tc.exp.Uint64(), gas) - } - } -} - -func (suite *MsgsTestSuite) TestFromEthereumTx() { - privkey, _ := ethsecp256k1.GenerateKey() - ethPriv, err := privkey.ToECDSA() - suite.Require().NoError(err) - - // 10^80 is more than 256 bits - //nolint:all - exp_10_80 := new(big.Int).Mul(big.NewInt(1), new(big.Int).Exp(big.NewInt(10), big.NewInt(80), nil)) - - testCases := []struct { - msg string - expectPass bool - buildTx func() *ethtypes.Transaction - }{ - {"success, normal tx", true, func() *ethtypes.Transaction { - tx := ethtypes.NewTx(ðtypes.AccessListTx{ - Nonce: 0, - Data: nil, - To: &suite.to, - Value: big.NewInt(10), - GasPrice: big.NewInt(1), - Gas: 21000, - }) - tx, err := ethtypes.SignTx(tx, ethtypes.NewEIP2930Signer(suite.chainID), ethPriv) - suite.Require().NoError(err) - return tx - }}, - {"success, DynamicFeeTx", true, func() *ethtypes.Transaction { - tx := ethtypes.NewTx(ðtypes.DynamicFeeTx{ - Nonce: 0, - Data: nil, - To: &suite.to, - Value: big.NewInt(10), - Gas: 21000, - }) - tx, err := ethtypes.SignTx(tx, ethtypes.NewLondonSigner(suite.chainID), ethPriv) - suite.Require().NoError(err) - return tx - }}, - {"fail, value bigger than 256bits - AccessListTx", false, func() *ethtypes.Transaction { - tx := ethtypes.NewTx(ðtypes.AccessListTx{ - Nonce: 0, - Data: nil, - To: &suite.to, - Value: exp_10_80, - GasPrice: big.NewInt(1), - Gas: 21000, - }) - tx, err := ethtypes.SignTx(tx, ethtypes.NewEIP2930Signer(suite.chainID), ethPriv) - suite.Require().NoError(err) - return tx - }}, - {"fail, gas price bigger than 256bits - AccessListTx", false, func() *ethtypes.Transaction { - tx := ethtypes.NewTx(ðtypes.AccessListTx{ - Nonce: 0, - Data: nil, - To: &suite.to, - Value: big.NewInt(1), - GasPrice: exp_10_80, - Gas: 21000, - }) - tx, err := ethtypes.SignTx(tx, ethtypes.NewEIP2930Signer(suite.chainID), ethPriv) - suite.Require().NoError(err) - return tx - }}, - {"fail, value bigger than 256bits - LegacyTx", false, func() *ethtypes.Transaction { - tx := ethtypes.NewTx(ðtypes.LegacyTx{ - Nonce: 0, - Data: nil, - To: &suite.to, - Value: exp_10_80, - GasPrice: big.NewInt(1), - Gas: 21000, - }) - tx, err := ethtypes.SignTx(tx, ethtypes.NewEIP2930Signer(suite.chainID), ethPriv) - suite.Require().NoError(err) - return tx - }}, - {"fail, gas price bigger than 256bits - LegacyTx", false, func() *ethtypes.Transaction { - tx := ethtypes.NewTx(ðtypes.LegacyTx{ - Nonce: 0, - Data: nil, - To: &suite.to, - Value: big.NewInt(1), - GasPrice: exp_10_80, - Gas: 21000, - }) - tx, err := ethtypes.SignTx(tx, ethtypes.NewEIP2930Signer(suite.chainID), ethPriv) - suite.Require().NoError(err) - return tx - }}, - } - - for _, tc := range testCases { - ethTx := tc.buildTx() - tx := &types.MsgEthereumTx{} - err := tx.FromEthereumTx(ethTx) - if tc.expectPass { - suite.Require().NoError(err) - - // round-trip test - suite.Require().NoError(assertEqual(tx.AsTransaction(), ethTx)) - } else { - suite.Require().Error(err) - } + suite.Run(tc.name, func() { + tx := types.NewTx(evmTx) + switch { + case strings.Contains(tc.name, "get fee"): + fee = tx.GetFee() + suite.Require().Equal(tc.exp, fee) + case strings.Contains(tc.name, "get effective fee"): + effFee = tx.GetEffectiveFee(big.NewInt(0)) + suite.Require().Equal(tc.exp, effFee) + case strings.Contains(tc.name, "get gas"): + gas := tx.GetGas() + suite.Require().Equal(tc.exp.Uint64(), gas) + } + }) } } diff --git a/x/vm/types/query.go b/x/vm/types/query.go index ad656fe97..e2e78f4cc 100644 --- a/x/vm/types/query.go +++ b/x/vm/types/query.go @@ -1,33 +1,5 @@ package types -import ( - "fmt" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" -) - -// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces -func (m QueryTraceTxRequest) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { - if m.Msg == nil { - return fmt.Errorf("msg cannot be empty") - } - 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 -} - // Failed returns if the contract execution failed in vm errors func (egr EstimateGasResponse) Failed() bool { return len(egr.VmError) > 0 diff --git a/x/vm/types/tx.go b/x/vm/types/tx.go index 96c7bf1fa..7db847983 100644 --- a/x/vm/types/tx.go +++ b/x/vm/types/tx.go @@ -5,6 +5,7 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" ) @@ -22,12 +23,30 @@ type EvmTxArgs struct { GasTipCap *big.Int To *common.Address Accesses *ethtypes.AccessList + + // For SetCodeTxType + AuthorizationList []ethtypes.SetCodeAuthorization `json:"authorizationList"` } // ToTxData converts the EvmTxArgs to TxData -func (args *EvmTxArgs) ToTxData() (TxData, error) { - ethTx := NewTx(args).AsTransaction() - return NewTxDataFromTx(ethTx) +func (args *EvmTxArgs) ToTxData() *TransactionArgs { + return &TransactionArgs{ + Nonce: (*hexutil.Uint64)(&args.Nonce), + Gas: (*hexutil.Uint64)(&args.GasLimit), + Data: (*hexutil.Bytes)(&args.Input), + MaxFeePerGas: (*hexutil.Big)(args.GasFeeCap), + GasPrice: (*hexutil.Big)(args.GasPrice), + ChainID: (*hexutil.Big)(args.ChainID), + MaxPriorityFeePerGas: (*hexutil.Big)(args.GasTipCap), + Value: (*hexutil.Big)(args.Amount), + To: args.To, + AccessList: args.Accesses, + AuthorizationList: args.AuthorizationList, + } +} + +func (args *EvmTxArgs) ToTx() *ethtypes.Transaction { + return args.ToTxData().ToTransaction(ethtypes.LegacyTxType) } // GetTxPriority returns the priority of a given Ethereum tx. It relies of the @@ -35,14 +54,9 @@ func (args *EvmTxArgs) ToTxData() (TxData, error) { // tip price: // // tx_priority = tip_price / priority_reduction -func GetTxPriority(txData TxData, baseFee *big.Int) (priority int64) { +func GetTxPriority(ethTx *ethtypes.Transaction, baseFee *big.Int) (priority int64) { // calculate priority based on effective gas price - tipPrice := txData.EffectiveGasPrice(baseFee) - // if london hardfork is not enabled, tipPrice is the gasPrice - if baseFee != nil { - tipPrice = new(big.Int).Sub(tipPrice, baseFee) - } - + tipPrice, _ := ethTx.EffectiveGasTip(baseFee) priority = math.MaxInt64 priorityBig := new(big.Int).Quo(tipPrice, DefaultPriorityReduction.BigInt()) diff --git a/x/vm/types/tx.pb.go b/x/vm/types/tx.pb.go index 8b1f695b6..f0da31374 100644 --- a/x/vm/types/tx.pb.go +++ b/x/vm/types/tx.pb.go @@ -5,11 +5,8 @@ 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/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" @@ -37,17 +34,12 @@ 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 - Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"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 ethereum transaction + Raw EthereumTx `protobuf:"bytes,6,opt,name=raw,proto3,customtype=EthereumTx" json:"raw"` } func (m *MsgEthereumTx) Reset() { *m = MsgEthereumTx{} } @@ -83,183 +75,6 @@ func (m *MsgEthereumTx) XXX_DiscardUnknown() { 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_77a8ac5e8c9c4850, []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_77a8ac5e8c9c4850, []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 dynamic 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 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_77a8ac5e8c9c4850, []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 { } @@ -268,7 +83,7 @@ func (m *ExtensionOptionsEthereumTx) Reset() { *m = ExtensionOptionsEthe func (m *ExtensionOptionsEthereumTx) String() string { return proto.CompactTextString(m) } func (*ExtensionOptionsEthereumTx) ProtoMessage() {} func (*ExtensionOptionsEthereumTx) Descriptor() ([]byte, []int) { - return fileDescriptor_77a8ac5e8c9c4850, []int{4} + return fileDescriptor_77a8ac5e8c9c4850, []int{1} } func (m *ExtensionOptionsEthereumTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -319,7 +134,7 @@ 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_77a8ac5e8c9c4850, []int{5} + return fileDescriptor_77a8ac5e8c9c4850, []int{2} } func (m *MsgEthereumTxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -361,7 +176,7 @@ 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_77a8ac5e8c9c4850, []int{6} + return fileDescriptor_77a8ac5e8c9c4850, []int{3} } func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -413,7 +228,7 @@ 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_77a8ac5e8c9c4850, []int{7} + return fileDescriptor_77a8ac5e8c9c4850, []int{4} } func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -454,7 +269,7 @@ func (m *MsgRegisterPreinstalls) Reset() { *m = MsgRegisterPreinstalls{} func (m *MsgRegisterPreinstalls) String() string { return proto.CompactTextString(m) } func (*MsgRegisterPreinstalls) ProtoMessage() {} func (*MsgRegisterPreinstalls) Descriptor() ([]byte, []int) { - return fileDescriptor_77a8ac5e8c9c4850, []int{8} + return fileDescriptor_77a8ac5e8c9c4850, []int{5} } func (m *MsgRegisterPreinstalls) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -506,7 +321,7 @@ func (m *MsgRegisterPreinstallsResponse) Reset() { *m = MsgRegisterPrein func (m *MsgRegisterPreinstallsResponse) String() string { return proto.CompactTextString(m) } func (*MsgRegisterPreinstallsResponse) ProtoMessage() {} func (*MsgRegisterPreinstallsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_77a8ac5e8c9c4850, []int{9} + return fileDescriptor_77a8ac5e8c9c4850, []int{6} } func (m *MsgRegisterPreinstallsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -537,9 +352,6 @@ var xxx_messageInfo_MsgRegisterPreinstallsResponse proto.InternalMessageInfo func init() { proto.RegisterType((*MsgEthereumTx)(nil), "cosmos.evm.vm.v1.MsgEthereumTx") - proto.RegisterType((*LegacyTx)(nil), "cosmos.evm.vm.v1.LegacyTx") - proto.RegisterType((*AccessListTx)(nil), "cosmos.evm.vm.v1.AccessListTx") - proto.RegisterType((*DynamicFeeTx)(nil), "cosmos.evm.vm.v1.DynamicFeeTx") proto.RegisterType((*ExtensionOptionsEthereumTx)(nil), "cosmos.evm.vm.v1.ExtensionOptionsEthereumTx") proto.RegisterType((*MsgEthereumTxResponse)(nil), "cosmos.evm.vm.v1.MsgEthereumTxResponse") proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.evm.vm.v1.MsgUpdateParams") @@ -551,78 +363,50 @@ func init() { func init() { proto.RegisterFile("cosmos/evm/vm/v1/tx.proto", fileDescriptor_77a8ac5e8c9c4850) } var fileDescriptor_77a8ac5e8c9c4850 = []byte{ - // 1128 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xdf, 0x6b, 0x23, 0x45, - 0x1c, 0xef, 0x26, 0x9b, 0x5f, 0x93, 0x78, 0x77, 0xee, 0xb5, 0x76, 0x1b, 0xee, 0xb2, 0xb9, 0xd5, - 0x3b, 0x73, 0x95, 0x66, 0xbd, 0x0a, 0x42, 0xe3, 0x53, 0x73, 0x6d, 0xa5, 0xd2, 0x62, 0x59, 0x73, - 0x2f, 0x22, 0xc4, 0xe9, 0xee, 0x74, 0xb3, 0x98, 0xdd, 0x59, 0x77, 0x26, 0x21, 0x11, 0x04, 0xb9, - 0x27, 0xf1, 0x49, 0xf0, 0x59, 0xf0, 0xc1, 0x07, 0xf5, 0xa9, 0x0f, 0xf7, 0xe4, 0x5f, 0x70, 0xf8, - 0x74, 0x28, 0x88, 0x88, 0xe4, 0xa4, 0x15, 0x0a, 0x7d, 0xf4, 0x2f, 0x90, 0x99, 0xd9, 0x34, 0x9b, - 0x26, 0xfd, 0x61, 0x41, 0x21, 0x84, 0x99, 0xf9, 0x7e, 0xbe, 0xdf, 0x99, 0xef, 0xe7, 0xf3, 0xd9, - 0xd9, 0x05, 0x0b, 0x16, 0x26, 0x1e, 0x26, 0x06, 0xea, 0x7a, 0x06, 0xfb, 0x3d, 0x30, 0x68, 0xaf, - 0x1a, 0x84, 0x98, 0x62, 0xe5, 0x86, 0x08, 0x55, 0x51, 0xd7, 0xab, 0xb2, 0xdf, 0x83, 0xe2, 0x8b, - 0xd0, 0x73, 0x7d, 0x6c, 0xf0, 0x7f, 0x01, 0x2a, 0x16, 0x27, 0xf2, 0x19, 0x5c, 0xc4, 0xe6, 0xa3, - 0x98, 0x47, 0x1c, 0x16, 0xf0, 0x88, 0x13, 0x05, 0xa2, 0x4d, 0x9b, 0x7c, 0x66, 0x44, 0xdb, 0x88, - 0xd0, 0xac, 0x83, 0x1d, 0x2c, 0xd6, 0xd9, 0x28, 0x5a, 0xbd, 0xe5, 0x60, 0xec, 0xb4, 0x91, 0x01, - 0x03, 0xd7, 0x80, 0xbe, 0x8f, 0x29, 0xa4, 0x2e, 0xf6, 0x87, 0x39, 0x0b, 0x51, 0x94, 0xcf, 0x76, - 0x3b, 0x7b, 0x06, 0xf4, 0xfb, 0x22, 0xa4, 0x1f, 0x4a, 0xe0, 0x85, 0x6d, 0xe2, 0xac, 0xd3, 0x16, - 0x0a, 0x51, 0xc7, 0x6b, 0xf4, 0x94, 0x0a, 0x90, 0x6d, 0x48, 0xa1, 0x2a, 0x95, 0xa5, 0x4a, 0x7e, - 0x79, 0xb6, 0x2a, 0x72, 0xab, 0xc3, 0xdc, 0xea, 0xaa, 0xdf, 0x37, 0x39, 0x42, 0x29, 0x01, 0x99, - 0xb8, 0x9f, 0x20, 0x35, 0x51, 0x96, 0x2a, 0x52, 0x1d, 0x1c, 0x0f, 0x34, 0x69, 0xe9, 0xbb, 0xa3, - 0xfd, 0x45, 0xc9, 0xe4, 0xeb, 0xca, 0x2b, 0x40, 0x6e, 0x41, 0xd2, 0x52, 0x93, 0x65, 0xa9, 0x92, - 0xab, 0xdf, 0xf8, 0x7b, 0xa0, 0x65, 0xc2, 0x76, 0x50, 0xd3, 0x97, 0xf4, 0x08, 0xc5, 0xa2, 0xca, - 0x6b, 0xe0, 0xba, 0x8d, 0x82, 0x10, 0x59, 0x90, 0x22, 0xbb, 0xb9, 0x17, 0x62, 0x4f, 0x95, 0x79, - 0x42, 0x42, 0x95, 0xcc, 0x6b, 0xa3, 0xd0, 0x46, 0x88, 0x3d, 0x45, 0x01, 0x32, 0x47, 0xa4, 0xca, - 0x52, 0xa5, 0x60, 0xf2, 0x71, 0xed, 0xce, 0xe7, 0xdf, 0x68, 0x33, 0x5f, 0x1c, 0xed, 0x2f, 0xaa, - 0x31, 0xaa, 0xc7, 0x7a, 0xd2, 0xbf, 0x4f, 0x80, 0xec, 0x16, 0x72, 0xa0, 0xd5, 0x6f, 0xf4, 0x94, - 0x59, 0x90, 0xf2, 0xb1, 0x6f, 0x21, 0xde, 0xa1, 0x6c, 0x8a, 0x89, 0xf2, 0x26, 0xc8, 0x39, 0x90, - 0x31, 0xee, 0x5a, 0xa2, 0xa3, 0x5c, 0x7d, 0xe1, 0xf7, 0x81, 0x36, 0x27, 0x6a, 0x12, 0xfb, 0xa3, - 0xaa, 0x8b, 0x0d, 0x0f, 0xd2, 0x56, 0x75, 0xd3, 0xa7, 0x66, 0xd6, 0x81, 0x64, 0x87, 0x41, 0x95, - 0x12, 0x48, 0x3a, 0x90, 0xf0, 0x1e, 0xe5, 0x7a, 0xe1, 0x60, 0xa0, 0x65, 0xdf, 0x86, 0x64, 0xcb, - 0xf5, 0x5c, 0x6a, 0xb2, 0x80, 0x72, 0x0d, 0x24, 0x28, 0x16, 0x1d, 0x99, 0x09, 0x8a, 0x95, 0x15, - 0x90, 0xea, 0xc2, 0x76, 0x07, 0xf1, 0x16, 0x72, 0xf5, 0x97, 0xcf, 0xdc, 0xe3, 0x60, 0xa0, 0xa5, - 0x57, 0x3d, 0xdc, 0xf1, 0xa9, 0x29, 0x32, 0x58, 0xf3, 0x5c, 0x99, 0xb4, 0x68, 0x9e, 0x6b, 0x50, - 0x00, 0x52, 0x57, 0xcd, 0xf0, 0x05, 0xa9, 0xcb, 0x66, 0xa1, 0x9a, 0x15, 0xb3, 0x90, 0xcd, 0x88, - 0x9a, 0x13, 0x33, 0x52, 0xbb, 0xc7, 0x68, 0xfa, 0xe9, 0xc9, 0x52, 0xba, 0xd1, 0x5b, 0x83, 0x14, - 0x32, 0xc2, 0x6e, 0xc6, 0x08, 0x1b, 0xd2, 0xa3, 0x3f, 0x4f, 0x82, 0xc2, 0xaa, 0x65, 0x21, 0x42, - 0xb6, 0x5c, 0x42, 0x1b, 0x3d, 0xe5, 0x1d, 0x90, 0xb5, 0x5a, 0xd0, 0xf5, 0x9b, 0xae, 0xcd, 0x29, - 0xcb, 0xd5, 0x8d, 0xf3, 0x0e, 0x9d, 0x79, 0xc8, 0xc0, 0x9b, 0x6b, 0xc7, 0x03, 0x2d, 0x63, 0x89, - 0xa1, 0x19, 0x0d, 0xec, 0x11, 0xf7, 0x89, 0x33, 0xb9, 0x4f, 0xfe, 0x6b, 0xee, 0xe5, 0xf3, 0xb9, - 0x4f, 0x4d, 0x72, 0x9f, 0xbe, 0x32, 0xf7, 0x99, 0x18, 0xf7, 0x1f, 0x82, 0x2c, 0xe4, 0x44, 0x21, - 0xa2, 0x66, 0xcb, 0xc9, 0x4a, 0x7e, 0xf9, 0x76, 0xf5, 0xf4, 0x95, 0x50, 0x15, 0x54, 0x36, 0x3a, - 0x41, 0x1b, 0xd5, 0xef, 0x3e, 0x1d, 0x68, 0x33, 0xc7, 0x03, 0x0d, 0xc0, 0x13, 0x7e, 0x7f, 0x78, - 0xae, 0x81, 0x11, 0xdb, 0xe2, 0xb9, 0x38, 0xa9, 0x2a, 0xd4, 0xcd, 0x8d, 0xa9, 0x0b, 0xc6, 0xd4, - 0xcd, 0x0f, 0xd5, 0x5d, 0x9c, 0x54, 0x77, 0x3e, 0xa6, 0x6e, 0x5c, 0x50, 0xfd, 0x6b, 0x19, 0x14, - 0xd6, 0xfa, 0x3e, 0xf4, 0x5c, 0x6b, 0x03, 0xa1, 0xff, 0x45, 0xe1, 0x15, 0x90, 0x67, 0x0a, 0x53, - 0x37, 0x68, 0x5a, 0x30, 0xb8, 0x58, 0x63, 0xe6, 0x87, 0x86, 0x1b, 0x3c, 0x84, 0xc1, 0x30, 0x75, - 0x0f, 0x21, 0x9e, 0x2a, 0x5f, 0x26, 0x75, 0x03, 0x21, 0x96, 0x1a, 0xf9, 0x23, 0x75, 0xbe, 0x3f, - 0xd2, 0x93, 0xfe, 0xc8, 0x5c, 0xd9, 0x1f, 0xd9, 0x33, 0xfc, 0x91, 0xfb, 0xef, 0xfc, 0x01, 0xc6, - 0xfc, 0x91, 0x1f, 0xf3, 0x47, 0xe1, 0x92, 0xfe, 0x88, 0xdb, 0x41, 0xd7, 0x41, 0x71, 0xbd, 0x47, - 0x91, 0x4f, 0x5c, 0xec, 0xbf, 0x1b, 0xf0, 0x17, 0xc9, 0xe8, 0x2e, 0xad, 0xc9, 0xac, 0x92, 0xfe, - 0xad, 0x04, 0xe6, 0xc6, 0xee, 0x58, 0x13, 0x91, 0x00, 0xfb, 0x84, 0x33, 0xc1, 0x6f, 0x7d, 0x6e, - 0xa4, 0xe8, 0x8e, 0xbf, 0x0f, 0xe4, 0x36, 0x76, 0x88, 0x9a, 0xe0, 0x2c, 0xcc, 0x4d, 0xb2, 0xb0, - 0x85, 0x1d, 0x93, 0x43, 0x94, 0x1b, 0x20, 0x19, 0x22, 0xca, 0x1d, 0x52, 0x30, 0xd9, 0x50, 0x59, - 0x00, 0xd9, 0xae, 0xd7, 0x44, 0x61, 0x88, 0xc3, 0xe8, 0x1e, 0xcd, 0x74, 0xbd, 0x75, 0x36, 0x65, - 0x21, 0xe6, 0x8d, 0x0e, 0x41, 0xb6, 0x50, 0xd9, 0xcc, 0x38, 0x90, 0x3c, 0x22, 0xc8, 0x8e, 0x8e, - 0xf9, 0xa3, 0x04, 0xae, 0x6f, 0x13, 0xe7, 0x51, 0x60, 0x43, 0x8a, 0x76, 0x60, 0x08, 0x3d, 0xc2, - 0x6e, 0x1b, 0xd8, 0xa1, 0x2d, 0x1c, 0xba, 0xb4, 0x1f, 0xd9, 0x5d, 0xfd, 0xf9, 0xc9, 0xd2, 0x6c, - 0x74, 0xa8, 0x55, 0xdb, 0x0e, 0x11, 0x21, 0xef, 0xd1, 0xd0, 0xf5, 0x1d, 0x73, 0x04, 0x55, 0xde, - 0x02, 0xe9, 0x80, 0x57, 0xe0, 0xd6, 0xce, 0x2f, 0xab, 0x93, 0x6d, 0x88, 0x1d, 0xea, 0x39, 0xa6, - 0xa3, 0xd0, 0x2a, 0x4a, 0xa9, 0x2d, 0x3f, 0x3e, 0xda, 0x5f, 0x1c, 0x15, 0x63, 0xfc, 0x6b, 0x31, - 0xfe, 0x7b, 0x86, 0x78, 0x67, 0xc5, 0x0f, 0xaa, 0x2f, 0x80, 0xf9, 0x53, 0x4b, 0x43, 0x92, 0xf5, - 0x5f, 0x25, 0xf0, 0xd2, 0x36, 0x71, 0x4c, 0xe4, 0xb8, 0x84, 0xa2, 0x70, 0x27, 0x44, 0xae, 0x4f, - 0x28, 0x6c, 0xb7, 0xaf, 0xde, 0xde, 0x26, 0xc8, 0x07, 0xa3, 0x32, 0x91, 0x54, 0xb7, 0xa6, 0xf4, - 0x78, 0x02, 0x8a, 0xf7, 0x19, 0xcf, 0xad, 0xad, 0x4c, 0x36, 0x7b, 0x6f, 0x4a, 0xb3, 0x53, 0x4e, - 0xaf, 0x97, 0x41, 0x69, 0x7a, 0x64, 0xd8, 0xfa, 0xf2, 0x1f, 0x09, 0x90, 0xdc, 0x26, 0x8e, 0xf2, - 0x29, 0x00, 0xb1, 0xaf, 0x16, 0x6d, 0xf2, 0xa0, 0x63, 0xf6, 0x2c, 0xbe, 0x7a, 0x01, 0xe0, 0x84, - 0xda, 0xbb, 0x8f, 0x7f, 0xf9, 0xeb, 0xab, 0x84, 0xa6, 0xdf, 0x36, 0x26, 0xbf, 0xdc, 0x22, 0x74, - 0x93, 0xf6, 0x94, 0x0f, 0x40, 0x61, 0xcc, 0x55, 0x77, 0xa6, 0xd6, 0x8f, 0x43, 0x8a, 0xf7, 0x2f, - 0x84, 0x9c, 0x3c, 0x44, 0x1f, 0x83, 0x9b, 0xd3, 0xb4, 0xad, 0x4c, 0xad, 0x30, 0x05, 0x59, 0x7c, - 0xfd, 0xb2, 0xc8, 0xe1, 0x96, 0xc5, 0xd4, 0x67, 0x4c, 0xc8, 0x7a, 0xed, 0xe9, 0x41, 0x49, 0x7a, - 0x76, 0x50, 0x92, 0xfe, 0x3c, 0x28, 0x49, 0x5f, 0x1e, 0x96, 0x66, 0x9e, 0x1d, 0x96, 0x66, 0x7e, - 0x3b, 0x2c, 0xcd, 0xbc, 0x5f, 0x76, 0x5c, 0xda, 0xea, 0xec, 0x56, 0x2d, 0xec, 0x19, 0xa7, 0xd5, - 0xa4, 0xfd, 0x00, 0x91, 0xdd, 0x34, 0xff, 0x48, 0x7c, 0xe3, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x8a, 0x31, 0x4a, 0xe9, 0x34, 0x0b, 0x00, 0x00, + // 678 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4f, 0x6b, 0x13, 0x41, + 0x1c, 0xcd, 0x66, 0xb7, 0x6d, 0x3a, 0xad, 0x18, 0xc7, 0xd6, 0x6e, 0x97, 0xba, 0x49, 0x17, 0xff, + 0xa4, 0x05, 0xb3, 0x36, 0x82, 0x60, 0x3c, 0x19, 0xe8, 0xc1, 0x60, 0xb0, 0xac, 0xf6, 0x22, 0x42, + 0x98, 0x36, 0xe3, 0x64, 0x21, 0xbb, 0xb3, 0xce, 0x4c, 0x62, 0x7a, 0x10, 0xa4, 0x78, 0x10, 0x4f, + 0x82, 0x5f, 0xc0, 0x83, 0x07, 0x8f, 0x3d, 0x78, 0xf2, 0x13, 0xf4, 0x58, 0x14, 0x44, 0x44, 0x8a, + 0xb4, 0x42, 0xbf, 0x86, 0xcc, 0xee, 0xb6, 0xd9, 0x34, 0x0b, 0x15, 0x61, 0x09, 0xb3, 0xf3, 0xde, + 0xef, 0xfd, 0x7e, 0x6f, 0xde, 0x64, 0xc1, 0xfc, 0x26, 0xe5, 0x1e, 0xe5, 0x36, 0xee, 0x79, 0xb6, + 0x7c, 0x56, 0x6c, 0xd1, 0x2f, 0x07, 0x8c, 0x0a, 0x0a, 0xf3, 0x11, 0x54, 0xc6, 0x3d, 0xaf, 0x2c, + 0x9f, 0x15, 0xe3, 0x02, 0xf2, 0x5c, 0x9f, 0xda, 0xe1, 0x6f, 0x44, 0x32, 0x8c, 0x91, 0x7a, 0x49, + 0x8f, 0xb0, 0xb9, 0x18, 0xf3, 0x38, 0x91, 0x80, 0xc7, 0x49, 0x0c, 0xc4, 0x4d, 0x9b, 0xe1, 0x9b, + 0x1d, 0xb7, 0x89, 0xa0, 0x19, 0x42, 0x09, 0x8d, 0xf6, 0xe5, 0x2a, 0xde, 0x5d, 0x20, 0x94, 0x92, + 0x0e, 0xb6, 0x51, 0xe0, 0xda, 0xc8, 0xf7, 0xa9, 0x40, 0xc2, 0xa5, 0x7e, 0x5c, 0x63, 0xbd, 0x56, + 0xc0, 0xb9, 0x06, 0x27, 0xab, 0xa2, 0x8d, 0x19, 0xee, 0x7a, 0x8f, 0xfb, 0x10, 0x02, 0xed, 0x19, + 0xa3, 0x9e, 0x3e, 0x56, 0x54, 0x4a, 0xd3, 0x4e, 0xb8, 0x86, 0x57, 0x80, 0xca, 0xd0, 0x0b, 0x7d, + 0x5c, 0x6e, 0xd5, 0xe0, 0xee, 0x7e, 0x21, 0xf3, 0x73, 0xbf, 0x00, 0x06, 0x45, 0x8e, 0x84, 0xab, + 0x8b, 0x6f, 0x3e, 0x14, 0x32, 0x6f, 0x8f, 0x76, 0x96, 0xf5, 0x84, 0xb1, 0x21, 0xf1, 0xba, 0x96, + 0x53, 0xf2, 0xd9, 0xba, 0x96, 0xcb, 0xe6, 0xd5, 0xba, 0x96, 0x53, 0xf3, 0x5a, 0x5d, 0xcb, 0x69, + 0xf9, 0x31, 0xcb, 0x02, 0xc6, 0x6a, 0x5f, 0x60, 0x9f, 0xbb, 0xd4, 0x7f, 0x18, 0x84, 0x03, 0x0e, + 0xaa, 0xaa, 0x9a, 0x14, 0xb6, 0x3e, 0x2a, 0x60, 0x76, 0x48, 0xcd, 0xc1, 0x3c, 0xa0, 0x3e, 0xc7, + 0x72, 0xe4, 0x36, 0xe2, 0x6d, 0x5d, 0x29, 0x2a, 0xa5, 0x49, 0x27, 0x5c, 0xc3, 0x25, 0xa0, 0x75, + 0x28, 0xe1, 0x7a, 0xb6, 0xa8, 0x96, 0xa6, 0x2a, 0xb3, 0xe5, 0xd3, 0x81, 0x94, 0x1f, 0x50, 0xe2, + 0x84, 0x14, 0x98, 0x07, 0x2a, 0xc3, 0x42, 0x57, 0x43, 0xc3, 0x72, 0x09, 0xe7, 0x41, 0xae, 0xe7, + 0x35, 0x31, 0x63, 0x94, 0xe9, 0x5a, 0x28, 0x3a, 0xd1, 0xf3, 0x56, 0xe5, 0xab, 0x84, 0x08, 0xe2, + 0xcd, 0x2e, 0xc7, 0xad, 0xf0, 0x88, 0x34, 0x67, 0x82, 0x20, 0xbe, 0xce, 0x71, 0x2b, 0x1e, 0xf3, + 0x8b, 0x02, 0xce, 0x37, 0x38, 0x59, 0x0f, 0x5a, 0x48, 0xe0, 0x35, 0xc4, 0x90, 0xc7, 0xe1, 0x6d, + 0x30, 0x89, 0xba, 0xa2, 0x4d, 0x99, 0x2b, 0xb6, 0xa2, 0x29, 0x6b, 0xfa, 0xd7, 0xcf, 0x37, 0x66, + 0xe2, 0xa1, 0xee, 0xb5, 0x5a, 0x0c, 0x73, 0xfe, 0x48, 0x30, 0xd7, 0x27, 0xce, 0x80, 0x0a, 0xef, + 0x82, 0xf1, 0x20, 0x54, 0xd0, 0xb3, 0x45, 0xa5, 0x34, 0x55, 0xd1, 0x47, 0x6d, 0x44, 0x1d, 0x6a, + 0x93, 0x32, 0x94, 0x4f, 0x47, 0x3b, 0xcb, 0x8a, 0x13, 0x97, 0x54, 0x2b, 0xdb, 0x47, 0x3b, 0xcb, + 0x03, 0x31, 0x19, 0x4c, 0x21, 0x11, 0x4c, 0xdf, 0x8e, 0xd2, 0x49, 0x0e, 0x6a, 0xcd, 0x83, 0xb9, + 0x53, 0x5b, 0xc7, 0x87, 0x6c, 0x7d, 0x57, 0xc0, 0xa5, 0x06, 0x27, 0x0e, 0x26, 0x2e, 0x17, 0x98, + 0xad, 0x31, 0xec, 0xfa, 0x5c, 0xa0, 0x4e, 0xe7, 0xff, 0xed, 0xdd, 0x07, 0x53, 0xc1, 0x40, 0x26, + 0x8e, 0x6a, 0x21, 0xc5, 0xe3, 0x09, 0x29, 0xe9, 0x33, 0x59, 0x5b, 0xbd, 0x33, 0x6a, 0xf6, 0x5a, + 0x8a, 0xd9, 0x94, 0xe9, 0xad, 0x22, 0x30, 0xd3, 0x91, 0x63, 0xeb, 0x95, 0x5f, 0x59, 0xa0, 0x36, + 0x38, 0x81, 0x2f, 0x41, 0xe2, 0xce, 0xc3, 0xc2, 0xe8, 0xa0, 0x43, 0xd7, 0xd3, 0xb8, 0x7e, 0x06, + 0xe1, 0xe4, 0x68, 0xaf, 0x6e, 0x7f, 0xfb, 0xf3, 0x3e, 0x5b, 0xb0, 0x2e, 0xdb, 0xa3, 0x5f, 0x84, + 0x98, 0xdd, 0x14, 0x7d, 0xf8, 0x14, 0x4c, 0x0f, 0xdd, 0xaa, 0xc5, 0x54, 0xfd, 0x24, 0xc5, 0x58, + 0x3a, 0x93, 0x72, 0xf2, 0x27, 0x7a, 0x0e, 0x2e, 0xa6, 0x65, 0x5b, 0x4a, 0x55, 0x48, 0x61, 0x1a, + 0x37, 0xff, 0x95, 0x79, 0xdc, 0xd2, 0x18, 0x7b, 0x25, 0x83, 0xac, 0x55, 0x77, 0x0f, 0x4c, 0x65, + 0xef, 0xc0, 0x54, 0x7e, 0x1f, 0x98, 0xca, 0xbb, 0x43, 0x33, 0xb3, 0x77, 0x68, 0x66, 0x7e, 0x1c, + 0x9a, 0x99, 0x27, 0x45, 0xe2, 0x8a, 0x76, 0x77, 0xa3, 0xbc, 0x49, 0x3d, 0xfb, 0x74, 0x9a, 0x62, + 0x2b, 0xc0, 0x7c, 0x63, 0x3c, 0xfc, 0x8c, 0xdd, 0xfa, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x48, + 0x3b, 0x6f, 0x8c, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -811,6 +595,16 @@ func (m *MsgEthereumTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = 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) @@ -818,42 +612,10 @@ func (m *MsgEthereumTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintTx(dAtA, i, uint64(len(m.Hash))) - 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) { +func (m *ExtensionOptionsEthereumTx) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -863,89 +625,20 @@ func (m *LegacyTx) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *LegacyTx) MarshalTo(dAtA []byte) (int, error) { +func (m *ExtensionOptionsEthereumTx) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *LegacyTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ExtensionOptionsEthereumTx) 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) { +func (m *MsgEthereumTxResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -955,41 +648,39 @@ func (m *AccessListTx) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AccessListTx) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgEthereumTxResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AccessListTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgEthereumTxResponse) 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))) + if m.GasUsed != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.GasUsed)) i-- - dAtA[i] = 0x5a + dAtA[i] = 0x28 } - if len(m.R) > 0 { - i -= len(m.R) - copy(dAtA[i:], m.R) - i = encodeVarintTx(dAtA, i, uint64(len(m.R))) + 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] = 0x52 + dAtA[i] = 0x22 } - if len(m.V) > 0 { - i -= len(m.V) - copy(dAtA[i:], m.V) - i = encodeVarintTx(dAtA, i, uint64(len(m.V))) + 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] = 0x4a + dAtA[i] = 0x1a } - if len(m.Accesses) > 0 { - for iNdEx := len(m.Accesses) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Logs) > 0 { + for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Accesses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Logs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -997,73 +688,20 @@ func (m *AccessListTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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)) + dAtA[i] = 0x12 } - 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)) - } + 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 *DynamicFeeTx) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1073,127 +711,37 @@ func (m *DynamicFeeTx) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DynamicFeeTx) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DynamicFeeTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateParams) 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)) + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x1a - } - if m.Nonce != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Nonce)) - i-- - dAtA[i] = 0x10 + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - 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] = 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 *ExtensionOptionsEthereumTx) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1203,12 +751,12 @@ func (m *ExtensionOptionsEthereumTx) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExtensionOptionsEthereumTx) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ExtensionOptionsEthereumTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1216,7 +764,7 @@ func (m *ExtensionOptionsEthereumTx) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *MsgEthereumTxResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgRegisterPreinstalls) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1226,155 +774,29 @@ func (m *MsgEthereumTxResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgEthereumTxResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgRegisterPreinstalls) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgEthereumTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgRegisterPreinstalls) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - 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 (m *MsgRegisterPreinstalls) 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 *MsgRegisterPreinstalls) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterPreinstalls) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Preinstalls) > 0 { - for iNdEx := len(m.Preinstalls) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Preinstalls[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.Preinstalls) > 0 { + for iNdEx := len(m.Preinstalls) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Preinstalls[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.Authority) > 0 { i -= len(m.Authority) @@ -1426,178 +848,12 @@ func (m *MsgEthereumTx) Size() (n int) { } 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.Hash) - 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)) } - 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)) - } + l = m.Raw.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -1727,11 +983,11 @@ func (m *MsgEthereumTx) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgEthereumTx: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1741,1130 +997,29 @@ func (m *MsgEthereumTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen 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 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 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 - 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 + m.From = append(m.From[:0], dAtA[iNdEx:postIndex]...) + if m.From == nil { + m.From = []byte{} } 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) + return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -2891,147 +1046,10 @@ func (m *DynamicFeeTx) Unmarshal(dAtA []byte) error { 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 { + if err := m.Raw.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:]) diff --git a/x/vm/types/tx_args.go b/x/vm/types/tx_args.go index c4acdc11d..9f382e77a 100644 --- a/x/vm/types/tx_args.go +++ b/x/vm/types/tx_args.go @@ -1,3 +1,19 @@ +// Copyright 2021 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + package types import ( @@ -9,16 +25,14 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core" - ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto/kzg4844" - - sdkmath "cosmossdk.io/math" + "github.com/ethereum/go-ethereum/log" + "github.com/holiman/uint256" ) // 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 +// or a message call. type TransactionArgs struct { From *common.Address `json:"from"` To *common.Address `json:"to"` @@ -36,8 +50,8 @@ type TransactionArgs struct { Input *hexutil.Bytes `json:"input"` // Introduced by AccessListTxType transaction. - AccessList *ethtypes.AccessList `json:"accessList,omitempty"` - ChainID *hexutil.Big `json:"chainId,omitempty"` + AccessList *types.AccessList `json:"accessList,omitempty"` + ChainID *hexutil.Big `json:"chainId,omitempty"` // For BlobTxType BlobFeeCap *hexutil.Big `json:"maxFeePerBlobGas"` @@ -49,159 +63,91 @@ type TransactionArgs struct { Proofs []kzg4844.Proof `json:"proofs"` // For SetCodeTxType - AuthorizationList []ethtypes.SetCodeAuthorization `json:"authorizationList"` -} - -// 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) + AuthorizationList []types.SetCodeAuthorization `json:"authorizationList"` } -// ToTransaction converts the arguments to an ethereum transaction. -// This assumes that setTxDefaults has been called. -func (args *TransactionArgs) ToTransaction() *MsgEthereumTx { - var ( - chainID, value, gasPrice, maxFeePerGas, maxPriorityFeePerGas sdkmath.Int - gas, nonce uint64 - from []byte - to string - ) - - // Set sender address or use zero address if none specified. - if args.ChainID != nil { - chainID = sdkmath.NewIntFromBigInt(args.ChainID.ToInt()) +// GetFrom retrieves the transaction sender address. +func (args *TransactionArgs) GetFrom() common.Address { + if args.From == nil { + return common.Address{} } + return *args.From +} - if args.Nonce != nil { - nonce = uint64(*args.Nonce) +// GetData retrieves the transaction calldata. Input field is preferred. +func (args *TransactionArgs) GetData() []byte { + if args.Input != nil { + return *args.Input } - - if args.Gas != nil { - gas = uint64(*args.Gas) + if args.Data != nil { + return *args.Data } + return nil +} - if args.GasPrice != nil { - gasPrice = sdkmath.NewIntFromBigInt(args.GasPrice.ToInt()) +// CallDefaults sanitizes the transaction arguments, often filling in zero values, +// for the purpose of eth_call class of RPC methods. +func (args *TransactionArgs) CallDefaults(globalGasCap uint64, baseFee *big.Int, chainID *big.Int) error { + // Reject invalid combinations of pre- and post-1559 fee styles + if args.GasPrice != nil && (args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil) { + return errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified") } - - if args.MaxFeePerGas != nil { - maxFeePerGas = sdkmath.NewIntFromBigInt(args.MaxFeePerGas.ToInt()) + if args.ChainID == nil { + args.ChainID = (*hexutil.Big)(chainID) + } else { + if have := (*big.Int)(args.ChainID); have.Cmp(chainID) != 0 { + return fmt.Errorf("chainId does not match node's (have=%v, want=%v)", have, chainID) + } } - - if args.MaxPriorityFeePerGas != nil { - maxPriorityFeePerGas = sdkmath.NewIntFromBigInt(args.MaxPriorityFeePerGas.ToInt()) + if args.Gas == nil { + gas := globalGasCap + if gas == 0 { + gas = uint64(math.MaxUint64 / 2) + } + args.Gas = (*hexutil.Uint64)(&gas) + } else if globalGasCap > 0 && globalGasCap < uint64(*args.Gas) { + log.Warn("Caller gas above allowance, capping", "requested", args.Gas, "cap", globalGasCap) + args.Gas = (*hexutil.Uint64)(&globalGasCap) } - - if args.Value != nil { - value = sdkmath.NewIntFromBigInt(args.Value.ToInt()) + if args.Nonce == nil { + args.Nonce = new(hexutil.Uint64) } - - if args.To != nil { - to = args.To.Hex() + if args.Value == nil { + args.Value = new(hexutil.Big) } - - var data TxData - switch { - case args.MaxFeePerGas != nil: - al := AccessList{} - if args.AccessList != nil { - al = NewAccessList(args.AccessList) - } - - data = &DynamicFeeTx{ - To: to, - ChainID: &chainID, - Nonce: nonce, - GasLimit: gas, - GasFeeCap: &maxFeePerGas, - GasTipCap: &maxPriorityFeePerGas, - Amount: &value, - Data: args.GetData(), - Accesses: al, + if baseFee == nil { + // If there's no basefee, then it must be a non-1559 execution + if args.GasPrice == nil { + args.GasPrice = new(hexutil.Big) } - case args.AccessList != nil: - data = &AccessListTx{ - To: to, - ChainID: &chainID, - Nonce: nonce, - GasLimit: gas, - GasPrice: &gasPrice, - Amount: &value, - Data: args.GetData(), - Accesses: NewAccessList(args.AccessList), + } else { + // A basefee is provided, necessitating 1559-type execution + if args.MaxFeePerGas == nil { + args.MaxFeePerGas = new(hexutil.Big) } - default: - data = &LegacyTx{ - To: to, - Nonce: nonce, - GasLimit: gas, - GasPrice: &gasPrice, - Amount: &value, - Data: args.GetData(), + if args.MaxPriorityFeePerGas == nil { + args.MaxPriorityFeePerGas = new(hexutil.Big) } } - - anyData, err := PackTxData(data) - if err != nil { - return nil - } - - if args.From != nil { - from = args.From.Bytes() + if args.BlobFeeCap == nil && args.BlobHashes != nil { + args.BlobFeeCap = new(hexutil.Big) } - msg := MsgEthereumTx{ - Data: anyData, - From: from, - } - msg.Hash = msg.AsTransaction().Hash().Hex() - return &msg + return nil } -// 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, skipNonceCheck, - skipEoACheck bool, -) (core.Message, error) { - // Reject invalid combinations of pre- and post-1559 fee styles - if args.GasPrice != nil && (args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil) { - return core.Message{}, 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 - } +// ToMessage converts the transaction arguments to the Message type used by the +// core evm. This method is used in calls and traces that do not require a real +// live transaction. +// Assumes that fields are not nil, i.e. setDefaults or CallDefaults has been called. +func (args *TransactionArgs) ToMessage(baseFee *big.Int, skipNonceCheck, skipEoACheck bool) *core.Message { 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() - } + gasPrice = args.GasPrice.ToInt() gasFeeCap, gasTipCap = gasPrice, gasPrice } else { // A basefee is provided, necessitating 1559-type execution @@ -210,50 +156,33 @@ func (args *TransactionArgs) ToMessage(globalGasCap uint64, baseFee *big.Int, sk gasPrice = args.GasPrice.ToInt() gasFeeCap, gasTipCap = gasPrice, gasPrice } else { - // User specified 1559 gas feilds (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() - } + // User specified 1559 gas fields (or none), use those + gasFeeCap = args.MaxFeePerGas.ToInt() + 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 = new(big.Int).Add(gasTipCap, baseFee) + gasPrice = gasPrice.Add(gasTipCap, baseFee) if gasPrice.Cmp(gasFeeCap) > 0 { gasPrice = gasFeeCap } } } } - value := new(big.Int) - if args.Value != nil { - value = args.Value.ToInt() - } - data := args.GetData() - var accessList ethtypes.AccessList + 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, + return &core.Message{ + From: args.GetFrom(), To: args.To, - Nonce: nonce, - Value: value, - GasLimit: gas, + Value: (*big.Int)(args.Value), + Nonce: uint64(*args.Nonce), + GasLimit: uint64(*args.Gas), GasPrice: gasPrice, GasFeeCap: gasFeeCap, GasTipCap: gasTipCap, - Data: data, + Data: args.GetData(), AccessList: accessList, BlobGasFeeCap: (*big.Int)(args.BlobFeeCap), BlobHashes: args.BlobHashes, @@ -261,24 +190,119 @@ func (args *TransactionArgs) ToMessage(globalGasCap uint64, baseFee *big.Int, sk SkipNonceChecks: skipNonceCheck, SkipFromEOACheck: skipEoACheck, } - return msg, nil } -// GetFrom retrieves the transaction sender address. -func (args *TransactionArgs) GetFrom() common.Address { - if args.From == nil { - return common.Address{} +// ToTransaction converts the arguments to a transaction. +// This assumes that setDefaults has been called. +func (args *TransactionArgs) ToTransaction(defaultType int) *types.Transaction { + usedType := types.LegacyTxType + switch { + case args.AuthorizationList != nil || defaultType == types.SetCodeTxType: + usedType = types.SetCodeTxType + case args.BlobHashes != nil || defaultType == types.BlobTxType: + usedType = types.BlobTxType + case args.MaxFeePerGas != nil || defaultType == types.DynamicFeeTxType: + usedType = types.DynamicFeeTxType + case args.AccessList != nil || defaultType == types.AccessListTxType: + usedType = types.AccessListTxType } - return *args.From -} - -// GetData retrieves the transaction calldata. Input field is preferred. -func (args *TransactionArgs) GetData() []byte { - if args.Input != nil { - return *args.Input + // Make it possible to default to newer tx, but use legacy if gasprice is provided + if args.GasPrice != nil { + usedType = types.LegacyTxType } - if args.Data != nil { - return *args.Data + var data types.TxData + switch usedType { + case types.SetCodeTxType: + al := types.AccessList{} + if args.AccessList != nil { + al = *args.AccessList + } + authList := []types.SetCodeAuthorization{} + if args.AuthorizationList != nil { + authList = args.AuthorizationList + } + data = &types.SetCodeTx{ + To: *args.To, + ChainID: uint256.MustFromBig(args.ChainID.ToInt()), + Nonce: uint64(*args.Nonce), + Gas: uint64(*args.Gas), + GasFeeCap: uint256.MustFromBig((*big.Int)(args.MaxFeePerGas)), + GasTipCap: uint256.MustFromBig((*big.Int)(args.MaxPriorityFeePerGas)), + Value: uint256.MustFromBig((*big.Int)(args.Value)), + Data: args.GetData(), + AccessList: al, + AuthList: authList, + } + + case types.BlobTxType: + al := types.AccessList{} + if args.AccessList != nil { + al = *args.AccessList + } + data = &types.BlobTx{ + To: *args.To, + ChainID: uint256.MustFromBig((*big.Int)(args.ChainID)), + Nonce: uint64(*args.Nonce), + Gas: uint64(*args.Gas), + GasFeeCap: uint256.MustFromBig((*big.Int)(args.MaxFeePerGas)), + GasTipCap: uint256.MustFromBig((*big.Int)(args.MaxPriorityFeePerGas)), + Value: uint256.MustFromBig((*big.Int)(args.Value)), + Data: args.GetData(), + AccessList: al, + BlobHashes: args.BlobHashes, + BlobFeeCap: uint256.MustFromBig((*big.Int)(args.BlobFeeCap)), + } + if args.Blobs != nil { + data.(*types.BlobTx).Sidecar = &types.BlobTxSidecar{ + Blobs: args.Blobs, + Commitments: args.Commitments, + Proofs: args.Proofs, + } + } + + case types.DynamicFeeTxType: + al := types.AccessList{} + if args.AccessList != nil { + al = *args.AccessList + } + data = &types.DynamicFeeTx{ + To: args.To, + ChainID: (*big.Int)(args.ChainID), + Nonce: uint64(*args.Nonce), + Gas: uint64(*args.Gas), + GasFeeCap: (*big.Int)(args.MaxFeePerGas), + GasTipCap: (*big.Int)(args.MaxPriorityFeePerGas), + Value: (*big.Int)(args.Value), + Data: args.GetData(), + AccessList: al, + } + + case types.AccessListTxType: + data = &types.AccessListTx{ + To: args.To, + ChainID: (*big.Int)(args.ChainID), + Nonce: uint64(*args.Nonce), + Gas: uint64(*args.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: uint64(*args.Nonce), + Gas: uint64(*args.Gas), + GasPrice: (*big.Int)(args.GasPrice), + Value: (*big.Int)(args.Value), + Data: args.GetData(), + } } - return nil + return types.NewTx(data) +} + +// IsEIP4844 returns an indicator if the args contains EIP4844 fields. +func (args *TransactionArgs) IsEIP4844() bool { + return args.BlobHashes != nil || args.BlobFeeCap != nil } diff --git a/x/vm/types/tx_args_test.go b/x/vm/types/tx_args_test.go deleted file mode 100644 index d0f2018ac..000000000 --- a/x/vm/types/tx_args_test.go +++ /dev/null @@ -1,289 +0,0 @@ -package types_test - -import ( - "fmt" - "math/big" - - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - - "github.com/cosmos/evm/x/vm/types" -) - -func (suite *TxDataTestSuite) TestTxArgsString() { - testCases := []struct { - name string - txArgs types.TransactionArgs - expectedString string - }{ - { - "empty tx args", - types.TransactionArgs{}, - "TransactionArgs{From:, To:, Gas:, Nonce:, Data:, Input:, AccessList:}", - }, - { - "tx args with fields", - types.TransactionArgs{ - From: &suite.addr, - To: &suite.addr, - Gas: &suite.hexUint64, - Nonce: &suite.hexUint64, - Input: &suite.hexInputBytes, - Data: &suite.hexDataBytes, - AccessList: ðtypes.AccessList{}, - }, - fmt.Sprintf("TransactionArgs{From:%v, To:%v, Gas:%v, Nonce:%v, Data:%v, Input:%v, AccessList:%v}", - &suite.addr, - &suite.addr, - &suite.hexUint64, - &suite.hexUint64, - &suite.hexDataBytes, - &suite.hexInputBytes, - ðtypes.AccessList{}), - }, - } - for _, tc := range testCases { - outputString := tc.txArgs.String() - suite.Require().Equal(outputString, tc.expectedString) - } -} - -func (suite *TxDataTestSuite) TestConvertTxArgsEthTx() { - testCases := []struct { - name string - txArgs types.TransactionArgs - }{ - { - "empty tx args", - types.TransactionArgs{}, - }, - { - "no nil args", - types.TransactionArgs{ - From: &suite.addr, - To: &suite.addr, - Gas: &suite.hexUint64, - GasPrice: &suite.hexBigInt, - MaxFeePerGas: &suite.hexBigInt, - MaxPriorityFeePerGas: &suite.hexBigInt, - Value: &suite.hexBigInt, - Nonce: &suite.hexUint64, - Data: &suite.hexDataBytes, - Input: &suite.hexInputBytes, - AccessList: ðtypes.AccessList{{Address: suite.addr, StorageKeys: []common.Hash{{0}}}}, - ChainID: &suite.hexBigInt, - }, - }, - { - "max fee per gas nil, but access list not nil", - types.TransactionArgs{ - From: &suite.addr, - To: &suite.addr, - Gas: &suite.hexUint64, - GasPrice: &suite.hexBigInt, - MaxFeePerGas: nil, - MaxPriorityFeePerGas: &suite.hexBigInt, - Value: &suite.hexBigInt, - Nonce: &suite.hexUint64, - Data: &suite.hexDataBytes, - Input: &suite.hexInputBytes, - AccessList: ðtypes.AccessList{{Address: suite.addr, StorageKeys: []common.Hash{{0}}}}, - ChainID: &suite.hexBigInt, - }, - }, - } - for _, tc := range testCases { - res := tc.txArgs.ToTransaction() - suite.Require().NotNil(res) - } -} - -func (suite *TxDataTestSuite) TestToMessageEVM() { - testCases := []struct { - name string - txArgs types.TransactionArgs - globalGasCap uint64 - baseFee *big.Int - expError bool - }{ - { - "empty tx args", - types.TransactionArgs{}, - uint64(0), - nil, - false, - }, - { - "specify gasPrice and (maxFeePerGas or maxPriorityFeePerGas)", - types.TransactionArgs{ - From: &suite.addr, - To: &suite.addr, - Gas: &suite.hexUint64, - GasPrice: &suite.hexBigInt, - MaxFeePerGas: &suite.hexBigInt, - MaxPriorityFeePerGas: &suite.hexBigInt, - Value: &suite.hexBigInt, - Nonce: &suite.hexUint64, - Data: &suite.hexDataBytes, - Input: &suite.hexInputBytes, - AccessList: ðtypes.AccessList{{Address: suite.addr, StorageKeys: []common.Hash{{0}}}}, - ChainID: &suite.hexBigInt, - }, - uint64(0), - nil, - true, - }, - { - "non-1559 execution, zero gas cap", - types.TransactionArgs{ - From: &suite.addr, - To: &suite.addr, - Gas: &suite.hexUint64, - GasPrice: &suite.hexBigInt, - MaxFeePerGas: nil, - MaxPriorityFeePerGas: nil, - Value: &suite.hexBigInt, - Nonce: &suite.hexUint64, - Data: &suite.hexDataBytes, - Input: &suite.hexInputBytes, - AccessList: ðtypes.AccessList{{Address: suite.addr, StorageKeys: []common.Hash{{0}}}}, - ChainID: &suite.hexBigInt, - }, - uint64(0), - nil, - false, - }, - { - "non-1559 execution, nonzero gas cap", - types.TransactionArgs{ - From: &suite.addr, - To: &suite.addr, - Gas: &suite.hexUint64, - GasPrice: &suite.hexBigInt, - MaxFeePerGas: nil, - MaxPriorityFeePerGas: nil, - Value: &suite.hexBigInt, - Nonce: &suite.hexUint64, - Data: &suite.hexDataBytes, - Input: &suite.hexInputBytes, - AccessList: ðtypes.AccessList{{Address: suite.addr, StorageKeys: []common.Hash{{0}}}}, - ChainID: &suite.hexBigInt, - }, - uint64(1), - nil, - false, - }, - { - "1559-type execution, nil gas price", - types.TransactionArgs{ - From: &suite.addr, - To: &suite.addr, - Gas: &suite.hexUint64, - GasPrice: nil, - MaxFeePerGas: &suite.hexBigInt, - MaxPriorityFeePerGas: &suite.hexBigInt, - Value: &suite.hexBigInt, - Nonce: &suite.hexUint64, - Data: &suite.hexDataBytes, - Input: &suite.hexInputBytes, - AccessList: ðtypes.AccessList{{Address: suite.addr, StorageKeys: []common.Hash{{0}}}}, - ChainID: &suite.hexBigInt, - }, - uint64(1), - suite.bigInt, - false, - }, - { - "1559-type execution, non-nil gas price", - types.TransactionArgs{ - From: &suite.addr, - To: &suite.addr, - Gas: &suite.hexUint64, - GasPrice: &suite.hexBigInt, - MaxFeePerGas: nil, - MaxPriorityFeePerGas: nil, - Value: &suite.hexBigInt, - Nonce: &suite.hexUint64, - Data: &suite.hexDataBytes, - Input: &suite.hexInputBytes, - AccessList: ðtypes.AccessList{{Address: suite.addr, StorageKeys: []common.Hash{{0}}}}, - ChainID: &suite.hexBigInt, - }, - uint64(1), - suite.bigInt, - false, - }, - } - for _, tc := range testCases { - res, err := tc.txArgs.ToMessage(tc.globalGasCap, tc.baseFee, true, true) - - if tc.expError { - suite.Require().NotNil(err) - } else { - suite.Require().Nil(err) - suite.Require().NotNil(res) - } - } -} - -func (suite *TxDataTestSuite) TestGetFrom() { - testCases := []struct { - name string - txArgs types.TransactionArgs - expAddress common.Address - }{ - { - "empty from field", - types.TransactionArgs{}, - common.Address{}, - }, - { - "non-empty from field", - types.TransactionArgs{ - From: &suite.addr, - }, - suite.addr, - }, - } - for _, tc := range testCases { - retrievedAddress := tc.txArgs.GetFrom() - suite.Require().Equal(retrievedAddress, tc.expAddress) - } -} - -func (suite *TxDataTestSuite) TestGetData() { - testCases := []struct { - name string - txArgs types.TransactionArgs - expectedOutput []byte - }{ - { - "empty input and data fields", - types.TransactionArgs{ - Data: nil, - Input: nil, - }, - nil, - }, - { - "empty input field, non-empty data field", - types.TransactionArgs{ - Data: &suite.hexDataBytes, - Input: nil, - }, - []byte("data"), - }, - { - "non-empty input and data fields", - types.TransactionArgs{ - Data: &suite.hexDataBytes, - Input: &suite.hexInputBytes, - }, - []byte("input"), - }, - } - for _, tc := range testCases { - retrievedData := tc.txArgs.GetData() - suite.Require().Equal(retrievedData, tc.expectedOutput) - } -} diff --git a/x/vm/types/tx_data.go b/x/vm/types/tx_data.go deleted file mode 100644 index aa21759b4..000000000 --- a/x/vm/types/tx_data.go +++ /dev/null @@ -1,90 +0,0 @@ -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 - - // Fee returns the maximum fee a sender of a message is willing to pay. - Fee() *big.Int - // Cost returns the total cost of a transaction before executing any smart - // contract call. This means it should return the fee the user has to pay - // plus the amount of tokens they want to transfer. - Cost() *big.Int - - // EffectiveGasPrice returns the price for the gas used in a transaction - // based on the transaction type. - EffectiveGasPrice(baseFee *big.Int) *big.Int - // EffectiveFee returns the fees a user is willing to pay for a transaction. - 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 -} - -// fee returns the fee for a transaction given by the gas price time the gas. -func fee(gasPrice *big.Int, gas uint64) *big.Int { - gasLimit := new(big.Int).SetUint64(gas) - return new(big.Int).Mul(gasPrice, gasLimit) -} - -// cost returns the sum of the fee and value. If value is nil it returns only -// the fee. This function is made to be used in the ante handler to compute the -// total cost of a transaction given by the fee the user has to pay and the -// amount they want to transfer. -func cost(fee, value *big.Int) *big.Int { - if value != nil { - return new(big.Int).Add(fee, value) - } - return fee -} diff --git a/x/vm/types/tx_data_test.go b/x/vm/types/tx_data_test.go deleted file mode 100644 index acb8b7525..000000000 --- a/x/vm/types/tx_data_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package types - -import ( - "math/big" - "testing" - - "github.com/stretchr/testify/require" - - ethutils "github.com/cosmos/evm/utils/eth" - - sdkmath "cosmossdk.io/math" -) - -func TestTxData_chainID(t *testing.T) { - chainID := sdkmath.NewInt(1) - - testCases := []struct { - msg string - data TxData - expChainID *big.Int - }{ - { - "access list tx", &AccessListTx{Accesses: AccessList{}, ChainID: &chainID}, big.NewInt(1), - }, - { - "access list tx, nil chain ID", &AccessListTx{Accesses: AccessList{}}, nil, - }, - { - "legacy tx, derived", &LegacyTx{}, nil, - }, - } - - for _, tc := range testCases { - chainID := tc.data.GetChainID() - require.Equal(t, chainID, tc.expChainID, tc.msg) - } -} - -func TestTxData_DeriveChainID(t *testing.T) { - bitLen64, ok := new(big.Int).SetString("0x8000000000000000", 0) - require.True(t, ok) - - bitLen80, ok := new(big.Int).SetString("0x80000000000000000000", 0) - require.True(t, ok) - - expBitLen80, ok := new(big.Int).SetString("302231454903657293676526", 0) - require.True(t, ok) - - testCases := []struct { - msg string - data TxData - expChainID *big.Int - }{ - { - "v = -1", &LegacyTx{V: big.NewInt(-1).Bytes()}, nil, - }, - { - "v = 0", &LegacyTx{V: big.NewInt(0).Bytes()}, nil, - }, - { - "v = 1", &LegacyTx{V: big.NewInt(1).Bytes()}, nil, - }, - { - "v = 27", &LegacyTx{V: big.NewInt(27).Bytes()}, new(big.Int), - }, - { - "v = 28", &LegacyTx{V: big.NewInt(28).Bytes()}, new(big.Int), - }, - { - "Ethereum mainnet", &LegacyTx{V: big.NewInt(37).Bytes()}, big.NewInt(1), - }, - { - "chain ID 9000", &LegacyTx{V: big.NewInt(18035).Bytes()}, big.NewInt(9000), - }, - { - "bit len 64", &LegacyTx{V: bitLen64.Bytes()}, big.NewInt(4611686018427387886), - }, - { - "bit len 80", &LegacyTx{V: bitLen80.Bytes()}, expBitLen80, - }, - { - "v = nil ", &LegacyTx{V: nil}, nil, - }, - } - - for _, tc := range testCases { - v, _, _ := tc.data.GetRawSignatureValues() - - chainID := ethutils.DeriveChainID(v) - require.Equal(t, tc.expChainID, chainID, tc.msg) - } -} diff --git a/x/vm/types/utils.go b/x/vm/types/utils.go index c4179a474..74b287a26 100644 --- a/x/vm/types/utils.go +++ b/x/vm/types/utils.go @@ -179,7 +179,6 @@ func UnwrapEthereumMsg(tx *sdk.Tx, ethHash common.Hash) (*MsgEthereumTx, error) return nil, fmt.Errorf("invalid tx type: %T", tx) } txHash := ethMsg.AsTransaction().Hash() - ethMsg.Hash = txHash.Hex() if txHash == ethHash { return ethMsg, nil } @@ -191,7 +190,7 @@ func UnwrapEthereumMsg(tx *sdk.Tx, ethHash common.Hash) (*MsgEthereumTx, error) // UnpackEthMsg unpacks an Ethereum message from a Cosmos SDK message func UnpackEthMsg(msg sdk.Msg) ( ethMsg *MsgEthereumTx, - txData TxData, + ethTx *ethtypes.Transaction, err error, ) { msgEthTx, ok := msg.(*MsgEthereumTx) @@ -199,13 +198,8 @@ func UnpackEthMsg(msg sdk.Msg) ( return nil, nil, errorsmod.Wrapf(errortypes.ErrUnknownRequest, "invalid message type %T, expected %T", msg, (*MsgEthereumTx)(nil)) } - txData, err = UnpackTxData(msgEthTx.Data) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to unpack tx data any for tx") - } - // sender address should be in the tx cache from the previous AnteHandle call - return msgEthTx, txData, nil + return msgEthTx, msgEthTx.Raw.Transaction, nil } // BinSearch executes the binary search and hone in on an executable gas limit