Co-authored-by: testinginprod <98415576+testinginprod@users.noreply.github.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
co-authored by
testinginprod
Julien Robert
parent
0255823d3c
commit
72f1c12ee6
+1
-1
@@ -61,7 +61,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
* [#19093](https://github.com/cosmos/cosmos-sdk/pull/19093) SetPubKeyDecorator was merged into SigVerification, gas consumption is almost halved for a simple tx.
|
||||
* [#19535](https://github.com/cosmos/cosmos-sdk/pull/19535) Remove vesting account creation when the chain is running. The accounts module is required for creating [#vesting accounts](../accounts/defaults/lockup/README.md) on a running chain.
|
||||
* [#21688](https://github.com/cosmos/cosmos-sdk/pull/21688) Allow x/accounts to be queriable from the `AccountInfo` and `Account` gRPC endpoints
|
||||
|
||||
* [#21820](https://github.com/cosmos/cosmos-sdk/pull/21820) Allow x/auth `BaseAccount` to migrate to a `x/accounts` via the new `MsgMigrateAccount`.
|
||||
### Bug Fixes
|
||||
|
||||
* [#19148](https://github.com/cosmos/cosmos-sdk/pull/19148) Checks the consumed gas for verifying a multisig pubKey signature during simulation.
|
||||
|
||||
@@ -4,7 +4,14 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
gogoproto "github.com/cosmos/gogoproto/proto"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
)
|
||||
@@ -68,3 +75,61 @@ func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams
|
||||
|
||||
return &types.MsgUpdateParamsResponse{}, nil
|
||||
}
|
||||
|
||||
func (ms msgServer) MigrateAccount(ctx context.Context, msg *types.MsgMigrateAccount) (*types.MsgMigrateAccountResponse, error) {
|
||||
signer, err := ms.ak.AddressCodec().StringToBytes(msg.Signer)
|
||||
if err != nil {
|
||||
return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid signer address: %s", err)
|
||||
}
|
||||
|
||||
acc := ms.ak.GetAccount(ctx, signer)
|
||||
if acc == nil {
|
||||
return nil, sdkerrors.ErrUnknownAddress.Wrapf("account %s does not exist", signer)
|
||||
}
|
||||
|
||||
// check if account type is valid or not
|
||||
_, isBaseAccount := (acc).(*types.BaseAccount)
|
||||
if !isBaseAccount {
|
||||
return nil, status.Error(codes.InvalidArgument, "only BaseAccount can be migrated")
|
||||
}
|
||||
|
||||
// unwrap any msg
|
||||
initMsg, err := unpackAnyRaw(msg.AccountInitMsg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
initResp, err := ms.ak.AccountsModKeeper.MigrateLegacyAccount(ctx, signer, acc.GetAccountNumber(), msg.AccountType, initMsg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// account is then removed from state
|
||||
ms.ak.RemoveAccount(ctx, acc)
|
||||
|
||||
initRespAny, err := codectypes.NewAnyWithValue(initResp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &types.MsgMigrateAccountResponse{InitResponse: initRespAny}, nil
|
||||
}
|
||||
|
||||
func unpackAnyRaw(m *codectypes.Any) (gogoproto.Message, error) {
|
||||
if m == nil {
|
||||
return nil, fmt.Errorf("cannot unpack nil any")
|
||||
}
|
||||
split := strings.Split(m.TypeUrl, "/")
|
||||
name := split[len(split)-1]
|
||||
typ := gogoproto.MessageType(name)
|
||||
if typ == nil {
|
||||
return nil, fmt.Errorf("no message type found for %s", name)
|
||||
}
|
||||
concreteMsg := reflect.New(typ.Elem()).Interface().(gogoproto.Message)
|
||||
err := gogoproto.Unmarshal(m.Value, concreteMsg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return concreteMsg, nil
|
||||
}
|
||||
|
||||
@@ -134,6 +134,21 @@ func (mr *MockAccountsModKeeperMockRecorder) IsAccountsModuleAccount(ctx, accoun
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAccountsModuleAccount", reflect.TypeOf((*MockAccountsModKeeper)(nil).IsAccountsModuleAccount), ctx, accountAddr)
|
||||
}
|
||||
|
||||
// MigrateLegacyAccount mocks base method.
|
||||
func (m *MockAccountsModKeeper) MigrateLegacyAccount(ctx context.Context, addr []byte, accNum uint64, accType string, msg transaction.Msg) (transaction.Msg, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "MigrateLegacyAccount", ctx, addr, accNum, accType, msg)
|
||||
ret0, _ := ret[0].(transaction.Msg)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// MigrateLegacyAccount indicates an expected call of MigrateLegacyAccount.
|
||||
func (mr *MockAccountsModKeeperMockRecorder) MigrateLegacyAccount(ctx, addr, accNum, accType, msg interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MigrateLegacyAccount", reflect.TypeOf((*MockAccountsModKeeper)(nil).MigrateLegacyAccount), ctx, addr, accNum, accType, msg)
|
||||
}
|
||||
|
||||
// NextAccountNumber mocks base method.
|
||||
func (m *MockAccountsModKeeper) NextAccountNumber(ctx context.Context) (uint64, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
||||
@@ -70,7 +70,7 @@ type QueryLegacyAccountResponse struct {
|
||||
// the type wrapped by the any does not need to comply with the
|
||||
// sdk.AccountI interface.
|
||||
Account *any.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
|
||||
// info represents the account as a BaseAccount, this can return
|
||||
// base represents the account as a BaseAccount, this can return
|
||||
// nil if the account cannot be represented as a BaseAccount.
|
||||
// This is used in the gRPC QueryAccountInfo method.
|
||||
Base *BaseAccount `protobuf:"bytes,2,opt,name=base,proto3" json:"base,omitempty"`
|
||||
|
||||
@@ -59,5 +59,6 @@ func RegisterInterfaces(registrar registry.InterfaceRegistrar) {
|
||||
registrar.RegisterImplementations((*coretransaction.Msg)(nil),
|
||||
&MsgUpdateParams{},
|
||||
&MsgNonAtomicExec{},
|
||||
&MsgMigrateAccount{},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -31,4 +31,13 @@ type AccountsModKeeper interface {
|
||||
// InitAccountNumberSeqUnsafe is use to set accounts module account number with value
|
||||
// of auth module current account number
|
||||
InitAccountNumberSeqUnsafe(ctx context.Context, currentAccNum uint64) error
|
||||
|
||||
// MigrateLegacyAccount migrates the given account to an x/accounts' account.
|
||||
MigrateLegacyAccount(
|
||||
ctx context.Context,
|
||||
addr []byte, // The current address of the account
|
||||
accNum uint64, // The current account number
|
||||
accType string, // The account type to migrate to
|
||||
msg transaction.Msg, // The init msg of the account type we're migrating to
|
||||
) (transaction.Msg, error)
|
||||
}
|
||||
|
||||
+547
-36
@@ -279,53 +279,172 @@ func (m *MsgNonAtomicExecResponse) GetResults() []*NonAtomicExecResult {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MsgMigrateAccount defines a message which allows users to migrate from BaseAccount
|
||||
// to other x/accounts types.
|
||||
type MsgMigrateAccount struct {
|
||||
Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"`
|
||||
AccountType string `protobuf:"bytes,2,opt,name=account_type,json=accountType,proto3" json:"account_type,omitempty"`
|
||||
AccountInitMsg *any.Any `protobuf:"bytes,3,opt,name=account_init_msg,json=accountInitMsg,proto3" json:"account_init_msg,omitempty"`
|
||||
}
|
||||
|
||||
func (m *MsgMigrateAccount) Reset() { *m = MsgMigrateAccount{} }
|
||||
func (m *MsgMigrateAccount) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgMigrateAccount) ProtoMessage() {}
|
||||
func (*MsgMigrateAccount) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_c2d62bd9c4c212e5, []int{5}
|
||||
}
|
||||
func (m *MsgMigrateAccount) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgMigrateAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgMigrateAccount.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 *MsgMigrateAccount) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgMigrateAccount.Merge(m, src)
|
||||
}
|
||||
func (m *MsgMigrateAccount) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgMigrateAccount) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgMigrateAccount.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgMigrateAccount proto.InternalMessageInfo
|
||||
|
||||
func (m *MsgMigrateAccount) GetSigner() string {
|
||||
if m != nil {
|
||||
return m.Signer
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgMigrateAccount) GetAccountType() string {
|
||||
if m != nil {
|
||||
return m.AccountType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgMigrateAccount) GetAccountInitMsg() *any.Any {
|
||||
if m != nil {
|
||||
return m.AccountInitMsg
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MsgMigrateAccountResponse defines the response given when migrating to
|
||||
// an x/accounts account.
|
||||
type MsgMigrateAccountResponse struct {
|
||||
// init_response defines the response returned by the x/account account
|
||||
// initialization.
|
||||
InitResponse *any.Any `protobuf:"bytes,1,opt,name=init_response,json=initResponse,proto3" json:"init_response,omitempty"`
|
||||
}
|
||||
|
||||
func (m *MsgMigrateAccountResponse) Reset() { *m = MsgMigrateAccountResponse{} }
|
||||
func (m *MsgMigrateAccountResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgMigrateAccountResponse) ProtoMessage() {}
|
||||
func (*MsgMigrateAccountResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_c2d62bd9c4c212e5, []int{6}
|
||||
}
|
||||
func (m *MsgMigrateAccountResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgMigrateAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgMigrateAccountResponse.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 *MsgMigrateAccountResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgMigrateAccountResponse.Merge(m, src)
|
||||
}
|
||||
func (m *MsgMigrateAccountResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgMigrateAccountResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgMigrateAccountResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgMigrateAccountResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *MsgMigrateAccountResponse) GetInitResponse() *any.Any {
|
||||
if m != nil {
|
||||
return m.InitResponse
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.auth.v1beta1.MsgUpdateParams")
|
||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.auth.v1beta1.MsgUpdateParamsResponse")
|
||||
proto.RegisterType((*MsgNonAtomicExec)(nil), "cosmos.auth.v1beta1.MsgNonAtomicExec")
|
||||
proto.RegisterType((*NonAtomicExecResult)(nil), "cosmos.auth.v1beta1.NonAtomicExecResult")
|
||||
proto.RegisterType((*MsgNonAtomicExecResponse)(nil), "cosmos.auth.v1beta1.MsgNonAtomicExecResponse")
|
||||
proto.RegisterType((*MsgMigrateAccount)(nil), "cosmos.auth.v1beta1.MsgMigrateAccount")
|
||||
proto.RegisterType((*MsgMigrateAccountResponse)(nil), "cosmos.auth.v1beta1.MsgMigrateAccountResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("cosmos/auth/v1beta1/tx.proto", fileDescriptor_c2d62bd9c4c212e5) }
|
||||
|
||||
var fileDescriptor_c2d62bd9c4c212e5 = []byte{
|
||||
// 548 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcf, 0x8f, 0xd2, 0x40,
|
||||
0x14, 0x66, 0xdc, 0x1f, 0x86, 0x41, 0xb3, 0x5a, 0x48, 0x16, 0x59, 0x53, 0xb1, 0xd1, 0x04, 0x89,
|
||||
0x4c, 0x17, 0x34, 0x9a, 0x70, 0x30, 0x01, 0xb3, 0xf1, 0x84, 0x31, 0x35, 0x7b, 0xf1, 0xa0, 0x29,
|
||||
0x30, 0xce, 0x36, 0x6e, 0x3b, 0x4d, 0xdf, 0xb0, 0xc2, 0xcd, 0x78, 0xf4, 0xe4, 0xd1, 0x3f, 0xc1,
|
||||
0x23, 0x07, 0xfe, 0x88, 0xcd, 0x9e, 0x36, 0x9c, 0x3c, 0x19, 0x03, 0x07, 0x2e, 0xfe, 0x11, 0xa6,
|
||||
0x33, 0x53, 0x09, 0x6c, 0x8d, 0x7b, 0x69, 0x3b, 0xf3, 0x7d, 0xef, 0xbd, 0xef, 0xbd, 0xef, 0x15,
|
||||
0xdf, 0xee, 0x71, 0xf0, 0x39, 0xd8, 0xee, 0x40, 0x1c, 0xd9, 0x27, 0xf5, 0x2e, 0x15, 0x6e, 0xdd,
|
||||
0x16, 0x43, 0x12,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, 0x61, 0x0f, 0x55, 0x5f, 0x6b, 0x0d, 0x58, 0x04, 0xef, 0xae, 0x5d, 0x39, 0x14, 0x42, 0x1e,
|
||||
0x00, 0x6d, 0xe6, 0x53, 0x6a, 0x58, 0xdf, 0x10, 0xbe, 0xd1, 0x01, 0xf6, 0x92, 0x07, 0x2d, 0xc1,
|
||||
0x7d, 0xaf, 0x77, 0x30, 0xa4, 0x3d, 0x63, 0x1f, 0x6f, 0x83, 0xc7, 0x02, 0x1a, 0xfd, 0x77, 0x04,
|
||||
0x9a, 0x67, 0x1c, 0xe0, 0x4d, 0x1f, 0x58, 0xdc, 0xfd, 0x46, 0x25, 0xd7, 0x28, 0x10, 0x65, 0x2e,
|
||||
0x49, 0xcc, 0x25, 0xad, 0x60, 0xd4, 0xde, 0x3b, 0x9b, 0xd4, 0xb4, 0x7f, 0xa4, 0xeb, 0x02, 0xfd,
|
||||
0x3b, 0x96, 0x0e, 0x30, 0x47, 0x86, 0x37, 0x73, 0x71, 0xcf, 0x3a, 0xa7, 0x75, 0x88, 0xf3, 0x2b,
|
||||
0xb2, 0x1c, 0x0a, 0x83, 0x63, 0x61, 0x14, 0xf0, 0x16, 0x8d, 0x22, 0xae, 0xb5, 0x39, 0xea, 0x60,
|
||||
0x54, 0xf0, 0x66, 0x44, 0x21, 0xd4, 0xe3, 0x4f, 0x15, 0xe0, 0x48, 0x86, 0xf5, 0x16, 0x17, 0xd7,
|
||||
0x1b, 0x4e, 0x46, 0x64, 0xb4, 0xf1, 0xd5, 0x48, 0x56, 0x81, 0x22, 0x92, 0x9d, 0x54, 0x52, 0x7d,
|
||||
0x4c, 0x91, 0xe5, 0x24, 0x81, 0x8d, 0xdf, 0x08, 0x6f, 0x74, 0x80, 0x19, 0x1f, 0xf1, 0xb5, 0x95,
|
||||
0xd5, 0xba, 0x97, 0x9a, 0x6a, 0xcd, 0xac, 0xd2, 0xc3, 0xcb, 0xb0, 0x12, 0xbd, 0x56, 0xfe, 0xec,
|
||||
0xa2, 0xa5, 0x06, 0xc5, 0xd7, 0x57, 0xed, 0xbc, 0xff, 0xaf, 0x9c, 0x2b, 0xb4, 0x52, 0xed, 0x52,
|
||||
0xb4, 0xa4, 0x76, 0x69, 0xeb, 0x53, 0xbc, 0xc1, 0xed, 0xe7, 0xa7, 0x33, 0x13, 0x9d, 0xcf, 0x4c,
|
||||
0xf4, 0x6b, 0x66, 0xa2, 0xaf, 0x73, 0x33, 0x73, 0x3e, 0x37, 0x33, 0x3f, 0xe6, 0x66, 0xe6, 0xcd,
|
||||
0x03, 0xe6, 0x89, 0xa3, 0x41, 0x97, 0xf4, 0xb8, 0xaf, 0x7f, 0x62, 0xfb, 0xe2, 0xfe, 0x8a, 0x51,
|
||||
0x48, 0xa1, 0xbb, 0x2d, 0x7d, 0x7a, 0xf4, 0x27, 0x00, 0x00, 0xff, 0xff, 0x4a, 0xdf, 0x75, 0x60,
|
||||
0x5e, 0x04, 0x00, 0x00,
|
||||
// 667 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcb, 0x6e, 0xd3, 0x40,
|
||||
0x14, 0x8d, 0xfb, 0x42, 0x99, 0xf4, 0xe9, 0x44, 0xaa, 0xeb, 0x22, 0xd3, 0x9a, 0x87, 0x42, 0x45,
|
||||
0xc6, 0x7d, 0x20, 0x10, 0x59, 0x54, 0x4a, 0x50, 0x85, 0x58, 0x18, 0x21, 0x43, 0x59, 0xb0, 0xa0,
|
||||
0x72, 0x9c, 0x61, 0x6a, 0x51, 0x7b, 0xac, 0x99, 0x49, 0x69, 0x76, 0x88, 0x25, 0x2b, 0x96, 0x7c,
|
||||
0x02, 0xcb, 0x2e, 0xfa, 0x11, 0x55, 0x57, 0x55, 0x17, 0x88, 0x0d, 0x08, 0xb5, 0x8b, 0xfe, 0x06,
|
||||
0xf2, 0x78, 0xdc, 0xe2, 0xd4, 0x81, 0x88, 0x4d, 0x62, 0xcf, 0x3d, 0xf7, 0xde, 0x73, 0xce, 0xbd,
|
||||
0x63, 0x70, 0xdd, 0x23, 0x2c, 0x20, 0xcc, 0x72, 0x3b, 0x7c, 0xdb, 0xda, 0x5d, 0x69, 0x21, 0xee,
|
||||
0xae, 0x58, 0x7c, 0x0f, 0x46, 0x94, 0x70, 0xa2, 0x96, 0x93, 0x28, 0x8c, 0xa3, 0x50, 0x46, 0xf5,
|
||||
0x0a, 0x26, 0x98, 0x88, 0xb8, 0x15, 0x3f, 0x25, 0x50, 0x7d, 0x0e, 0x13, 0x82, 0x77, 0x90, 0x25,
|
||||
0xde, 0x5a, 0x9d, 0xb7, 0x96, 0x1b, 0x76, 0xd3, 0x50, 0x52, 0x65, 0x2b, 0xc9, 0x91, 0x25, 0x93,
|
||||
0xd0, 0xac, 0x6c, 0x1f, 0x30, 0x6c, 0xed, 0xae, 0xc4, 0x7f, 0x32, 0x30, 0xe3, 0x06, 0x7e, 0x48,
|
||||
0x2c, 0xf1, 0x2b, 0x8f, 0x8c, 0x3c, 0xaa, 0x82, 0x99, 0x88, 0x9b, 0x27, 0x0a, 0x98, 0xb2, 0x19,
|
||||
0xde, 0x8c, 0xda, 0x2e, 0x47, 0xcf, 0x5d, 0xea, 0x06, 0x4c, 0x7d, 0x00, 0x8a, 0x31, 0x82, 0x50,
|
||||
0x9f, 0x77, 0x35, 0x65, 0x41, 0xa9, 0x16, 0x9b, 0xda, 0xc9, 0x41, 0xad, 0x22, 0x49, 0x34, 0xda,
|
||||
0x6d, 0x8a, 0x18, 0x7b, 0xc1, 0xa9, 0x1f, 0x62, 0xe7, 0x12, 0xaa, 0xae, 0x83, 0xb1, 0x48, 0x54,
|
||||
0xd0, 0x86, 0x16, 0x94, 0x6a, 0x69, 0x75, 0x1e, 0xe6, 0x38, 0x01, 0x93, 0x26, 0xcd, 0xe2, 0xe1,
|
||||
0xcf, 0x1b, 0x85, 0xaf, 0xe7, 0xfb, 0x4b, 0x8a, 0x23, 0xb3,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x50, 0x7e, 0x9d, 0x1a, 0xca, 0xe7, 0x33, 0xa3, 0x70, 0x7c,
|
||||
0x66, 0x14, 0xbe, 0x9f, 0x19, 0x85, 0xd7, 0x77, 0xb1, 0xcf, 0xb7, 0x3b, 0x2d, 0xe8, 0x91, 0x40,
|
||||
0x7e, 0x66, 0xad, 0xab, 0x1b, 0x10, 0x2f, 0x1f, 0x6b, 0x8d, 0x89, 0xc9, 0xad, 0xfd, 0x0e, 0x00,
|
||||
0x00, 0xff, 0xff, 0xc2, 0x24, 0xb6, 0x0e, 0x00, 0x06, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -345,6 +464,8 @@ type MsgClient interface {
|
||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||
// NonAtomicExec allows users to submit multiple messages for non-atomic execution.
|
||||
NonAtomicExec(ctx context.Context, in *MsgNonAtomicExec, opts ...grpc.CallOption) (*MsgNonAtomicExecResponse, error)
|
||||
// MigrateAccount migrates the account to x/accounts.
|
||||
MigrateAccount(ctx context.Context, in *MsgMigrateAccount, opts ...grpc.CallOption) (*MsgMigrateAccountResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
@@ -373,6 +494,15 @@ func (c *msgClient) NonAtomicExec(ctx context.Context, in *MsgNonAtomicExec, opt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) MigrateAccount(ctx context.Context, in *MsgMigrateAccount, opts ...grpc.CallOption) (*MsgMigrateAccountResponse, error) {
|
||||
out := new(MsgMigrateAccountResponse)
|
||||
err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Msg/MigrateAccount", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
type MsgServer interface {
|
||||
// UpdateParams defines a (governance) operation for updating the x/auth module
|
||||
@@ -380,6 +510,8 @@ type MsgServer interface {
|
||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||
// NonAtomicExec allows users to submit multiple messages for non-atomic execution.
|
||||
NonAtomicExec(context.Context, *MsgNonAtomicExec) (*MsgNonAtomicExecResponse, error)
|
||||
// MigrateAccount migrates the account to x/accounts.
|
||||
MigrateAccount(context.Context, *MsgMigrateAccount) (*MsgMigrateAccountResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
|
||||
@@ -392,6 +524,9 @@ func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateP
|
||||
func (*UnimplementedMsgServer) NonAtomicExec(ctx context.Context, req *MsgNonAtomicExec) (*MsgNonAtomicExecResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NonAtomicExec not implemented")
|
||||
}
|
||||
func (*UnimplementedMsgServer) MigrateAccount(ctx context.Context, req *MsgMigrateAccount) (*MsgMigrateAccountResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method MigrateAccount not implemented")
|
||||
}
|
||||
|
||||
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
|
||||
s.RegisterService(&_Msg_serviceDesc, srv)
|
||||
@@ -433,6 +568,24 @@ func _Msg_NonAtomicExec_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_MigrateAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgMigrateAccount)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).MigrateAccount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/cosmos.auth.v1beta1.Msg/MigrateAccount",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).MigrateAccount(ctx, req.(*MsgMigrateAccount))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var Msg_serviceDesc = _Msg_serviceDesc
|
||||
var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "cosmos.auth.v1beta1.Msg",
|
||||
@@ -446,6 +599,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "NonAtomicExec",
|
||||
Handler: _Msg_NonAtomicExec_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "MigrateAccount",
|
||||
Handler: _Msg_MigrateAccount_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cosmos/auth/v1beta1/tx.proto",
|
||||
@@ -637,6 +794,90 @@ func (m *MsgNonAtomicExecResponse) MarshalToSizedBuffer(dAtA []byte) (int, error
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgMigrateAccount) 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 *MsgMigrateAccount) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgMigrateAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.AccountInitMsg != nil {
|
||||
{
|
||||
size, err := m.AccountInitMsg.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTx(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(m.AccountType) > 0 {
|
||||
i -= len(m.AccountType)
|
||||
copy(dAtA[i:], m.AccountType)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(m.AccountType)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if len(m.Signer) > 0 {
|
||||
i -= len(m.Signer)
|
||||
copy(dAtA[i:], m.Signer)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(m.Signer)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgMigrateAccountResponse) 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 *MsgMigrateAccountResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgMigrateAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.InitResponse != nil {
|
||||
{
|
||||
size, err := m.InitResponse.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTx(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovTx(v)
|
||||
base := offset
|
||||
@@ -723,6 +964,40 @@ func (m *MsgNonAtomicExecResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgMigrateAccount) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Signer)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
l = len(m.AccountType)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
if m.AccountInitMsg != nil {
|
||||
l = m.AccountInitMsg.Size()
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgMigrateAccountResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.InitResponse != nil {
|
||||
l = m.InitResponse.Size()
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovTx(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
@@ -1212,6 +1487,242 @@ func (m *MsgNonAtomicExecResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgMigrateAccount) 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: MsgMigrateAccount: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgMigrateAccount: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field AccountType", 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.AccountType = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field AccountInitMsg", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.AccountInitMsg == nil {
|
||||
m.AccountInitMsg = &any.Any{}
|
||||
}
|
||||
if err := m.AccountInitMsg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgMigrateAccountResponse) 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: MsgMigrateAccountResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgMigrateAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field InitResponse", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.InitResponse == nil {
|
||||
m.InitResponse = &any.Any{}
|
||||
}
|
||||
if err := m.InitResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipTx(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
Reference in New Issue
Block a user