diff --git a/ante/ante.go b/ante/ante.go index 156095162..f00589270 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -14,6 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/ante" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + feesponsorkeeper "github.com/cosmos/evm/x/feesponsor/keeper" ) // HandlerOptions defines the list of module keepers required to run the Cosmos EVM @@ -25,7 +26,8 @@ type HandlerOptions struct { IBCKeeper *ibckeeper.Keeper FeeMarketKeeper anteinterfaces.FeeMarketKeeper EvmKeeper anteinterfaces.EVMKeeper - FeegrantKeeper ante.FeegrantKeeper + FeegrantKeeper anteinterfaces.FeegrantKeeper + FeesponsorKeeper feesponsorkeeper.Keeper ExtensionOptionChecker ante.ExtensionOptionChecker SignModeHandler *txsigning.HandlerMap SigGasConsumer func(meter storetypes.GasMeter, sig signing.SignatureV2, params authtypes.Params) error diff --git a/ante/evm.go b/ante/evm.go index 85a76a1ec..f459bf4c1 100644 --- a/ante/evm.go +++ b/ante/evm.go @@ -15,6 +15,8 @@ func newMonoEVMAnteHandler(ctx sdk.Context, options HandlerOptions) sdk.AnteHand options.AccountKeeper, options.FeeMarketKeeper, options.EvmKeeper, + options.FeegrantKeeper, + options.FeesponsorKeeper, options.MaxTxGasWanted, &evmParams, &feemarketParams, diff --git a/ante/evm/06_account_verification.go b/ante/evm/06_account_verification.go index 0f66d4c7e..00a91dae3 100644 --- a/ante/evm/06_account_verification.go +++ b/ante/evm/06_account_verification.go @@ -1,6 +1,8 @@ package evm import ( + "math/big" + "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -15,26 +17,25 @@ import ( errortypes "github.com/cosmos/cosmos-sdk/types/errors" ) -// VerifyAccountBalance checks that the account balance is greater than the total transaction cost. +// VerifyAccount checks that the account is valid and is an EOA (Externally Owned Account). // The account will be set to store if it doesn't exist, i.e. cannot be found on store. // This method will fail if: -// - from address is NOT an EOA -// - account balance is lower than the transaction cost -func VerifyAccountBalance( +// - from address is NOT an EOA (unless it's an EIP-7702 delegated account) +// Returns the account (either the input account or newly created empty account). +func VerifyAccount( ctx sdk.Context, evmKeeper anteinterfaces.EVMKeeper, accountKeeper anteinterfaces.AccountKeeper, account *statedb.Account, from common.Address, - ethTx *ethtypes.Transaction, -) error { +) (*statedb.Account, error) { // Only EOA are allowed to send transactions. if account != nil && account.HasCodeHash() { // check eip-7702 code := evmKeeper.GetCode(ctx, common.BytesToHash(account.CodeHash)) _, delegated := ethtypes.ParseDelegation(code) if len(code) > 0 && !delegated { - return errorsmod.Wrapf( + return nil, errorsmod.Wrapf( errortypes.ErrInvalidType, "the sender is not EOA: address %s", from, ) @@ -46,7 +47,21 @@ func VerifyAccountBalance( account = statedb.NewEmptyAccount() } - if err := keeper.CheckSenderBalance(sdkmath.NewIntFromBigInt(account.Balance.ToBig()), ethTx); err != nil { + return account, nil +} + +// VerifyAccountBalance checks that the account balance is greater than the total transaction cost. +// This method will fail if: +// - account balance is lower than the transaction cost +func VerifyAccountBalance( + account *statedb.Account, + cost *big.Int, +) error { + if account == nil { + return errorsmod.Wrap(errortypes.ErrInvalidAddress, "account not found") + } + + if err := keeper.CheckSenderBalance(sdkmath.NewIntFromBigInt(account.Balance.ToBig()), cost); err != nil { return errorsmod.Wrap(err, "failed to check sender balance") } diff --git a/ante/evm/mono_decorator.go b/ante/evm/mono_decorator.go index ba4601557..bdaf39c80 100644 --- a/ante/evm/mono_decorator.go +++ b/ante/evm/mono_decorator.go @@ -16,9 +16,11 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" + "cosmossdk.io/x/feegrant" sdk "github.com/cosmos/cosmos-sdk/types" errortypes "github.com/cosmos/cosmos-sdk/types/errors" txtypes "github.com/cosmos/cosmos-sdk/types/tx" + feesponsorkeeper "github.com/cosmos/evm/x/feesponsor/keeper" ) const AcceptedTxType = 0 | @@ -30,12 +32,14 @@ const AcceptedTxType = 0 | // MonoDecorator is a single decorator that handles all the prechecks for // ethereum transactions. type MonoDecorator struct { - accountKeeper anteinterfaces.AccountKeeper - feeMarketKeeper anteinterfaces.FeeMarketKeeper - evmKeeper anteinterfaces.EVMKeeper - maxGasWanted uint64 - evmParams *evmtypes.Params - feemarketParams *feemarkettypes.Params + accountKeeper anteinterfaces.AccountKeeper + feeMarketKeeper anteinterfaces.FeeMarketKeeper + evmKeeper anteinterfaces.EVMKeeper + maxGasWanted uint64 + evmParams *evmtypes.Params + feemarketParams *feemarkettypes.Params + feegrantKeeper anteinterfaces.FeegrantKeeper + feesponsorKeeper feesponsorkeeper.Keeper } // NewEVMMonoDecorator creates the 'mono' decorator, that is used to run the ante handle logic @@ -48,17 +52,21 @@ func NewEVMMonoDecorator( accountKeeper anteinterfaces.AccountKeeper, feeMarketKeeper anteinterfaces.FeeMarketKeeper, evmKeeper anteinterfaces.EVMKeeper, + feegrantKeeper anteinterfaces.FeegrantKeeper, + feesponsorKeeper feesponsorkeeper.Keeper, maxGasWanted uint64, evmParams *evmtypes.Params, feemarketParams *feemarkettypes.Params, ) MonoDecorator { return MonoDecorator{ - accountKeeper: accountKeeper, - feeMarketKeeper: feeMarketKeeper, - evmKeeper: evmKeeper, - maxGasWanted: maxGasWanted, - evmParams: evmParams, - feemarketParams: feemarketParams, + accountKeeper: accountKeeper, + feeMarketKeeper: feeMarketKeeper, + evmKeeper: evmKeeper, + feegrantKeeper: feegrantKeeper, + feesponsorKeeper: feesponsorKeeper, + maxGasWanted: maxGasWanted, + evmParams: evmParams, + feemarketParams: feemarketParams, } } @@ -172,38 +180,27 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne } from := ethMsg.GetFrom() - fromAddr := common.BytesToAddress(from) + haveSponsor := false + feePayer := common.BytesToAddress(from) + globalFeePayer, found := md.feesponsorKeeper.GetFeePayer(ctx) - // 6. account balance verification - // We get the account with the balance from the EVM keeper because it is - // using a wrapper of the bank keeper as a dependency to scale all - // balances to 18 decimals. - account := md.evmKeeper.GetAccount(ctx, fromAddr) - if err := VerifyAccountBalance( + // 6. account verification and balance check + + // Verify account is valid EOA + account := md.evmKeeper.GetAccount(ctx, common.BytesToAddress(from)) + account, err = VerifyAccount( ctx, md.evmKeeper, md.accountKeeper, account, - fromAddr, - ethTx, - ); err != nil { - return ctx, err - } - - // 7. can transfer - coreMsg := ethMsg.AsMessage(decUtils.BaseFee) - if err := CanTransfer( - ctx, - md.evmKeeper, - *coreMsg, - decUtils.BaseFee, - decUtils.EvmParams, - decUtils.Rules.IsLondon, - ); err != nil { + common.BytesToAddress(from), + ) + if err != nil { return ctx, err } // 8. gas consumption + // VerifyFee early for fee sponsor check msgFees, err := evmkeeper.VerifyFee( ethTx, evmDenom, @@ -217,11 +214,97 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne return ctx, err } + // We get the account with the balance from the EVM keeper because it is + // using a wrapper of the bank keeper as a dependency to scale all + // balances to 18 decimals. + + // Check if we found a global fee payer and the account exists + if found { + grant, err := md.feegrantKeeper.Allowance(ctx, &feegrant.QueryAllowanceRequest{ + Granter: sdk.AccAddress(globalFeePayer).String(), + Grantee: from.String(), + }) + + // If have grant, check global fee payer can cover tx fee + // (not contains tx value) + if grant != nil && err == nil { + account := md.evmKeeper.GetAccount(ctx, common.BytesToAddress(globalFeePayer)) + + feeAmount := big.NewInt(0) + if len(msgFees) != 0 { + feeAmount = msgFees[0].Amount.BigInt() + } + + // Verify global fee account balance with tx fees + err = VerifyAccountBalance( + account, + feeAmount, + ) + if err != nil { + haveSponsor = false + ctx.Logger().Info("fee sponsor fallback: insufficient sponsor balance", + "sponsor", sdk.AccAddress(globalFeePayer).String(), + "sender", from.String(), + ) + } else { + err = md.feegrantKeeper.UseGrantedFees( + ctx, + globalFeePayer, + from, + msgFees, + msgs, + ) + // If grant is not enough or expired, deduct fee from tx sender + if err != nil { + haveSponsor = false + ctx.Logger().Info("fee sponsor fallback: grant use failed", + "sponsor", sdk.AccAddress(globalFeePayer).String(), + "sender", from.String(), + "error", err.Error(), + ) + } else { + haveSponsor = true + feePayer = common.BytesToAddress(globalFeePayer) + ctx.Logger().Info("fee sponsor: sponsor pays fee", + "sponsor", sdk.AccAddress(globalFeePayer).String(), + "sender", from.String(), + ) + } + } + } + } + + // If no fee sponsor, verify sender has enough balance for total cost (fees + value) + if !haveSponsor { + // Verify sender has enough balance for total cost (fees + value) + if err := VerifyAccountBalance(account, ethTx.Cost()); err != nil { + return ctx, err + } + } else { + // Verify the sender has balance >= ethTx.Value() + if err := VerifyAccountBalance(account, ethTx.Value()); err != nil { + return ctx, err + } + } + + // 7. can transfer + coreMsg := ethMsg.AsMessage(decUtils.BaseFee) + if err := CanTransfer( + ctx, + md.evmKeeper, + *coreMsg, + decUtils.BaseFee, + decUtils.EvmParams, + decUtils.Rules.IsLondon, + ); err != nil { + return ctx, err + } + err = ConsumeFeesAndEmitEvent( ctx, md.evmKeeper, msgFees, - from, + feePayer.Bytes(), ) if err != nil { return ctx, err diff --git a/ante/evm/mono_decorator_test.go b/ante/evm/mono_decorator_test.go index 72e205993..2fc88ae5f 100644 --- a/ante/evm/mono_decorator_test.go +++ b/ante/evm/mono_decorator_test.go @@ -31,8 +31,10 @@ import ( "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" + feegrantkeeper "cosmossdk.io/x/feegrant/keeper" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + feesponsorkeeper "github.com/cosmos/evm/x/feesponsor/keeper" ) // adds missing methods @@ -219,7 +221,9 @@ func TestMonoDecorator(t *testing.T) { feeMarketKeeper := MockFeeMarketKeeper{} params := keeper.GetParams(sdk.Context{}) feemarketParams := feeMarketKeeper.GetParams(sdk.Context{}) - monoDec := evm.NewEVMMonoDecorator(accountKeeper, feeMarketKeeper, keeper, 0, ¶ms, &feemarketParams) + feegrantKeeper := feegrantkeeper.Keeper{} + feesponsorKeeper := feesponsorkeeper.Keeper{} + monoDec := evm.NewEVMMonoDecorator(accountKeeper, feeMarketKeeper, keeper, feegrantKeeper, feesponsorKeeper, 0, ¶ms, &feemarketParams) ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) ctx = ctx.WithBlockGasMeter(storetypes.NewGasMeter(1e19)) diff --git a/ante/interfaces/cosmos.go b/ante/interfaces/cosmos.go index ec8eb08eb..df4984f2a 100644 --- a/ante/interfaces/cosmos.go +++ b/ante/interfaces/cosmos.go @@ -6,7 +6,9 @@ import ( addresscodec "cosmossdk.io/core/address" + "cosmossdk.io/x/feegrant" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/ante" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -30,3 +32,9 @@ type BankKeeper interface { SendCoins(ctx context.Context, from, to sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error } + +// FeegrantKeeper defines the expected feegrant keeper. +type FeegrantKeeper interface { + ante.FeegrantKeeper + Allowance(c context.Context, req *feegrant.QueryAllowanceRequest) (*feegrant.QueryAllowanceResponse, error) +} diff --git a/api/cosmos/evm/feesponsor/v1/genesis.pulsar.go b/api/cosmos/evm/feesponsor/v1/genesis.pulsar.go new file mode 100644 index 000000000..201fb838a --- /dev/null +++ b/api/cosmos/evm/feesponsor/v1/genesis.pulsar.go @@ -0,0 +1,578 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package feesponsorv1 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_fee_payer protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_evm_feesponsor_v1_genesis_proto_init() + md_GenesisState = File_cosmos_evm_feesponsor_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_fee_payer = md_GenesisState.Fields().ByName("fee_payer") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_evm_feesponsor_v1_genesis_proto_msgTypes[0] + 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_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// 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_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(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_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.FeePayer != "" { + value := protoreflect.ValueOfString(x.FeePayer) + if !f(fd_GenesisState_fee_payer, 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_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.GenesisState.fee_payer": + return x.FeePayer != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.GenesisState 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_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.GenesisState.fee_payer": + x.FeePayer = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.GenesisState 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_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.evm.feesponsor.v1.GenesisState.fee_payer": + value := x.FeePayer + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.GenesisState 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_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.GenesisState.fee_payer": + x.FeePayer = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.GenesisState 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_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.GenesisState.fee_payer": + panic(fmt.Errorf("field fee_payer of message cosmos.evm.feesponsor.v1.GenesisState is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.GenesisState 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_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.GenesisState.fee_payer": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.GenesisState 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_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.feesponsor.v1.GenesisState", 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_GenesisState) 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_GenesisState) 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_GenesisState) 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_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + 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.FeePayer) + 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, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + 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.FeePayer) > 0 { + i -= len(x.FeePayer) + copy(dAtA[i:], x.FeePayer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FeePayer))) + 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().(*GenesisState) + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: 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 FeePayer", 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.FeePayer = string(dAtA[iNdEx:postIndex]) + 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/evm/feesponsor/v1/genesis.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) +) + +// GenesisState defines the feesponsor module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // fee_payer is the EVM fee payer configuration + FeePayer string `protobuf:"bytes,1,opt,name=fee_payer,json=feePayer,proto3" json:"fee_payer,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_evm_feesponsor_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_cosmos_evm_feesponsor_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetFeePayer() string { + if x != nil { + return x.FeePayer + } + return "" +} + +var File_cosmos_evm_feesponsor_v1_genesis_proto protoreflect.FileDescriptor + +var file_cosmos_evm_feesponsor_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x66, 0x65, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2e, + 0x76, 0x31, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x45, 0x0a, + 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, + 0x09, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 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, 0x08, 0x66, 0x65, 0x65, 0x50, + 0x61, 0x79, 0x65, 0x72, 0x42, 0xe7, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 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, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2f, 0x76, 0x31, + 0x3b, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x43, 0x45, 0x46, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x76, 0x6d, + 0x2e, 0x46, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x46, 0x65, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x46, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, + 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, + 0x46, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_evm_feesponsor_v1_genesis_proto_rawDescOnce sync.Once + file_cosmos_evm_feesponsor_v1_genesis_proto_rawDescData = file_cosmos_evm_feesponsor_v1_genesis_proto_rawDesc +) + +func file_cosmos_evm_feesponsor_v1_genesis_proto_rawDescGZIP() []byte { + file_cosmos_evm_feesponsor_v1_genesis_proto_rawDescOnce.Do(func() { + file_cosmos_evm_feesponsor_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_evm_feesponsor_v1_genesis_proto_rawDescData) + }) + return file_cosmos_evm_feesponsor_v1_genesis_proto_rawDescData +} + +var file_cosmos_evm_feesponsor_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_evm_feesponsor_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: cosmos.evm.feesponsor.v1.GenesisState +} +var file_cosmos_evm_feesponsor_v1_genesis_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_evm_feesponsor_v1_genesis_proto_init() } +func file_cosmos_evm_feesponsor_v1_genesis_proto_init() { + if File_cosmos_evm_feesponsor_v1_genesis_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_evm_feesponsor_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_evm_feesponsor_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_evm_feesponsor_v1_genesis_proto_goTypes, + DependencyIndexes: file_cosmos_evm_feesponsor_v1_genesis_proto_depIdxs, + MessageInfos: file_cosmos_evm_feesponsor_v1_genesis_proto_msgTypes, + }.Build() + File_cosmos_evm_feesponsor_v1_genesis_proto = out.File + file_cosmos_evm_feesponsor_v1_genesis_proto_rawDesc = nil + file_cosmos_evm_feesponsor_v1_genesis_proto_goTypes = nil + file_cosmos_evm_feesponsor_v1_genesis_proto_depIdxs = nil +} diff --git a/api/cosmos/evm/feesponsor/v1/query.pulsar.go b/api/cosmos/evm/feesponsor/v1/query.pulsar.go new file mode 100644 index 000000000..ffdb9f87c --- /dev/null +++ b/api/cosmos/evm/feesponsor/v1/query.pulsar.go @@ -0,0 +1,991 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package feesponsorv1 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryFeePayerRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_evm_feesponsor_v1_query_proto_init() + md_QueryFeePayerRequest = File_cosmos_evm_feesponsor_v1_query_proto.Messages().ByName("QueryFeePayerRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryFeePayerRequest)(nil) + +type fastReflection_QueryFeePayerRequest QueryFeePayerRequest + +func (x *QueryFeePayerRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryFeePayerRequest)(x) +} + +func (x *QueryFeePayerRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_evm_feesponsor_v1_query_proto_msgTypes[0] + 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_QueryFeePayerRequest_messageType fastReflection_QueryFeePayerRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryFeePayerRequest_messageType{} + +type fastReflection_QueryFeePayerRequest_messageType struct{} + +func (x fastReflection_QueryFeePayerRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryFeePayerRequest)(nil) +} +func (x fastReflection_QueryFeePayerRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryFeePayerRequest) +} +func (x fastReflection_QueryFeePayerRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryFeePayerRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryFeePayerRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryFeePayerRequest +} + +// 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_QueryFeePayerRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryFeePayerRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryFeePayerRequest) New() protoreflect.Message { + return new(fastReflection_QueryFeePayerRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryFeePayerRequest) Interface() protoreflect.ProtoMessage { + return (*QueryFeePayerRequest)(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_QueryFeePayerRequest) 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_QueryFeePayerRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.QueryFeePayerRequest")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.QueryFeePayerRequest 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_QueryFeePayerRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.QueryFeePayerRequest")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.QueryFeePayerRequest 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_QueryFeePayerRequest) 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.feesponsor.v1.QueryFeePayerRequest")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.QueryFeePayerRequest 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_QueryFeePayerRequest) 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.feesponsor.v1.QueryFeePayerRequest")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.QueryFeePayerRequest 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_QueryFeePayerRequest) 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.feesponsor.v1.QueryFeePayerRequest")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.QueryFeePayerRequest 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_QueryFeePayerRequest) 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.feesponsor.v1.QueryFeePayerRequest")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.QueryFeePayerRequest 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_QueryFeePayerRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.feesponsor.v1.QueryFeePayerRequest", 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_QueryFeePayerRequest) 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_QueryFeePayerRequest) 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_QueryFeePayerRequest) 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_QueryFeePayerRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryFeePayerRequest) + 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().(*QueryFeePayerRequest) + 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().(*QueryFeePayerRequest) + 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: QueryFeePayerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryFeePayerRequest: 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 ( + md_QueryFeePayerResponse protoreflect.MessageDescriptor + fd_QueryFeePayerResponse_fee_payer protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_evm_feesponsor_v1_query_proto_init() + md_QueryFeePayerResponse = File_cosmos_evm_feesponsor_v1_query_proto.Messages().ByName("QueryFeePayerResponse") + fd_QueryFeePayerResponse_fee_payer = md_QueryFeePayerResponse.Fields().ByName("fee_payer") +} + +var _ protoreflect.Message = (*fastReflection_QueryFeePayerResponse)(nil) + +type fastReflection_QueryFeePayerResponse QueryFeePayerResponse + +func (x *QueryFeePayerResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryFeePayerResponse)(x) +} + +func (x *QueryFeePayerResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_evm_feesponsor_v1_query_proto_msgTypes[1] + 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_QueryFeePayerResponse_messageType fastReflection_QueryFeePayerResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryFeePayerResponse_messageType{} + +type fastReflection_QueryFeePayerResponse_messageType struct{} + +func (x fastReflection_QueryFeePayerResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryFeePayerResponse)(nil) +} +func (x fastReflection_QueryFeePayerResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryFeePayerResponse) +} +func (x fastReflection_QueryFeePayerResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryFeePayerResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryFeePayerResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryFeePayerResponse +} + +// 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_QueryFeePayerResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryFeePayerResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryFeePayerResponse) New() protoreflect.Message { + return new(fastReflection_QueryFeePayerResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryFeePayerResponse) Interface() protoreflect.ProtoMessage { + return (*QueryFeePayerResponse)(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_QueryFeePayerResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.FeePayer != "" { + value := protoreflect.ValueOfString(x.FeePayer) + if !f(fd_QueryFeePayerResponse_fee_payer, 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_QueryFeePayerResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.QueryFeePayerResponse.fee_payer": + return x.FeePayer != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.QueryFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.QueryFeePayerResponse 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_QueryFeePayerResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.QueryFeePayerResponse.fee_payer": + x.FeePayer = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.QueryFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.QueryFeePayerResponse 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_QueryFeePayerResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.evm.feesponsor.v1.QueryFeePayerResponse.fee_payer": + value := x.FeePayer + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.QueryFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.QueryFeePayerResponse 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_QueryFeePayerResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.QueryFeePayerResponse.fee_payer": + x.FeePayer = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.QueryFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.QueryFeePayerResponse 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_QueryFeePayerResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.QueryFeePayerResponse.fee_payer": + panic(fmt.Errorf("field fee_payer of message cosmos.evm.feesponsor.v1.QueryFeePayerResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.QueryFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.QueryFeePayerResponse 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_QueryFeePayerResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.QueryFeePayerResponse.fee_payer": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.QueryFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.QueryFeePayerResponse 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_QueryFeePayerResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.feesponsor.v1.QueryFeePayerResponse", 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_QueryFeePayerResponse) 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_QueryFeePayerResponse) 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_QueryFeePayerResponse) 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_QueryFeePayerResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryFeePayerResponse) + 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.FeePayer) + 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, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryFeePayerResponse) + 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.FeePayer) > 0 { + i -= len(x.FeePayer) + copy(dAtA[i:], x.FeePayer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FeePayer))) + 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().(*QueryFeePayerResponse) + 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: QueryFeePayerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryFeePayerResponse: 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 FeePayer", 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.FeePayer = string(dAtA[iNdEx:postIndex]) + 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/evm/feesponsor/v1/query.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) +) + +// QueryFeePayerRequest is the request type for the Query/FeePayer RPC method. +type QueryFeePayerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryFeePayerRequest) Reset() { + *x = QueryFeePayerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_evm_feesponsor_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryFeePayerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryFeePayerRequest) ProtoMessage() {} + +// Deprecated: Use QueryFeePayerRequest.ProtoReflect.Descriptor instead. +func (*QueryFeePayerRequest) Descriptor() ([]byte, []int) { + return file_cosmos_evm_feesponsor_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryFeePayerResponse is the response type for the Query/FeePayer RPC method. +type QueryFeePayerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // fee_payer is the current EVM fee payer + FeePayer string `protobuf:"bytes,1,opt,name=fee_payer,json=feePayer,proto3" json:"fee_payer,omitempty"` +} + +func (x *QueryFeePayerResponse) Reset() { + *x = QueryFeePayerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_evm_feesponsor_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryFeePayerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryFeePayerResponse) ProtoMessage() {} + +// Deprecated: Use QueryFeePayerResponse.ProtoReflect.Descriptor instead. +func (*QueryFeePayerResponse) Descriptor() ([]byte, []int) { + return file_cosmos_evm_feesponsor_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryFeePayerResponse) GetFeePayer() string { + if x != nil { + return x.FeePayer + } + return "" +} + +var File_cosmos_evm_feesponsor_v1_query_proto protoreflect.FileDescriptor + +var file_cosmos_evm_feesponsor_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x66, 0x65, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, + 0x76, 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, + 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, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x16, 0x0a, 0x14, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x4e, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x09, 0x66, 0x65, + 0x65, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 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, 0x08, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, + 0x72, 0x32, 0xa2, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x98, 0x01, 0x0a, 0x08, + 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x25, 0x12, 0x23, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x66, + 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x65, 0x65, + 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x42, 0xe5, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 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, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2f, 0x76, 0x31, + 0x3b, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x43, 0x45, 0x46, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x76, 0x6d, + 0x2e, 0x46, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x46, 0x65, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x46, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, + 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, + 0x46, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_evm_feesponsor_v1_query_proto_rawDescOnce sync.Once + file_cosmos_evm_feesponsor_v1_query_proto_rawDescData = file_cosmos_evm_feesponsor_v1_query_proto_rawDesc +) + +func file_cosmos_evm_feesponsor_v1_query_proto_rawDescGZIP() []byte { + file_cosmos_evm_feesponsor_v1_query_proto_rawDescOnce.Do(func() { + file_cosmos_evm_feesponsor_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_evm_feesponsor_v1_query_proto_rawDescData) + }) + return file_cosmos_evm_feesponsor_v1_query_proto_rawDescData +} + +var file_cosmos_evm_feesponsor_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_evm_feesponsor_v1_query_proto_goTypes = []interface{}{ + (*QueryFeePayerRequest)(nil), // 0: cosmos.evm.feesponsor.v1.QueryFeePayerRequest + (*QueryFeePayerResponse)(nil), // 1: cosmos.evm.feesponsor.v1.QueryFeePayerResponse +} +var file_cosmos_evm_feesponsor_v1_query_proto_depIdxs = []int32{ + 0, // 0: cosmos.evm.feesponsor.v1.Query.FeePayer:input_type -> cosmos.evm.feesponsor.v1.QueryFeePayerRequest + 1, // 1: cosmos.evm.feesponsor.v1.Query.FeePayer:output_type -> cosmos.evm.feesponsor.v1.QueryFeePayerResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_evm_feesponsor_v1_query_proto_init() } +func file_cosmos_evm_feesponsor_v1_query_proto_init() { + if File_cosmos_evm_feesponsor_v1_query_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_evm_feesponsor_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryFeePayerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_evm_feesponsor_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryFeePayerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_evm_feesponsor_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_evm_feesponsor_v1_query_proto_goTypes, + DependencyIndexes: file_cosmos_evm_feesponsor_v1_query_proto_depIdxs, + MessageInfos: file_cosmos_evm_feesponsor_v1_query_proto_msgTypes, + }.Build() + File_cosmos_evm_feesponsor_v1_query_proto = out.File + file_cosmos_evm_feesponsor_v1_query_proto_rawDesc = nil + file_cosmos_evm_feesponsor_v1_query_proto_goTypes = nil + file_cosmos_evm_feesponsor_v1_query_proto_depIdxs = nil +} diff --git a/api/cosmos/evm/feesponsor/v1/query_grpc.pb.go b/api/cosmos/evm/feesponsor/v1/query_grpc.pb.go new file mode 100644 index 000000000..35da622cf --- /dev/null +++ b/api/cosmos/evm/feesponsor/v1/query_grpc.pb.go @@ -0,0 +1,111 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: cosmos/evm/feesponsor/v1/query.proto + +package feesponsorv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_FeePayer_FullMethodName = "/cosmos.evm.feesponsor.v1.Query/FeePayer" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + // FeePayer queries the current EVM fee payer + FeePayer(ctx context.Context, in *QueryFeePayerRequest, opts ...grpc.CallOption) (*QueryFeePayerResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) FeePayer(ctx context.Context, in *QueryFeePayerRequest, opts ...grpc.CallOption) (*QueryFeePayerResponse, error) { + out := new(QueryFeePayerResponse) + err := c.cc.Invoke(ctx, Query_FeePayer_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + // FeePayer queries the current EVM fee payer + FeePayer(context.Context, *QueryFeePayerRequest) (*QueryFeePayerResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) FeePayer(context.Context, *QueryFeePayerRequest) (*QueryFeePayerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FeePayer not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_FeePayer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryFeePayerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).FeePayer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_FeePayer_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).FeePayer(ctx, req.(*QueryFeePayerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.evm.feesponsor.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "FeePayer", + Handler: _Query_FeePayer_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/evm/feesponsor/v1/query.proto", +} diff --git a/api/cosmos/evm/feesponsor/v1/tx.pulsar.go b/api/cosmos/evm/feesponsor/v1/tx.pulsar.go new file mode 100644 index 000000000..b06aa1e00 --- /dev/null +++ b/api/cosmos/evm/feesponsor/v1/tx.pulsar.go @@ -0,0 +1,1954 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package feesponsorv1 + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgSetFeePayer protoreflect.MessageDescriptor + fd_MsgSetFeePayer_authority protoreflect.FieldDescriptor + fd_MsgSetFeePayer_evm_fee_payer protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_evm_feesponsor_v1_tx_proto_init() + md_MsgSetFeePayer = File_cosmos_evm_feesponsor_v1_tx_proto.Messages().ByName("MsgSetFeePayer") + fd_MsgSetFeePayer_authority = md_MsgSetFeePayer.Fields().ByName("authority") + fd_MsgSetFeePayer_evm_fee_payer = md_MsgSetFeePayer.Fields().ByName("evm_fee_payer") +} + +var _ protoreflect.Message = (*fastReflection_MsgSetFeePayer)(nil) + +type fastReflection_MsgSetFeePayer MsgSetFeePayer + +func (x *MsgSetFeePayer) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSetFeePayer)(x) +} + +func (x *MsgSetFeePayer) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes[0] + 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_MsgSetFeePayer_messageType fastReflection_MsgSetFeePayer_messageType +var _ protoreflect.MessageType = fastReflection_MsgSetFeePayer_messageType{} + +type fastReflection_MsgSetFeePayer_messageType struct{} + +func (x fastReflection_MsgSetFeePayer_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSetFeePayer)(nil) +} +func (x fastReflection_MsgSetFeePayer_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSetFeePayer) +} +func (x fastReflection_MsgSetFeePayer_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSetFeePayer +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSetFeePayer) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSetFeePayer +} + +// 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_MsgSetFeePayer) Type() protoreflect.MessageType { + return _fastReflection_MsgSetFeePayer_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSetFeePayer) New() protoreflect.Message { + return new(fastReflection_MsgSetFeePayer) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSetFeePayer) Interface() protoreflect.ProtoMessage { + return (*MsgSetFeePayer)(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_MsgSetFeePayer) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgSetFeePayer_authority, value) { + return + } + } + if x.EvmFeePayer != "" { + value := protoreflect.ValueOfString(x.EvmFeePayer) + if !f(fd_MsgSetFeePayer_evm_fee_payer, 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_MsgSetFeePayer) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.MsgSetFeePayer.authority": + return x.Authority != "" + case "cosmos.evm.feesponsor.v1.MsgSetFeePayer.evm_fee_payer": + return x.EvmFeePayer != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgSetFeePayer")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgSetFeePayer 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_MsgSetFeePayer) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.MsgSetFeePayer.authority": + x.Authority = "" + case "cosmos.evm.feesponsor.v1.MsgSetFeePayer.evm_fee_payer": + x.EvmFeePayer = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgSetFeePayer")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgSetFeePayer 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_MsgSetFeePayer) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.evm.feesponsor.v1.MsgSetFeePayer.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.evm.feesponsor.v1.MsgSetFeePayer.evm_fee_payer": + value := x.EvmFeePayer + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgSetFeePayer")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgSetFeePayer 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_MsgSetFeePayer) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.MsgSetFeePayer.authority": + x.Authority = value.Interface().(string) + case "cosmos.evm.feesponsor.v1.MsgSetFeePayer.evm_fee_payer": + x.EvmFeePayer = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgSetFeePayer")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgSetFeePayer 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_MsgSetFeePayer) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.MsgSetFeePayer.authority": + panic(fmt.Errorf("field authority of message cosmos.evm.feesponsor.v1.MsgSetFeePayer is not mutable")) + case "cosmos.evm.feesponsor.v1.MsgSetFeePayer.evm_fee_payer": + panic(fmt.Errorf("field evm_fee_payer of message cosmos.evm.feesponsor.v1.MsgSetFeePayer is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgSetFeePayer")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgSetFeePayer 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_MsgSetFeePayer) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.MsgSetFeePayer.authority": + return protoreflect.ValueOfString("") + case "cosmos.evm.feesponsor.v1.MsgSetFeePayer.evm_fee_payer": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgSetFeePayer")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgSetFeePayer 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_MsgSetFeePayer) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.feesponsor.v1.MsgSetFeePayer", 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_MsgSetFeePayer) 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_MsgSetFeePayer) 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_MsgSetFeePayer) 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_MsgSetFeePayer) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSetFeePayer) + 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)) + } + l = len(x.EvmFeePayer) + 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, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgSetFeePayer) + 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.EvmFeePayer) > 0 { + i -= len(x.EvmFeePayer) + copy(dAtA[i:], x.EvmFeePayer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EvmFeePayer))) + 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().(*MsgSetFeePayer) + 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: MsgSetFeePayer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSetFeePayer: 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 EvmFeePayer", 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.EvmFeePayer = string(dAtA[iNdEx:postIndex]) + 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_MsgSetFeePayerResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_evm_feesponsor_v1_tx_proto_init() + md_MsgSetFeePayerResponse = File_cosmos_evm_feesponsor_v1_tx_proto.Messages().ByName("MsgSetFeePayerResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgSetFeePayerResponse)(nil) + +type fastReflection_MsgSetFeePayerResponse MsgSetFeePayerResponse + +func (x *MsgSetFeePayerResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSetFeePayerResponse)(x) +} + +func (x *MsgSetFeePayerResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes[1] + 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_MsgSetFeePayerResponse_messageType fastReflection_MsgSetFeePayerResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgSetFeePayerResponse_messageType{} + +type fastReflection_MsgSetFeePayerResponse_messageType struct{} + +func (x fastReflection_MsgSetFeePayerResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSetFeePayerResponse)(nil) +} +func (x fastReflection_MsgSetFeePayerResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSetFeePayerResponse) +} +func (x fastReflection_MsgSetFeePayerResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSetFeePayerResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSetFeePayerResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSetFeePayerResponse +} + +// 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_MsgSetFeePayerResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgSetFeePayerResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSetFeePayerResponse) New() protoreflect.Message { + return new(fastReflection_MsgSetFeePayerResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSetFeePayerResponse) Interface() protoreflect.ProtoMessage { + return (*MsgSetFeePayerResponse)(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_MsgSetFeePayerResponse) 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_MsgSetFeePayerResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgSetFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgSetFeePayerResponse 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_MsgSetFeePayerResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgSetFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgSetFeePayerResponse 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_MsgSetFeePayerResponse) 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.feesponsor.v1.MsgSetFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgSetFeePayerResponse 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_MsgSetFeePayerResponse) 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.feesponsor.v1.MsgSetFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgSetFeePayerResponse 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_MsgSetFeePayerResponse) 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.feesponsor.v1.MsgSetFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgSetFeePayerResponse 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_MsgSetFeePayerResponse) 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.feesponsor.v1.MsgSetFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgSetFeePayerResponse 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_MsgSetFeePayerResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.feesponsor.v1.MsgSetFeePayerResponse", 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_MsgSetFeePayerResponse) 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_MsgSetFeePayerResponse) 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_MsgSetFeePayerResponse) 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_MsgSetFeePayerResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSetFeePayerResponse) + 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().(*MsgSetFeePayerResponse) + 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().(*MsgSetFeePayerResponse) + 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: MsgSetFeePayerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSetFeePayerResponse: 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 ( + md_MsgRemoveFeePayer protoreflect.MessageDescriptor + fd_MsgRemoveFeePayer_authority protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_evm_feesponsor_v1_tx_proto_init() + md_MsgRemoveFeePayer = File_cosmos_evm_feesponsor_v1_tx_proto.Messages().ByName("MsgRemoveFeePayer") + fd_MsgRemoveFeePayer_authority = md_MsgRemoveFeePayer.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_MsgRemoveFeePayer)(nil) + +type fastReflection_MsgRemoveFeePayer MsgRemoveFeePayer + +func (x *MsgRemoveFeePayer) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRemoveFeePayer)(x) +} + +func (x *MsgRemoveFeePayer) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes[2] + 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_MsgRemoveFeePayer_messageType fastReflection_MsgRemoveFeePayer_messageType +var _ protoreflect.MessageType = fastReflection_MsgRemoveFeePayer_messageType{} + +type fastReflection_MsgRemoveFeePayer_messageType struct{} + +func (x fastReflection_MsgRemoveFeePayer_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRemoveFeePayer)(nil) +} +func (x fastReflection_MsgRemoveFeePayer_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRemoveFeePayer) +} +func (x fastReflection_MsgRemoveFeePayer_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRemoveFeePayer +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgRemoveFeePayer) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRemoveFeePayer +} + +// 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_MsgRemoveFeePayer) Type() protoreflect.MessageType { + return _fastReflection_MsgRemoveFeePayer_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgRemoveFeePayer) New() protoreflect.Message { + return new(fastReflection_MsgRemoveFeePayer) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgRemoveFeePayer) Interface() protoreflect.ProtoMessage { + return (*MsgRemoveFeePayer)(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_MsgRemoveFeePayer) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgRemoveFeePayer_authority, 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_MsgRemoveFeePayer) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.MsgRemoveFeePayer.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgRemoveFeePayer")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgRemoveFeePayer 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_MsgRemoveFeePayer) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.MsgRemoveFeePayer.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgRemoveFeePayer")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgRemoveFeePayer 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_MsgRemoveFeePayer) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.evm.feesponsor.v1.MsgRemoveFeePayer.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgRemoveFeePayer")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgRemoveFeePayer 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_MsgRemoveFeePayer) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.MsgRemoveFeePayer.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgRemoveFeePayer")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgRemoveFeePayer 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_MsgRemoveFeePayer) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.MsgRemoveFeePayer.authority": + panic(fmt.Errorf("field authority of message cosmos.evm.feesponsor.v1.MsgRemoveFeePayer is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgRemoveFeePayer")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgRemoveFeePayer 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_MsgRemoveFeePayer) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.evm.feesponsor.v1.MsgRemoveFeePayer.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgRemoveFeePayer")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgRemoveFeePayer 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_MsgRemoveFeePayer) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.feesponsor.v1.MsgRemoveFeePayer", 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_MsgRemoveFeePayer) 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_MsgRemoveFeePayer) 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_MsgRemoveFeePayer) 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_MsgRemoveFeePayer) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgRemoveFeePayer) + 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 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().(*MsgRemoveFeePayer) + 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.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().(*MsgRemoveFeePayer) + 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: MsgRemoveFeePayer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemoveFeePayer: 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 + 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_MsgRemoveFeePayerResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_evm_feesponsor_v1_tx_proto_init() + md_MsgRemoveFeePayerResponse = File_cosmos_evm_feesponsor_v1_tx_proto.Messages().ByName("MsgRemoveFeePayerResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgRemoveFeePayerResponse)(nil) + +type fastReflection_MsgRemoveFeePayerResponse MsgRemoveFeePayerResponse + +func (x *MsgRemoveFeePayerResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRemoveFeePayerResponse)(x) +} + +func (x *MsgRemoveFeePayerResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes[3] + 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_MsgRemoveFeePayerResponse_messageType fastReflection_MsgRemoveFeePayerResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgRemoveFeePayerResponse_messageType{} + +type fastReflection_MsgRemoveFeePayerResponse_messageType struct{} + +func (x fastReflection_MsgRemoveFeePayerResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRemoveFeePayerResponse)(nil) +} +func (x fastReflection_MsgRemoveFeePayerResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRemoveFeePayerResponse) +} +func (x fastReflection_MsgRemoveFeePayerResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRemoveFeePayerResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgRemoveFeePayerResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRemoveFeePayerResponse +} + +// 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_MsgRemoveFeePayerResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgRemoveFeePayerResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgRemoveFeePayerResponse) New() protoreflect.Message { + return new(fastReflection_MsgRemoveFeePayerResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgRemoveFeePayerResponse) Interface() protoreflect.ProtoMessage { + return (*MsgRemoveFeePayerResponse)(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_MsgRemoveFeePayerResponse) 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_MsgRemoveFeePayerResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgRemoveFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgRemoveFeePayerResponse 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_MsgRemoveFeePayerResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.feesponsor.v1.MsgRemoveFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgRemoveFeePayerResponse 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_MsgRemoveFeePayerResponse) 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.feesponsor.v1.MsgRemoveFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgRemoveFeePayerResponse 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_MsgRemoveFeePayerResponse) 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.feesponsor.v1.MsgRemoveFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgRemoveFeePayerResponse 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_MsgRemoveFeePayerResponse) 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.feesponsor.v1.MsgRemoveFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgRemoveFeePayerResponse 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_MsgRemoveFeePayerResponse) 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.feesponsor.v1.MsgRemoveFeePayerResponse")) + } + panic(fmt.Errorf("message cosmos.evm.feesponsor.v1.MsgRemoveFeePayerResponse 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_MsgRemoveFeePayerResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.feesponsor.v1.MsgRemoveFeePayerResponse", 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_MsgRemoveFeePayerResponse) 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_MsgRemoveFeePayerResponse) 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_MsgRemoveFeePayerResponse) 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_MsgRemoveFeePayerResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgRemoveFeePayerResponse) + 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().(*MsgRemoveFeePayerResponse) + 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().(*MsgRemoveFeePayerResponse) + 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: MsgRemoveFeePayerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemoveFeePayerResponse: 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/feesponsor/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) +) + +// MsgSetFeePayer defines a message for setting the EVM fee payer. +type MsgSetFeePayer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // evm_fee_payer is the address that will pay for EVM transaction fees + EvmFeePayer string `protobuf:"bytes,2,opt,name=evm_fee_payer,json=evmFeePayer,proto3" json:"evm_fee_payer,omitempty"` +} + +func (x *MsgSetFeePayer) Reset() { + *x = MsgSetFeePayer{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSetFeePayer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSetFeePayer) ProtoMessage() {} + +// Deprecated: Use MsgSetFeePayer.ProtoReflect.Descriptor instead. +func (*MsgSetFeePayer) Descriptor() ([]byte, []int) { + return file_cosmos_evm_feesponsor_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgSetFeePayer) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgSetFeePayer) GetEvmFeePayer() string { + if x != nil { + return x.EvmFeePayer + } + return "" +} + +// MsgSetFeePayerResponse defines the response for MsgSetFeePayer. +type MsgSetFeePayerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgSetFeePayerResponse) Reset() { + *x = MsgSetFeePayerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSetFeePayerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSetFeePayerResponse) ProtoMessage() {} + +// Deprecated: Use MsgSetFeePayerResponse.ProtoReflect.Descriptor instead. +func (*MsgSetFeePayerResponse) Descriptor() ([]byte, []int) { + return file_cosmos_evm_feesponsor_v1_tx_proto_rawDescGZIP(), []int{1} +} + +// MsgRemoveFeePayer defines a message for removing the EVM fee payer. +type MsgRemoveFeePayer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *MsgRemoveFeePayer) Reset() { + *x = MsgRemoveFeePayer{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRemoveFeePayer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRemoveFeePayer) ProtoMessage() {} + +// Deprecated: Use MsgRemoveFeePayer.ProtoReflect.Descriptor instead. +func (*MsgRemoveFeePayer) Descriptor() ([]byte, []int) { + return file_cosmos_evm_feesponsor_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgRemoveFeePayer) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +// MsgRemoveFeePayerResponse defines the response for MsgRemoveFeePayer. +type MsgRemoveFeePayerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgRemoveFeePayerResponse) Reset() { + *x = MsgRemoveFeePayerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRemoveFeePayerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRemoveFeePayerResponse) ProtoMessage() {} + +// Deprecated: Use MsgRemoveFeePayerResponse.ProtoReflect.Descriptor instead. +func (*MsgRemoveFeePayerResponse) Descriptor() ([]byte, []int) { + return file_cosmos_evm_feesponsor_v1_tx_proto_rawDescGZIP(), []int{3} +} + +var File_cosmos_evm_feesponsor_v1_tx_proto protoreflect.FileDescriptor + +var file_cosmos_evm_feesponsor_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x66, 0x65, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, + 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, + 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x46, + 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 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, + 0x3c, 0x0a, 0x0d, 0x65, 0x76, 0x6d, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, + 0x18, 0x02, 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, 0x0b, 0x65, 0x76, 0x6d, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x3a, 0x2c, 0x82, + 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, + 0x2a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x4d, 0x73, 0x67, + 0x53, 0x65, 0x74, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x22, 0x18, 0x0a, 0x16, 0x4d, + 0x73, 0x67, 0x53, 0x65, 0x74, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7c, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 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, 0x3a, 0x2f, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, + 0x6d, 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x46, 0x65, 0x65, 0x50, 0x61, + 0x79, 0x65, 0x72, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x32, 0xeb, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x69, 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x46, + 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, + 0x72, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x66, + 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x53, 0x65, 0x74, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x0e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x46, 0x65, 0x65, + 0x50, 0x61, 0x79, 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, + 0x76, 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, + 0x65, 0x72, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, + 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xe2, + 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, + 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, + 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 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, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x45, 0x46, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x45, 0x76, 0x6d, 0x2e, 0x46, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, + 0x5c, 0x46, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x46, 0x65, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, + 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_evm_feesponsor_v1_tx_proto_rawDescOnce sync.Once + file_cosmos_evm_feesponsor_v1_tx_proto_rawDescData = file_cosmos_evm_feesponsor_v1_tx_proto_rawDesc +) + +func file_cosmos_evm_feesponsor_v1_tx_proto_rawDescGZIP() []byte { + file_cosmos_evm_feesponsor_v1_tx_proto_rawDescOnce.Do(func() { + file_cosmos_evm_feesponsor_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_evm_feesponsor_v1_tx_proto_rawDescData) + }) + return file_cosmos_evm_feesponsor_v1_tx_proto_rawDescData +} + +var file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cosmos_evm_feesponsor_v1_tx_proto_goTypes = []interface{}{ + (*MsgSetFeePayer)(nil), // 0: cosmos.evm.feesponsor.v1.MsgSetFeePayer + (*MsgSetFeePayerResponse)(nil), // 1: cosmos.evm.feesponsor.v1.MsgSetFeePayerResponse + (*MsgRemoveFeePayer)(nil), // 2: cosmos.evm.feesponsor.v1.MsgRemoveFeePayer + (*MsgRemoveFeePayerResponse)(nil), // 3: cosmos.evm.feesponsor.v1.MsgRemoveFeePayerResponse +} +var file_cosmos_evm_feesponsor_v1_tx_proto_depIdxs = []int32{ + 0, // 0: cosmos.evm.feesponsor.v1.Msg.SetFeePayer:input_type -> cosmos.evm.feesponsor.v1.MsgSetFeePayer + 2, // 1: cosmos.evm.feesponsor.v1.Msg.RemoveFeePayer:input_type -> cosmos.evm.feesponsor.v1.MsgRemoveFeePayer + 1, // 2: cosmos.evm.feesponsor.v1.Msg.SetFeePayer:output_type -> cosmos.evm.feesponsor.v1.MsgSetFeePayerResponse + 3, // 3: cosmos.evm.feesponsor.v1.Msg.RemoveFeePayer:output_type -> cosmos.evm.feesponsor.v1.MsgRemoveFeePayerResponse + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_evm_feesponsor_v1_tx_proto_init() } +func file_cosmos_evm_feesponsor_v1_tx_proto_init() { + if File_cosmos_evm_feesponsor_v1_tx_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSetFeePayer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSetFeePayerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgRemoveFeePayer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgRemoveFeePayerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_evm_feesponsor_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_evm_feesponsor_v1_tx_proto_goTypes, + DependencyIndexes: file_cosmos_evm_feesponsor_v1_tx_proto_depIdxs, + MessageInfos: file_cosmos_evm_feesponsor_v1_tx_proto_msgTypes, + }.Build() + File_cosmos_evm_feesponsor_v1_tx_proto = out.File + file_cosmos_evm_feesponsor_v1_tx_proto_rawDesc = nil + file_cosmos_evm_feesponsor_v1_tx_proto_goTypes = nil + file_cosmos_evm_feesponsor_v1_tx_proto_depIdxs = nil +} diff --git a/api/cosmos/evm/feesponsor/v1/tx_grpc.pb.go b/api/cosmos/evm/feesponsor/v1/tx_grpc.pb.go new file mode 100644 index 000000000..fe2405305 --- /dev/null +++ b/api/cosmos/evm/feesponsor/v1/tx_grpc.pb.go @@ -0,0 +1,154 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: cosmos/evm/feesponsor/v1/tx.proto + +package feesponsorv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_SetFeePayer_FullMethodName = "/cosmos.evm.feesponsor.v1.Msg/SetFeePayer" + Msg_RemoveFeePayer_FullMethodName = "/cosmos.evm.feesponsor.v1.Msg/RemoveFeePayer" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // SetFeePayer defines a governance operation for setting the EVM fee payer. + // The authority is hard-coded to the Cosmos SDK x/gov module account. + SetFeePayer(ctx context.Context, in *MsgSetFeePayer, opts ...grpc.CallOption) (*MsgSetFeePayerResponse, error) + // RemoveFeePayer defines a governance operation for removing the EVM fee payer. + // The authority is hard-coded to the Cosmos SDK x/gov module account. + RemoveFeePayer(ctx context.Context, in *MsgRemoveFeePayer, opts ...grpc.CallOption) (*MsgRemoveFeePayerResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SetFeePayer(ctx context.Context, in *MsgSetFeePayer, opts ...grpc.CallOption) (*MsgSetFeePayerResponse, error) { + out := new(MsgSetFeePayerResponse) + err := c.cc.Invoke(ctx, Msg_SetFeePayer_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RemoveFeePayer(ctx context.Context, in *MsgRemoveFeePayer, opts ...grpc.CallOption) (*MsgRemoveFeePayerResponse, error) { + out := new(MsgRemoveFeePayerResponse) + err := c.cc.Invoke(ctx, Msg_RemoveFeePayer_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // SetFeePayer defines a governance operation for setting the EVM fee payer. + // The authority is hard-coded to the Cosmos SDK x/gov module account. + SetFeePayer(context.Context, *MsgSetFeePayer) (*MsgSetFeePayerResponse, error) + // RemoveFeePayer defines a governance operation for removing the EVM fee payer. + // The authority is hard-coded to the Cosmos SDK x/gov module account. + RemoveFeePayer(context.Context, *MsgRemoveFeePayer) (*MsgRemoveFeePayerResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) SetFeePayer(context.Context, *MsgSetFeePayer) (*MsgSetFeePayerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetFeePayer not implemented") +} +func (UnimplementedMsgServer) RemoveFeePayer(context.Context, *MsgRemoveFeePayer) (*MsgRemoveFeePayerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveFeePayer not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_SetFeePayer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetFeePayer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetFeePayer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_SetFeePayer_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetFeePayer(ctx, req.(*MsgSetFeePayer)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RemoveFeePayer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveFeePayer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RemoveFeePayer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_RemoveFeePayer_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RemoveFeePayer(ctx, req.(*MsgRemoveFeePayer)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.evm.feesponsor.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetFeePayer", + Handler: _Msg_SetFeePayer_Handler, + }, + { + MethodName: "RemoveFeePayer", + Handler: _Msg_RemoveFeePayer_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/evm/feesponsor/v1/tx.proto", +} diff --git a/evmd/app.go b/evmd/app.go index f07b0a471..10da084d1 100644 --- a/evmd/app.go +++ b/evmd/app.go @@ -35,6 +35,9 @@ import ( "github.com/cosmos/evm/x/feemarket" feemarketkeeper "github.com/cosmos/evm/x/feemarket/keeper" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" + "github.com/cosmos/evm/x/feesponsor" + feesponsorkeeper "github.com/cosmos/evm/x/feesponsor/keeper" + feesponsortypes "github.com/cosmos/evm/x/feesponsor/types" ibccallbackskeeper "github.com/cosmos/evm/x/ibc/callbacks/keeper" "github.com/cosmos/evm/x/ibc/transfer" @@ -188,6 +191,7 @@ type EVMD struct { // Cosmos EVM keepers FeeMarketKeeper feemarketkeeper.Keeper + FeeSponsorKeeper feesponsorkeeper.Keeper EVMKeeper *evmkeeper.Keeper Erc20Keeper erc20keeper.Keeper PreciseBankKeeper precisebankkeeper.Keeper @@ -242,7 +246,7 @@ func NewExampleApp( // ibc keys ibcexported.StoreKey, ibctransfertypes.StoreKey, // Cosmos EVM store keys - evmtypes.StoreKey, feemarkettypes.StoreKey, erc20types.StoreKey, precisebanktypes.StoreKey, + evmtypes.StoreKey, feemarkettypes.StoreKey, feesponsortypes.StoreKey, erc20types.StoreKey, precisebanktypes.StoreKey, ) tkeys := storetypes.NewTransientStoreKeys(evmtypes.TransientKey, feemarkettypes.TransientKey) @@ -405,7 +409,7 @@ func NewExampleApp( app.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks( - // register the governance hooks + // register the governance hooks ), ) @@ -428,6 +432,12 @@ func NewExampleApp( tkeys[feemarkettypes.TransientKey], ) + app.FeeSponsorKeeper = feesponsorkeeper.NewKeeper( + appCodec, + authtypes.NewModuleAddress(govtypes.ModuleName), + keys[feesponsortypes.StoreKey], + ) + // Set up PreciseBank keeper // // NOTE: PreciseBank is not needed if SDK use 18 decimals for gas coin. Use BankKeeper instead. @@ -571,6 +581,7 @@ func NewExampleApp( // Cosmos EVM modules vm.NewAppModule(app.EVMKeeper, app.AccountKeeper, app.BankKeeper, app.AccountKeeper.AddressCodec()), feemarket.NewAppModule(app.FeeMarketKeeper), + feesponsor.NewAppModule(app.FeeSponsorKeeper), erc20.NewAppModule(app.Erc20Keeper, app.AccountKeeper), precisebank.NewAppModule(app.PreciseBankKeeper, app.BankKeeper, app.AccountKeeper), ) @@ -611,7 +622,7 @@ func NewExampleApp( ibcexported.ModuleName, ibctransfertypes.ModuleName, // Cosmos EVM BeginBlockers - erc20types.ModuleName, feemarkettypes.ModuleName, + erc20types.ModuleName, feemarkettypes.ModuleName, feesponsortypes.ModuleName, evmtypes.ModuleName, // NOTE: EVM BeginBlocker must come after FeeMarket BeginBlocker // TODO: remove no-ops? check if all are no-ops before removing @@ -639,7 +650,7 @@ func NewExampleApp( slashingtypes.ModuleName, minttypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, feegrant.ModuleName, upgradetypes.ModuleName, consensusparamtypes.ModuleName, - precisebanktypes.ModuleName, + precisebanktypes.ModuleName, feesponsortypes.ModuleName, vestingtypes.ModuleName, ) @@ -658,6 +669,7 @@ func NewExampleApp( // gentx transactions use MinGasPriceDecorator.AnteHandle evmtypes.ModuleName, feemarkettypes.ModuleName, + feesponsortypes.ModuleName, erc20types.ModuleName, precisebanktypes.ModuleName, @@ -775,6 +787,7 @@ func (app *EVMD) setAnteHandler(txConfig client.TxConfig, maxGasWanted uint64) { FeegrantKeeper: app.FeeGrantKeeper, IBCKeeper: app.IBCKeeper, FeeMarketKeeper: app.FeeMarketKeeper, + FeesponsorKeeper: app.FeeSponsorKeeper, SignModeHandler: txConfig.SignModeHandler(), SigGasConsumer: evmante.SigVerificationGasConsumer, MaxTxGasWanted: maxGasWanted, diff --git a/proto/cosmos/evm/feesponsor/v1/genesis.proto b/proto/cosmos/evm/feesponsor/v1/genesis.proto new file mode 100644 index 000000000..43b1fca0a --- /dev/null +++ b/proto/cosmos/evm/feesponsor/v1/genesis.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package cosmos.evm.feesponsor.v1; + +import "cosmos_proto/cosmos.proto"; + + +option go_package = "github.com/cosmos/evm/x/feesponsor/types"; + +// GenesisState defines the feesponsor module's genesis state. +message GenesisState { + // fee_payer is the EVM fee payer configuration + string fee_payer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + diff --git a/proto/cosmos/evm/feesponsor/v1/query.proto b/proto/cosmos/evm/feesponsor/v1/query.proto new file mode 100644 index 000000000..e7f6f3147 --- /dev/null +++ b/proto/cosmos/evm/feesponsor/v1/query.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package cosmos.evm.feesponsor.v1; + +import "google/api/annotations.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/evm/x/feesponsor/types"; + +// Query defines the gRPC querier service. +service Query { + // FeePayer queries the current EVM fee payer + rpc FeePayer(QueryFeePayerRequest) returns (QueryFeePayerResponse) { + option (google.api.http).get = "/cosmos/evm/feesponsor/v1/fee_payer"; + } +} + +// QueryFeePayerRequest is the request type for the Query/FeePayer RPC method. +message QueryFeePayerRequest {} + +// QueryFeePayerResponse is the response type for the Query/FeePayer RPC method. +message QueryFeePayerResponse { + // fee_payer is the current EVM fee payer + string fee_payer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + diff --git a/proto/cosmos/evm/feesponsor/v1/tx.proto b/proto/cosmos/evm/feesponsor/v1/tx.proto new file mode 100644 index 000000000..1d7cace49 --- /dev/null +++ b/proto/cosmos/evm/feesponsor/v1/tx.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +package cosmos.evm.feesponsor.v1; + +import "amino/amino.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/evm/x/feesponsor/types"; + +// Msg defines the feesponsor Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SetFeePayer defines a governance operation for setting the EVM fee payer. + // The authority is hard-coded to the Cosmos SDK x/gov module account. + rpc SetFeePayer(MsgSetFeePayer) returns (MsgSetFeePayerResponse); + + // RemoveFeePayer defines a governance operation for removing the EVM fee payer. + // The authority is hard-coded to the Cosmos SDK x/gov module account. + rpc RemoveFeePayer(MsgRemoveFeePayer) returns (MsgRemoveFeePayerResponse); +} + +// MsgSetFeePayer defines a message for setting the EVM fee payer. +message MsgSetFeePayer { + option (amino.name) = "cosmos/evm/MsgSetFeePayer"; + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // evm_fee_payer is the address that will pay for EVM transaction fees + string evm_fee_payer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgSetFeePayerResponse defines the response for MsgSetFeePayer. +message MsgSetFeePayerResponse {} + +// MsgRemoveFeePayer defines a message for removing the EVM fee payer. +message MsgRemoveFeePayer { + option (amino.name) = "cosmos/evm/MsgRemoveFeePayer"; + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgRemoveFeePayerResponse defines the response for MsgRemoveFeePayer. +message MsgRemoveFeePayerResponse {} 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 b9e248afd..ee381ad4e 100644 --- a/tests/integration/ante/test_evm_unit_06_account_verification.go +++ b/tests/integration/ante/test_evm_unit_06_account_verification.go @@ -220,16 +220,22 @@ func (s *EvmUnitAnteTestSuite) TestVerifyAccountBalance() { statedbAccount, txArgs := tc.generateAccountAndArgs() ethTx := txArgs.ToTx() - // Function to be tested - err := evm.VerifyAccountBalance( + account, err := evm.VerifyAccount( unitNetwork.GetContext(), unitNetwork.App.GetEVMKeeper(), unitNetwork.App.GetAccountKeeper(), statedbAccount, senderKey.Addr, - ethTx, ) + // VerifyAccountBalance after VerifyAccount + if err == nil { + err = evm.VerifyAccountBalance( + account, + ethTx.Cost(), + ) + } + if tc.expectedError != nil { s.Require().Error(err) s.Contains(err.Error(), tc.expectedError.Error()) diff --git a/tests/integration/x/vm/test_fees.go b/tests/integration/x/vm/test_fees.go index f3cf852a6..d610c144c 100644 --- a/tests/integration/x/vm/test_fees.go +++ b/tests/integration/x/vm/test_fees.go @@ -254,7 +254,7 @@ func (s *KeeperTestSuite) TestCheckSenderBalance() { acct := s.Network.App.GetEVMKeeper().GetAccountOrEmpty(s.Network.GetContext(), addr) err := keeper.CheckSenderBalance( sdkmath.NewIntFromBigInt(acct.Balance.ToBig()), - tx.AsTransaction(), + tx.AsTransaction().Cost(), ) if tc.expectPass { diff --git a/x/feesponsor/genesis.go b/x/feesponsor/genesis.go new file mode 100644 index 000000000..ec1455d59 --- /dev/null +++ b/x/feesponsor/genesis.go @@ -0,0 +1,35 @@ +package feesponsor + +import ( + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/evm/x/feesponsor/keeper" + "github.com/cosmos/evm/x/feesponsor/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// InitGenesis initializes the feesponsor module's state from a provided genesis state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) []abci.ValidatorUpdate { + // Set fee payer if provided + if genState.FeePayer != "" { + addr, err := types.ValidateFeePayerAddress(genState.FeePayer) + if err != nil { + panic(err) + } + k.SetFeePayerToStore(ctx, addr) + } + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the feesponsor module's exported genesis. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + feePayer, found := k.GetFeePayer(ctx) + if !found { + return types.DefaultGenesisState() + } + + return &types.GenesisState{ + FeePayer: sdk.AccAddress(feePayer).String(), + } +} diff --git a/x/feesponsor/keeper/grpc_query.go b/x/feesponsor/keeper/grpc_query.go new file mode 100644 index 000000000..2786f9544 --- /dev/null +++ b/x/feesponsor/keeper/grpc_query.go @@ -0,0 +1,26 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/evm/x/feesponsor/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ types.QueryServer = Keeper{} + +// FeePayer returns the current EVM fee payer +func (k Keeper) FeePayer(goCtx context.Context, _ *types.QueryFeePayerRequest) (*types.QueryFeePayerResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + feePayer, found := k.GetFeePayer(ctx) + if !found { + return &types.QueryFeePayerResponse{}, types.ErrFeePayerNotSet + } + + return &types.QueryFeePayerResponse{ + FeePayer: sdk.AccAddress(feePayer).String(), + }, nil +} + diff --git a/x/feesponsor/keeper/keeper.go b/x/feesponsor/keeper/keeper.go new file mode 100644 index 000000000..641668b18 --- /dev/null +++ b/x/feesponsor/keeper/keeper.go @@ -0,0 +1,72 @@ +package keeper + +import ( + "github.com/cosmos/evm/x/feesponsor/types" + + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// Keeper grants access to the Fee Sponsor module state. +type Keeper struct { + // Protobuf codec + cdc codec.BinaryCodec + // Store key required for the Fee Sponsor Prefix KVStore. + storeKey storetypes.StoreKey + // the address capable of executing a MsgSetFeePayer/MsgUpdateFeePayer message. + // Typically, this should be the x/gov module account. + authority sdk.AccAddress +} + +// NewKeeper generates new fee sponsor module keeper +func NewKeeper( + cdc codec.BinaryCodec, + authority sdk.AccAddress, + storeKey storetypes.StoreKey, +) Keeper { + // ensure authority account is correctly formatted + if err := sdk.VerifyAddressFormat(authority); err != nil { + panic(err) + } + + return Keeper{ + cdc: cdc, + storeKey: storeKey, + authority: authority, + } +} + +// Logger returns a module-specific logger. +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", types.ModuleName) +} + +// GetAuthority returns the module's authority. +func (k Keeper) GetAuthority() sdk.AccAddress { + return k.authority +} + +// SetFeePayerToStore sets the EVM fee payer to the store. +func (k Keeper) SetFeePayerToStore(ctx sdk.Context, feePayerAddr []byte) { + store := ctx.KVStore(k.storeKey) + store.Set(types.KeyPrefixFeePayer, feePayerAddr) +} + +// GetFeePayer returns the EVM fee payer from the store. +func (k Keeper) GetFeePayer(ctx sdk.Context) ([]byte, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.KeyPrefixFeePayer) + if bz == nil { + return []byte{}, false + } + return bz, true +} + +// RemoveFeePayerFromStore removes the EVM fee payer from the store. +func (k Keeper) RemoveFeePayerFromStore(ctx sdk.Context) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.KeyPrefixFeePayer) +} diff --git a/x/feesponsor/keeper/keeper_test.go b/x/feesponsor/keeper/keeper_test.go new file mode 100644 index 000000000..5560e1934 --- /dev/null +++ b/x/feesponsor/keeper/keeper_test.go @@ -0,0 +1,168 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + evmencoding "github.com/cosmos/evm/encoding" + testconstants "github.com/cosmos/evm/testutil/constants" + "github.com/cosmos/evm/x/feesponsor/keeper" + "github.com/cosmos/evm/x/feesponsor/types" + vmtypes "github.com/cosmos/evm/x/vm/types" + + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// testData defines necessary fields for testing keeper store methods +type testData struct { + ctx sdk.Context + keeper keeper.Keeper + storeKey *storetypes.KVStoreKey + authority sdk.AccAddress +} + +// newTestData creates a new testData instance for unit tests +func newTestData(t *testing.T) testData { + t.Helper() + + storeKey := storetypes.NewKVStoreKey(types.ModuleName) + tKey := storetypes.NewTransientStoreKey("transient_test") + ctx := testutil.DefaultContext(storeKey, tKey) + + chainID := testconstants.SixDecimalsChainID.EVMChainID + cfg := evmencoding.MakeConfig(chainID) + cdc := cfg.Codec + + authority := sdk.AccAddress("authority") + k := keeper.NewKeeper(cdc, authority, storeKey) + + evmConfigurator := vmtypes.NewEVMConfigurator(). + WithEVMCoinInfo(testconstants.ExampleChainCoinInfo[testconstants.SixDecimalsChainID]) + evmConfigurator.ResetTestConfig() + err := evmConfigurator.Configure() + require.NoError(t, err) + + return testData{ + ctx: ctx, + keeper: k, + storeKey: storeKey, + authority: authority, + } +} + +func TestNewKeeper(t *testing.T) { + td := newTestData(t) + + require.NotNil(t, td.keeper) + require.Equal(t, td.authority, td.keeper.GetAuthority()) +} + +func TestSetFeePayerToStore(t *testing.T) { + td := newTestData(t) + + testCases := []struct { + name string + feePayerAddr []byte + }{ + { + name: "set valid fee payer address", + feePayerAddr: sdk.AccAddress("feepayer1"), + }, + { + name: "set different fee payer address", + feePayerAddr: sdk.AccAddress("feepayer2"), + }, + { + name: "set empty fee payer address", + feePayerAddr: []byte{}, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + td.keeper.SetFeePayerToStore(td.ctx, tc.feePayerAddr) + + // Verify it was stored + stored, found := td.keeper.GetFeePayer(td.ctx) + require.True(t, found) + require.Equal(t, tc.feePayerAddr, stored) + }) + } +} + +func TestGetFeePayer(t *testing.T) { + testCases := []struct { + name string + setupFn func(td testData) + expectFound bool + expectAddr []byte + }{ + { + name: "get existing fee payer", + setupFn: func(td testData) { + addr := sdk.AccAddress("feepayer1") + td.keeper.SetFeePayerToStore(td.ctx, addr) + }, + expectFound: true, + expectAddr: sdk.AccAddress("feepayer1"), + }, + { + name: "get non-existent fee payer", + setupFn: func(td testData) {}, + expectFound: false, + expectAddr: []byte{}, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + // Create fresh test data for each test case + td := newTestData(t) + tc.setupFn(td) + + addr, found := td.keeper.GetFeePayer(td.ctx) + require.Equal(t, tc.expectFound, found) + require.Equal(t, tc.expectAddr, addr) + }) + } +} + +func TestRemoveFeePayerFromStore(t *testing.T) { + td := newTestData(t) + + testCases := []struct { + name string + setupFn func() + }{ + { + name: "remove existing fee payer", + setupFn: func() { + addr := sdk.AccAddress("feepayer1") + td.keeper.SetFeePayerToStore(td.ctx, addr) + }, + }, + { + name: "remove non-existent fee payer", + setupFn: func() {}, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + // Create fresh test data for each test case + td := newTestData(t) + tc.setupFn() + + // Remove fee payer + td.keeper.RemoveFeePayerFromStore(td.ctx) + + // Verify it was removed + _, found := td.keeper.GetFeePayer(td.ctx) + require.False(t, found) + }) + } +} diff --git a/x/feesponsor/keeper/msg_server.go b/x/feesponsor/keeper/msg_server.go new file mode 100644 index 000000000..0e13f1eed --- /dev/null +++ b/x/feesponsor/keeper/msg_server.go @@ -0,0 +1,80 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/evm/x/feesponsor/types" + + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +var _ types.MsgServer = &Keeper{} + +// SetFeePayer sets the EVM fee payer address +func (k Keeper) SetFeePayer(goCtx context.Context, msg *types.MsgSetFeePayer) (*types.MsgSetFeePayerResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Validate authority + if err := k.validateAuthority(msg.Authority); err != nil { + return nil, err + } + + // Validate fee payer address + addr, err := types.ValidateFeePayerAddress(msg.EvmFeePayer) + if err != nil { + return nil, err + } + + // Set the fee payer + k.SetFeePayerToStore(ctx, addr) + + // Emit event + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.ModuleName, + sdk.NewAttribute("action", "set_fee_payer"), + sdk.NewAttribute("fee_payer", msg.EvmFeePayer), + ), + ) + + return &types.MsgSetFeePayerResponse{}, nil +} + +// RemoveFeePayer removes the EVM fee payer address +func (k Keeper) RemoveFeePayer(goCtx context.Context, msg *types.MsgRemoveFeePayer) (*types.MsgRemoveFeePayerResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Validate authority + if err := k.validateAuthority(msg.Authority); err != nil { + return nil, err + } + + // Remove the fee payer + k.RemoveFeePayerFromStore(ctx) + + // Emit event + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.ModuleName, + sdk.NewAttribute("action", "remove_fee_payer"), + ), + ) + + return &types.MsgRemoveFeePayerResponse{}, nil +} + +// validateAuthority checks if the provided authority is the expected authority +func (k Keeper) validateAuthority(authority string) error { + if authority != k.authority.String() { + return errorsmod.Wrapf( + govtypes.ErrInvalidSigner, + "invalid authority; expected %s, got %s", + k.authority.String(), + authority, + ) + } + return nil +} diff --git a/x/feesponsor/keeper/msg_server_test.go b/x/feesponsor/keeper/msg_server_test.go new file mode 100644 index 000000000..d65fd7c4a --- /dev/null +++ b/x/feesponsor/keeper/msg_server_test.go @@ -0,0 +1,310 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/evm/x/feesponsor/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func TestSetFeePayer(t *testing.T) { + testCases := []struct { + name string + msg *types.MsgSetFeePayer + expectErr bool + errMsg string + }{ + { + name: "pass - valid set fee payer", + msg: &types.MsgSetFeePayer{ + Authority: sdk.AccAddress("authority").String(), + EvmFeePayer: sdk.AccAddress("feepayer1").String(), + }, + expectErr: false, + }, + { + name: "fail - invalid authority", + msg: &types.MsgSetFeePayer{ + Authority: sdk.AccAddress("invalid").String(), + EvmFeePayer: sdk.AccAddress("feepayer1").String(), + }, + expectErr: true, + errMsg: "invalid authority", + }, + { + name: "fail - empty fee payer address", + msg: &types.MsgSetFeePayer{ + Authority: sdk.AccAddress("authority").String(), + EvmFeePayer: "", + }, + expectErr: true, + errMsg: "fee payer address cannot be empty", + }, + { + name: "fail - invalid fee payer address", + msg: &types.MsgSetFeePayer{ + Authority: sdk.AccAddress("authority").String(), + EvmFeePayer: "invalid_address", + }, + expectErr: true, + errMsg: "invalid bech32 address", + }, + { + name: "pass - update existing fee payer", + msg: &types.MsgSetFeePayer{ + Authority: sdk.AccAddress("authority").String(), + EvmFeePayer: sdk.AccAddress("feepayer2").String(), + }, + expectErr: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + td := newTestData(t) + + resp, err := td.keeper.SetFeePayer(td.ctx, tc.msg) + + if tc.expectErr { + require.Error(t, err) + require.Contains(t, err.Error(), tc.errMsg) + require.Nil(t, resp) + } else { + require.NoError(t, err) + require.NotNil(t, resp) + + // Verify fee payer was set + addr, err := types.ValidateFeePayerAddress(tc.msg.EvmFeePayer) + require.NoError(t, err) + + stored, found := td.keeper.GetFeePayer(td.ctx) + require.True(t, found) + require.Equal(t, addr, stored) + } + }) + } +} + +func TestRemoveFeePayer(t *testing.T) { + testCases := []struct { + name string + setupFn func(td testData) + msg *types.MsgRemoveFeePayer + expectErr bool + errMsg string + }{ + { + name: "pass - remove existing fee payer", + setupFn: func(td testData) { + // Set a fee payer first + addr := sdk.AccAddress("feepayer1") + td.keeper.SetFeePayerToStore(td.ctx, addr) + }, + msg: &types.MsgRemoveFeePayer{ + Authority: sdk.AccAddress("authority").String(), + }, + expectErr: false, + }, + { + name: "pass - remove non-existent fee payer", + setupFn: func(td testData) {}, + msg: &types.MsgRemoveFeePayer{ + Authority: sdk.AccAddress("authority").String(), + }, + expectErr: false, + }, + { + name: "fail - invalid authority", + setupFn: func(td testData) { + addr := sdk.AccAddress("feepayer1") + td.keeper.SetFeePayerToStore(td.ctx, addr) + }, + msg: &types.MsgRemoveFeePayer{ + Authority: sdk.AccAddress("invalid").String(), + }, + expectErr: true, + errMsg: "invalid authority", + }, + { + name: "fail - empty authority", + setupFn: func(td testData) {}, + msg: &types.MsgRemoveFeePayer{ + Authority: "", + }, + expectErr: true, + errMsg: "invalid authority", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + td := newTestData(t) + tc.setupFn(td) + + resp, err := td.keeper.RemoveFeePayer(td.ctx, tc.msg) + + if tc.expectErr { + require.Error(t, err) + require.Contains(t, err.Error(), tc.errMsg) + require.Nil(t, resp) + } else { + require.NoError(t, err) + require.NotNil(t, resp) + + // Verify fee payer was removed + _, found := td.keeper.GetFeePayer(td.ctx) + require.False(t, found) + } + }) + } +} + +func TestSetFeePayerEvent(t *testing.T) { + td := newTestData(t) + + msg := &types.MsgSetFeePayer{ + Authority: td.authority.String(), + EvmFeePayer: sdk.AccAddress("feepayer1").String(), + } + + resp, err := td.keeper.SetFeePayer(td.ctx, msg) + require.NoError(t, err) + require.NotNil(t, resp) + + // Check event was emitted + events := td.ctx.EventManager().Events() + require.NotEmpty(t, events) + + // Find the feesponsor event + var found bool + for _, event := range events { + if event.Type == types.ModuleName { + found = true + // Check attributes + attrs := event.Attributes + require.Len(t, attrs, 2) + require.Equal(t, "action", attrs[0].Key) + require.Equal(t, "set_fee_payer", attrs[0].Value) + require.Equal(t, "fee_payer", attrs[1].Key) + require.Equal(t, msg.EvmFeePayer, attrs[1].Value) + } + } + require.True(t, found, "feesponsor event not found") +} + +func TestRemoveFeePayerEvent(t *testing.T) { + td := newTestData(t) + + // Set a fee payer first + addr := sdk.AccAddress("feepayer1") + td.keeper.SetFeePayerToStore(td.ctx, addr) + + msg := &types.MsgRemoveFeePayer{ + Authority: td.authority.String(), + } + + resp, err := td.keeper.RemoveFeePayer(td.ctx, msg) + require.NoError(t, err) + require.NotNil(t, resp) + + // Check event was emitted + events := td.ctx.EventManager().Events() + require.NotEmpty(t, events) + + // Find the feesponsor event + var found bool + for _, event := range events { + if event.Type == types.ModuleName { + found = true + // Check attributes + attrs := event.Attributes + require.Len(t, attrs, 1) + require.Equal(t, "action", attrs[0].Key) + require.Equal(t, "remove_fee_payer", attrs[0].Value) + } + } + require.True(t, found, "feesponsor event not found") +} + +func TestSetFeePayerMultipleTimes(t *testing.T) { + td := newTestData(t) + + // Set fee payer first time + msg1 := &types.MsgSetFeePayer{ + Authority: td.authority.String(), + EvmFeePayer: sdk.AccAddress("feepayer1").String(), + } + resp1, err := td.keeper.SetFeePayer(td.ctx, msg1) + require.NoError(t, err) + require.NotNil(t, resp1) + + addr1, err := types.ValidateFeePayerAddress(msg1.EvmFeePayer) + require.NoError(t, err) + + stored1, found := td.keeper.GetFeePayer(td.ctx) + require.True(t, found) + require.Equal(t, addr1, stored1) + + // Update fee payer + msg2 := &types.MsgSetFeePayer{ + Authority: td.authority.String(), + EvmFeePayer: sdk.AccAddress("feepayer2").String(), + } + resp2, err := td.keeper.SetFeePayer(td.ctx, msg2) + require.NoError(t, err) + require.NotNil(t, resp2) + + addr2, err := types.ValidateFeePayerAddress(msg2.EvmFeePayer) + require.NoError(t, err) + + stored2, found := td.keeper.GetFeePayer(td.ctx) + require.True(t, found) + require.Equal(t, addr2, stored2) + require.NotEqual(t, addr1, addr2) +} + +func TestRemoveFeePayerThenSet(t *testing.T) { + td := newTestData(t) + + // Set fee payer + setMsg := &types.MsgSetFeePayer{ + Authority: td.authority.String(), + EvmFeePayer: sdk.AccAddress("feepayer1").String(), + } + _, err := td.keeper.SetFeePayer(td.ctx, setMsg) + require.NoError(t, err) + + // Verify it exists + _, found := td.keeper.GetFeePayer(td.ctx) + require.True(t, found) + + // Remove fee payer + removeMsg := &types.MsgRemoveFeePayer{ + Authority: td.authority.String(), + } + _, err = td.keeper.RemoveFeePayer(td.ctx, removeMsg) + require.NoError(t, err) + + // Verify it was removed + _, found = td.keeper.GetFeePayer(td.ctx) + require.False(t, found) + + // Set fee payer again + setMsg2 := &types.MsgSetFeePayer{ + Authority: td.authority.String(), + EvmFeePayer: sdk.AccAddress("feepayer2").String(), + } + _, err = td.keeper.SetFeePayer(td.ctx, setMsg2) + require.NoError(t, err) + + // Verify it exists + addr, found := td.keeper.GetFeePayer(td.ctx) + require.True(t, found) + + expectedAddr, err := types.ValidateFeePayerAddress(setMsg2.EvmFeePayer) + require.NoError(t, err) + require.Equal(t, expectedAddr, addr) +} diff --git a/x/feesponsor/module.go b/x/feesponsor/module.go new file mode 100644 index 000000000..c49a068ca --- /dev/null +++ b/x/feesponsor/module.go @@ -0,0 +1,134 @@ +package feesponsor + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/cosmos/evm/x/feesponsor/keeper" + "github.com/cosmos/evm/x/feesponsor/types" + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + "cosmossdk.io/core/appmodule" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" +) + +var ( + _ module.AppModuleBasic = AppModuleBasic{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + _ appmodule.AppModule = AppModule{} +) + +// AppModuleBasic defines the basic application module used by the feesponsor module. +type AppModuleBasic struct{} + +// Name returns the feesponsor module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec registers the feesponsor module's types on the LegacyAmino codec. +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterLegacyAminoCodec(cdc) +} + +// RegisterInterfaces registers the module's interface types +func (b AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} + +// DefaultGenesis returns default genesis state as raw bytes for the feesponsor module. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesisState()) +} + +// ValidateGenesis performs genesis state validation for the feesponsor module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the feesponsor module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// GetTxCmd returns no root tx command for the feesponsor module. +func (AppModuleBasic) GetTxCmd() *cobra.Command { + return nil +} + +// GetQueryCmd returns the root query command for the feesponsor module. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return nil +} + +// AppModule implements an application module for the feesponsor module. +type AppModule struct { + AppModuleBasic + keeper keeper.Keeper +} + +// NewAppModule creates a new AppModule object +func NewAppModule(k keeper.Keeper) AppModule { + return AppModule{ + AppModuleBasic: AppModuleBasic{}, + keeper: k, + } +} + +func (AppModule) Name() string { + return types.ModuleName +} + +// RegisterServices registers module services. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), &am.keeper) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// InitGenesis performs genesis initialization for the feesponsor module. It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { + var genesisState types.GenesisState + cdc.MustUnmarshalJSON(data, &genesisState) + InitGenesis(ctx, am.keeper, genesisState) +} + +// ExportGenesis returns the exported genesis state as raw bytes for the feesponsor module. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(gs) +} + +// ConsensusVersion implements AppModule/ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 1 } + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// BeginBlock returns the begin blocker for the feesponsor module. +func (am AppModule) BeginBlock(_ context.Context) error { + return nil +} + +// EndBlock returns the end blocker for the feesponsor module. +func (am AppModule) EndBlock(_ context.Context) error { + return nil +} diff --git a/x/feesponsor/types/codec.go b/x/feesponsor/types/codec.go new file mode 100644 index 000000000..64604b0f5 --- /dev/null +++ b/x/feesponsor/types/codec.go @@ -0,0 +1,42 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +var ( + amino = codec.NewLegacyAmino() + + // ModuleCdc references the global feesponsor module codec. Note, the codec should + // ONLY be used in certain instances of tests and for JSON encoding. + ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) + + // AminoCdc is a amino codec created to support amino JSON compatible msgs. + AminoCdc = codec.NewAminoCodec(amino) +) + +func init() { + RegisterLegacyAminoCodec(amino) + amino.Seal() +} + +// RegisterLegacyAminoCodec registers the necessary x/feesponsor interfaces and concrete types +// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgSetFeePayer{}, "cosmos/evm/MsgSetFeePayer", nil) + cdc.RegisterConcrete(&MsgRemoveFeePayer{}, "cosmos/evm/MsgRemoveFeePayer", nil) +} + +// RegisterInterfaces registers the x/feesponsor interfaces types with the interface registry +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgSetFeePayer{}, + &MsgRemoveFeePayer{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} diff --git a/x/feesponsor/types/errors.go b/x/feesponsor/types/errors.go new file mode 100644 index 000000000..c778ffaf4 --- /dev/null +++ b/x/feesponsor/types/errors.go @@ -0,0 +1,11 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" +) + +var ( + ErrInvalidFeePayer = errorsmod.Register(ModuleName, 2, "invalid fee payer address") + ErrFeePayerNotSet = errorsmod.Register(ModuleName, 3, "fee payer not set") +) + diff --git a/x/feesponsor/types/genesis.go b/x/feesponsor/types/genesis.go new file mode 100644 index 000000000..06d4fdff4 --- /dev/null +++ b/x/feesponsor/types/genesis.go @@ -0,0 +1,20 @@ +package types + +// DefaultGenesisState sets default feesponsor genesis state +func DefaultGenesisState() *GenesisState { + return &GenesisState{ + FeePayer: "", + } +} + +// Validate performs basic genesis state validation returning an error upon any failure. +func (gs GenesisState) Validate() error { + // Validate fee payer address if set + if gs.FeePayer != "" { + if _, err := ValidateFeePayerAddress(gs.FeePayer); err != nil { + return err + } + } + return nil +} + diff --git a/x/feesponsor/types/genesis.pb.go b/x/feesponsor/types/genesis.pb.go new file mode 100644 index 000000000..1b3ae93fb --- /dev/null +++ b/x/feesponsor/types/genesis.pb.go @@ -0,0 +1,322 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/evm/feesponsor/v1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the feesponsor module's genesis state. +type GenesisState struct { + // fee_payer is the EVM fee payer configuration + FeePayer string `protobuf:"bytes,1,opt,name=fee_payer,json=feePayer,proto3" json:"fee_payer,omitempty"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_52bb102004e718e7, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetFeePayer() string { + if m != nil { + return m.FeePayer + } + return "" +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.evm.feesponsor.v1.GenesisState") +} + +func init() { + proto.RegisterFile("cosmos/evm/feesponsor/v1/genesis.proto", fileDescriptor_52bb102004e718e7) +} + +var fileDescriptor_52bb102004e718e7 = []byte{ + // 207 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4b, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0xd5, 0x4f, 0x4b, 0x4d, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, 0xce, + 0x2f, 0xd2, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0x92, 0x80, 0xa8, 0xd3, 0x4b, 0x2d, 0xcb, 0xd5, 0x43, 0xa8, 0xd3, 0x2b, 0x33, + 0x94, 0x92, 0x84, 0xc8, 0xc4, 0x83, 0xd5, 0xe9, 0x43, 0x95, 0x81, 0x39, 0x4a, 0xae, 0x5c, 0x3c, + 0xee, 0x10, 0x53, 0x82, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x4c, 0xb9, 0x38, 0xd3, 0x52, 0x53, 0xe3, + 0x0b, 0x12, 0x2b, 0x53, 0x8b, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, 0x6d, 0xd1, + 0x15, 0x81, 0x6a, 0x72, 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0x0e, 0x2e, 0x29, 0xca, 0xcc, 0x4b, + 0x0f, 0xe2, 0x48, 0x4b, 0x4d, 0x0d, 0x00, 0xa9, 0x74, 0x72, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, + 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, + 0xc6, 0x63, 0x39, 0x86, 0x28, 0x8d, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, + 0x7d, 0x24, 0x8f, 0x54, 0x20, 0x7b, 0xa5, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x22, + 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa6, 0xb8, 0x0b, 0x90, 0xf0, 0x00, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FeePayer) > 0 { + i -= len(m.FeePayer) + copy(dAtA[i:], m.FeePayer) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.FeePayer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FeePayer) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/feesponsor/types/keys.go b/x/feesponsor/types/keys.go new file mode 100644 index 000000000..cdd1778b2 --- /dev/null +++ b/x/feesponsor/types/keys.go @@ -0,0 +1,23 @@ +package types + +const ( + // ModuleName string name of module + ModuleName = "feesponsor" + + // StoreKey key for the feesponsor module store + StoreKey = ModuleName + + // RouterKey uses module name for routing + RouterKey = ModuleName +) + +// prefix bytes for the feesponsor persistent store +const ( + prefixFeePayer = iota + 1 +) + +// KVStore key prefixes +var ( + KeyPrefixFeePayer = []byte{prefixFeePayer} +) + diff --git a/x/feesponsor/types/msg.go b/x/feesponsor/types/msg.go new file mode 100644 index 000000000..db44ecb13 --- /dev/null +++ b/x/feesponsor/types/msg.go @@ -0,0 +1,66 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + _ sdk.Msg = &MsgSetFeePayer{} + _ sdk.Msg = &MsgRemoveFeePayer{} +) + +// GetSigners returns the expected signers for MsgSetFeePayer +func (m *MsgSetFeePayer) GetSigners() []sdk.AccAddress { + authority, err := sdk.AccAddressFromBech32(m.Authority) + if err != nil { + panic(err) + } + return []sdk.AccAddress{authority} +} + +// ValidateBasic does a sanity check on the provided data +func (m *MsgSetFeePayer) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + + if _, err := ValidateFeePayerAddress(m.EvmFeePayer); err != nil { + return err + } + + return nil +} + +// GetSigners returns the expected signers for MsgRemoveFeePayer +func (m *MsgRemoveFeePayer) GetSigners() []sdk.AccAddress { + authority, err := sdk.AccAddressFromBech32(m.Authority) + if err != nil { + panic(err) + } + return []sdk.AccAddress{authority} +} + +// ValidateBasic does a sanity check on the provided data +func (m *MsgRemoveFeePayer) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + + return nil +} + +// ValidateFeePayerAddress validates the fee payer address +func ValidateFeePayerAddress(address string) ([]byte, error) { + if address == "" { + return nil, errorsmod.Wrap(ErrInvalidFeePayer, "fee payer address cannot be empty") + } + + // Validate as bech32 address + addr, err := sdk.AccAddressFromBech32(address) + if err != nil { + return nil, errorsmod.Wrapf(ErrInvalidFeePayer, "invalid bech32 address: %s", err.Error()) + } + + return addr.Bytes(), nil +} diff --git a/x/feesponsor/types/query.pb.go b/x/feesponsor/types/query.pb.go new file mode 100644 index 000000000..dd1448594 --- /dev/null +++ b/x/feesponsor/types/query.pb.go @@ -0,0 +1,536 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/evm/feesponsor/v1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryFeePayerRequest is the request type for the Query/FeePayer RPC method. +type QueryFeePayerRequest struct { +} + +func (m *QueryFeePayerRequest) Reset() { *m = QueryFeePayerRequest{} } +func (m *QueryFeePayerRequest) String() string { return proto.CompactTextString(m) } +func (*QueryFeePayerRequest) ProtoMessage() {} +func (*QueryFeePayerRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4aa06cceb70e11bb, []int{0} +} +func (m *QueryFeePayerRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFeePayerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFeePayerRequest.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 *QueryFeePayerRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFeePayerRequest.Merge(m, src) +} +func (m *QueryFeePayerRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryFeePayerRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFeePayerRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFeePayerRequest proto.InternalMessageInfo + +// QueryFeePayerResponse is the response type for the Query/FeePayer RPC method. +type QueryFeePayerResponse struct { + // fee_payer is the current EVM fee payer + FeePayer string `protobuf:"bytes,1,opt,name=fee_payer,json=feePayer,proto3" json:"fee_payer,omitempty"` +} + +func (m *QueryFeePayerResponse) Reset() { *m = QueryFeePayerResponse{} } +func (m *QueryFeePayerResponse) String() string { return proto.CompactTextString(m) } +func (*QueryFeePayerResponse) ProtoMessage() {} +func (*QueryFeePayerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4aa06cceb70e11bb, []int{1} +} +func (m *QueryFeePayerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFeePayerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFeePayerResponse.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 *QueryFeePayerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFeePayerResponse.Merge(m, src) +} +func (m *QueryFeePayerResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryFeePayerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFeePayerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFeePayerResponse proto.InternalMessageInfo + +func (m *QueryFeePayerResponse) GetFeePayer() string { + if m != nil { + return m.FeePayer + } + return "" +} + +func init() { + proto.RegisterType((*QueryFeePayerRequest)(nil), "cosmos.evm.feesponsor.v1.QueryFeePayerRequest") + proto.RegisterType((*QueryFeePayerResponse)(nil), "cosmos.evm.feesponsor.v1.QueryFeePayerResponse") +} + +func init() { + proto.RegisterFile("cosmos/evm/feesponsor/v1/query.proto", fileDescriptor_4aa06cceb70e11bb) +} + +var fileDescriptor_4aa06cceb70e11bb = []byte{ + // 290 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0xd5, 0x4f, 0x4b, 0x4d, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, 0xce, + 0x2f, 0xd2, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0x92, 0x80, 0xa8, 0xd2, 0x4b, 0x2d, 0xcb, 0xd5, 0x43, 0xa8, 0xd2, 0x2b, 0x33, 0x94, 0x92, + 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, + 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x86, 0xe8, 0x93, 0x92, 0x84, 0xe8, 0x8b, 0x07, 0xf3, 0xf4, + 0xa1, 0x86, 0x80, 0x39, 0x4a, 0x62, 0x5c, 0x22, 0x81, 0x20, 0x1b, 0xdc, 0x52, 0x53, 0x03, 0x12, + 0x2b, 0x53, 0x8b, 0x82, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x94, 0xfc, 0xb8, 0x44, 0xd1, 0xc4, + 0xc1, 0xb6, 0xa5, 0x0a, 0x99, 0x72, 0x71, 0xa6, 0xa5, 0xa6, 0xc6, 0x17, 0x80, 0x04, 0x25, 0x18, + 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, 0x6d, 0xd1, 0x15, 0x81, 0x9a, 0xea, 0x98, 0x92, 0x52, + 0x94, 0x5a, 0x5c, 0x1c, 0x5c, 0x52, 0x94, 0x99, 0x97, 0x1e, 0xc4, 0x91, 0x06, 0xd5, 0x6e, 0xb4, + 0x88, 0x91, 0x8b, 0x15, 0x6c, 0xa0, 0xd0, 0x0c, 0x46, 0x2e, 0x0e, 0x98, 0xa9, 0x42, 0x7a, 0x7a, + 0xb8, 0xbc, 0xa4, 0x87, 0xcd, 0x59, 0x52, 0xfa, 0x44, 0xab, 0x87, 0x38, 0x57, 0x49, 0xbb, 0xe9, + 0xf2, 0x93, 0xc9, 0x4c, 0xaa, 0x42, 0xca, 0xfa, 0x38, 0x43, 0x18, 0xee, 0x1d, 0x27, 0xa7, 0x13, + 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, + 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, + 0xd2, 0x4b, 0xce, 0xcf, 0x45, 0x36, 0xa8, 0x02, 0xd9, 0xa8, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, + 0x36, 0x70, 0xb8, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x49, 0x4c, 0x32, 0xea, 0xd2, 0x01, + 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // FeePayer queries the current EVM fee payer + FeePayer(ctx context.Context, in *QueryFeePayerRequest, opts ...grpc.CallOption) (*QueryFeePayerResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) FeePayer(ctx context.Context, in *QueryFeePayerRequest, opts ...grpc.CallOption) (*QueryFeePayerResponse, error) { + out := new(QueryFeePayerResponse) + err := c.cc.Invoke(ctx, "/cosmos.evm.feesponsor.v1.Query/FeePayer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // FeePayer queries the current EVM fee payer + FeePayer(context.Context, *QueryFeePayerRequest) (*QueryFeePayerResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) FeePayer(ctx context.Context, req *QueryFeePayerRequest) (*QueryFeePayerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FeePayer not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_FeePayer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryFeePayerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).FeePayer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.evm.feesponsor.v1.Query/FeePayer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).FeePayer(ctx, req.(*QueryFeePayerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.evm.feesponsor.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "FeePayer", + Handler: _Query_FeePayer_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/evm/feesponsor/v1/query.proto", +} + +func (m *QueryFeePayerRequest) 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 *QueryFeePayerRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFeePayerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryFeePayerResponse) 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 *QueryFeePayerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFeePayerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FeePayer) > 0 { + i -= len(m.FeePayer) + copy(dAtA[i:], m.FeePayer) + i = encodeVarintQuery(dAtA, i, uint64(len(m.FeePayer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryFeePayerRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryFeePayerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FeePayer) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryFeePayerRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFeePayerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFeePayerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryFeePayerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFeePayerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFeePayerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/feesponsor/types/query.pb.gw.go b/x/feesponsor/types/query.pb.gw.go new file mode 100644 index 000000000..b3f6e4c04 --- /dev/null +++ b/x/feesponsor/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/evm/feesponsor/v1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_FeePayer_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFeePayerRequest + var metadata runtime.ServerMetadata + + msg, err := client.FeePayer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_FeePayer_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFeePayerRequest + var metadata runtime.ServerMetadata + + msg, err := server.FeePayer(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_FeePayer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_FeePayer_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_FeePayer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_FeePayer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_FeePayer_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_FeePayer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_FeePayer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "evm", "feesponsor", "v1", "fee_payer"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_FeePayer_0 = runtime.ForwardResponseMessage +) diff --git a/x/feesponsor/types/tx.pb.go b/x/feesponsor/types/tx.pb.go new file mode 100644 index 000000000..6957768ab --- /dev/null +++ b/x/feesponsor/types/tx.pb.go @@ -0,0 +1,926 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/evm/feesponsor/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgSetFeePayer defines a message for setting the EVM fee payer. +type MsgSetFeePayer struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // evm_fee_payer is the address that will pay for EVM transaction fees + EvmFeePayer string `protobuf:"bytes,2,opt,name=evm_fee_payer,json=evmFeePayer,proto3" json:"evm_fee_payer,omitempty"` +} + +func (m *MsgSetFeePayer) Reset() { *m = MsgSetFeePayer{} } +func (m *MsgSetFeePayer) String() string { return proto.CompactTextString(m) } +func (*MsgSetFeePayer) ProtoMessage() {} +func (*MsgSetFeePayer) Descriptor() ([]byte, []int) { + return fileDescriptor_e3d57ca0440ca912, []int{0} +} +func (m *MsgSetFeePayer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetFeePayer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetFeePayer.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 *MsgSetFeePayer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetFeePayer.Merge(m, src) +} +func (m *MsgSetFeePayer) XXX_Size() int { + return m.Size() +} +func (m *MsgSetFeePayer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetFeePayer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetFeePayer proto.InternalMessageInfo + +func (m *MsgSetFeePayer) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgSetFeePayer) GetEvmFeePayer() string { + if m != nil { + return m.EvmFeePayer + } + return "" +} + +// MsgSetFeePayerResponse defines the response for MsgSetFeePayer. +type MsgSetFeePayerResponse struct { +} + +func (m *MsgSetFeePayerResponse) Reset() { *m = MsgSetFeePayerResponse{} } +func (m *MsgSetFeePayerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetFeePayerResponse) ProtoMessage() {} +func (*MsgSetFeePayerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e3d57ca0440ca912, []int{1} +} +func (m *MsgSetFeePayerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetFeePayerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetFeePayerResponse.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 *MsgSetFeePayerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetFeePayerResponse.Merge(m, src) +} +func (m *MsgSetFeePayerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetFeePayerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetFeePayerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetFeePayerResponse proto.InternalMessageInfo + +// MsgRemoveFeePayer defines a message for removing the EVM fee payer. +type MsgRemoveFeePayer struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *MsgRemoveFeePayer) Reset() { *m = MsgRemoveFeePayer{} } +func (m *MsgRemoveFeePayer) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveFeePayer) ProtoMessage() {} +func (*MsgRemoveFeePayer) Descriptor() ([]byte, []int) { + return fileDescriptor_e3d57ca0440ca912, []int{2} +} +func (m *MsgRemoveFeePayer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveFeePayer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveFeePayer.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 *MsgRemoveFeePayer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveFeePayer.Merge(m, src) +} +func (m *MsgRemoveFeePayer) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveFeePayer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveFeePayer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveFeePayer proto.InternalMessageInfo + +func (m *MsgRemoveFeePayer) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +// MsgRemoveFeePayerResponse defines the response for MsgRemoveFeePayer. +type MsgRemoveFeePayerResponse struct { +} + +func (m *MsgRemoveFeePayerResponse) Reset() { *m = MsgRemoveFeePayerResponse{} } +func (m *MsgRemoveFeePayerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveFeePayerResponse) ProtoMessage() {} +func (*MsgRemoveFeePayerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e3d57ca0440ca912, []int{3} +} +func (m *MsgRemoveFeePayerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveFeePayerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveFeePayerResponse.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 *MsgRemoveFeePayerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveFeePayerResponse.Merge(m, src) +} +func (m *MsgRemoveFeePayerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveFeePayerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveFeePayerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveFeePayerResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgSetFeePayer)(nil), "cosmos.evm.feesponsor.v1.MsgSetFeePayer") + proto.RegisterType((*MsgSetFeePayerResponse)(nil), "cosmos.evm.feesponsor.v1.MsgSetFeePayerResponse") + proto.RegisterType((*MsgRemoveFeePayer)(nil), "cosmos.evm.feesponsor.v1.MsgRemoveFeePayer") + proto.RegisterType((*MsgRemoveFeePayerResponse)(nil), "cosmos.evm.feesponsor.v1.MsgRemoveFeePayerResponse") +} + +func init() { proto.RegisterFile("cosmos/evm/feesponsor/v1/tx.proto", fileDescriptor_e3d57ca0440ca912) } + +var fileDescriptor_e3d57ca0440ca912 = []byte{ + // 372 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0xd5, 0x4f, 0x4b, 0x4d, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, 0xce, + 0x2f, 0xd2, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x80, + 0x28, 0xd1, 0x4b, 0x2d, 0xcb, 0xd5, 0x43, 0x28, 0xd1, 0x2b, 0x33, 0x94, 0x12, 0x4c, 0xcc, 0xcd, + 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0xc5, 0x52, 0xe2, 0x50, 0xf3, 0x72, 0x8b, 0xd3, 0x41, 0x86, + 0xe4, 0x16, 0xa7, 0x43, 0x25, 0x24, 0x21, 0x12, 0xf1, 0x60, 0x9e, 0x3e, 0xd4, 0x48, 0x30, 0x47, + 0x69, 0x0b, 0x23, 0x17, 0x9f, 0x6f, 0x71, 0x7a, 0x70, 0x6a, 0x89, 0x5b, 0x6a, 0x6a, 0x40, 0x62, + 0x65, 0x6a, 0x91, 0x90, 0x19, 0x17, 0x67, 0x62, 0x69, 0x49, 0x46, 0x7e, 0x51, 0x66, 0x49, 0xa5, + 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xa7, 0x93, 0xc4, 0xa5, 0x2d, 0xba, 0x22, 0x50, 0x7d, 0x8e, 0x29, + 0x29, 0x45, 0xa9, 0xc5, 0xc5, 0xc1, 0x25, 0x45, 0x99, 0x79, 0xe9, 0x41, 0x08, 0xa5, 0x42, 0x36, + 0x5c, 0xbc, 0xa9, 0x65, 0xb9, 0xf1, 0x69, 0xa9, 0xa9, 0xf1, 0x05, 0x20, 0x83, 0x24, 0x98, 0x08, + 0xe8, 0xe5, 0x4e, 0x2d, 0xcb, 0x85, 0xd9, 0x6a, 0xa5, 0xd3, 0xf4, 0x7c, 0x83, 0x16, 0xc2, 0xb4, + 0xae, 0xe7, 0x1b, 0xb4, 0x24, 0x91, 0xc2, 0x07, 0xd5, 0x8d, 0x4a, 0x12, 0x5c, 0x62, 0xa8, 0x22, + 0x41, 0x90, 0xb0, 0x49, 0x55, 0xaa, 0xe1, 0x12, 0xf4, 0x2d, 0x4e, 0x0f, 0x4a, 0xcd, 0xcd, 0x2f, + 0x4b, 0xa5, 0xd4, 0x4b, 0x56, 0xfa, 0x98, 0x8e, 0x92, 0x41, 0x75, 0x14, 0xaa, 0x45, 0x4a, 0xd2, + 0x5c, 0x92, 0x18, 0x82, 0x30, 0xa7, 0x19, 0xbd, 0x66, 0xe4, 0x62, 0xf6, 0x2d, 0x4e, 0x17, 0xca, + 0xe4, 0xe2, 0x46, 0x0e, 0x6f, 0x0d, 0x3d, 0x5c, 0x91, 0xac, 0x87, 0xea, 0x47, 0x29, 0x03, 0x62, + 0x55, 0xc2, 0xac, 0x14, 0x2a, 0xe2, 0xe2, 0x43, 0x0b, 0x0a, 0x6d, 0xbc, 0x66, 0xa0, 0x2a, 0x96, + 0x32, 0x26, 0x41, 0x31, 0xcc, 0x4e, 0x29, 0xd6, 0x86, 0xe7, 0x1b, 0xb4, 0x18, 0x9d, 0x9c, 0x4e, + 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, + 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x23, 0x3d, 0xb3, 0x24, 0xa3, 0x34, + 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x29, 0x34, 0x2b, 0x90, 0x33, 0x41, 0x49, 0x65, 0x41, 0x6a, + 0x71, 0x12, 0x1b, 0x38, 0x91, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x17, 0xb3, 0x3f, 0xb9, + 0x2a, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // SetFeePayer defines a governance operation for setting the EVM fee payer. + // The authority is hard-coded to the Cosmos SDK x/gov module account. + SetFeePayer(ctx context.Context, in *MsgSetFeePayer, opts ...grpc.CallOption) (*MsgSetFeePayerResponse, error) + // RemoveFeePayer defines a governance operation for removing the EVM fee payer. + // The authority is hard-coded to the Cosmos SDK x/gov module account. + RemoveFeePayer(ctx context.Context, in *MsgRemoveFeePayer, opts ...grpc.CallOption) (*MsgRemoveFeePayerResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SetFeePayer(ctx context.Context, in *MsgSetFeePayer, opts ...grpc.CallOption) (*MsgSetFeePayerResponse, error) { + out := new(MsgSetFeePayerResponse) + err := c.cc.Invoke(ctx, "/cosmos.evm.feesponsor.v1.Msg/SetFeePayer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RemoveFeePayer(ctx context.Context, in *MsgRemoveFeePayer, opts ...grpc.CallOption) (*MsgRemoveFeePayerResponse, error) { + out := new(MsgRemoveFeePayerResponse) + err := c.cc.Invoke(ctx, "/cosmos.evm.feesponsor.v1.Msg/RemoveFeePayer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // SetFeePayer defines a governance operation for setting the EVM fee payer. + // The authority is hard-coded to the Cosmos SDK x/gov module account. + SetFeePayer(context.Context, *MsgSetFeePayer) (*MsgSetFeePayerResponse, error) + // RemoveFeePayer defines a governance operation for removing the EVM fee payer. + // The authority is hard-coded to the Cosmos SDK x/gov module account. + RemoveFeePayer(context.Context, *MsgRemoveFeePayer) (*MsgRemoveFeePayerResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SetFeePayer(ctx context.Context, req *MsgSetFeePayer) (*MsgSetFeePayerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetFeePayer not implemented") +} +func (*UnimplementedMsgServer) RemoveFeePayer(ctx context.Context, req *MsgRemoveFeePayer) (*MsgRemoveFeePayerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveFeePayer not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SetFeePayer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetFeePayer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetFeePayer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.evm.feesponsor.v1.Msg/SetFeePayer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetFeePayer(ctx, req.(*MsgSetFeePayer)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RemoveFeePayer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveFeePayer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RemoveFeePayer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.evm.feesponsor.v1.Msg/RemoveFeePayer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RemoveFeePayer(ctx, req.(*MsgRemoveFeePayer)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.evm.feesponsor.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetFeePayer", + Handler: _Msg_SetFeePayer_Handler, + }, + { + MethodName: "RemoveFeePayer", + Handler: _Msg_RemoveFeePayer_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/evm/feesponsor/v1/tx.proto", +} + +func (m *MsgSetFeePayer) 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 *MsgSetFeePayer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetFeePayer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.EvmFeePayer) > 0 { + i -= len(m.EvmFeePayer) + copy(dAtA[i:], m.EvmFeePayer) + i = encodeVarintTx(dAtA, i, uint64(len(m.EvmFeePayer))) + 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 *MsgSetFeePayerResponse) 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 *MsgSetFeePayerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetFeePayerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRemoveFeePayer) 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 *MsgRemoveFeePayer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveFeePayer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 *MsgRemoveFeePayerResponse) 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 *MsgRemoveFeePayerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveFeePayerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgSetFeePayer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.EvmFeePayer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetFeePayerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRemoveFeePayer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRemoveFeePayerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgSetFeePayer) 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: MsgSetFeePayer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetFeePayer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvmFeePayer", 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.EvmFeePayer = string(dAtA[iNdEx:postIndex]) + 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 *MsgSetFeePayerResponse) 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: MsgSetFeePayerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetFeePayerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRemoveFeePayer) 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: MsgRemoveFeePayer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveFeePayer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 *MsgRemoveFeePayerResponse) 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: MsgRemoveFeePayerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveFeePayerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/vm/keeper/fees.go b/x/vm/keeper/fees.go index a5569fa18..d2fd2a4d5 100644 --- a/x/vm/keeper/fees.go +++ b/x/vm/keeper/fees.go @@ -19,9 +19,8 @@ import ( // sender has enough funds to pay for the fees and value of the transaction. func CheckSenderBalance( balance sdkmath.Int, - ethTx *ethtypes.Transaction, + cost *big.Int, ) error { - cost := ethTx.Cost() if cost.Sign() < 0 { return errorsmod.Wrapf(