diff --git a/proto/sequencers/tx.proto b/proto/sequencers/tx.proto index ec4205b0..39582421 100644 --- a/proto/sequencers/tx.proto +++ b/proto/sequencers/tx.proto @@ -14,6 +14,8 @@ service Msg { // Consensus Messages rpc UpsertSequencer(ConsensusMsgUpsertSequencer) returns (ConsensusMsgUpsertSequencerResponse); + rpc BumpAccountSequences(MsgBumpAccountSequences) returns (MsgBumpAccountSequencesResponse); + rpc UpgradeDRS(MsgUpgradeDRS) returns (MsgUpgradeDRSResponse); } message MsgUpdateRewardAddress { @@ -55,3 +57,23 @@ message ConsensusMsgUpsertSequencer { } message ConsensusMsgUpsertSequencerResponse {} + +message MsgBumpAccountSequences { + option (cosmos.msg.v1.signer) = "authority"; + // authority defines the address of the authority that is allowed to bump the account sequences. + // this is gov but it can be triggered by a consensus message. + string authority = 1; +} + +message MsgBumpAccountSequencesResponse {} + +message MsgUpgradeDRS { + option (cosmos.msg.v1.signer) = "authority"; + // authority defines the address of the authority that is allowed to bump the account sequences. + // this is gov but it can be triggered by a consensus message. + string authority = 1; + + uint64 drs_version = 2; +} + +message MsgUpgradeDRSResponse {} \ No newline at end of file diff --git a/testutil/app/app.go b/testutil/app/app.go index 8d878061..769319e9 100644 --- a/testutil/app/app.go +++ b/testutil/app/app.go @@ -418,6 +418,10 @@ func NewRollapp( keys[seqtypes.StoreKey], app.GetSubspace(seqtypes.ModuleName), authtypes.NewModuleAddress(seqtypes.ModuleName).String(), + app.AccountKeeper, + app.RollappParamsKeeper, + app.UpgradeKeeper, + nil, ) app.IBCKeeper = ibckeeper.NewKeeper( diff --git a/x/sequencers/keeper/keeper.go b/x/sequencers/keeper/keeper.go index 72959bac..536fb6a3 100644 --- a/x/sequencers/keeper/keeper.go +++ b/x/sequencers/keeper/keeper.go @@ -4,10 +4,13 @@ import ( "fmt" "time" + upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" + "cosmossdk.io/collections" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/tendermint/tendermint/libs/log" @@ -25,12 +28,22 @@ type StakingKeeper interface { var _ StakingKeeper = (*Keeper)(nil) +// AccountBumpFilterFunc is a function signature that filters accounts whose sequence should be bumped. +// IT is passed the account proto name to avoid re-computing it, it is also passed the account in case +// casting is needed. +type AccountBumpFilterFunc = func(accountProtoName string, account authtypes.AccountI) (bool, error) + type Keeper struct { cdc codec.BinaryCodec storeKey storetypes.StoreKey paramstore paramtypes.Subspace authority string // address of the authorized actor that can execute consensus msgs + accountKeeper types.AccountKeeper + rollapParamsKeeper types.RollappParamsKeeper + accountBumpFilters []AccountBumpFilterFunc + upgradeKeeper upgradekeeper.Keeper + whitelistedRelayers collections.Map[sdk.ValAddress, types.WhitelistedRelayers] } @@ -39,6 +52,10 @@ func NewKeeper( storeKey storetypes.StoreKey, ps paramtypes.Subspace, authority string, + accountKeeper types.AccountKeeper, + rollapParamsKeeper types.RollappParamsKeeper, + upgradeKeeper upgradekeeper.Keeper, + accountBumpFilters []AccountBumpFilterFunc, ) *Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -48,10 +65,14 @@ func NewKeeper( sb := collections.NewSchemaBuilder(collcompat.NewKVStoreService(storeKey)) return &Keeper{ - cdc: cdc, - storeKey: storeKey, - paramstore: ps, - authority: authority, + cdc: cdc, + storeKey: storeKey, + paramstore: ps, + authority: authority, + accountKeeper: accountKeeper, + rollapParamsKeeper: rollapParamsKeeper, + accountBumpFilters: accountBumpFilters, + upgradeKeeper: upgradeKeeper, whitelistedRelayers: collections.NewMap( sb, types.WhitelistedRelayersPrefix(), diff --git a/x/sequencers/keeper/msg_server.go b/x/sequencers/keeper/msg_server.go index 6aa7b373..371d0a5d 100644 --- a/x/sequencers/keeper/msg_server.go +++ b/x/sequencers/keeper/msg_server.go @@ -2,12 +2,17 @@ package keeper import ( "context" + "errors" "fmt" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" "github.com/dymensionxyz/gerr-cosmos/gerrc" + "github.com/gogo/protobuf/proto" "github.com/dymensionxyz/dymension-rdk/utils/uevent" "github.com/dymensionxyz/dymension-rdk/x/sequencers/types" @@ -113,3 +118,97 @@ func (m msgServer) UpsertSequencer(goCtx context.Context, msg *types.ConsensusMs return &types.ConsensusMsgUpsertSequencerResponse{}, nil } + +// defines the list of accounts we want to bump the sequence +var handleAccounts = map[string]struct{}{ + proto.MessageName(&authtypes.BaseAccount{}): {}, + proto.MessageName(&vestingtypes.BaseVestingAccount{}): {}, + proto.MessageName(&vestingtypes.ContinuousVestingAccount{}): {}, + proto.MessageName(&vestingtypes.DelayedVestingAccount{}): {}, + proto.MessageName(&vestingtypes.PeriodicVestingAccount{}): {}, + proto.MessageName(&vestingtypes.PermanentLockedAccount{}): {}, +} + +const BumpSequence = 10_000_000_000 + +func (m msgServer) BumpAccountSequences(goCtx context.Context, msg *types.MsgBumpAccountSequences) (*types.MsgBumpAccountSequencesResponse, error) { + if msg.Authority != m.authority { + return nil, sdkerrors.ErrorInvalidSigner.Wrapf("only an authorized actor can bump account sequences") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + var allErrors error + m.accountKeeper.IterateAccounts(ctx, func(account authtypes.AccountI) bool { + // handle well known accounts + accType := proto.MessageName(account) + _, toHandle := handleAccounts[accType] + if toHandle { + err := m.bumpAccountSequence(ctx, account) + allErrors = errors.Join(allErrors, err) + } else { + // check if it can be handled by something custom + for _, f := range m.accountBumpFilters { + toBump, err := f(accType, account) + if err != nil { + allErrors = errors.Join(allErrors, fmt.Errorf("filter account: %w", err)) + return false + } + if toBump { + err := m.bumpAccountSequence(ctx, account) + allErrors = errors.Join(allErrors, err) + break + } + } + } + return false + }) + + // we could decide to stop or continue + return &types.MsgBumpAccountSequencesResponse{}, allErrors +} + +func (m msgServer) bumpAccountSequence(ctx sdk.Context, acc authtypes.AccountI) error { + err := acc.SetSequence(acc.GetSequence() + BumpSequence) + if err != nil { + return fmt.Errorf("set account sequence: %w", err) + } + m.accountKeeper.SetAccount(ctx, acc) + return nil +} + +func (m msgServer) UpgradeDRS(goCtx context.Context, drs *types.MsgUpgradeDRS) (*types.MsgUpgradeDRSResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + needUpgrade := m.updateDrsVersion(ctx, drs.DrsVersion) + + if needUpgrade { + err := m.upgradeKeeper.ScheduleUpgrade(ctx, upgradetypes.Plan{ + Name: fmt.Sprintf("upgrade-drs-%d", drs.DrsVersion), + Height: ctx.BlockHeight(), + Info: fmt.Sprintf("upgrade to DRS version %d", drs.DrsVersion), + }) + if err != nil { + return nil, fmt.Errorf("schedule upgrade: %w", err) + } + } + + return &types.MsgUpgradeDRSResponse{}, nil +} + +// updateDrsVersion updates the DRS (Dynamic Rollup System) protocol version if it differs from the current version. +// The function compares the new version against the existing one and updates the parameters if they differ. +// +// Returns: +// - bool: true if the version was updated, false if no update was needed (versions were identical) +func (m msgServer) updateDrsVersion(ctx sdk.Context, newVersion uint64) bool { + currentParams := m.rollapParamsKeeper.GetParams(ctx) + if currentParams.DrsVersion == uint32(newVersion) { + return false + } + + currentParams.DrsVersion = uint32(newVersion) + m.rollapParamsKeeper.SetParams(ctx, currentParams) + + return true +} diff --git a/x/sequencers/keeper/msg_server_test.go b/x/sequencers/keeper/msg_server_test.go index fb96033c..b3f50041 100644 --- a/x/sequencers/keeper/msg_server_test.go +++ b/x/sequencers/keeper/msg_server_test.go @@ -6,6 +6,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/dymensionxyz/dymension-rdk/x/sequencers/keeper" "github.com/stretchr/testify/require" testkeepers "github.com/dymensionxyz/dymension-rdk/testutil/keepers" @@ -19,10 +20,9 @@ func TestHappyPath(t *testing.T) { app = utils.Setup(t, false) _, ctx = testkeepers.NewTestSequencerKeeperFromApp(app) authority = authtypes.NewModuleAddress(types.ModuleName).String() + msgServer = keeper.NewMsgServerImpl(app.SequencersKeeper) ) - t.Log(authority) - // prepare test data var ( operator = utils.Proposer.GetOperator() @@ -135,4 +135,121 @@ func TestHappyPath(t *testing.T) { // validate results validateResults(rewardAddr2.String(), relayers2) }) + + t.Run("MsgBumpAccountSequences", func(t *testing.T) { + // all accounts are module accounts. this ensures if the assumption + // change in the future we will realize it. + accs := app.AccountKeeper.GetAllAccounts(ctx) + for _, acc := range accs { + require.IsType(t, acc, &authtypes.ModuleAccount{}) + } + + // add a new account + newAcc := utils.AccAddress() + acc := app.AccountKeeper.NewAccountWithAddress(ctx, newAcc) + app.AccountKeeper.SetAccount(ctx, acc) + + // now we invoke bump account sequences and we should see this new acc + // sequence bumped. + msg := &types.MsgBumpAccountSequences{ + Authority: authority, + } + resp, err := msgServer.BumpAccountSequences(sdk.WrapSDKContext(ctx), msg) + require.NoError(t, err) + require.NotNil(t, resp) + + // ensure accounts are correctly bumped + accs = app.AccountKeeper.GetAllAccounts(ctx) + for _, acc := range accs { + switch concreteAccount := acc.(type) { + case *authtypes.ModuleAccount: + // module accounts should not be bumped + require.Zero(t, concreteAccount.GetSequence()) + case *authtypes.BaseAccount: + // base accounts should be bumped + require.Equal(t, uint64(keeper.BumpSequence), concreteAccount.GetSequence()) + } + } + }) +} + +func TestUpgradeDRS(t *testing.T) { + // prepare test + var ( + app = utils.Setup(t, false) + _, ctx = testkeepers.NewTestSequencerKeeperFromApp(app) + ) + + tests := []struct { + name string + drsVersion uint64 + expectError bool + }{ + { + name: "Success: Update DRS version", + drsVersion: 2, + expectError: false, + }, + { + name: "Success: Update to higher version", + drsVersion: 10, + expectError: false, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + // Get initial params + initialParams := app.RollappParamsKeeper.GetParams(ctx) + + // Create message + msg := &types.MsgUpgradeDRS{ + Authority: authtypes.NewModuleAddress("gov").String(), + DrsVersion: tc.drsVersion, + } + + // Validate basic + err := msg.ValidateBasic() + require.NoError(t, err) + + // Execute message + handler := app.MsgServiceRouter().Handler(new(types.MsgUpgradeDRS)) + _, err = handler(ctx, msg) + + if tc.expectError { + require.Error(t, err) + // Verify params haven't changed + currentParams := app.RollappParamsKeeper.GetParams(ctx) + require.Equal(t, initialParams.DrsVersion, currentParams.DrsVersion) + } else { + require.NoError(t, err) + // Verify params have been updated + currentParams := app.RollappParamsKeeper.GetParams(ctx) + require.Equal(t, uint32(tc.drsVersion), currentParams.DrsVersion) + require.NotEqual(t, initialParams.DrsVersion, currentParams.DrsVersion) + } + }) + } + + t.Run("Multiple updates", func(t *testing.T) { + versions := []uint64{3, 5, 8} + + for _, version := range versions { + msg := &types.MsgUpgradeDRS{ + Authority: authtypes.NewModuleAddress("gov").String(), + DrsVersion: version, + } + + err := msg.ValidateBasic() + require.NoError(t, err) + + handler := app.MsgServiceRouter().Handler(new(types.MsgUpgradeDRS)) + _, err = handler(ctx, msg) + require.NoError(t, err) + + // Verify version was updated + currentParams := app.RollappParamsKeeper.GetParams(ctx) + require.Equal(t, uint32(version), currentParams.DrsVersion) + } + }) } diff --git a/x/sequencers/types/expected_keepers.go b/x/sequencers/types/expected_keepers.go new file mode 100644 index 00000000..12586094 --- /dev/null +++ b/x/sequencers/types/expected_keepers.go @@ -0,0 +1,17 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/dymensionxyz/dymension-rdk/x/rollappparams/types" +) + +type AccountKeeper interface { + IterateAccounts(ctx sdk.Context, do func(i authtypes.AccountI) bool) + SetAccount(ctx sdk.Context, acc authtypes.AccountI) +} + +type RollappParamsKeeper interface { + GetParams(ctx sdk.Context) (params types.Params) + SetParams(ctx sdk.Context, params types.Params) +} diff --git a/x/sequencers/types/msgs.go b/x/sequencers/types/msgs.go index cc9d5b36..b8c943ab 100644 --- a/x/sequencers/types/msgs.go +++ b/x/sequencers/types/msgs.go @@ -18,6 +18,8 @@ var ( _ sdk.Msg = (*MsgUpdateWhitelistedRelayers)(nil) _ sdk.Msg = (*ConsensusMsgUpsertSequencer)(nil) _ codectypes.UnpackInterfacesMessage = (*ConsensusMsgUpsertSequencer)(nil) + _ sdk.Msg = (*MsgBumpAccountSequences)(nil) + _ sdk.Msg = (*MsgUpgradeDRS)(nil) ) func (m *MsgUpdateRewardAddress) ValidateBasic() error { @@ -167,3 +169,27 @@ func (m *ConsensusMsgUpsertSequencer) MustRewardAddr() sdk.AccAddress { } return rewardAddr } + +func (m *MsgBumpAccountSequences) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{sdk.MustAccAddressFromBech32(m.Authority)} +} + +func (m *MsgBumpAccountSequences) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(m.Authority) + if err != nil { + return errorsmod.Wrap(errors.Join(gerrc.ErrInvalidArgument, err), "get authority addr from bech32") + } + return nil +} + +func (m *MsgUpgradeDRS) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(m.Authority) + if err != nil { + return errorsmod.Wrap(errors.Join(gerrc.ErrInvalidArgument, err), "get authority addr from bech32") + } + return nil +} + +func (m *MsgUpgradeDRS) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{sdk.MustAccAddressFromBech32(m.Authority)} +} diff --git a/x/sequencers/types/tx.pb.go b/x/sequencers/types/tx.pb.go index 7d742c3c..72169d9f 100644 --- a/x/sequencers/types/tx.pb.go +++ b/x/sequencers/types/tx.pb.go @@ -329,6 +329,178 @@ func (m *ConsensusMsgUpsertSequencerResponse) XXX_DiscardUnknown() { var xxx_messageInfo_ConsensusMsgUpsertSequencerResponse proto.InternalMessageInfo +type MsgBumpAccountSequences struct { + // authority defines the address of the authority that is allowed to bump the account sequences. + // this is gov but it can be triggered by a consensus message. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *MsgBumpAccountSequences) Reset() { *m = MsgBumpAccountSequences{} } +func (m *MsgBumpAccountSequences) String() string { return proto.CompactTextString(m) } +func (*MsgBumpAccountSequences) ProtoMessage() {} +func (*MsgBumpAccountSequences) Descriptor() ([]byte, []int) { + return fileDescriptor_aee37376ffafeb0a, []int{6} +} +func (m *MsgBumpAccountSequences) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBumpAccountSequences) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBumpAccountSequences.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 *MsgBumpAccountSequences) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBumpAccountSequences.Merge(m, src) +} +func (m *MsgBumpAccountSequences) XXX_Size() int { + return m.Size() +} +func (m *MsgBumpAccountSequences) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBumpAccountSequences.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBumpAccountSequences proto.InternalMessageInfo + +func (m *MsgBumpAccountSequences) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +type MsgBumpAccountSequencesResponse struct { +} + +func (m *MsgBumpAccountSequencesResponse) Reset() { *m = MsgBumpAccountSequencesResponse{} } +func (m *MsgBumpAccountSequencesResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBumpAccountSequencesResponse) ProtoMessage() {} +func (*MsgBumpAccountSequencesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_aee37376ffafeb0a, []int{7} +} +func (m *MsgBumpAccountSequencesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBumpAccountSequencesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBumpAccountSequencesResponse.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 *MsgBumpAccountSequencesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBumpAccountSequencesResponse.Merge(m, src) +} +func (m *MsgBumpAccountSequencesResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBumpAccountSequencesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBumpAccountSequencesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBumpAccountSequencesResponse proto.InternalMessageInfo + +type MsgUpgradeDRS struct { + // authority defines the address of the authority that is allowed to bump the account sequences. + // this is gov but it can be triggered by a consensus message. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + DrsVersion uint64 `protobuf:"varint,2,opt,name=drs_version,json=drsVersion,proto3" json:"drs_version,omitempty"` +} + +func (m *MsgUpgradeDRS) Reset() { *m = MsgUpgradeDRS{} } +func (m *MsgUpgradeDRS) String() string { return proto.CompactTextString(m) } +func (*MsgUpgradeDRS) ProtoMessage() {} +func (*MsgUpgradeDRS) Descriptor() ([]byte, []int) { + return fileDescriptor_aee37376ffafeb0a, []int{8} +} +func (m *MsgUpgradeDRS) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpgradeDRS) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpgradeDRS.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 *MsgUpgradeDRS) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpgradeDRS.Merge(m, src) +} +func (m *MsgUpgradeDRS) XXX_Size() int { + return m.Size() +} +func (m *MsgUpgradeDRS) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpgradeDRS.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpgradeDRS proto.InternalMessageInfo + +func (m *MsgUpgradeDRS) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpgradeDRS) GetDrsVersion() uint64 { + if m != nil { + return m.DrsVersion + } + return 0 +} + +type MsgUpgradeDRSResponse struct { +} + +func (m *MsgUpgradeDRSResponse) Reset() { *m = MsgUpgradeDRSResponse{} } +func (m *MsgUpgradeDRSResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpgradeDRSResponse) ProtoMessage() {} +func (*MsgUpgradeDRSResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_aee37376ffafeb0a, []int{9} +} +func (m *MsgUpgradeDRSResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpgradeDRSResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpgradeDRSResponse.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 *MsgUpgradeDRSResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpgradeDRSResponse.Merge(m, src) +} +func (m *MsgUpgradeDRSResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpgradeDRSResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpgradeDRSResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpgradeDRSResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpdateRewardAddress)(nil), "rollapp.sequencers.types.MsgUpdateRewardAddress") proto.RegisterType((*MsgUpdateRewardAddressResponse)(nil), "rollapp.sequencers.types.MsgUpdateRewardAddressResponse") @@ -336,43 +508,54 @@ func init() { proto.RegisterType((*MsgUpdateWhitelistedRelayersResponse)(nil), "rollapp.sequencers.types.MsgUpdateWhitelistedRelayersResponse") proto.RegisterType((*ConsensusMsgUpsertSequencer)(nil), "rollapp.sequencers.types.ConsensusMsgUpsertSequencer") proto.RegisterType((*ConsensusMsgUpsertSequencerResponse)(nil), "rollapp.sequencers.types.ConsensusMsgUpsertSequencerResponse") + proto.RegisterType((*MsgBumpAccountSequences)(nil), "rollapp.sequencers.types.MsgBumpAccountSequences") + proto.RegisterType((*MsgBumpAccountSequencesResponse)(nil), "rollapp.sequencers.types.MsgBumpAccountSequencesResponse") + proto.RegisterType((*MsgUpgradeDRS)(nil), "rollapp.sequencers.types.MsgUpgradeDRS") + proto.RegisterType((*MsgUpgradeDRSResponse)(nil), "rollapp.sequencers.types.MsgUpgradeDRSResponse") } func init() { proto.RegisterFile("sequencers/tx.proto", fileDescriptor_aee37376ffafeb0a) } var fileDescriptor_aee37376ffafeb0a = []byte{ - // 481 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xcf, 0x8b, 0xd3, 0x50, - 0x10, 0xc7, 0xfb, 0x5a, 0x5d, 0xd6, 0xa9, 0x22, 0x64, 0x65, 0xed, 0x46, 0x89, 0xa5, 0xfe, 0x60, - 0x11, 0x7c, 0xd1, 0x15, 0x97, 0x45, 0x50, 0x58, 0x3d, 0xca, 0x82, 0x44, 0x44, 0xf0, 0x52, 0x92, - 0xbe, 0x31, 0x1b, 0x36, 0x7d, 0x2f, 0xbe, 0x79, 0xd1, 0xc6, 0x9b, 0x5e, 0xbc, 0x0a, 0xfe, 0x15, - 0xde, 0xfc, 0x33, 0x3c, 0x2e, 0x78, 0xf1, 0x28, 0xed, 0xc1, 0x7f, 0x43, 0x92, 0x36, 0x59, 0x37, - 0xb4, 0xc5, 0xdd, 0x53, 0x3b, 0xcc, 0x7c, 0xdf, 0x7c, 0x66, 0xe6, 0x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, 0x2d, 0x0e, 0xdc, 0x91, 0xfb, 0xef, 0x47, 0x26, 0xef, 0x1b, 0xac, - 0x14, 0x56, 0xbc, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x23, 0xf0, 0x76, 0x7f, 0x04, 0x00, - 0x00, + // 602 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xdf, 0x6b, 0xd3, 0x50, + 0x14, 0x5e, 0xf6, 0x8b, 0xed, 0xcc, 0x29, 0x64, 0x73, 0xeb, 0xe2, 0xc8, 0x6a, 0xfd, 0x35, 0x04, + 0x13, 0x37, 0x71, 0xcc, 0x81, 0xc2, 0xa6, 0xe0, 0x83, 0x14, 0x24, 0x43, 0x05, 0x1f, 0x2c, 0x69, + 0xee, 0x59, 0x1a, 0xd6, 0xe6, 0xc6, 0x7b, 0x92, 0xd9, 0xf8, 0xa6, 0x08, 0xbe, 0x0a, 0xbe, 0xf8, + 0x67, 0xf8, 0x67, 0xf8, 0x38, 0xf0, 0xc5, 0x47, 0x69, 0x1f, 0xfc, 0x37, 0x24, 0x69, 0x93, 0xae, + 0x31, 0x8d, 0xdb, 0x9e, 0xda, 0x93, 0xfb, 0x7d, 0xe7, 0xfb, 0xce, 0xb9, 0x5f, 0x1b, 0x58, 0x20, + 0x7c, 0x1b, 0xa0, 0x6b, 0xa1, 0x20, 0xdd, 0x6f, 0x6b, 0x9e, 0xe0, 0x3e, 0x97, 0x4b, 0x82, 0x37, + 0x9b, 0xa6, 0xe7, 0x69, 0x83, 0x43, 0xcd, 0x0f, 0x3d, 0x24, 0x65, 0xd9, 0xe2, 0xd4, 0xe2, 0xa4, + 0xb7, 0xc8, 0xd6, 0x8f, 0x36, 0xa2, 0x8f, 0x1e, 0x45, 0x59, 0xb1, 0x39, 0xb7, 0x9b, 0xa8, 0xc7, + 0x55, 0x3d, 0x38, 0xd0, 0x4d, 0x37, 0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0x70, 0x22, 0xa8, 0xb7, 0xfe, 0xb3, 0xde, 0x04, 0xa8, 0xe8, 0xa7, 0x04, 0x26, 0x3a, + 0x7b, 0xc6, 0x8f, 0x8e, 0x2a, 0x1d, 0x77, 0x54, 0xe9, 0x77, 0x47, 0x95, 0xbe, 0x74, 0xd5, 0xb1, + 0xe3, 0xae, 0x3a, 0xf6, 0xab, 0xab, 0x8e, 0xbd, 0xde, 0xb6, 0x1d, 0xbf, 0x11, 0xd4, 0x35, 0x8b, + 0xb7, 0x74, 0x16, 0xb6, 0xd0, 0x8d, 0x32, 0xdf, 0x0e, 0xdf, 0x0f, 0x8a, 0x3b, 0x82, 0x1d, 0xea, + 0x6d, 0xfd, 0xe4, 0x8b, 0x23, 0x52, 0xaa, 0x4f, 0xc7, 0x7f, 0x2f, 0xf7, 0xfe, 0x06, 0x00, 0x00, + 0xff, 0xff, 0x4a, 0x17, 0x94, 0xf5, 0x53, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -392,6 +575,8 @@ type MsgClient interface { UpdateWhitelistedRelayers(ctx context.Context, in *MsgUpdateWhitelistedRelayers, opts ...grpc.CallOption) (*MsgUpdateWhitelistedRelayersResponse, error) // Consensus Messages UpsertSequencer(ctx context.Context, in *ConsensusMsgUpsertSequencer, opts ...grpc.CallOption) (*ConsensusMsgUpsertSequencerResponse, error) + BumpAccountSequences(ctx context.Context, in *MsgBumpAccountSequences, opts ...grpc.CallOption) (*MsgBumpAccountSequencesResponse, error) + UpgradeDRS(ctx context.Context, in *MsgUpgradeDRS, opts ...grpc.CallOption) (*MsgUpgradeDRSResponse, error) } type msgClient struct { @@ -429,6 +614,24 @@ func (c *msgClient) UpsertSequencer(ctx context.Context, in *ConsensusMsgUpsertS return out, nil } +func (c *msgClient) BumpAccountSequences(ctx context.Context, in *MsgBumpAccountSequences, opts ...grpc.CallOption) (*MsgBumpAccountSequencesResponse, error) { + out := new(MsgBumpAccountSequencesResponse) + err := c.cc.Invoke(ctx, "/rollapp.sequencers.types.Msg/BumpAccountSequences", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpgradeDRS(ctx context.Context, in *MsgUpgradeDRS, opts ...grpc.CallOption) (*MsgUpgradeDRSResponse, error) { + out := new(MsgUpgradeDRSResponse) + err := c.cc.Invoke(ctx, "/rollapp.sequencers.types.Msg/UpgradeDRS", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // Messages @@ -436,6 +639,8 @@ type MsgServer interface { UpdateWhitelistedRelayers(context.Context, *MsgUpdateWhitelistedRelayers) (*MsgUpdateWhitelistedRelayersResponse, error) // Consensus Messages UpsertSequencer(context.Context, *ConsensusMsgUpsertSequencer) (*ConsensusMsgUpsertSequencerResponse, error) + BumpAccountSequences(context.Context, *MsgBumpAccountSequences) (*MsgBumpAccountSequencesResponse, error) + UpgradeDRS(context.Context, *MsgUpgradeDRS) (*MsgUpgradeDRSResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -451,6 +656,12 @@ func (*UnimplementedMsgServer) UpdateWhitelistedRelayers(ctx context.Context, re func (*UnimplementedMsgServer) UpsertSequencer(ctx context.Context, req *ConsensusMsgUpsertSequencer) (*ConsensusMsgUpsertSequencerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpsertSequencer not implemented") } +func (*UnimplementedMsgServer) BumpAccountSequences(ctx context.Context, req *MsgBumpAccountSequences) (*MsgBumpAccountSequencesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BumpAccountSequences not implemented") +} +func (*UnimplementedMsgServer) UpgradeDRS(ctx context.Context, req *MsgUpgradeDRS) (*MsgUpgradeDRSResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpgradeDRS not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -510,6 +721,42 @@ func _Msg_UpsertSequencer_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Msg_BumpAccountSequences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBumpAccountSequences) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).BumpAccountSequences(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rollapp.sequencers.types.Msg/BumpAccountSequences", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).BumpAccountSequences(ctx, req.(*MsgBumpAccountSequences)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpgradeDRS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpgradeDRS) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpgradeDRS(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rollapp.sequencers.types.Msg/UpgradeDRS", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpgradeDRS(ctx, req.(*MsgUpgradeDRS)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "rollapp.sequencers.types.Msg", HandlerType: (*MsgServer)(nil), @@ -526,6 +773,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpsertSequencer", Handler: _Msg_UpsertSequencer_Handler, }, + { + MethodName: "BumpAccountSequences", + Handler: _Msg_BumpAccountSequences_Handler, + }, + { + MethodName: "UpgradeDRS", + Handler: _Msg_UpgradeDRS_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "sequencers/tx.proto", @@ -741,6 +996,117 @@ func (m *ConsensusMsgUpsertSequencerResponse) MarshalToSizedBuffer(dAtA []byte) return len(dAtA) - i, nil } +func (m *MsgBumpAccountSequences) 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 *MsgBumpAccountSequences) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBumpAccountSequences) 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 *MsgBumpAccountSequencesResponse) 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 *MsgBumpAccountSequencesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBumpAccountSequencesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpgradeDRS) 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 *MsgUpgradeDRS) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpgradeDRS) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DrsVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.DrsVersion)) + i-- + dAtA[i] = 0x10 + } + 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 *MsgUpgradeDRSResponse) 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 *MsgUpgradeDRSResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpgradeDRSResponse) 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 @@ -846,18 +1212,65 @@ func (m *ConsensusMsgUpsertSequencerResponse) Size() (n int) { return n } -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *MsgBumpAccountSequences) 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 sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *MsgBumpAccountSequencesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n } -func (m *MsgUpdateRewardAddress) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 + +func (m *MsgUpgradeDRS) 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)) + } + if m.DrsVersion != 0 { + n += 1 + sovTx(uint64(m.DrsVersion)) + } + return n +} + +func (m *MsgUpgradeDRSResponse) 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 *MsgUpdateRewardAddress) 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 @@ -1444,6 +1857,289 @@ func (m *ConsensusMsgUpsertSequencerResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgBumpAccountSequences) 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: MsgBumpAccountSequences: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBumpAccountSequences: 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 *MsgBumpAccountSequencesResponse) 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: MsgBumpAccountSequencesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBumpAccountSequencesResponse: 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 *MsgUpgradeDRS) 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: MsgUpgradeDRS: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpgradeDRS: 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DrsVersion", wireType) + } + m.DrsVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DrsVersion |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *MsgUpgradeDRSResponse) 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: MsgUpgradeDRSResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpgradeDRSResponse: 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 diff --git a/x/timeupgrade/keeper/msg_server_test.go b/x/timeupgrade/keeper/msg_server_test.go index 02fb4e30..345c442c 100644 --- a/x/timeupgrade/keeper/msg_server_test.go +++ b/x/timeupgrade/keeper/msg_server_test.go @@ -1,16 +1,18 @@ package keeper_test import ( + "testing" + "time" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" types2 "github.com/cosmos/cosmos-sdk/x/upgrade/types" + types3 "github.com/gogo/protobuf/types" + "github.com/stretchr/testify/require" + testkeepers "github.com/dymensionxyz/dymension-rdk/testutil/keepers" "github.com/dymensionxyz/dymension-rdk/testutil/utils" "github.com/dymensionxyz/dymension-rdk/x/timeupgrade/keeper" "github.com/dymensionxyz/dymension-rdk/x/timeupgrade/types" - types3 "github.com/gogo/protobuf/types" - "github.com/stretchr/testify/require" - "testing" - "time" ) func TestMsgServer_SoftwareUpgrade_Errors(t *testing.T) {