From 9061b89afd4ea85a87109b7009ee3dae6202dc87 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 20 Jan 2025 13:06:01 +0100 Subject: [PATCH 1/6] scaffold: message upload-morse-state --module migration --signer authority state --- proto/poktroll/migration/tx.proto | 31 ++++++++------ .../keeper/msg_server_upload_morse_state.go | 18 +++++++++ x/migration/module/autocli.go | 8 +++- x/migration/module/simulation.go | 29 ++++++++++++-- x/migration/simulation/upload_morse_state.go | 29 ++++++++++++++ x/migration/types/codec.go | 5 ++- .../types/message_upload_morse_state.go | 25 ++++++++++++ .../types/message_upload_morse_state_test.go | 40 +++++++++++++++++++ 8 files changed, 168 insertions(+), 17 deletions(-) create mode 100644 x/migration/keeper/msg_server_upload_morse_state.go create mode 100644 x/migration/simulation/upload_morse_state.go create mode 100644 x/migration/types/message_upload_morse_state.go create mode 100644 x/migration/types/message_upload_morse_state_test.go diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 9e9957de3..abd90ddbd 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -1,4 +1,5 @@ syntax = "proto3"; + package poktroll.migration; import "amino/amino.proto"; @@ -13,29 +14,35 @@ option (gogoproto.stable_marshaler_all) = true; // Msg defines the Msg service. service Msg { option (cosmos.msg.v1.service) = true; - + // UpdateParams defines a (governance) operation for updating the module // parameters. The authority defaults to the x/gov module account. - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + rpc UpdateParams (MsgUpdateParams ) returns (MsgUpdateParamsResponse ); + rpc UploadMorseState (MsgUploadMorseState) returns (MsgUploadMorseStateResponse); } - // MsgUpdateParams is the Msg/UpdateParams request type. message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "poktroll/x/migration/MsgUpdateParams"; - + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "poktroll/x/migration/MsgUpdateParams"; + // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // params defines the module parameters to update. - // + // NOTE: All parameters must be supplied. - Params params = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. -message MsgUpdateParamsResponse {} \ No newline at end of file +message MsgUpdateParamsResponse {} + +message MsgUploadMorseState { + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1; + string state = 2; +} + +message MsgUploadMorseStateResponse {} + diff --git a/x/migration/keeper/msg_server_upload_morse_state.go b/x/migration/keeper/msg_server_upload_morse_state.go new file mode 100644 index 000000000..f65a8a33f --- /dev/null +++ b/x/migration/keeper/msg_server_upload_morse_state.go @@ -0,0 +1,18 @@ +package keeper + +import ( + "context" + + "github.com/pokt-network/poktroll/x/migration/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + + +func (k msgServer) UploadMorseState(goCtx context.Context, msg *types.MsgUploadMorseState) (*types.MsgUploadMorseStateResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgUploadMorseStateResponse{}, nil +} diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index 96169a21d..4aa553cb7 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -28,7 +28,13 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcMethod: "UpdateParams", Skip: true, // skipped because authority gated }, - // this line is used by ignite scaffolding # autocli/tx + { + RpcMethod: "UploadMorseState", + Use: "upload-morse-state [state]", + Short: "Send a upload-morse-state tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "state"},}, + }, + // this line is used by ignite scaffolding # autocli/tx }, }, } diff --git a/x/migration/module/simulation.go b/x/migration/module/simulation.go index 2c4ef40a8..e21413a83 100644 --- a/x/migration/module/simulation.go +++ b/x/migration/module/simulation.go @@ -23,7 +23,11 @@ var ( ) const ( -// this line is used by starport scaffolding # simapp/module/const + opWeightMsgUploadMorseState = "op_weight_msg_upload_morse_state" + // TODO: Determine the simulation weight value + defaultWeightMsgUploadMorseState int = 100 + + // this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module. @@ -33,7 +37,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { accs[i] = acc.Address.String() } migrationGenesis := types.GenesisState{ - Params: types.DefaultParams(), + Params: types.DefaultParams(), // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&migrationGenesis) @@ -46,6 +50,17 @@ func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) + var weightMsgUploadMorseState int + simState.AppParams.GetOrGenerate(opWeightMsgUploadMorseState, &weightMsgUploadMorseState, nil, + func(_ *rand.Rand) { + weightMsgUploadMorseState = defaultWeightMsgUploadMorseState + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgUploadMorseState, + migrationsimulation.SimulateMsgUploadMorseState(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations @@ -54,6 +69,14 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp // ProposalMsgs returns msgs used for governance proposals for simulations. func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { return []simtypes.WeightedProposalMsg{ - // this line is used by starport scaffolding # simapp/module/OpMsg + simulation.NewWeightedProposalMsg( + opWeightMsgUploadMorseState, + defaultWeightMsgUploadMorseState, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + migrationsimulation.SimulateMsgUploadMorseState(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, +), +// this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/migration/simulation/upload_morse_state.go b/x/migration/simulation/upload_morse_state.go new file mode 100644 index 000000000..5b95864a1 --- /dev/null +++ b/x/migration/simulation/upload_morse_state.go @@ -0,0 +1,29 @@ +package simulation + +import ( + "math/rand" + + "github.com/pokt-network/poktroll/x/migration/keeper" + "github.com/pokt-network/poktroll/x/migration/types" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +func SimulateMsgUploadMorseState( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgUploadMorseState{ + Authority: simAccount.Address.String(), + } + + // TODO: Handling the UploadMorseState simulation + + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "UploadMorseState simulation not implemented"), nil, nil + } +} diff --git a/x/migration/types/codec.go b/x/migration/types/codec.go index ac5526374..3710778b2 100644 --- a/x/migration/types/codec.go +++ b/x/migration/types/codec.go @@ -8,7 +8,10 @@ import ( ) func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - // this line is used by starport scaffolding # 3 + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUploadMorseState{}, +) +// this line is used by starport scaffolding # 3 registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}, diff --git a/x/migration/types/message_upload_morse_state.go b/x/migration/types/message_upload_morse_state.go new file mode 100644 index 000000000..cba622b19 --- /dev/null +++ b/x/migration/types/message_upload_morse_state.go @@ -0,0 +1,25 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgUploadMorseState{} + +func NewMsgUploadMorseState(authority string, state string) *MsgUploadMorseState { + return &MsgUploadMorseState{ + Authority: authority, + State: state, + } +} + +func (msg *MsgUploadMorseState) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid authority address (%s)", err) + } + return nil +} + diff --git a/x/migration/types/message_upload_morse_state_test.go b/x/migration/types/message_upload_morse_state_test.go new file mode 100644 index 000000000..9908bbe9c --- /dev/null +++ b/x/migration/types/message_upload_morse_state_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/testutil/sample" +) + +func TestMsgUploadMorseState_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgUploadMorseState + err error + }{ + { + name: "invalid address", + msg: MsgUploadMorseState{ + Authority: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgUploadMorseState{ + Authority: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} From 9e5d729da4b60a05ebd0cfbdb0f259d86970fd27 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 21 Jan 2025 12:59:08 +0100 Subject: [PATCH 2/6] chore: add comments & regenerate protobufs --- api/poktroll/migration/tx.pulsar.go | 1015 +++++++++++++++++++++++++- api/poktroll/migration/tx_grpc.pb.go | 40 +- proto/poktroll/migration/tx.proto | 6 +- x/migration/types/tx.pb.go | 397 +++++++++- 4 files changed, 1414 insertions(+), 44 deletions(-) diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index f7af6fa34..1aed112ed 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -871,6 +871,848 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } +var ( + md_MsgUploadMorseState protoreflect.MessageDescriptor + fd_MsgUploadMorseState_authority protoreflect.FieldDescriptor + fd_MsgUploadMorseState_state protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_tx_proto_init() + md_MsgUploadMorseState = File_poktroll_migration_tx_proto.Messages().ByName("MsgUploadMorseState") + fd_MsgUploadMorseState_authority = md_MsgUploadMorseState.Fields().ByName("authority") + fd_MsgUploadMorseState_state = md_MsgUploadMorseState.Fields().ByName("state") +} + +var _ protoreflect.Message = (*fastReflection_MsgUploadMorseState)(nil) + +type fastReflection_MsgUploadMorseState MsgUploadMorseState + +func (x *MsgUploadMorseState) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUploadMorseState)(x) +} + +func (x *MsgUploadMorseState) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_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_MsgUploadMorseState_messageType fastReflection_MsgUploadMorseState_messageType +var _ protoreflect.MessageType = fastReflection_MsgUploadMorseState_messageType{} + +type fastReflection_MsgUploadMorseState_messageType struct{} + +func (x fastReflection_MsgUploadMorseState_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUploadMorseState)(nil) +} +func (x fastReflection_MsgUploadMorseState_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUploadMorseState) +} +func (x fastReflection_MsgUploadMorseState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUploadMorseState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUploadMorseState) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUploadMorseState +} + +// 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_MsgUploadMorseState) Type() protoreflect.MessageType { + return _fastReflection_MsgUploadMorseState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUploadMorseState) New() protoreflect.Message { + return new(fastReflection_MsgUploadMorseState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUploadMorseState) Interface() protoreflect.ProtoMessage { + return (*MsgUploadMorseState)(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_MsgUploadMorseState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUploadMorseState_authority, value) { + return + } + } + if len(x.State) != 0 { + value := protoreflect.ValueOfBytes(x.State) + if !f(fd_MsgUploadMorseState_state, 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_MsgUploadMorseState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MsgUploadMorseState.authority": + return x.Authority != "" + case "poktroll.migration.MsgUploadMorseState.state": + return len(x.State) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseState")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUploadMorseState 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_MsgUploadMorseState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MsgUploadMorseState.authority": + x.Authority = "" + case "poktroll.migration.MsgUploadMorseState.state": + x.State = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseState")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUploadMorseState 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_MsgUploadMorseState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MsgUploadMorseState.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "poktroll.migration.MsgUploadMorseState.state": + value := x.State + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseState")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUploadMorseState 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_MsgUploadMorseState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MsgUploadMorseState.authority": + x.Authority = value.Interface().(string) + case "poktroll.migration.MsgUploadMorseState.state": + x.State = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseState")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUploadMorseState 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_MsgUploadMorseState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgUploadMorseState.authority": + panic(fmt.Errorf("field authority of message poktroll.migration.MsgUploadMorseState is not mutable")) + case "poktroll.migration.MsgUploadMorseState.state": + panic(fmt.Errorf("field state of message poktroll.migration.MsgUploadMorseState is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseState")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUploadMorseState 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_MsgUploadMorseState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgUploadMorseState.authority": + return protoreflect.ValueOfString("") + case "poktroll.migration.MsgUploadMorseState.state": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseState")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUploadMorseState 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_MsgUploadMorseState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MsgUploadMorseState", 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_MsgUploadMorseState) 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_MsgUploadMorseState) 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_MsgUploadMorseState) 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_MsgUploadMorseState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUploadMorseState) + 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.State) + 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().(*MsgUploadMorseState) + 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.State) > 0 { + i -= len(x.State) + copy(dAtA[i:], x.State) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.State))) + 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().(*MsgUploadMorseState) + 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: MsgUploadMorseState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUploadMorseState: 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 State", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.State = append(x.State[:0], dAtA[iNdEx:postIndex]...) + if x.State == nil { + x.State = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + 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_MsgUploadMorseStateResponse protoreflect.MessageDescriptor +) + +func init() { + file_poktroll_migration_tx_proto_init() + md_MsgUploadMorseStateResponse = File_poktroll_migration_tx_proto.Messages().ByName("MsgUploadMorseStateResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUploadMorseStateResponse)(nil) + +type fastReflection_MsgUploadMorseStateResponse MsgUploadMorseStateResponse + +func (x *MsgUploadMorseStateResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUploadMorseStateResponse)(x) +} + +func (x *MsgUploadMorseStateResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_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_MsgUploadMorseStateResponse_messageType fastReflection_MsgUploadMorseStateResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUploadMorseStateResponse_messageType{} + +type fastReflection_MsgUploadMorseStateResponse_messageType struct{} + +func (x fastReflection_MsgUploadMorseStateResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUploadMorseStateResponse)(nil) +} +func (x fastReflection_MsgUploadMorseStateResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUploadMorseStateResponse) +} +func (x fastReflection_MsgUploadMorseStateResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUploadMorseStateResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUploadMorseStateResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUploadMorseStateResponse +} + +// 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_MsgUploadMorseStateResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUploadMorseStateResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUploadMorseStateResponse) New() protoreflect.Message { + return new(fastReflection_MsgUploadMorseStateResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUploadMorseStateResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUploadMorseStateResponse)(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_MsgUploadMorseStateResponse) 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_MsgUploadMorseStateResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseStateResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUploadMorseStateResponse 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_MsgUploadMorseStateResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseStateResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUploadMorseStateResponse 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_MsgUploadMorseStateResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseStateResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUploadMorseStateResponse 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_MsgUploadMorseStateResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseStateResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUploadMorseStateResponse 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_MsgUploadMorseStateResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseStateResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUploadMorseStateResponse 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_MsgUploadMorseStateResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseStateResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUploadMorseStateResponse 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_MsgUploadMorseStateResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MsgUploadMorseStateResponse", 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_MsgUploadMorseStateResponse) 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_MsgUploadMorseStateResponse) 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_MsgUploadMorseStateResponse) 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_MsgUploadMorseStateResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUploadMorseStateResponse) + 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().(*MsgUploadMorseStateResponse) + 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().(*MsgUploadMorseStateResponse) + 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: MsgUploadMorseStateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUploadMorseStateResponse: 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 @@ -892,8 +1734,6 @@ type MsgUpdateParams 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"` - // params defines the module parameters to update. - // // NOTE: All parameters must be supplied. Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` } @@ -960,6 +1800,77 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{1} } +// MsgUploadMorseState commits the "Morse migration" state to the Shannon state +// for subsequent migration operations on Shannon. +type MsgUploadMorseState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + State []byte `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` +} + +func (x *MsgUploadMorseState) Reset() { + *x = MsgUploadMorseState{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUploadMorseState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUploadMorseState) ProtoMessage() {} + +// Deprecated: Use MsgUploadMorseState.ProtoReflect.Descriptor instead. +func (*MsgUploadMorseState) Descriptor() ([]byte, []int) { + return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgUploadMorseState) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUploadMorseState) GetState() []byte { + if x != nil { + return x.State + } + return nil +} + +type MsgUploadMorseStateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUploadMorseStateResponse) Reset() { + *x = MsgUploadMorseStateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUploadMorseStateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUploadMorseStateResponse) ProtoMessage() {} + +// Deprecated: Use MsgUploadMorseStateResponse.ProtoReflect.Descriptor instead. +func (*MsgUploadMorseStateResponse) Descriptor() ([]byte, []int) { + return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{3} +} + var File_poktroll_migration_tx_proto protoreflect.FileDescriptor var file_poktroll_migration_tx_proto_rawDesc = []byte{ @@ -987,26 +1898,42 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x6e, - 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x73, + 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, 0x73, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x65, 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, 0x14, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x22, 0x1d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x32, 0xdc, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb3, - 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x54, - 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, - 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, - 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, - 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, + 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x10, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, + 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x2f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, + 0x01, 0x42, 0xb3, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1021,18 +1948,22 @@ func file_poktroll_migration_tx_proto_rawDescGZIP() []byte { return file_poktroll_migration_tx_proto_rawDescData } -var file_poktroll_migration_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_poktroll_migration_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_poktroll_migration_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: poktroll.migration.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: poktroll.migration.MsgUpdateParamsResponse - (*Params)(nil), // 2: poktroll.migration.Params + (*MsgUpdateParams)(nil), // 0: poktroll.migration.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: poktroll.migration.MsgUpdateParamsResponse + (*MsgUploadMorseState)(nil), // 2: poktroll.migration.MsgUploadMorseState + (*MsgUploadMorseStateResponse)(nil), // 3: poktroll.migration.MsgUploadMorseStateResponse + (*Params)(nil), // 4: poktroll.migration.Params } var file_poktroll_migration_tx_proto_depIdxs = []int32{ - 2, // 0: poktroll.migration.MsgUpdateParams.params:type_name -> poktroll.migration.Params + 4, // 0: poktroll.migration.MsgUpdateParams.params:type_name -> poktroll.migration.Params 0, // 1: poktroll.migration.Msg.UpdateParams:input_type -> poktroll.migration.MsgUpdateParams - 1, // 2: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.MsgUpdateParamsResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type + 2, // 2: poktroll.migration.Msg.UploadMorseState:input_type -> poktroll.migration.MsgUploadMorseState + 1, // 3: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.MsgUpdateParamsResponse + 3, // 4: poktroll.migration.Msg.UploadMorseState:output_type -> poktroll.migration.MsgUploadMorseStateResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name @@ -1069,6 +2000,30 @@ func file_poktroll_migration_tx_proto_init() { return nil } } + file_poktroll_migration_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUploadMorseState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUploadMorseStateResponse); 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{ @@ -1076,7 +2031,7 @@ func file_poktroll_migration_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_migration_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/api/poktroll/migration/tx_grpc.pb.go b/api/poktroll/migration/tx_grpc.pb.go index 79681fb48..555b607e6 100644 --- a/api/poktroll/migration/tx_grpc.pb.go +++ b/api/poktroll/migration/tx_grpc.pb.go @@ -19,7 +19,8 @@ import ( const _ = grpc.SupportPackageIsVersion8 const ( - Msg_UpdateParams_FullMethodName = "/poktroll.migration.Msg/UpdateParams" + Msg_UpdateParams_FullMethodName = "/poktroll.migration.Msg/UpdateParams" + Msg_UploadMorseState_FullMethodName = "/poktroll.migration.Msg/UploadMorseState" ) // MsgClient is the client API for Msg service. @@ -31,6 +32,7 @@ type MsgClient interface { // UpdateParams defines a (governance) operation for updating the module // parameters. The authority defaults to the x/gov module account. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + UploadMorseState(ctx context.Context, in *MsgUploadMorseState, opts ...grpc.CallOption) (*MsgUploadMorseStateResponse, error) } type msgClient struct { @@ -51,6 +53,16 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) UploadMorseState(ctx context.Context, in *MsgUploadMorseState, opts ...grpc.CallOption) (*MsgUploadMorseStateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUploadMorseStateResponse) + err := c.cc.Invoke(ctx, Msg_UploadMorseState_FullMethodName, in, out, cOpts...) + 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 @@ -60,6 +72,7 @@ type MsgServer interface { // UpdateParams defines a (governance) operation for updating the module // parameters. The authority defaults to the x/gov module account. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + UploadMorseState(context.Context, *MsgUploadMorseState) (*MsgUploadMorseStateResponse, error) mustEmbedUnimplementedMsgServer() } @@ -70,6 +83,9 @@ type UnimplementedMsgServer struct { func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (UnimplementedMsgServer) UploadMorseState(context.Context, *MsgUploadMorseState) (*MsgUploadMorseStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UploadMorseState not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -101,6 +117,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_UploadMorseState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUploadMorseState) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UploadMorseState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UploadMorseState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UploadMorseState(ctx, req.(*MsgUploadMorseState)) + } + 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) @@ -112,6 +146,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "UploadMorseState", + Handler: _Msg_UploadMorseState_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/migration/tx.proto", diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index abd90ddbd..3a81cdfb9 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -38,10 +38,12 @@ message MsgUpdateParams { // MsgUpdateParams message. message MsgUpdateParamsResponse {} +// MsgUploadMorseState commits the "Morse migration" state to the Shannon state +// for subsequent migration operations on Shannon. message MsgUploadMorseState { option (cosmos.msg.v1.signer) = "authority"; - string authority = 1; - string state = 2; + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + bytes state = 2; } message MsgUploadMorseStateResponse {} diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 6299c5f97..837557554 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -35,8 +35,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgUpdateParams 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"` - // params defines the module parameters to update. - // // NOTE: All parameters must be supplied. Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` } @@ -118,15 +116,99 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +// MsgUploadMorseState commits the "Morse migration" state to the Shannon state +// for subsequent migration operations on Shannon. +type MsgUploadMorseState struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + State []byte `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` +} + +func (m *MsgUploadMorseState) Reset() { *m = MsgUploadMorseState{} } +func (m *MsgUploadMorseState) String() string { return proto.CompactTextString(m) } +func (*MsgUploadMorseState) ProtoMessage() {} +func (*MsgUploadMorseState) Descriptor() ([]byte, []int) { + return fileDescriptor_21658240592266b6, []int{2} +} +func (m *MsgUploadMorseState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUploadMorseState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUploadMorseState) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUploadMorseState.Merge(m, src) +} +func (m *MsgUploadMorseState) XXX_Size() int { + return m.Size() +} +func (m *MsgUploadMorseState) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUploadMorseState.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUploadMorseState proto.InternalMessageInfo + +func (m *MsgUploadMorseState) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUploadMorseState) GetState() []byte { + if m != nil { + return m.State + } + return nil +} + +type MsgUploadMorseStateResponse struct { +} + +func (m *MsgUploadMorseStateResponse) Reset() { *m = MsgUploadMorseStateResponse{} } +func (m *MsgUploadMorseStateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUploadMorseStateResponse) ProtoMessage() {} +func (*MsgUploadMorseStateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_21658240592266b6, []int{3} +} +func (m *MsgUploadMorseStateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUploadMorseStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MsgUploadMorseStateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUploadMorseStateResponse.Merge(m, src) +} +func (m *MsgUploadMorseStateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUploadMorseStateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUploadMorseStateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUploadMorseStateResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.migration.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.migration.MsgUpdateParamsResponse") + proto.RegisterType((*MsgUploadMorseState)(nil), "poktroll.migration.MsgUploadMorseState") + proto.RegisterType((*MsgUploadMorseStateResponse)(nil), "poktroll.migration.MsgUploadMorseStateResponse") } func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 352 bytes of a gzipped FileDescriptorProto + // 420 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0xc8, 0xcf, 0x2e, 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0xcf, 0xcd, 0x4c, 0x2f, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0x49, 0xea, 0xc1, 0x25, 0xa5, 0x04, @@ -141,14 +223,19 @@ var fileDescriptor_21658240592266b6 = []byte{ 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x52, 0x7a, 0x98, 0xde, 0xd5, 0x83, 0xd8, 0xe1, 0xc4, 0x79, 0xe2, 0x9e, 0x3c, 0xc3, 0x8a, 0xe7, 0x1b, 0xb4, 0x18, 0x83, 0xa0, 0x9a, 0xac, 0xcc, 0x9b, 0x9e, 0x6f, 0xd0, 0x42, 0x18, 0xd7, 0xf5, 0x7c, 0x83, 0x96, 0x0a, 0xdc, 0xf9, 0x15, 0x48, 0x1e, 0x40, 0x73, - 0xaf, 0x92, 0x24, 0x97, 0x38, 0x9a, 0x50, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x51, - 0x1e, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x50, 0x02, 0x17, 0x0f, 0x8a, 0x0f, 0x95, 0xb1, 0xb9, 0x0c, - 0xcd, 0x0c, 0x29, 0x6d, 0x22, 0x14, 0xc1, 0x2c, 0x92, 0x62, 0x6d, 0x00, 0xf9, 0xc5, 0x29, 0xe0, - 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x6f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, - 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x32, 0x4a, - 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x07, 0x99, 0xad, 0x9b, 0x97, 0x5a, - 0x52, 0x9e, 0x5f, 0x94, 0xad, 0x8f, 0xd5, 0x9b, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, - 0x78, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x58, 0x1b, 0x5f, 0x75, 0x58, 0x02, 0x00, 0x00, + 0xaf, 0x92, 0x24, 0x97, 0x38, 0x9a, 0x50, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x52, + 0x31, 0x97, 0x30, 0x58, 0x2a, 0x27, 0x3f, 0x31, 0xc5, 0x37, 0xbf, 0xa8, 0x38, 0x35, 0xb8, 0x24, + 0xb1, 0x24, 0x95, 0x6c, 0x1f, 0x8a, 0x70, 0xb1, 0x16, 0x83, 0x0c, 0x00, 0x7b, 0x90, 0x27, 0x08, + 0xc2, 0xb1, 0xe2, 0x43, 0x75, 0xb8, 0x92, 0x2c, 0x97, 0x34, 0x16, 0x4b, 0x61, 0x6e, 0x32, 0xba, + 0xc3, 0xc8, 0xc5, 0xec, 0x5b, 0x9c, 0x2e, 0x94, 0xc0, 0xc5, 0x83, 0x12, 0xec, 0xca, 0xd8, 0x82, + 0x0b, 0xcd, 0x63, 0x52, 0xda, 0x44, 0x28, 0x82, 0xd9, 0x24, 0x94, 0xc3, 0x25, 0x80, 0xe1, 0x75, + 0x75, 0x9c, 0x06, 0xa0, 0x2a, 0x94, 0xd2, 0x27, 0x52, 0x21, 0xcc, 0x36, 0x29, 0xd6, 0x06, 0x50, + 0x74, 0x3a, 0x05, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x8d, 0x47, 0x72, 0x8c, + 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, + 0x0c, 0x51, 0x46, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x20, 0xf3, + 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0xb1, 0xc6, 0x74, 0x49, 0x65, 0x41, 0x6a, + 0x71, 0x12, 0x1b, 0x38, 0xa9, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x61, 0x68, 0x19, + 0x5b, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -166,6 +253,7 @@ type MsgClient interface { // UpdateParams defines a (governance) operation for updating the module // parameters. The authority defaults to the x/gov module account. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + UploadMorseState(ctx context.Context, in *MsgUploadMorseState, opts ...grpc.CallOption) (*MsgUploadMorseStateResponse, error) } type msgClient struct { @@ -185,11 +273,21 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) UploadMorseState(ctx context.Context, in *MsgUploadMorseState, opts ...grpc.CallOption) (*MsgUploadMorseStateResponse, error) { + out := new(MsgUploadMorseStateResponse) + err := c.cc.Invoke(ctx, "/poktroll.migration.Msg/UploadMorseState", 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 module // parameters. The authority defaults to the x/gov module account. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + UploadMorseState(context.Context, *MsgUploadMorseState) (*MsgUploadMorseStateResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -199,6 +297,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (*UnimplementedMsgServer) UploadMorseState(ctx context.Context, req *MsgUploadMorseState) (*MsgUploadMorseStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UploadMorseState not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -222,6 +323,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_UploadMorseState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUploadMorseState) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UploadMorseState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.migration.Msg/UploadMorseState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UploadMorseState(ctx, req.(*MsgUploadMorseState)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "poktroll.migration.Msg", HandlerType: (*MsgServer)(nil), @@ -230,6 +349,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "UploadMorseState", + Handler: _Msg_UploadMorseState_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/migration/tx.proto", @@ -298,6 +421,66 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgUploadMorseState) 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 *MsgUploadMorseState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUploadMorseState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.State) > 0 { + i -= len(m.State) + copy(dAtA[i:], m.State) + i = encodeVarintTx(dAtA, i, uint64(len(m.State))) + 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 *MsgUploadMorseStateResponse) 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 *MsgUploadMorseStateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUploadMorseStateResponse) 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 @@ -333,6 +516,32 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { return n } +func (m *MsgUploadMorseState) 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.State) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUploadMorseStateResponse) 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 } @@ -504,6 +713,172 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUploadMorseState) 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: MsgUploadMorseState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUploadMorseState: 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 State", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.State = append(m.State[:0], dAtA[iNdEx:postIndex]...) + if m.State == nil { + m.State = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUploadMorseStateResponse) 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: MsgUploadMorseStateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUploadMorseStateResponse: 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 From 3e715e5fea3ff7a6cd304d45564c3db1d881b5bf Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 22 Jan 2025 09:08:02 +0100 Subject: [PATCH 3/6] fix: type --- api/poktroll/migration/tx.pulsar.go | 157 ++++++++++-------- proto/poktroll/migration/tx.proto | 3 +- .../types/message_upload_morse_state.go | 17 +- x/migration/types/tx.pb.go | 87 +++++----- 4 files changed, 143 insertions(+), 121 deletions(-) diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index 1aed112ed..a7a8a74f1 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -955,8 +955,8 @@ func (x *fastReflection_MsgUploadMorseState) Range(f func(protoreflect.FieldDesc return } } - if len(x.State) != 0 { - value := protoreflect.ValueOfBytes(x.State) + if x.State != nil { + value := protoreflect.ValueOfMessage(x.State.ProtoReflect()) if !f(fd_MsgUploadMorseState_state, value) { return } @@ -979,7 +979,7 @@ func (x *fastReflection_MsgUploadMorseState) Has(fd protoreflect.FieldDescriptor case "poktroll.migration.MsgUploadMorseState.authority": return x.Authority != "" case "poktroll.migration.MsgUploadMorseState.state": - return len(x.State) != 0 + return x.State != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseState")) @@ -1021,7 +1021,7 @@ func (x *fastReflection_MsgUploadMorseState) Get(descriptor protoreflect.FieldDe return protoreflect.ValueOfString(value) case "poktroll.migration.MsgUploadMorseState.state": value := x.State - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseState")) @@ -1045,7 +1045,7 @@ func (x *fastReflection_MsgUploadMorseState) Set(fd protoreflect.FieldDescriptor case "poktroll.migration.MsgUploadMorseState.authority": x.Authority = value.Interface().(string) case "poktroll.migration.MsgUploadMorseState.state": - x.State = value.Bytes() + x.State = value.Message().Interface().(*MorseAccountState) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseState")) @@ -1066,10 +1066,13 @@ func (x *fastReflection_MsgUploadMorseState) Set(fd protoreflect.FieldDescriptor // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUploadMorseState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.migration.MsgUploadMorseState.state": + if x.State == nil { + x.State = new(MorseAccountState) + } + return protoreflect.ValueOfMessage(x.State.ProtoReflect()) case "poktroll.migration.MsgUploadMorseState.authority": panic(fmt.Errorf("field authority of message poktroll.migration.MsgUploadMorseState is not mutable")) - case "poktroll.migration.MsgUploadMorseState.state": - panic(fmt.Errorf("field state of message poktroll.migration.MsgUploadMorseState is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseState")) @@ -1086,7 +1089,8 @@ func (x *fastReflection_MsgUploadMorseState) NewField(fd protoreflect.FieldDescr case "poktroll.migration.MsgUploadMorseState.authority": return protoreflect.ValueOfString("") case "poktroll.migration.MsgUploadMorseState.state": - return protoreflect.ValueOfBytes(nil) + m := new(MorseAccountState) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseState")) @@ -1160,8 +1164,8 @@ func (x *fastReflection_MsgUploadMorseState) ProtoMethods() *protoiface.Methods if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.State) - if l > 0 { + if x.State != nil { + l = options.Size(x.State) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -1193,10 +1197,17 @@ func (x *fastReflection_MsgUploadMorseState) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.State) > 0 { - i -= len(x.State) - copy(dAtA[i:], x.State) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.State))) + if x.State != nil { + encoded, err := options.Marshal(x.State) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0x12 } @@ -1292,7 +1303,7 @@ func (x *fastReflection_MsgUploadMorseState) ProtoMethods() *protoiface.Methods if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1302,24 +1313,26 @@ func (x *fastReflection_MsgUploadMorseState) ProtoMethods() *protoiface.Methods } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.State = append(x.State[:0], dAtA[iNdEx:postIndex]...) if x.State == nil { - x.State = []byte{} + x.State = &MorseAccountState{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.State); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex default: @@ -1807,8 +1820,8 @@ type MsgUploadMorseState struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - State []byte `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + State *MorseAccountState `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` } func (x *MsgUploadMorseState) Reset() { @@ -1838,7 +1851,7 @@ func (x *MsgUploadMorseState) GetAuthority() string { return "" } -func (x *MsgUploadMorseState) GetState() []byte { +func (x *MsgUploadMorseState) GetState() *MorseAccountState { if x != nil { return x.State } @@ -1884,7 +1897,9 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc1, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, @@ -1898,42 +1913,45 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x73, - 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, 0x73, 0x65, - 0x53, 0x74, 0x61, 0x74, 0x65, 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, 0x14, 0x0a, - 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x74, 0x79, 0x22, 0x1d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x32, 0xdc, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, - 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x10, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa0, + 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 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, 0x41, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x22, 0x1d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, + 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x32, 0xdc, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x10, 0x55, 0x70, + 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x27, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, + 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x2f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, - 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x2f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, - 0x01, 0x42, 0xb3, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, - 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, + 0xb3, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, + 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, + 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, + 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1955,18 +1973,20 @@ var file_poktroll_migration_tx_proto_goTypes = []interface{}{ (*MsgUploadMorseState)(nil), // 2: poktroll.migration.MsgUploadMorseState (*MsgUploadMorseStateResponse)(nil), // 3: poktroll.migration.MsgUploadMorseStateResponse (*Params)(nil), // 4: poktroll.migration.Params + (*MorseAccountState)(nil), // 5: poktroll.migration.MorseAccountState } var file_poktroll_migration_tx_proto_depIdxs = []int32{ 4, // 0: poktroll.migration.MsgUpdateParams.params:type_name -> poktroll.migration.Params - 0, // 1: poktroll.migration.Msg.UpdateParams:input_type -> poktroll.migration.MsgUpdateParams - 2, // 2: poktroll.migration.Msg.UploadMorseState:input_type -> poktroll.migration.MsgUploadMorseState - 1, // 3: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.MsgUpdateParamsResponse - 3, // 4: poktroll.migration.Msg.UploadMorseState:output_type -> poktroll.migration.MsgUploadMorseStateResponse - 3, // [3:5] is the sub-list for method output_type - 1, // [1:3] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 5, // 1: poktroll.migration.MsgUploadMorseState.state:type_name -> poktroll.migration.MorseAccountState + 0, // 2: poktroll.migration.Msg.UpdateParams:input_type -> poktroll.migration.MsgUpdateParams + 2, // 3: poktroll.migration.Msg.UploadMorseState:input_type -> poktroll.migration.MsgUploadMorseState + 1, // 4: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.MsgUpdateParamsResponse + 3, // 5: poktroll.migration.Msg.UploadMorseState:output_type -> poktroll.migration.MsgUploadMorseStateResponse + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_poktroll_migration_tx_proto_init() } @@ -1975,6 +1995,7 @@ func file_poktroll_migration_tx_proto_init() { return } file_poktroll_migration_params_proto_init() + file_poktroll_migration_types_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_migration_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParams); i { diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 3a81cdfb9..1e460d80f 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -7,6 +7,7 @@ import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "poktroll/migration/params.proto"; +import "poktroll/migration/types.proto"; option go_package = "github.com/pokt-network/poktroll/x/migration/types"; option (gogoproto.stable_marshaler_all) = true; @@ -43,7 +44,7 @@ message MsgUpdateParamsResponse {} message MsgUploadMorseState { option (cosmos.msg.v1.signer) = "authority"; string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - bytes state = 2; + MorseAccountState state = 2 [(gogoproto.nullable) = false]; } message MsgUploadMorseStateResponse {} diff --git a/x/migration/types/message_upload_morse_state.go b/x/migration/types/message_upload_morse_state.go index cba622b19..5bd0a1704 100644 --- a/x/migration/types/message_upload_morse_state.go +++ b/x/migration/types/message_upload_morse_state.go @@ -8,18 +8,17 @@ import ( var _ sdk.Msg = &MsgUploadMorseState{} -func NewMsgUploadMorseState(authority string, state string) *MsgUploadMorseState { - return &MsgUploadMorseState{ +func NewMsgUploadMorseState(authority string, state MorseAccountState) *MsgUploadMorseState { + return &MsgUploadMorseState{ Authority: authority, - State: state, + State: state, } } func (msg *MsgUploadMorseState) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Authority) - if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid authority address (%s)", err) - } - return nil + _, err := sdk.AccAddressFromBech32(msg.Authority) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid authority address (%s)", err) + } + return nil } - diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 837557554..8d81fe11b 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -119,8 +119,8 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo // MsgUploadMorseState commits the "Morse migration" state to the Shannon state // for subsequent migration operations on Shannon. type MsgUploadMorseState struct { - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - State []byte `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + State MorseAccountState `protobuf:"bytes,2,opt,name=state,proto3" json:"state"` } func (m *MsgUploadMorseState) Reset() { *m = MsgUploadMorseState{} } @@ -159,11 +159,11 @@ func (m *MsgUploadMorseState) GetAuthority() string { return "" } -func (m *MsgUploadMorseState) GetState() []byte { +func (m *MsgUploadMorseState) GetState() MorseAccountState { if m != nil { return m.State } - return nil + return MorseAccountState{} } type MsgUploadMorseStateResponse struct { @@ -208,34 +208,35 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 420 bytes of a gzipped FileDescriptorProto + // 446 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0xc8, 0xcf, 0x2e, 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0xcf, 0xcd, 0x4c, 0x2f, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0x49, 0xea, 0xc1, 0x25, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x99, 0x94, 0x78, 0x72, 0x7e, 0x71, 0x6e, 0x7e, 0xb1, 0x7e, 0x6e, 0x71, 0xba, 0x7e, 0x99, 0x21, 0x88, 0x82, 0x4a, 0x48, 0x42, 0x24, 0xe2, 0xc1, 0x3c, 0x7d, 0x08, 0x07, 0x2a, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x11, 0x07, 0xb1, 0xa0, - 0xa2, 0xf2, 0x58, 0x5c, 0x53, 0x90, 0x58, 0x94, 0x98, 0x0b, 0xd5, 0xa6, 0x74, 0x90, 0x91, 0x8b, - 0xdf, 0xb7, 0x38, 0x3d, 0xb4, 0x20, 0x25, 0xb1, 0x24, 0x35, 0x00, 0x2c, 0x23, 0x64, 0xc6, 0xc5, - 0x99, 0x58, 0x5a, 0x92, 0x91, 0x5f, 0x94, 0x59, 0x52, 0x29, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, - 0x24, 0x71, 0x69, 0x8b, 0xae, 0x08, 0xd4, 0x3e, 0xc7, 0x94, 0x94, 0xa2, 0xd4, 0xe2, 0xe2, 0xe0, - 0x92, 0xa2, 0xcc, 0xbc, 0xf4, 0x20, 0x84, 0x52, 0x21, 0x5b, 0x2e, 0x36, 0x88, 0xd9, 0x12, 0x4c, - 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x52, 0x7a, 0x98, 0xde, 0xd5, 0x83, 0xd8, 0xe1, 0xc4, 0x79, 0xe2, - 0x9e, 0x3c, 0xc3, 0x8a, 0xe7, 0x1b, 0xb4, 0x18, 0x83, 0xa0, 0x9a, 0xac, 0xcc, 0x9b, 0x9e, 0x6f, - 0xd0, 0x42, 0x18, 0xd7, 0xf5, 0x7c, 0x83, 0x96, 0x0a, 0xdc, 0xf9, 0x15, 0x48, 0x1e, 0x40, 0x73, - 0xaf, 0x92, 0x24, 0x97, 0x38, 0x9a, 0x50, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x52, - 0x31, 0x97, 0x30, 0x58, 0x2a, 0x27, 0x3f, 0x31, 0xc5, 0x37, 0xbf, 0xa8, 0x38, 0x35, 0xb8, 0x24, - 0xb1, 0x24, 0x95, 0x6c, 0x1f, 0x8a, 0x70, 0xb1, 0x16, 0x83, 0x0c, 0x00, 0x7b, 0x90, 0x27, 0x08, - 0xc2, 0xb1, 0xe2, 0x43, 0x75, 0xb8, 0x92, 0x2c, 0x97, 0x34, 0x16, 0x4b, 0x61, 0x6e, 0x32, 0xba, - 0xc3, 0xc8, 0xc5, 0xec, 0x5b, 0x9c, 0x2e, 0x94, 0xc0, 0xc5, 0x83, 0x12, 0xec, 0xca, 0xd8, 0x82, - 0x0b, 0xcd, 0x63, 0x52, 0xda, 0x44, 0x28, 0x82, 0xd9, 0x24, 0x94, 0xc3, 0x25, 0x80, 0xe1, 0x75, - 0x75, 0x9c, 0x06, 0xa0, 0x2a, 0x94, 0xd2, 0x27, 0x52, 0x21, 0xcc, 0x36, 0x29, 0xd6, 0x06, 0x50, - 0x74, 0x3a, 0x05, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x8d, 0x47, 0x72, 0x8c, - 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, - 0x0c, 0x51, 0x46, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x20, 0xf3, - 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0xb1, 0xc6, 0x74, 0x49, 0x65, 0x41, 0x6a, - 0x71, 0x12, 0x1b, 0x38, 0xa9, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x61, 0x68, 0x19, - 0x5b, 0x03, 0x00, 0x00, + 0xa2, 0xf2, 0x58, 0x5c, 0x53, 0x90, 0x58, 0x94, 0x98, 0x0b, 0xd3, 0x26, 0x87, 0xcd, 0xb9, 0x95, + 0x05, 0xa9, 0x50, 0x79, 0xa5, 0x83, 0x8c, 0x5c, 0xfc, 0xbe, 0xc5, 0xe9, 0xa1, 0x05, 0x29, 0x89, + 0x25, 0xa9, 0x01, 0x60, 0x9d, 0x42, 0x66, 0x5c, 0x9c, 0x89, 0xa5, 0x25, 0x19, 0xf9, 0x45, 0x99, + 0x25, 0x95, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x4e, 0x12, 0x97, 0xb6, 0xe8, 0x8a, 0x40, 0xdd, + 0xe3, 0x98, 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x1c, 0x5c, 0x52, 0x94, 0x99, 0x97, 0x1e, 0x84, 0x50, + 0x2a, 0x64, 0xcb, 0xc5, 0x06, 0xb1, 0x5b, 0x82, 0x49, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x4a, 0x0f, + 0x33, 0x38, 0xf4, 0x20, 0x76, 0x38, 0x71, 0x9e, 0xb8, 0x27, 0xcf, 0xb0, 0xe2, 0xf9, 0x06, 0x2d, + 0xc6, 0x20, 0xa8, 0x26, 0x2b, 0xf3, 0xa6, 0xe7, 0x1b, 0xb4, 0x10, 0xc6, 0x75, 0x3d, 0xdf, 0xa0, + 0xa5, 0x02, 0x77, 0x7d, 0x05, 0x92, 0xfb, 0xd1, 0xdc, 0xab, 0x24, 0xc9, 0x25, 0x8e, 0x26, 0x14, + 0x94, 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0xaa, 0xb4, 0x80, 0x91, 0x4b, 0x18, 0x2c, 0x97, 0x93, + 0x9f, 0x98, 0xe2, 0x9b, 0x5f, 0x54, 0x9c, 0x1a, 0x5c, 0x92, 0x58, 0x92, 0x4a, 0xb6, 0x17, 0x1d, + 0xb9, 0x58, 0x8b, 0x41, 0x06, 0x40, 0x7d, 0xa8, 0x8a, 0xcd, 0x87, 0x60, 0x6b, 0x1c, 0x93, 0x93, + 0xf3, 0x4b, 0xf3, 0x4a, 0xc0, 0xb6, 0x39, 0xb1, 0x80, 0x3c, 0x1b, 0x04, 0xd1, 0x69, 0xc5, 0x87, + 0xea, 0x4d, 0x25, 0x59, 0x2e, 0x69, 0x2c, 0x2e, 0x84, 0xf9, 0xc0, 0xe8, 0x0e, 0x23, 0x17, 0xb3, + 0x6f, 0x71, 0xba, 0x50, 0x02, 0x17, 0x0f, 0x4a, 0x24, 0x29, 0x63, 0xb5, 0x1a, 0x35, 0x18, 0xa4, + 0xb4, 0x89, 0x50, 0x04, 0xb3, 0x49, 0x28, 0x87, 0x4b, 0x00, 0x23, 0x9c, 0xd4, 0x71, 0x1a, 0x80, + 0xaa, 0x50, 0x4a, 0x9f, 0x48, 0x85, 0x30, 0xdb, 0xa4, 0x58, 0x1b, 0x40, 0x91, 0xef, 0x14, 0x70, + 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x37, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, + 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x19, 0xa5, + 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x83, 0xcc, 0xd7, 0xcd, 0x4b, 0x2d, + 0x29, 0xcf, 0x2f, 0xca, 0xd6, 0xc7, 0x9a, 0x2e, 0xc0, 0xe9, 0x3a, 0x89, 0x0d, 0x9c, 0xb0, 0x8d, + 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x08, 0x00, 0xc7, 0xa9, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -441,13 +442,16 @@ func (m *MsgUploadMorseState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.State) > 0 { - i -= len(m.State) - copy(dAtA[i:], m.State) - i = encodeVarintTx(dAtA, i, uint64(len(m.State))) - i-- - dAtA[i] = 0x12 + { + size, err := m.State.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 if len(m.Authority) > 0 { i -= len(m.Authority) copy(dAtA[i:], m.Authority) @@ -526,10 +530,8 @@ func (m *MsgUploadMorseState) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.State) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } + l = m.State.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -778,7 +780,7 @@ func (m *MsgUploadMorseState) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -788,24 +790,23 @@ func (m *MsgUploadMorseState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.State = append(m.State[:0], dAtA[iNdEx:postIndex]...) - if m.State == nil { - m.State = []byte{} + if err := m.State.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex default: From 25c8f2b8889c87bab94c5173badd2fe2bfdb4d74 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 27 Jan 2025 17:35:42 +0100 Subject: [PATCH 4/6] chore: add response fields --- api/poktroll/migration/tx.pulsar.go | 188 ++++++++++++++++++++++++---- proto/poktroll/migration/tx.proto | 5 +- x/migration/types/tx.pb.go | 148 +++++++++++++++++----- 3 files changed, 285 insertions(+), 56 deletions(-) diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index a7a8a74f1..67bbc6f83 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -1371,12 +1371,16 @@ func (x *fastReflection_MsgUploadMorseState) ProtoMethods() *protoiface.Methods } var ( - md_MsgUploadMorseStateResponse protoreflect.MessageDescriptor + md_MsgUploadMorseStateResponse protoreflect.MessageDescriptor + fd_MsgUploadMorseStateResponse_state_hash protoreflect.FieldDescriptor + fd_MsgUploadMorseStateResponse_num_accounts protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_tx_proto_init() md_MsgUploadMorseStateResponse = File_poktroll_migration_tx_proto.Messages().ByName("MsgUploadMorseStateResponse") + fd_MsgUploadMorseStateResponse_state_hash = md_MsgUploadMorseStateResponse.Fields().ByName("state_hash") + fd_MsgUploadMorseStateResponse_num_accounts = md_MsgUploadMorseStateResponse.Fields().ByName("num_accounts") } var _ protoreflect.Message = (*fastReflection_MsgUploadMorseStateResponse)(nil) @@ -1444,6 +1448,18 @@ func (x *fastReflection_MsgUploadMorseStateResponse) Interface() protoreflect.Pr // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgUploadMorseStateResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.StateHash != "" { + value := protoreflect.ValueOfString(x.StateHash) + if !f(fd_MsgUploadMorseStateResponse_state_hash, value) { + return + } + } + if x.NumAccounts != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumAccounts) + if !f(fd_MsgUploadMorseStateResponse_num_accounts, value) { + return + } + } } // Has reports whether a field is populated. @@ -1459,6 +1475,10 @@ func (x *fastReflection_MsgUploadMorseStateResponse) Range(f func(protoreflect.F // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgUploadMorseStateResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.migration.MsgUploadMorseStateResponse.state_hash": + return x.StateHash != "" + case "poktroll.migration.MsgUploadMorseStateResponse.num_accounts": + return x.NumAccounts != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseStateResponse")) @@ -1475,6 +1495,10 @@ func (x *fastReflection_MsgUploadMorseStateResponse) Has(fd protoreflect.FieldDe // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUploadMorseStateResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.migration.MsgUploadMorseStateResponse.state_hash": + x.StateHash = "" + case "poktroll.migration.MsgUploadMorseStateResponse.num_accounts": + x.NumAccounts = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseStateResponse")) @@ -1491,6 +1515,12 @@ func (x *fastReflection_MsgUploadMorseStateResponse) Clear(fd protoreflect.Field // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgUploadMorseStateResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.migration.MsgUploadMorseStateResponse.state_hash": + value := x.StateHash + return protoreflect.ValueOfString(value) + case "poktroll.migration.MsgUploadMorseStateResponse.num_accounts": + value := x.NumAccounts + return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseStateResponse")) @@ -1511,6 +1541,10 @@ func (x *fastReflection_MsgUploadMorseStateResponse) Get(descriptor protoreflect // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUploadMorseStateResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.migration.MsgUploadMorseStateResponse.state_hash": + x.StateHash = value.Interface().(string) + case "poktroll.migration.MsgUploadMorseStateResponse.num_accounts": + x.NumAccounts = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseStateResponse")) @@ -1531,6 +1565,10 @@ func (x *fastReflection_MsgUploadMorseStateResponse) Set(fd protoreflect.FieldDe // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUploadMorseStateResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.migration.MsgUploadMorseStateResponse.state_hash": + panic(fmt.Errorf("field state_hash of message poktroll.migration.MsgUploadMorseStateResponse is not mutable")) + case "poktroll.migration.MsgUploadMorseStateResponse.num_accounts": + panic(fmt.Errorf("field num_accounts of message poktroll.migration.MsgUploadMorseStateResponse is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseStateResponse")) @@ -1544,6 +1582,10 @@ func (x *fastReflection_MsgUploadMorseStateResponse) Mutable(fd protoreflect.Fie // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgUploadMorseStateResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.migration.MsgUploadMorseStateResponse.state_hash": + return protoreflect.ValueOfString("") + case "poktroll.migration.MsgUploadMorseStateResponse.num_accounts": + return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUploadMorseStateResponse")) @@ -1613,6 +1655,13 @@ func (x *fastReflection_MsgUploadMorseStateResponse) ProtoMethods() *protoiface. var n int var l int _ = l + l = len(x.StateHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.NumAccounts != 0 { + n += 1 + runtime.Sov(uint64(x.NumAccounts)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1642,6 +1691,18 @@ func (x *fastReflection_MsgUploadMorseStateResponse) ProtoMethods() *protoiface. i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.NumAccounts != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumAccounts)) + i-- + dAtA[i] = 0x10 + } + if len(x.StateHash) > 0 { + i -= len(x.StateHash) + copy(dAtA[i:], x.StateHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.StateHash))) + i-- + dAtA[i] = 0xa + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -1691,6 +1752,57 @@ func (x *fastReflection_MsgUploadMorseStateResponse) ProtoMethods() *protoiface. return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUploadMorseStateResponse: 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 StateHash", 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.StateHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumAccounts", wireType) + } + x.NumAccounts = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NumAccounts |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1862,6 +1974,9 @@ type MsgUploadMorseStateResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + StateHash string `protobuf:"bytes,1,opt,name=state_hash,json=stateHash,proto3" json:"state_hash,omitempty"` + NumAccounts uint64 `protobuf:"varint,2,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts,omitempty"` } func (x *MsgUploadMorseStateResponse) Reset() { @@ -1884,6 +1999,20 @@ func (*MsgUploadMorseStateResponse) Descriptor() ([]byte, []int) { return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{3} } +func (x *MsgUploadMorseStateResponse) GetStateHash() string { + if x != nil { + return x.StateHash + } + return "" +} + +func (x *MsgUploadMorseStateResponse) GetNumAccounts() uint64 { + if x != nil { + return x.NumAccounts + } + return 0 +} + var File_poktroll_migration_tx_proto protoreflect.FileDescriptor var file_poktroll_migration_tx_proto_rawDesc = []byte{ @@ -1924,34 +2053,41 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x22, 0x1d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, - 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x32, 0xdc, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, + 0x79, 0x22, 0x81, 0x01, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, + 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x33, 0x0a, 0x0c, 0x6e, 0x75, 0x6d, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x10, 0xea, 0xde, 0x1f, 0x0c, 0x6e, 0x75, 0x6d, 0x5f, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x0b, 0x6e, 0x75, 0x6d, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x32, 0xdc, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, + 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x10, 0x55, 0x70, - 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x27, + 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x6c, 0x0a, 0x10, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x2f, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, 0x73, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, + 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb3, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, - 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x2f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, - 0xb3, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, - 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, - 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, - 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, + 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, + 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 1e460d80f..8765b3e03 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -47,5 +47,8 @@ message MsgUploadMorseState { MorseAccountState state = 2 [(gogoproto.nullable) = false]; } -message MsgUploadMorseStateResponse {} +message MsgUploadMorseStateResponse { + string state_hash = 1 [(gogoproto.jsontag) = "state_hash"]; + uint64 num_accounts = 2 [(gogoproto.jsontag) = "num_accounts"]; +} diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 8d81fe11b..e7bd9367a 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -167,6 +167,8 @@ func (m *MsgUploadMorseState) GetState() MorseAccountState { } type MsgUploadMorseStateResponse struct { + StateHash string `protobuf:"bytes,1,opt,name=state_hash,json=stateHash,proto3" json:"state_hash"` + NumAccounts uint64 `protobuf:"varint,2,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts"` } func (m *MsgUploadMorseStateResponse) Reset() { *m = MsgUploadMorseStateResponse{} } @@ -198,6 +200,20 @@ func (m *MsgUploadMorseStateResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUploadMorseStateResponse proto.InternalMessageInfo +func (m *MsgUploadMorseStateResponse) GetStateHash() string { + if m != nil { + return m.StateHash + } + return "" +} + +func (m *MsgUploadMorseStateResponse) GetNumAccounts() uint64 { + if m != nil { + return m.NumAccounts + } + return 0 +} + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.migration.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.migration.MsgUpdateParamsResponse") @@ -208,35 +224,39 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 446 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0xcf, 0xcd, 0x4c, 0x2f, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, - 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0x49, 0xea, 0xc1, 0x25, 0xa5, 0x04, - 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x99, 0x94, 0x78, 0x72, 0x7e, 0x71, 0x6e, - 0x7e, 0xb1, 0x7e, 0x6e, 0x71, 0xba, 0x7e, 0x99, 0x21, 0x88, 0x82, 0x4a, 0x48, 0x42, 0x24, 0xe2, - 0xc1, 0x3c, 0x7d, 0x08, 0x07, 0x2a, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x11, 0x07, 0xb1, 0xa0, - 0xa2, 0xf2, 0x58, 0x5c, 0x53, 0x90, 0x58, 0x94, 0x98, 0x0b, 0xd3, 0x26, 0x87, 0xcd, 0xb9, 0x95, - 0x05, 0xa9, 0x50, 0x79, 0xa5, 0x83, 0x8c, 0x5c, 0xfc, 0xbe, 0xc5, 0xe9, 0xa1, 0x05, 0x29, 0x89, - 0x25, 0xa9, 0x01, 0x60, 0x9d, 0x42, 0x66, 0x5c, 0x9c, 0x89, 0xa5, 0x25, 0x19, 0xf9, 0x45, 0x99, - 0x25, 0x95, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x4e, 0x12, 0x97, 0xb6, 0xe8, 0x8a, 0x40, 0xdd, - 0xe3, 0x98, 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x1c, 0x5c, 0x52, 0x94, 0x99, 0x97, 0x1e, 0x84, 0x50, - 0x2a, 0x64, 0xcb, 0xc5, 0x06, 0xb1, 0x5b, 0x82, 0x49, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x4a, 0x0f, - 0x33, 0x38, 0xf4, 0x20, 0x76, 0x38, 0x71, 0x9e, 0xb8, 0x27, 0xcf, 0xb0, 0xe2, 0xf9, 0x06, 0x2d, - 0xc6, 0x20, 0xa8, 0x26, 0x2b, 0xf3, 0xa6, 0xe7, 0x1b, 0xb4, 0x10, 0xc6, 0x75, 0x3d, 0xdf, 0xa0, - 0xa5, 0x02, 0x77, 0x7d, 0x05, 0x92, 0xfb, 0xd1, 0xdc, 0xab, 0x24, 0xc9, 0x25, 0x8e, 0x26, 0x14, - 0x94, 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0xaa, 0xb4, 0x80, 0x91, 0x4b, 0x18, 0x2c, 0x97, 0x93, - 0x9f, 0x98, 0xe2, 0x9b, 0x5f, 0x54, 0x9c, 0x1a, 0x5c, 0x92, 0x58, 0x92, 0x4a, 0xb6, 0x17, 0x1d, - 0xb9, 0x58, 0x8b, 0x41, 0x06, 0x40, 0x7d, 0xa8, 0x8a, 0xcd, 0x87, 0x60, 0x6b, 0x1c, 0x93, 0x93, - 0xf3, 0x4b, 0xf3, 0x4a, 0xc0, 0xb6, 0x39, 0xb1, 0x80, 0x3c, 0x1b, 0x04, 0xd1, 0x69, 0xc5, 0x87, - 0xea, 0x4d, 0x25, 0x59, 0x2e, 0x69, 0x2c, 0x2e, 0x84, 0xf9, 0xc0, 0xe8, 0x0e, 0x23, 0x17, 0xb3, - 0x6f, 0x71, 0xba, 0x50, 0x02, 0x17, 0x0f, 0x4a, 0x24, 0x29, 0x63, 0xb5, 0x1a, 0x35, 0x18, 0xa4, - 0xb4, 0x89, 0x50, 0x04, 0xb3, 0x49, 0x28, 0x87, 0x4b, 0x00, 0x23, 0x9c, 0xd4, 0x71, 0x1a, 0x80, - 0xaa, 0x50, 0x4a, 0x9f, 0x48, 0x85, 0x30, 0xdb, 0xa4, 0x58, 0x1b, 0x40, 0x91, 0xef, 0x14, 0x70, - 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x37, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, - 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x19, 0xa5, - 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x83, 0xcc, 0xd7, 0xcd, 0x4b, 0x2d, - 0x29, 0xcf, 0x2f, 0xca, 0xd6, 0xc7, 0x9a, 0x2e, 0xc0, 0xe9, 0x3a, 0x89, 0x0d, 0x9c, 0xb0, 0x8d, - 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x08, 0x00, 0xc7, 0xa9, 0x03, 0x00, 0x00, + // 503 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x31, 0x6b, 0xdb, 0x40, + 0x14, 0xf6, 0xb5, 0x49, 0xc0, 0x97, 0x90, 0xa6, 0x6a, 0x20, 0x8e, 0x02, 0x72, 0x70, 0x5b, 0x1a, + 0x5c, 0xac, 0xa3, 0x0e, 0xb4, 0x10, 0xe8, 0x60, 0x4d, 0x5d, 0x0c, 0x41, 0xa1, 0x4b, 0x17, 0xf7, + 0x62, 0x0b, 0x49, 0xc4, 0xd2, 0x13, 0x77, 0xa7, 0x36, 0xd9, 0xda, 0x8e, 0x9d, 0xfa, 0x13, 0x3a, + 0x76, 0xf4, 0xd0, 0x3f, 0xd0, 0x2d, 0x63, 0xe8, 0x94, 0xa1, 0x98, 0x62, 0x0f, 0x86, 0xfc, 0x8a, + 0xa2, 0xbb, 0x93, 0x13, 0x25, 0x2a, 0x84, 0x2c, 0xd2, 0xdd, 0xfb, 0xde, 0x7b, 0xdf, 0xf7, 0xdd, + 0xbd, 0xc3, 0x5b, 0x09, 0x1c, 0x09, 0x06, 0xc3, 0x21, 0x89, 0x42, 0x9f, 0x51, 0x11, 0x42, 0x4c, + 0xc4, 0xb1, 0x9d, 0x30, 0x10, 0x60, 0x18, 0x39, 0x68, 0xcf, 0x41, 0xf3, 0x21, 0x8d, 0xc2, 0x18, + 0x88, 0xfc, 0xaa, 0x34, 0x73, 0xa3, 0x0f, 0x3c, 0x02, 0x4e, 0x22, 0xee, 0x93, 0x0f, 0x2f, 0xb2, + 0x9f, 0x06, 0x36, 0x15, 0xd0, 0x93, 0x3b, 0xa2, 0x36, 0x1a, 0x5a, 0xf7, 0xc1, 0x07, 0x15, 0xcf, + 0x56, 0x3a, 0x5a, 0x2f, 0x51, 0x93, 0x50, 0x46, 0xa3, 0xbc, 0xcc, 0x2a, 0x93, 0x7b, 0x92, 0x78, + 0x1a, 0x6f, 0xfc, 0x42, 0xf8, 0x41, 0x97, 0xfb, 0x6f, 0x93, 0x01, 0x15, 0xde, 0xbe, 0xac, 0x34, + 0x5e, 0xe2, 0x2a, 0x4d, 0x45, 0x00, 0x2c, 0x14, 0x27, 0x35, 0xb4, 0x8d, 0x76, 0xaa, 0x4e, 0xed, + 0xf7, 0xcf, 0xd6, 0xba, 0xd6, 0xd3, 0x19, 0x0c, 0x98, 0xc7, 0xf9, 0x81, 0x60, 0x61, 0xec, 0xbb, + 0x97, 0xa9, 0xc6, 0x6b, 0xbc, 0xa4, 0xb8, 0x6b, 0xf7, 0xb6, 0xd1, 0xce, 0x72, 0xdb, 0xb4, 0x6f, + 0x1e, 0x87, 0xad, 0x38, 0x9c, 0xea, 0xe9, 0xb8, 0x5e, 0xf9, 0x31, 0x1b, 0x35, 0x91, 0xab, 0x8b, + 0xf6, 0x5e, 0x7d, 0x99, 0x8d, 0x9a, 0x97, 0xed, 0xbe, 0xce, 0x46, 0xcd, 0x27, 0x73, 0xf5, 0xc7, + 0x57, 0xf4, 0x5f, 0xd3, 0xdb, 0xd8, 0xc4, 0x1b, 0xd7, 0x42, 0xae, 0xc7, 0x13, 0x88, 0xb9, 0xd7, + 0xf8, 0x8e, 0xf0, 0x23, 0x89, 0x0d, 0x81, 0x0e, 0xba, 0xc0, 0xb8, 0x77, 0x20, 0xa8, 0xf0, 0xee, + 0x6c, 0xb1, 0x83, 0x17, 0x79, 0xd6, 0x40, 0x3b, 0x7c, 0x5a, 0xe6, 0x50, 0xd2, 0x74, 0xfa, 0x7d, + 0x48, 0x63, 0x21, 0xd9, 0x9c, 0x85, 0xcc, 0xac, 0xab, 0x2a, 0xf7, 0x56, 0x8b, 0x36, 0x1b, 0x9f, + 0x11, 0xde, 0x2a, 0x91, 0x98, 0x5b, 0x30, 0x5a, 0x18, 0xcb, 0xc2, 0x5e, 0x40, 0x79, 0xa0, 0xb5, + 0xae, 0x5e, 0x8c, 0xeb, 0x57, 0xa2, 0x6e, 0x55, 0xae, 0xdf, 0x50, 0x1e, 0x18, 0xbb, 0x78, 0x25, + 0x4e, 0xa3, 0x1e, 0x55, 0xfc, 0xea, 0x2a, 0x16, 0x9c, 0xb5, 0x8b, 0x71, 0xbd, 0x10, 0x77, 0x97, + 0xe3, 0x34, 0xd2, 0x22, 0x79, 0xfb, 0x0f, 0xc2, 0xf7, 0xbb, 0xdc, 0x37, 0xde, 0xe3, 0x95, 0xc2, + 0x24, 0x3c, 0x2e, 0xf5, 0x57, 0x3c, 0x6b, 0xf3, 0xf9, 0x2d, 0x92, 0xe6, 0x6e, 0x86, 0x78, 0xed, + 0xc6, 0x65, 0x3c, 0xfb, 0x6f, 0x83, 0x62, 0xa2, 0x49, 0x6e, 0x99, 0x98, 0xb3, 0x99, 0x8b, 0x9f, + 0xb2, 0x09, 0x73, 0xf6, 0x4f, 0x27, 0x16, 0x3a, 0x9b, 0x58, 0xe8, 0x7c, 0x62, 0xa1, 0xbf, 0x13, + 0x0b, 0x7d, 0x9b, 0x5a, 0x95, 0xb3, 0xa9, 0x55, 0x39, 0x9f, 0x5a, 0x95, 0x77, 0x6d, 0x3f, 0x14, + 0x41, 0x7a, 0x68, 0xf7, 0x21, 0x22, 0x59, 0xff, 0x56, 0xec, 0x89, 0x8f, 0xc0, 0x8e, 0x48, 0xe9, + 0xf0, 0xc9, 0xc7, 0x73, 0xb8, 0x24, 0x5f, 0xcf, 0xee, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x14, + 0xac, 0x1f, 0x83, 0x0e, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -482,6 +502,18 @@ func (m *MsgUploadMorseStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l + if m.NumAccounts != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.NumAccounts)) + i-- + dAtA[i] = 0x10 + } + if len(m.StateHash) > 0 { + i -= len(m.StateHash) + copy(dAtA[i:], m.StateHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.StateHash))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -541,6 +573,13 @@ func (m *MsgUploadMorseStateResponse) Size() (n int) { } var l int _ = l + l = len(m.StateHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.NumAccounts != 0 { + n += 1 + sovTx(uint64(m.NumAccounts)) + } return n } @@ -859,6 +898,57 @@ func (m *MsgUploadMorseStateResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgUploadMorseStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateHash", 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.StateHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumAccounts", wireType) + } + m.NumAccounts = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumAccounts |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From d77af3078dc45dfaf0d76dd7f4dd3adc912f9ce5 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 27 Jan 2025 17:40:45 +0100 Subject: [PATCH 5/6] chore: skip autocli for UploadMoreState method --- x/migration/module/autocli.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index 4aa553cb7..1f46d0432 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -29,12 +29,13 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Skip: true, // skipped because authority gated }, { - RpcMethod: "UploadMorseState", - Use: "upload-morse-state [state]", - Short: "Send a upload-morse-state tx", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "state"},}, - }, - // this line is used by ignite scaffolding # autocli/tx + RpcMethod: "UploadMorseState", + Use: "upload-morse-state [state]", + Short: "Send a upload-morse-state tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "state"}}, + Skip: true, // skipped because authority gated + }, + // this line is used by ignite scaffolding # autocli/tx }, }, } From 1094a7ceb673833b4c527c8becf15da16a929809 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 27 Jan 2025 17:51:32 +0100 Subject: [PATCH 6/6] fix: linter errors --- .../keeper/msg_server_upload_morse_state.go | 10 ++++----- x/migration/module/simulation.go | 22 +++++++++---------- x/migration/simulation/upload_morse_state.go | 5 +++-- x/migration/types/codec.go | 6 ++--- .../types/message_upload_morse_state_test.go | 1 + 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/x/migration/keeper/msg_server_upload_morse_state.go b/x/migration/keeper/msg_server_upload_morse_state.go index f65a8a33f..d648ec9a9 100644 --- a/x/migration/keeper/msg_server_upload_morse_state.go +++ b/x/migration/keeper/msg_server_upload_morse_state.go @@ -3,16 +3,16 @@ package keeper import ( "context" - "github.com/pokt-network/poktroll/x/migration/types" sdk "github.com/cosmos/cosmos-sdk/types" -) + "github.com/pokt-network/poktroll/x/migration/types" +) -func (k msgServer) UploadMorseState(goCtx context.Context, msg *types.MsgUploadMorseState) (*types.MsgUploadMorseStateResponse, error) { +func (k msgServer) UploadMorseState(goCtx context.Context, msg *types.MsgUploadMorseState) (*types.MsgUploadMorseStateResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - // TODO: Handling the message - _ = ctx + // TODO: Handling the message + _ = ctx return &types.MsgUploadMorseStateResponse{}, nil } diff --git a/x/migration/module/simulation.go b/x/migration/module/simulation.go index e21413a83..74bcd9a3e 100644 --- a/x/migration/module/simulation.go +++ b/x/migration/module/simulation.go @@ -23,7 +23,7 @@ var ( ) const ( - opWeightMsgUploadMorseState = "op_weight_msg_upload_morse_state" + opWeightMsgUploadMorseState = "op_weight_msg_upload_morse_state" // TODO: Determine the simulation weight value defaultWeightMsgUploadMorseState int = 100 @@ -37,7 +37,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { accs[i] = acc.Address.String() } migrationGenesis := types.GenesisState{ - Params: types.DefaultParams(), + Params: types.DefaultParams(), // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&migrationGenesis) @@ -69,14 +69,14 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp // ProposalMsgs returns msgs used for governance proposals for simulations. func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { return []simtypes.WeightedProposalMsg{ - simulation.NewWeightedProposalMsg( - opWeightMsgUploadMorseState, - defaultWeightMsgUploadMorseState, - func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { - migrationsimulation.SimulateMsgUploadMorseState(am.accountKeeper, am.bankKeeper, am.keeper) - return nil - }, -), -// this line is used by starport scaffolding # simapp/module/OpMsg + simulation.NewWeightedProposalMsg( + opWeightMsgUploadMorseState, + defaultWeightMsgUploadMorseState, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + migrationsimulation.SimulateMsgUploadMorseState(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, + ), + // this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/migration/simulation/upload_morse_state.go b/x/migration/simulation/upload_morse_state.go index 5b95864a1..e8fb24b84 100644 --- a/x/migration/simulation/upload_morse_state.go +++ b/x/migration/simulation/upload_morse_state.go @@ -3,11 +3,12 @@ package simulation import ( "math/rand" - "github.com/pokt-network/poktroll/x/migration/keeper" - "github.com/pokt-network/poktroll/x/migration/types" "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + + "github.com/pokt-network/poktroll/x/migration/keeper" + "github.com/pokt-network/poktroll/x/migration/types" ) func SimulateMsgUploadMorseState( diff --git a/x/migration/types/codec.go b/x/migration/types/codec.go index 3710778b2..7eec035d4 100644 --- a/x/migration/types/codec.go +++ b/x/migration/types/codec.go @@ -9,9 +9,9 @@ import ( func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgUploadMorseState{}, -) -// this line is used by starport scaffolding # 3 + &MsgUploadMorseState{}, + ) + // this line is used by starport scaffolding # 3 registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}, diff --git a/x/migration/types/message_upload_morse_state_test.go b/x/migration/types/message_upload_morse_state_test.go index 9908bbe9c..84a2814a8 100644 --- a/x/migration/types/message_upload_morse_state_test.go +++ b/x/migration/types/message_upload_morse_state_test.go @@ -5,6 +5,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/testutil/sample" )