From 7cdced618dc95caaa1ca691699ad1b4ddfac66b9 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 29 Jan 2025 15:17:47 +0100 Subject: [PATCH 01/81] refactor: fixture generator testutil (cherry picked from commit 71f51129c275dcce267999c88027fbb07a6b39f9) --- cmd/poktrolld/cmd/migrate/migrate_test.go | 100 +---------------- testutil/testmigration/fixtures.go | 131 ++++++++++++++++++++++ 2 files changed, 135 insertions(+), 96 deletions(-) create mode 100644 testutil/testmigration/fixtures.go diff --git a/cmd/poktrolld/cmd/migrate/migrate_test.go b/cmd/poktrolld/cmd/migrate/migrate_test.go index 981950139..7fc11035c 100644 --- a/cmd/poktrolld/cmd/migrate/migrate_test.go +++ b/cmd/poktrolld/cmd/migrate/migrate_test.go @@ -1,22 +1,17 @@ package migrate import ( - "encoding/binary" "fmt" "math" - "math/rand" "os" "path/filepath" "testing" - cometcrypto "github.com/cometbft/cometbft/crypto/ed25519" cmtjson "github.com/cometbft/cometbft/libs/json" - cosmostypes "github.com/cosmos/cosmos-sdk/types" - "github.com/regen-network/gocuke" "github.com/stretchr/testify/require" - "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/pkg/polylog/polyzero" + "github.com/pokt-network/poktroll/testutil/testmigration" migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) @@ -37,7 +32,7 @@ func TestCollectMorseAccounts(t *testing.T) { require.NoError(t, err) // Generate and write the MorseStateExport input JSON file. - morseStateExportBz, morseAccountStateBz := newMorseStateExportAndAccountState(t, 10) + morseStateExportBz, morseAccountStateBz := testmigration.NewMorseStateExportAndAccountStateBytes(t, 10) _, err = inputFile.Write(morseStateExportBz) require.NoError(t, err) @@ -71,7 +66,7 @@ func TestNewTestMorseStateExport(t *testing.T) { for i := 1; i < 4; i++ { t.Run(fmt.Sprintf("num_accounts=%d", i), func(t *testing.T) { morseStateExport := new(migrationtypes.MorseStateExport) - stateExportBz, _ := newMorseStateExportAndAccountState(t, i) + stateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes(t, i) err := cmtjson.Unmarshal(stateExportBz, morseStateExport) require.NoError(t, err) @@ -112,7 +107,7 @@ func BenchmarkTransformMorseState(b *testing.B) { for i := 0; i < 5; i++ { numAccounts := int(math.Pow10(i + 1)) morseStateExport := new(migrationtypes.MorseStateExport) - morseStateExportBz, _ := newMorseStateExportAndAccountState(b, numAccounts) + morseStateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes(b, numAccounts) err := cmtjson.Unmarshal(morseStateExportBz, morseStateExport) require.NoError(b, err) @@ -128,90 +123,3 @@ func BenchmarkTransformMorseState(b *testing.B) { }) } } - -// TODO_CONSIDERATION: Test/benchmark execution speed can be optimized by refactoring this to a pre-generate fixture. -func newMorseStateExportAndAccountState( - t gocuke.TestingT, - numAccounts int, -) (morseStateExportBz []byte, morseAccountStateBz []byte) { - morseStateExport := &migrationtypes.MorseStateExport{ - AppHash: "", - AppState: &migrationtypes.MorseTendermintAppState{ - Application: &migrationtypes.MorseApplications{}, - Auth: &migrationtypes.MorseAuth{}, - Pos: &migrationtypes.MorsePos{}, - }, - } - - morseAccountState := &migrationtypes.MorseAccountState{ - Accounts: make([]*migrationtypes.MorseClaimableAccount, numAccounts), - } - - for i := 1; i < numAccounts+1; i++ { - seedUint := rand.Uint64() - seedBz := make([]byte, 8) - binary.LittleEndian.PutUint64(seedBz, seedUint) - privKey := cometcrypto.GenPrivKeyFromSecret(seedBz) - pubKey := privKey.PubKey() - balanceAmount := int64(1e6*i + i) // i_000_00i - appStakeAmount := int64(1e5*i + (i * 10)) // i00_0i0 - supplierStakeAmount := int64(1e4*i + (i * 100)) // i0_i00 - - // Add an account. - morseStateExport.AppState.Auth.Accounts = append( - morseStateExport.AppState.Auth.Accounts, - &migrationtypes.MorseAuthAccount{ - Type: "posmint/Account", - Value: &migrationtypes.MorseAccount{ - Address: pubKey.Address(), - Coins: cosmostypes.NewCoins(cosmostypes.NewInt64Coin(volatile.DenomuPOKT, balanceAmount)), - PubKey: &migrationtypes.MorsePublicKey{ - Value: pubKey.Bytes(), - }, - }, - }, - ) - - // Add an application. - morseStateExport.AppState.Application.Applications = append( - morseStateExport.AppState.Application.Applications, - &migrationtypes.MorseApplication{ - Address: pubKey.Address(), - PublicKey: pubKey.Bytes(), - Jailed: false, - Status: 2, - StakedTokens: fmt.Sprintf("%d", appStakeAmount), - }, - ) - - // Add a supplier. - morseStateExport.AppState.Pos.Validators = append( - morseStateExport.AppState.Pos.Validators, - &migrationtypes.MorseValidator{ - Address: pubKey.Address(), - PublicKey: pubKey.Bytes(), - Jailed: false, - Status: 2, - StakedTokens: fmt.Sprintf("%d", supplierStakeAmount), - }, - ) - - // Add the account to the morseAccountState. - morseAccountState.Accounts[i-1] = &migrationtypes.MorseClaimableAccount{ - Address: pubKey.Address(), - UnstakedBalance: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, balanceAmount), - SupplierStake: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, supplierStakeAmount), - ApplicationStake: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, appStakeAmount), - PublicKey: pubKey.Bytes(), - } - } - - var err error - morseStateExportBz, err = cmtjson.Marshal(morseStateExport) - require.NoError(t, err) - - morseAccountStateBz, err = cmtjson.Marshal(morseAccountState) - require.NoError(t, err) - - return morseStateExportBz, morseAccountStateBz -} diff --git a/testutil/testmigration/fixtures.go b/testutil/testmigration/fixtures.go new file mode 100644 index 000000000..d4db4cfcc --- /dev/null +++ b/testutil/testmigration/fixtures.go @@ -0,0 +1,131 @@ +package testmigration + +import ( + "encoding/binary" + "fmt" + "math/rand" + + cometcrypto "github.com/cometbft/cometbft/crypto/ed25519" + cmtjson "github.com/cometbft/cometbft/libs/json" + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/regen-network/gocuke" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/app/volatile" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" +) + +// NewMorseStateExportAndAccountStateBytes returns: +// - A serialized MorseStateExport. +// This is the JSON output of `pocket util export-genesis-for-reset`. +// It is used to generate the MorseAccountState. +// - Its corresponding MorseAccountState. +// This is the JSON output of `poktrolld migrate collect-morse-accounts`. +// It is used to persist the canonical Morse migration state from on Shannon. +// +// The states are populated with: +// - Random account addresses +// - Monotonically increasing balances/stakes +// - One application per account +// - One supplier per account +func NewMorseStateExportAndAccountStateBytes( + t gocuke.TestingT, + numAccounts int, +) (morseStateExportBz []byte, morseAccountStateBz []byte) { + morseStateExport, morseAccountState := NewMorseStateExportAndAccountState(t, numAccounts) + + var err error + morseStateExportBz, err = cmtjson.Marshal(morseStateExport) + require.NoError(t, err) + + morseAccountStateBz, err = cmtjson.Marshal(morseAccountState) + require.NoError(t, err) + + return morseStateExportBz, morseAccountStateBz +} + +// NewMorseStateExportAndAccountState returns MorseStateExport and MorseAccountState +// structs populated with: +// - Random account addresses +// - Monotonically increasing balances/stakes +// - One application per account +// - One supplier per account +func NewMorseStateExportAndAccountState( + t gocuke.TestingT, numAccounts int, +) (export *migrationtypes.MorseStateExport, state *migrationtypes.MorseAccountState) { + t.Helper() + + morseStateExport := &migrationtypes.MorseStateExport{ + AppHash: "", + AppState: &migrationtypes.MorseTendermintAppState{ + Application: &migrationtypes.MorseApplications{}, + Auth: &migrationtypes.MorseAuth{}, + Pos: &migrationtypes.MorsePos{}, + }, + } + + morseAccountState := &migrationtypes.MorseAccountState{ + Accounts: make([]*migrationtypes.MorseClaimableAccount, numAccounts), + } + + for i := 1; i < numAccounts+1; i++ { + seedUint := rand.Uint64() + seedBz := make([]byte, 8) + binary.LittleEndian.PutUint64(seedBz, seedUint) + privKey := cometcrypto.GenPrivKeyFromSecret(seedBz) + pubKey := privKey.PubKey() + balanceAmount := int64(1e6*i + i) // i_000_00i + appStakeAmount := int64(1e5*i + (i * 10)) // i00_0i0 + supplierStakeAmount := int64(1e4*i + (i * 100)) // i0_i00 + + // Add an account. + morseStateExport.AppState.Auth.Accounts = append( + morseStateExport.AppState.Auth.Accounts, + &migrationtypes.MorseAuthAccount{ + Type: "posmint/Account", + Value: &migrationtypes.MorseAccount{ + Address: pubKey.Address(), + Coins: cosmostypes.NewCoins(cosmostypes.NewInt64Coin(volatile.DenomuPOKT, balanceAmount)), + PubKey: &migrationtypes.MorsePublicKey{ + Value: pubKey.Bytes(), + }, + }, + }, + ) + + // Add an application. + morseStateExport.AppState.Application.Applications = append( + morseStateExport.AppState.Application.Applications, + &migrationtypes.MorseApplication{ + Address: pubKey.Address(), + PublicKey: pubKey.Bytes(), + Jailed: false, + Status: 2, + StakedTokens: fmt.Sprintf("%d", appStakeAmount), + }, + ) + + // Add a supplier. + morseStateExport.AppState.Pos.Validators = append( + morseStateExport.AppState.Pos.Validators, + &migrationtypes.MorseValidator{ + Address: pubKey.Address(), + PublicKey: pubKey.Bytes(), + Jailed: false, + Status: 2, + StakedTokens: fmt.Sprintf("%d", supplierStakeAmount), + }, + ) + + // Add the account to the morseAccountState. + morseAccountState.Accounts[i-1] = &migrationtypes.MorseClaimableAccount{ + Address: pubKey.Address(), + UnstakedBalance: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, balanceAmount), + SupplierStake: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, supplierStakeAmount), + ApplicationStake: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, appStakeAmount), + PublicKey: pubKey.Bytes(), + } + } + + return morseStateExport, morseAccountState +} From 7811f493aed6f278fb1d624a1897c38bb9cef184 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 13 Feb 2025 12:22:11 +0100 Subject: [PATCH 02/81] scaffold: message import-morse-claimable-accounts --module migration --signer authority --- api/poktroll/migration/event.pulsar.go | 713 ++++++++++++ api/poktroll/migration/tx.pulsar.go | 1015 ++++++++++++++++- api/poktroll/migration/tx_grpc.pb.go | 40 +- proto/poktroll/migration/tx.proto | 31 +- ..._server_import_morse_claimable_accounts.go | 18 + x/migration/module/autocli.go | 6 + x/migration/module/simulation.go | 25 +- .../import_morse_claimable_accounts.go | 29 + x/migration/types/codec.go | 3 + ...message_import_morse_claimable_accounts.go | 25 + ...ge_import_morse_claimable_accounts_test.go | 40 + x/migration/types/tx.pb.go | 396 ++++++- 12 files changed, 2286 insertions(+), 55 deletions(-) create mode 100644 api/poktroll/migration/event.pulsar.go create mode 100644 x/migration/keeper/msg_server_import_morse_claimable_accounts.go create mode 100644 x/migration/simulation/import_morse_claimable_accounts.go create mode 100644 x/migration/types/message_import_morse_claimable_accounts.go create mode 100644 x/migration/types/message_import_morse_claimable_accounts_test.go diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go new file mode 100644 index 000000000..718a05eec --- /dev/null +++ b/api/poktroll/migration/event.pulsar.go @@ -0,0 +1,713 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package migration + +import ( + _ "cosmossdk.io/api/cosmos/base/v1beta1" + _ "github.com/pokt-network/poktroll/api/poktroll/shared" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_EventCreateMorseAccountState protoreflect.MessageDescriptor + fd_EventCreateMorseAccountState_created_at_height protoreflect.FieldDescriptor + fd_EventCreateMorseAccountState_morse_account_state_hash protoreflect.FieldDescriptor + fd_EventCreateMorseAccountState_num_accounts protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_event_proto_init() + md_EventCreateMorseAccountState = File_poktroll_migration_event_proto.Messages().ByName("EventCreateMorseAccountState") + fd_EventCreateMorseAccountState_created_at_height = md_EventCreateMorseAccountState.Fields().ByName("created_at_height") + fd_EventCreateMorseAccountState_morse_account_state_hash = md_EventCreateMorseAccountState.Fields().ByName("morse_account_state_hash") + fd_EventCreateMorseAccountState_num_accounts = md_EventCreateMorseAccountState.Fields().ByName("num_accounts") +} + +var _ protoreflect.Message = (*fastReflection_EventCreateMorseAccountState)(nil) + +type fastReflection_EventCreateMorseAccountState EventCreateMorseAccountState + +func (x *EventCreateMorseAccountState) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventCreateMorseAccountState)(x) +} + +func (x *EventCreateMorseAccountState) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_event_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventCreateMorseAccountState_messageType fastReflection_EventCreateMorseAccountState_messageType +var _ protoreflect.MessageType = fastReflection_EventCreateMorseAccountState_messageType{} + +type fastReflection_EventCreateMorseAccountState_messageType struct{} + +func (x fastReflection_EventCreateMorseAccountState_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventCreateMorseAccountState)(nil) +} +func (x fastReflection_EventCreateMorseAccountState_messageType) New() protoreflect.Message { + return new(fastReflection_EventCreateMorseAccountState) +} +func (x fastReflection_EventCreateMorseAccountState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventCreateMorseAccountState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventCreateMorseAccountState) Descriptor() protoreflect.MessageDescriptor { + return md_EventCreateMorseAccountState +} + +// 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_EventCreateMorseAccountState) Type() protoreflect.MessageType { + return _fastReflection_EventCreateMorseAccountState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventCreateMorseAccountState) New() protoreflect.Message { + return new(fastReflection_EventCreateMorseAccountState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventCreateMorseAccountState) Interface() protoreflect.ProtoMessage { + return (*EventCreateMorseAccountState)(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_EventCreateMorseAccountState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CreatedAtHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.CreatedAtHeight) + if !f(fd_EventCreateMorseAccountState_created_at_height, value) { + return + } + } + if len(x.MorseAccountStateHash) != 0 { + value := protoreflect.ValueOfBytes(x.MorseAccountStateHash) + if !f(fd_EventCreateMorseAccountState_morse_account_state_hash, value) { + return + } + } + if x.NumAccounts != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumAccounts) + if !f(fd_EventCreateMorseAccountState_num_accounts, 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_EventCreateMorseAccountState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.EventCreateMorseAccountState.created_at_height": + return x.CreatedAtHeight != int64(0) + case "poktroll.migration.EventCreateMorseAccountState.morse_account_state_hash": + return len(x.MorseAccountStateHash) != 0 + case "poktroll.migration.EventCreateMorseAccountState.num_accounts": + return x.NumAccounts != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventCreateMorseAccountState")) + } + panic(fmt.Errorf("message poktroll.migration.EventCreateMorseAccountState 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_EventCreateMorseAccountState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.EventCreateMorseAccountState.created_at_height": + x.CreatedAtHeight = int64(0) + case "poktroll.migration.EventCreateMorseAccountState.morse_account_state_hash": + x.MorseAccountStateHash = nil + case "poktroll.migration.EventCreateMorseAccountState.num_accounts": + x.NumAccounts = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventCreateMorseAccountState")) + } + panic(fmt.Errorf("message poktroll.migration.EventCreateMorseAccountState 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_EventCreateMorseAccountState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.EventCreateMorseAccountState.created_at_height": + value := x.CreatedAtHeight + return protoreflect.ValueOfInt64(value) + case "poktroll.migration.EventCreateMorseAccountState.morse_account_state_hash": + value := x.MorseAccountStateHash + return protoreflect.ValueOfBytes(value) + case "poktroll.migration.EventCreateMorseAccountState.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.EventCreateMorseAccountState")) + } + panic(fmt.Errorf("message poktroll.migration.EventCreateMorseAccountState 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_EventCreateMorseAccountState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.EventCreateMorseAccountState.created_at_height": + x.CreatedAtHeight = value.Int() + case "poktroll.migration.EventCreateMorseAccountState.morse_account_state_hash": + x.MorseAccountStateHash = value.Bytes() + case "poktroll.migration.EventCreateMorseAccountState.num_accounts": + x.NumAccounts = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventCreateMorseAccountState")) + } + panic(fmt.Errorf("message poktroll.migration.EventCreateMorseAccountState 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_EventCreateMorseAccountState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.EventCreateMorseAccountState.created_at_height": + panic(fmt.Errorf("field created_at_height of message poktroll.migration.EventCreateMorseAccountState is not mutable")) + case "poktroll.migration.EventCreateMorseAccountState.morse_account_state_hash": + panic(fmt.Errorf("field morse_account_state_hash of message poktroll.migration.EventCreateMorseAccountState is not mutable")) + case "poktroll.migration.EventCreateMorseAccountState.num_accounts": + panic(fmt.Errorf("field num_accounts of message poktroll.migration.EventCreateMorseAccountState is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventCreateMorseAccountState")) + } + panic(fmt.Errorf("message poktroll.migration.EventCreateMorseAccountState 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_EventCreateMorseAccountState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.EventCreateMorseAccountState.created_at_height": + return protoreflect.ValueOfInt64(int64(0)) + case "poktroll.migration.EventCreateMorseAccountState.morse_account_state_hash": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.EventCreateMorseAccountState.num_accounts": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventCreateMorseAccountState")) + } + panic(fmt.Errorf("message poktroll.migration.EventCreateMorseAccountState 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_EventCreateMorseAccountState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.EventCreateMorseAccountState", 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_EventCreateMorseAccountState) 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_EventCreateMorseAccountState) 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_EventCreateMorseAccountState) 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_EventCreateMorseAccountState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventCreateMorseAccountState) + 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.CreatedAtHeight != 0 { + n += 1 + runtime.Sov(uint64(x.CreatedAtHeight)) + } + l = len(x.MorseAccountStateHash) + 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) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventCreateMorseAccountState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.NumAccounts != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumAccounts)) + i-- + dAtA[i] = 0x18 + } + if len(x.MorseAccountStateHash) > 0 { + i -= len(x.MorseAccountStateHash) + copy(dAtA[i:], x.MorseAccountStateHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseAccountStateHash))) + i-- + dAtA[i] = 0x12 + } + if x.CreatedAtHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CreatedAtHeight)) + i-- + dAtA[i] = 0x8 + } + 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().(*EventCreateMorseAccountState) + 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: EventCreateMorseAccountState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventCreateMorseAccountState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreatedAtHeight", wireType) + } + x.CreatedAtHeight = 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.CreatedAtHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MorseAccountStateHash", 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.MorseAccountStateHash = append(x.MorseAccountStateHash[:0], dAtA[iNdEx:postIndex]...) + if x.MorseAccountStateHash == nil { + x.MorseAccountStateHash = []byte{} + } + iNdEx = postIndex + case 3: + 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:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: poktroll/migration/event.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EventUploadMorseState is emitted when the MorseAccountState is created on-chain. +type EventCreateMorseAccountState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The height (on Shannon) at which the MorseAccountState was created on-chain. + CreatedAtHeight int64 `protobuf:"varint,1,opt,name=created_at_height,json=createdAtHeight,proto3" json:"created_at_height,omitempty"` + // The sha256 has of the MorseAccountState. + MorseAccountStateHash []byte `protobuf:"bytes,2,opt,name=morse_account_state_hash,json=morseAccountStateHash,proto3" json:"morse_account_state_hash,omitempty"` + // The number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. + // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. + NumAccounts uint64 `protobuf:"varint,3,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts,omitempty"` +} + +func (x *EventCreateMorseAccountState) Reset() { + *x = EventCreateMorseAccountState{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_event_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventCreateMorseAccountState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventCreateMorseAccountState) ProtoMessage() {} + +// Deprecated: Use EventCreateMorseAccountState.ProtoReflect.Descriptor instead. +func (*EventCreateMorseAccountState) Descriptor() ([]byte, []int) { + return file_poktroll_migration_event_proto_rawDescGZIP(), []int{0} +} + +func (x *EventCreateMorseAccountState) GetCreatedAtHeight() int64 { + if x != nil { + return x.CreatedAtHeight + } + return 0 +} + +func (x *EventCreateMorseAccountState) GetMorseAccountStateHash() []byte { + if x != nil { + return x.MorseAccountStateHash + } + return nil +} + +func (x *EventCreateMorseAccountState) GetNumAccounts() uint64 { + if x != nil { + return x.NumAccounts + } + return 0 +} + +var File_poktroll_migration_event_proto protoreflect.FileDescriptor + +var file_poktroll_migration_event_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x12, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, + 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x6f, + 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xed, 0x01, 0x0a, + 0x1c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x41, 0x0a, + 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, + 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x12, 0x55, 0x0a, 0x18, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x1c, 0xea, 0xde, 0x1f, 0x18, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x52, 0x15, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 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, 0x03, 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, 0x42, 0xb6, 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, 0x0a, 0x45, 0x76, 0x65, + 0x6e, 0x74, 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 ( + file_poktroll_migration_event_proto_rawDescOnce sync.Once + file_poktroll_migration_event_proto_rawDescData = file_poktroll_migration_event_proto_rawDesc +) + +func file_poktroll_migration_event_proto_rawDescGZIP() []byte { + file_poktroll_migration_event_proto_rawDescOnce.Do(func() { + file_poktroll_migration_event_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_migration_event_proto_rawDescData) + }) + return file_poktroll_migration_event_proto_rawDescData +} + +var file_poktroll_migration_event_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_migration_event_proto_goTypes = []interface{}{ + (*EventCreateMorseAccountState)(nil), // 0: poktroll.migration.EventCreateMorseAccountState +} +var file_poktroll_migration_event_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_poktroll_migration_event_proto_init() } +func file_poktroll_migration_event_proto_init() { + if File_poktroll_migration_event_proto != nil { + return + } + file_poktroll_migration_morse_onchain_proto_init() + if !protoimpl.UnsafeEnabled { + file_poktroll_migration_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventCreateMorseAccountState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_poktroll_migration_event_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_migration_event_proto_goTypes, + DependencyIndexes: file_poktroll_migration_event_proto_depIdxs, + MessageInfos: file_poktroll_migration_event_proto_msgTypes, + }.Build() + File_poktroll_migration_event_proto = out.File + file_poktroll_migration_event_proto_rawDesc = nil + file_poktroll_migration_event_proto_goTypes = nil + file_poktroll_migration_event_proto_depIdxs = nil +} diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index f7af6fa34..2971caed4 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -871,6 +871,846 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } +var ( + md_MsgImportMorseClaimableAccounts protoreflect.MessageDescriptor + fd_MsgImportMorseClaimableAccounts_authority protoreflect.FieldDescriptor + fd_MsgImportMorseClaimableAccounts_morseAccountState protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_tx_proto_init() + md_MsgImportMorseClaimableAccounts = File_poktroll_migration_tx_proto.Messages().ByName("MsgImportMorseClaimableAccounts") + fd_MsgImportMorseClaimableAccounts_authority = md_MsgImportMorseClaimableAccounts.Fields().ByName("authority") + fd_MsgImportMorseClaimableAccounts_morseAccountState = md_MsgImportMorseClaimableAccounts.Fields().ByName("morseAccountState") +} + +var _ protoreflect.Message = (*fastReflection_MsgImportMorseClaimableAccounts)(nil) + +type fastReflection_MsgImportMorseClaimableAccounts MsgImportMorseClaimableAccounts + +func (x *MsgImportMorseClaimableAccounts) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgImportMorseClaimableAccounts)(x) +} + +func (x *MsgImportMorseClaimableAccounts) 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_MsgImportMorseClaimableAccounts_messageType fastReflection_MsgImportMorseClaimableAccounts_messageType +var _ protoreflect.MessageType = fastReflection_MsgImportMorseClaimableAccounts_messageType{} + +type fastReflection_MsgImportMorseClaimableAccounts_messageType struct{} + +func (x fastReflection_MsgImportMorseClaimableAccounts_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgImportMorseClaimableAccounts)(nil) +} +func (x fastReflection_MsgImportMorseClaimableAccounts_messageType) New() protoreflect.Message { + return new(fastReflection_MsgImportMorseClaimableAccounts) +} +func (x fastReflection_MsgImportMorseClaimableAccounts_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgImportMorseClaimableAccounts +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgImportMorseClaimableAccounts) Descriptor() protoreflect.MessageDescriptor { + return md_MsgImportMorseClaimableAccounts +} + +// 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_MsgImportMorseClaimableAccounts) Type() protoreflect.MessageType { + return _fastReflection_MsgImportMorseClaimableAccounts_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgImportMorseClaimableAccounts) New() protoreflect.Message { + return new(fastReflection_MsgImportMorseClaimableAccounts) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgImportMorseClaimableAccounts) Interface() protoreflect.ProtoMessage { + return (*MsgImportMorseClaimableAccounts)(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_MsgImportMorseClaimableAccounts) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgImportMorseClaimableAccounts_authority, value) { + return + } + } + if x.MorseAccountState != "" { + value := protoreflect.ValueOfString(x.MorseAccountState) + if !f(fd_MsgImportMorseClaimableAccounts_morseAccountState, 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_MsgImportMorseClaimableAccounts) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MsgImportMorseClaimableAccounts.authority": + return x.Authority != "" + case "poktroll.migration.MsgImportMorseClaimableAccounts.morseAccountState": + return x.MorseAccountState != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccounts")) + } + panic(fmt.Errorf("message poktroll.migration.MsgImportMorseClaimableAccounts 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_MsgImportMorseClaimableAccounts) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MsgImportMorseClaimableAccounts.authority": + x.Authority = "" + case "poktroll.migration.MsgImportMorseClaimableAccounts.morseAccountState": + x.MorseAccountState = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccounts")) + } + panic(fmt.Errorf("message poktroll.migration.MsgImportMorseClaimableAccounts 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_MsgImportMorseClaimableAccounts) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MsgImportMorseClaimableAccounts.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "poktroll.migration.MsgImportMorseClaimableAccounts.morseAccountState": + value := x.MorseAccountState + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccounts")) + } + panic(fmt.Errorf("message poktroll.migration.MsgImportMorseClaimableAccounts 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_MsgImportMorseClaimableAccounts) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MsgImportMorseClaimableAccounts.authority": + x.Authority = value.Interface().(string) + case "poktroll.migration.MsgImportMorseClaimableAccounts.morseAccountState": + x.MorseAccountState = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccounts")) + } + panic(fmt.Errorf("message poktroll.migration.MsgImportMorseClaimableAccounts 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_MsgImportMorseClaimableAccounts) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgImportMorseClaimableAccounts.authority": + panic(fmt.Errorf("field authority of message poktroll.migration.MsgImportMorseClaimableAccounts is not mutable")) + case "poktroll.migration.MsgImportMorseClaimableAccounts.morseAccountState": + panic(fmt.Errorf("field morseAccountState of message poktroll.migration.MsgImportMorseClaimableAccounts is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccounts")) + } + panic(fmt.Errorf("message poktroll.migration.MsgImportMorseClaimableAccounts 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_MsgImportMorseClaimableAccounts) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgImportMorseClaimableAccounts.authority": + return protoreflect.ValueOfString("") + case "poktroll.migration.MsgImportMorseClaimableAccounts.morseAccountState": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccounts")) + } + panic(fmt.Errorf("message poktroll.migration.MsgImportMorseClaimableAccounts 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_MsgImportMorseClaimableAccounts) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MsgImportMorseClaimableAccounts", 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_MsgImportMorseClaimableAccounts) 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_MsgImportMorseClaimableAccounts) 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_MsgImportMorseClaimableAccounts) 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_MsgImportMorseClaimableAccounts) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgImportMorseClaimableAccounts) + 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.MorseAccountState) + 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().(*MsgImportMorseClaimableAccounts) + 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.MorseAccountState) > 0 { + i -= len(x.MorseAccountState) + copy(dAtA[i:], x.MorseAccountState) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseAccountState))) + 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().(*MsgImportMorseClaimableAccounts) + 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: MsgImportMorseClaimableAccounts: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgImportMorseClaimableAccounts: 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 MorseAccountState", 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.MorseAccountState = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgImportMorseClaimableAccountsResponse protoreflect.MessageDescriptor +) + +func init() { + file_poktroll_migration_tx_proto_init() + md_MsgImportMorseClaimableAccountsResponse = File_poktroll_migration_tx_proto.Messages().ByName("MsgImportMorseClaimableAccountsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgImportMorseClaimableAccountsResponse)(nil) + +type fastReflection_MsgImportMorseClaimableAccountsResponse MsgImportMorseClaimableAccountsResponse + +func (x *MsgImportMorseClaimableAccountsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgImportMorseClaimableAccountsResponse)(x) +} + +func (x *MsgImportMorseClaimableAccountsResponse) 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_MsgImportMorseClaimableAccountsResponse_messageType fastReflection_MsgImportMorseClaimableAccountsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgImportMorseClaimableAccountsResponse_messageType{} + +type fastReflection_MsgImportMorseClaimableAccountsResponse_messageType struct{} + +func (x fastReflection_MsgImportMorseClaimableAccountsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgImportMorseClaimableAccountsResponse)(nil) +} +func (x fastReflection_MsgImportMorseClaimableAccountsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgImportMorseClaimableAccountsResponse) +} +func (x fastReflection_MsgImportMorseClaimableAccountsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgImportMorseClaimableAccountsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgImportMorseClaimableAccountsResponse +} + +// 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_MsgImportMorseClaimableAccountsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgImportMorseClaimableAccountsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) New() protoreflect.Message { + return new(fastReflection_MsgImportMorseClaimableAccountsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgImportMorseClaimableAccountsResponse)(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_MsgImportMorseClaimableAccountsResponse) 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_MsgImportMorseClaimableAccountsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccountsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgImportMorseClaimableAccountsResponse 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_MsgImportMorseClaimableAccountsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccountsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgImportMorseClaimableAccountsResponse 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_MsgImportMorseClaimableAccountsResponse) 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.MsgImportMorseClaimableAccountsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgImportMorseClaimableAccountsResponse 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_MsgImportMorseClaimableAccountsResponse) 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.MsgImportMorseClaimableAccountsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgImportMorseClaimableAccountsResponse 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_MsgImportMorseClaimableAccountsResponse) 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.MsgImportMorseClaimableAccountsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgImportMorseClaimableAccountsResponse 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_MsgImportMorseClaimableAccountsResponse) 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.MsgImportMorseClaimableAccountsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgImportMorseClaimableAccountsResponse 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_MsgImportMorseClaimableAccountsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MsgImportMorseClaimableAccountsResponse", 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_MsgImportMorseClaimableAccountsResponse) 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_MsgImportMorseClaimableAccountsResponse) 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_MsgImportMorseClaimableAccountsResponse) 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_MsgImportMorseClaimableAccountsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgImportMorseClaimableAccountsResponse) + 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().(*MsgImportMorseClaimableAccountsResponse) + 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().(*MsgImportMorseClaimableAccountsResponse) + 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: MsgImportMorseClaimableAccountsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgImportMorseClaimableAccountsResponse: 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 +1732,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 +1798,75 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{1} } +type MsgImportMorseClaimableAccounts struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + MorseAccountState string `protobuf:"bytes,2,opt,name=morseAccountState,proto3" json:"morseAccountState,omitempty"` +} + +func (x *MsgImportMorseClaimableAccounts) Reset() { + *x = MsgImportMorseClaimableAccounts{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgImportMorseClaimableAccounts) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgImportMorseClaimableAccounts) ProtoMessage() {} + +// Deprecated: Use MsgImportMorseClaimableAccounts.ProtoReflect.Descriptor instead. +func (*MsgImportMorseClaimableAccounts) Descriptor() ([]byte, []int) { + return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgImportMorseClaimableAccounts) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgImportMorseClaimableAccounts) GetMorseAccountState() string { + if x != nil { + return x.MorseAccountState + } + return "" +} + +type MsgImportMorseClaimableAccountsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgImportMorseClaimableAccountsResponse) Reset() { + *x = MsgImportMorseClaimableAccountsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgImportMorseClaimableAccountsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgImportMorseClaimableAccountsResponse) ProtoMessage() {} + +// Deprecated: Use MsgImportMorseClaimableAccountsResponse.ProtoReflect.Descriptor instead. +func (*MsgImportMorseClaimableAccountsResponse) 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 +1894,46 @@ 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, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7d, + 0x0a, 0x1f, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, + 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, + 0x2c, 0x0a, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6d, 0x6f, 0x72, 0x73, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x0e, 0x82, + 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x29, 0x0a, + 0x27, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x81, 0x02, 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, 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, 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, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x90, 0x01, 0x0a, 0x1c, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, + 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x12, 0x33, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, + 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, + 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 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, } 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 + (*MsgImportMorseClaimableAccounts)(nil), // 2: poktroll.migration.MsgImportMorseClaimableAccounts + (*MsgImportMorseClaimableAccountsResponse)(nil), // 3: poktroll.migration.MsgImportMorseClaimableAccountsResponse + (*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.ImportMorseClaimableAccounts:input_type -> poktroll.migration.MsgImportMorseClaimableAccounts + 1, // 3: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.MsgUpdateParamsResponse + 3, // 4: poktroll.migration.Msg.ImportMorseClaimableAccounts:output_type -> poktroll.migration.MsgImportMorseClaimableAccountsResponse + 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.(*MsgImportMorseClaimableAccounts); 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.(*MsgImportMorseClaimableAccountsResponse); 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..3c65727fe 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_ImportMorseClaimableAccounts_FullMethodName = "/poktroll.migration.Msg/ImportMorseClaimableAccounts" ) // 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) + ImportMorseClaimableAccounts(ctx context.Context, in *MsgImportMorseClaimableAccounts, opts ...grpc.CallOption) (*MsgImportMorseClaimableAccountsResponse, error) } type msgClient struct { @@ -51,6 +53,16 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) ImportMorseClaimableAccounts(ctx context.Context, in *MsgImportMorseClaimableAccounts, opts ...grpc.CallOption) (*MsgImportMorseClaimableAccountsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgImportMorseClaimableAccountsResponse) + err := c.cc.Invoke(ctx, Msg_ImportMorseClaimableAccounts_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) + ImportMorseClaimableAccounts(context.Context, *MsgImportMorseClaimableAccounts) (*MsgImportMorseClaimableAccountsResponse, 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) ImportMorseClaimableAccounts(context.Context, *MsgImportMorseClaimableAccounts) (*MsgImportMorseClaimableAccountsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ImportMorseClaimableAccounts 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_ImportMorseClaimableAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgImportMorseClaimableAccounts) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ImportMorseClaimableAccounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_ImportMorseClaimableAccounts_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ImportMorseClaimableAccounts(ctx, req.(*MsgImportMorseClaimableAccounts)) + } + 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: "ImportMorseClaimableAccounts", + Handler: _Msg_ImportMorseClaimableAccounts_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/migration/tx.proto", diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 9e9957de3..1c991ffe5 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 ImportMorseClaimableAccounts (MsgImportMorseClaimableAccounts) returns (MsgImportMorseClaimableAccountsResponse); } - // 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 MsgImportMorseClaimableAccounts { + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1; + string morseAccountState = 2; +} + +message MsgImportMorseClaimableAccountsResponse {} + diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts.go new file mode 100644 index 000000000..7e23ba4b0 --- /dev/null +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts.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) ImportMorseClaimableAccounts(goCtx context.Context, msg *types.MsgImportMorseClaimableAccounts) (*types.MsgImportMorseClaimableAccountsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgImportMorseClaimableAccountsResponse{}, nil +} diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index 8104263eb..062a49ce2 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -43,6 +43,12 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcMethod: "UpdateParams", Skip: true, // skipped because authority gated }, + { + RpcMethod: "ImportMorseClaimableAccounts", + Use: "import-morse-claimable-accounts [morse-account-state]", + Short: "Send a import_morse_claimable_accounts tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morseAccountState"}}, + }, // 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..4ade18a81 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 + opWeightMsgImportMorseClaimableAccounts = "op_weight_msg_import_morse_claimable_accounts" + // TODO: Determine the simulation weight value + defaultWeightMsgImportMorseClaimableAccounts int = 100 + + // this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module. @@ -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 weightMsgImportMorseClaimableAccounts int + simState.AppParams.GetOrGenerate(opWeightMsgImportMorseClaimableAccounts, &weightMsgImportMorseClaimableAccounts, nil, + func(_ *rand.Rand) { + weightMsgImportMorseClaimableAccounts = defaultWeightMsgImportMorseClaimableAccounts + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgImportMorseClaimableAccounts, + migrationsimulation.SimulateMsgImportMorseClaimableAccounts(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{ + simulation.NewWeightedProposalMsg( + opWeightMsgImportMorseClaimableAccounts, + defaultWeightMsgImportMorseClaimableAccounts, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + migrationsimulation.SimulateMsgImportMorseClaimableAccounts(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, + ), // this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/migration/simulation/import_morse_claimable_accounts.go b/x/migration/simulation/import_morse_claimable_accounts.go new file mode 100644 index 000000000..7d35effcc --- /dev/null +++ b/x/migration/simulation/import_morse_claimable_accounts.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 SimulateMsgImportMorseClaimableAccounts( + 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.MsgImportMorseClaimableAccounts{ + Authority: simAccount.Address.String(), + } + + // TODO: Handling the ImportMorseClaimableAccounts simulation + + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "ImportMorseClaimableAccounts simulation not implemented"), nil, nil + } +} diff --git a/x/migration/types/codec.go b/x/migration/types/codec.go index ac5526374..eafcdd61a 100644 --- a/x/migration/types/codec.go +++ b/x/migration/types/codec.go @@ -8,6 +8,9 @@ import ( ) func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgImportMorseClaimableAccounts{}, + ) // this line is used by starport scaffolding # 3 registry.RegisterImplementations((*sdk.Msg)(nil), diff --git a/x/migration/types/message_import_morse_claimable_accounts.go b/x/migration/types/message_import_morse_claimable_accounts.go new file mode 100644 index 000000000..3653d4245 --- /dev/null +++ b/x/migration/types/message_import_morse_claimable_accounts.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 = &MsgImportMorseClaimableAccounts{} + +func NewMsgImportMorseClaimableAccounts(authority string, morseAccountState string) *MsgImportMorseClaimableAccounts { + return &MsgImportMorseClaimableAccounts{ + Authority: authority, + MorseAccountState: morseAccountState, + } +} + +func (msg *MsgImportMorseClaimableAccounts) 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_import_morse_claimable_accounts_test.go b/x/migration/types/message_import_morse_claimable_accounts_test.go new file mode 100644 index 000000000..08b992e1e --- /dev/null +++ b/x/migration/types/message_import_morse_claimable_accounts_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 TestMsgImportMorseClaimableAccounts_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgImportMorseClaimableAccounts + err error + }{ + { + name: "invalid address", + msg: MsgImportMorseClaimableAccounts{ + Authority: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgImportMorseClaimableAccounts{ + 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) + }) + } +} diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 23c8c5079..32ead25d7 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 +type MsgImportMorseClaimableAccounts struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + MorseAccountState string `protobuf:"bytes,2,opt,name=morseAccountState,proto3" json:"morseAccountState,omitempty"` +} + +func (m *MsgImportMorseClaimableAccounts) Reset() { *m = MsgImportMorseClaimableAccounts{} } +func (m *MsgImportMorseClaimableAccounts) String() string { return proto.CompactTextString(m) } +func (*MsgImportMorseClaimableAccounts) ProtoMessage() {} +func (*MsgImportMorseClaimableAccounts) Descriptor() ([]byte, []int) { + return fileDescriptor_21658240592266b6, []int{2} +} +func (m *MsgImportMorseClaimableAccounts) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgImportMorseClaimableAccounts) 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 *MsgImportMorseClaimableAccounts) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgImportMorseClaimableAccounts.Merge(m, src) +} +func (m *MsgImportMorseClaimableAccounts) XXX_Size() int { + return m.Size() +} +func (m *MsgImportMorseClaimableAccounts) XXX_DiscardUnknown() { + xxx_messageInfo_MsgImportMorseClaimableAccounts.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgImportMorseClaimableAccounts proto.InternalMessageInfo + +func (m *MsgImportMorseClaimableAccounts) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgImportMorseClaimableAccounts) GetMorseAccountState() string { + if m != nil { + return m.MorseAccountState + } + return "" +} + +type MsgImportMorseClaimableAccountsResponse struct { +} + +func (m *MsgImportMorseClaimableAccountsResponse) Reset() { + *m = MsgImportMorseClaimableAccountsResponse{} +} +func (m *MsgImportMorseClaimableAccountsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgImportMorseClaimableAccountsResponse) ProtoMessage() {} +func (*MsgImportMorseClaimableAccountsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_21658240592266b6, []int{3} +} +func (m *MsgImportMorseClaimableAccountsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgImportMorseClaimableAccountsResponse) 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 *MsgImportMorseClaimableAccountsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgImportMorseClaimableAccountsResponse.Merge(m, src) +} +func (m *MsgImportMorseClaimableAccountsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgImportMorseClaimableAccountsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgImportMorseClaimableAccountsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgImportMorseClaimableAccountsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.migration.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.migration.MsgUpdateParamsResponse") + proto.RegisterType((*MsgImportMorseClaimableAccounts)(nil), "poktroll.migration.MsgImportMorseClaimableAccounts") + proto.RegisterType((*MsgImportMorseClaimableAccountsResponse)(nil), "poktroll.migration.MsgImportMorseClaimableAccountsResponse") } func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 352 bytes of a gzipped FileDescriptorProto + // 448 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,20 @@ 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, + 0x2d, 0x97, 0xbc, 0x6f, 0x71, 0xba, 0x67, 0x6e, 0x41, 0x7e, 0x51, 0x89, 0x6f, 0x7e, 0x51, 0x71, + 0xaa, 0x73, 0x4e, 0x62, 0x66, 0x6e, 0x62, 0x52, 0x4e, 0xaa, 0x63, 0x72, 0x72, 0x7e, 0x69, 0x5e, + 0x49, 0xb1, 0x90, 0x0c, 0x86, 0x6f, 0x91, 0xfd, 0xa4, 0xc3, 0x25, 0x98, 0x0b, 0xd2, 0x07, 0x55, + 0x1e, 0x5c, 0x92, 0x58, 0x92, 0x0a, 0xf6, 0x1e, 0x67, 0x10, 0xa6, 0x84, 0x15, 0x1f, 0xaa, 0x17, + 0x94, 0x34, 0xb9, 0xd4, 0x09, 0x58, 0x0f, 0x73, 0xa9, 0x51, 0x23, 0x13, 0x17, 0xb3, 0x6f, 0x71, + 0xba, 0x50, 0x02, 0x17, 0x0f, 0x4a, 0x64, 0x28, 0x63, 0x0b, 0x44, 0x34, 0xef, 0x4a, 0x69, 0x13, + 0xa1, 0x08, 0x66, 0x93, 0xd0, 0x04, 0x46, 0x2e, 0x19, 0xbc, 0x21, 0x62, 0x8c, 0xc3, 0x34, 0x7c, + 0x9a, 0xa4, 0xac, 0xc9, 0xd0, 0x04, 0x73, 0x92, 0x14, 0x6b, 0x03, 0x28, 0x25, 0x38, 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, 0xbb, 0x74, 0xf3, 0x52, 0x4b, + 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0xb1, 0x26, 0x92, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, + 0x2a, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xca, 0x33, 0x83, 0xe7, 0x96, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -166,6 +254,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) + ImportMorseClaimableAccounts(ctx context.Context, in *MsgImportMorseClaimableAccounts, opts ...grpc.CallOption) (*MsgImportMorseClaimableAccountsResponse, error) } type msgClient struct { @@ -185,11 +274,21 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) ImportMorseClaimableAccounts(ctx context.Context, in *MsgImportMorseClaimableAccounts, opts ...grpc.CallOption) (*MsgImportMorseClaimableAccountsResponse, error) { + out := new(MsgImportMorseClaimableAccountsResponse) + err := c.cc.Invoke(ctx, "/poktroll.migration.Msg/ImportMorseClaimableAccounts", 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) + ImportMorseClaimableAccounts(context.Context, *MsgImportMorseClaimableAccounts) (*MsgImportMorseClaimableAccountsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -199,6 +298,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) ImportMorseClaimableAccounts(ctx context.Context, req *MsgImportMorseClaimableAccounts) (*MsgImportMorseClaimableAccountsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ImportMorseClaimableAccounts not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -222,6 +324,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_ImportMorseClaimableAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgImportMorseClaimableAccounts) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ImportMorseClaimableAccounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.migration.Msg/ImportMorseClaimableAccounts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ImportMorseClaimableAccounts(ctx, req.(*MsgImportMorseClaimableAccounts)) + } + return interceptor(ctx, in, info, handler) +} + var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "poktroll.migration.Msg", @@ -231,6 +351,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "ImportMorseClaimableAccounts", + Handler: _Msg_ImportMorseClaimableAccounts_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/migration/tx.proto", @@ -299,6 +423,66 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgImportMorseClaimableAccounts) 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 *MsgImportMorseClaimableAccounts) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgImportMorseClaimableAccounts) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MorseAccountState) > 0 { + i -= len(m.MorseAccountState) + copy(dAtA[i:], m.MorseAccountState) + i = encodeVarintTx(dAtA, i, uint64(len(m.MorseAccountState))) + 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 *MsgImportMorseClaimableAccountsResponse) 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 *MsgImportMorseClaimableAccountsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgImportMorseClaimableAccountsResponse) 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 @@ -334,6 +518,32 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { return n } +func (m *MsgImportMorseClaimableAccounts) 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.MorseAccountState) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgImportMorseClaimableAccountsResponse) 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 } @@ -505,6 +715,170 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgImportMorseClaimableAccounts) 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: MsgImportMorseClaimableAccounts: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgImportMorseClaimableAccounts: 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 MorseAccountState", 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.MorseAccountState = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgImportMorseClaimableAccountsResponse) 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: MsgImportMorseClaimableAccountsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgImportMorseClaimableAccountsResponse: 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 bb0809aeb0f9ab3f74060b1304471aef4c3ab16d Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 13 Feb 2025 12:24:18 +0100 Subject: [PATCH 03/81] chore: update types/fields --- api/poktroll/migration/tx.pulsar.go | 442 ++++++++++++++++++++++------ proto/poktroll/migration/tx.proto | 28 +- x/migration/types/tx.pb.go | 253 +++++++++++++--- 3 files changed, 581 insertions(+), 142 deletions(-) diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index 2971caed4..f91c33325 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -872,16 +872,18 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } var ( - md_MsgImportMorseClaimableAccounts protoreflect.MessageDescriptor - fd_MsgImportMorseClaimableAccounts_authority protoreflect.FieldDescriptor - fd_MsgImportMorseClaimableAccounts_morseAccountState protoreflect.FieldDescriptor + md_MsgImportMorseClaimableAccounts protoreflect.MessageDescriptor + fd_MsgImportMorseClaimableAccounts_authority protoreflect.FieldDescriptor + fd_MsgImportMorseClaimableAccounts_morse_account_state protoreflect.FieldDescriptor + fd_MsgImportMorseClaimableAccounts_morse_account_state_hash protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_tx_proto_init() md_MsgImportMorseClaimableAccounts = File_poktroll_migration_tx_proto.Messages().ByName("MsgImportMorseClaimableAccounts") fd_MsgImportMorseClaimableAccounts_authority = md_MsgImportMorseClaimableAccounts.Fields().ByName("authority") - fd_MsgImportMorseClaimableAccounts_morseAccountState = md_MsgImportMorseClaimableAccounts.Fields().ByName("morseAccountState") + fd_MsgImportMorseClaimableAccounts_morse_account_state = md_MsgImportMorseClaimableAccounts.Fields().ByName("morse_account_state") + fd_MsgImportMorseClaimableAccounts_morse_account_state_hash = md_MsgImportMorseClaimableAccounts.Fields().ByName("morse_account_state_hash") } var _ protoreflect.Message = (*fastReflection_MsgImportMorseClaimableAccounts)(nil) @@ -955,9 +957,15 @@ func (x *fastReflection_MsgImportMorseClaimableAccounts) Range(f func(protorefle return } } - if x.MorseAccountState != "" { - value := protoreflect.ValueOfString(x.MorseAccountState) - if !f(fd_MsgImportMorseClaimableAccounts_morseAccountState, value) { + if x.MorseAccountState != nil { + value := protoreflect.ValueOfMessage(x.MorseAccountState.ProtoReflect()) + if !f(fd_MsgImportMorseClaimableAccounts_morse_account_state, value) { + return + } + } + if len(x.MorseAccountStateHash) != 0 { + value := protoreflect.ValueOfBytes(x.MorseAccountStateHash) + if !f(fd_MsgImportMorseClaimableAccounts_morse_account_state_hash, value) { return } } @@ -978,8 +986,10 @@ func (x *fastReflection_MsgImportMorseClaimableAccounts) Has(fd protoreflect.Fie switch fd.FullName() { case "poktroll.migration.MsgImportMorseClaimableAccounts.authority": return x.Authority != "" - case "poktroll.migration.MsgImportMorseClaimableAccounts.morseAccountState": - return x.MorseAccountState != "" + case "poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state": + return x.MorseAccountState != nil + case "poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state_hash": + return len(x.MorseAccountStateHash) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccounts")) @@ -998,8 +1008,10 @@ func (x *fastReflection_MsgImportMorseClaimableAccounts) Clear(fd protoreflect.F switch fd.FullName() { case "poktroll.migration.MsgImportMorseClaimableAccounts.authority": x.Authority = "" - case "poktroll.migration.MsgImportMorseClaimableAccounts.morseAccountState": - x.MorseAccountState = "" + case "poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state": + x.MorseAccountState = nil + case "poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state_hash": + x.MorseAccountStateHash = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccounts")) @@ -1019,9 +1031,12 @@ func (x *fastReflection_MsgImportMorseClaimableAccounts) Get(descriptor protoref case "poktroll.migration.MsgImportMorseClaimableAccounts.authority": value := x.Authority return protoreflect.ValueOfString(value) - case "poktroll.migration.MsgImportMorseClaimableAccounts.morseAccountState": + case "poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state": value := x.MorseAccountState - return protoreflect.ValueOfString(value) + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state_hash": + value := x.MorseAccountStateHash + return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccounts")) @@ -1044,8 +1059,10 @@ func (x *fastReflection_MsgImportMorseClaimableAccounts) Set(fd protoreflect.Fie switch fd.FullName() { case "poktroll.migration.MsgImportMorseClaimableAccounts.authority": x.Authority = value.Interface().(string) - case "poktroll.migration.MsgImportMorseClaimableAccounts.morseAccountState": - x.MorseAccountState = value.Interface().(string) + case "poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state": + x.MorseAccountState = value.Message().Interface().(*MorseAccountState) + case "poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state_hash": + x.MorseAccountStateHash = value.Bytes() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccounts")) @@ -1066,10 +1083,15 @@ func (x *fastReflection_MsgImportMorseClaimableAccounts) Set(fd protoreflect.Fie // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgImportMorseClaimableAccounts) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state": + if x.MorseAccountState == nil { + x.MorseAccountState = new(MorseAccountState) + } + return protoreflect.ValueOfMessage(x.MorseAccountState.ProtoReflect()) case "poktroll.migration.MsgImportMorseClaimableAccounts.authority": panic(fmt.Errorf("field authority of message poktroll.migration.MsgImportMorseClaimableAccounts is not mutable")) - case "poktroll.migration.MsgImportMorseClaimableAccounts.morseAccountState": - panic(fmt.Errorf("field morseAccountState of message poktroll.migration.MsgImportMorseClaimableAccounts is not mutable")) + case "poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state_hash": + panic(fmt.Errorf("field morse_account_state_hash of message poktroll.migration.MsgImportMorseClaimableAccounts is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccounts")) @@ -1085,8 +1107,11 @@ func (x *fastReflection_MsgImportMorseClaimableAccounts) NewField(fd protoreflec switch fd.FullName() { case "poktroll.migration.MsgImportMorseClaimableAccounts.authority": return protoreflect.ValueOfString("") - case "poktroll.migration.MsgImportMorseClaimableAccounts.morseAccountState": - return protoreflect.ValueOfString("") + case "poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state": + m := new(MorseAccountState) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state_hash": + return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccounts")) @@ -1160,7 +1185,11 @@ func (x *fastReflection_MsgImportMorseClaimableAccounts) ProtoMethods() *protoif if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.MorseAccountState) + if x.MorseAccountState != nil { + l = options.Size(x.MorseAccountState) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MorseAccountStateHash) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1193,10 +1222,24 @@ func (x *fastReflection_MsgImportMorseClaimableAccounts) ProtoMethods() *protoif i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.MorseAccountState) > 0 { - i -= len(x.MorseAccountState) - copy(dAtA[i:], x.MorseAccountState) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseAccountState))) + if len(x.MorseAccountStateHash) > 0 { + i -= len(x.MorseAccountStateHash) + copy(dAtA[i:], x.MorseAccountStateHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseAccountStateHash))) + i-- + dAtA[i] = 0x1a + } + if x.MorseAccountState != nil { + encoded, err := options.Marshal(x.MorseAccountState) + 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 +1335,7 @@ func (x *fastReflection_MsgImportMorseClaimableAccounts) ProtoMethods() *protoif if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MorseAccountState", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1302,23 +1345,61 @@ func (x *fastReflection_MsgImportMorseClaimableAccounts) ProtoMethods() *protoif } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.MorseAccountState == nil { + x.MorseAccountState = &MorseAccountState{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MorseAccountState); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MorseAccountStateHash", 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.MorseAccountState = string(dAtA[iNdEx:postIndex]) + x.MorseAccountStateHash = append(x.MorseAccountStateHash[:0], dAtA[iNdEx:postIndex]...) + if x.MorseAccountStateHash == nil { + x.MorseAccountStateHash = []byte{} + } iNdEx = postIndex default: iNdEx = preIndex @@ -1356,12 +1437,16 @@ func (x *fastReflection_MsgImportMorseClaimableAccounts) ProtoMethods() *protoif } var ( - md_MsgImportMorseClaimableAccountsResponse protoreflect.MessageDescriptor + md_MsgImportMorseClaimableAccountsResponse protoreflect.MessageDescriptor + fd_MsgImportMorseClaimableAccountsResponse_state_hash protoreflect.FieldDescriptor + fd_MsgImportMorseClaimableAccountsResponse_num_accounts protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_tx_proto_init() md_MsgImportMorseClaimableAccountsResponse = File_poktroll_migration_tx_proto.Messages().ByName("MsgImportMorseClaimableAccountsResponse") + fd_MsgImportMorseClaimableAccountsResponse_state_hash = md_MsgImportMorseClaimableAccountsResponse.Fields().ByName("state_hash") + fd_MsgImportMorseClaimableAccountsResponse_num_accounts = md_MsgImportMorseClaimableAccountsResponse.Fields().ByName("num_accounts") } var _ protoreflect.Message = (*fastReflection_MsgImportMorseClaimableAccountsResponse)(nil) @@ -1429,6 +1514,18 @@ func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Interface() pro // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.StateHash) != 0 { + value := protoreflect.ValueOfBytes(x.StateHash) + if !f(fd_MsgImportMorseClaimableAccountsResponse_state_hash, value) { + return + } + } + if x.NumAccounts != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumAccounts) + if !f(fd_MsgImportMorseClaimableAccountsResponse_num_accounts, value) { + return + } + } } // Has reports whether a field is populated. @@ -1444,6 +1541,10 @@ func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Range(f func(pr // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.migration.MsgImportMorseClaimableAccountsResponse.state_hash": + return len(x.StateHash) != 0 + case "poktroll.migration.MsgImportMorseClaimableAccountsResponse.num_accounts": + return x.NumAccounts != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccountsResponse")) @@ -1460,6 +1561,10 @@ func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Has(fd protoref // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.migration.MsgImportMorseClaimableAccountsResponse.state_hash": + x.StateHash = nil + case "poktroll.migration.MsgImportMorseClaimableAccountsResponse.num_accounts": + x.NumAccounts = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccountsResponse")) @@ -1476,6 +1581,12 @@ func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Clear(fd protor // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.migration.MsgImportMorseClaimableAccountsResponse.state_hash": + value := x.StateHash + return protoreflect.ValueOfBytes(value) + case "poktroll.migration.MsgImportMorseClaimableAccountsResponse.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.MsgImportMorseClaimableAccountsResponse")) @@ -1496,6 +1607,10 @@ func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Get(descriptor // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.migration.MsgImportMorseClaimableAccountsResponse.state_hash": + x.StateHash = value.Bytes() + case "poktroll.migration.MsgImportMorseClaimableAccountsResponse.num_accounts": + x.NumAccounts = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccountsResponse")) @@ -1516,6 +1631,10 @@ func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Set(fd protoref // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.migration.MsgImportMorseClaimableAccountsResponse.state_hash": + panic(fmt.Errorf("field state_hash of message poktroll.migration.MsgImportMorseClaimableAccountsResponse is not mutable")) + case "poktroll.migration.MsgImportMorseClaimableAccountsResponse.num_accounts": + panic(fmt.Errorf("field num_accounts of message poktroll.migration.MsgImportMorseClaimableAccountsResponse is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccountsResponse")) @@ -1529,6 +1648,10 @@ func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) Mutable(fd prot // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.migration.MsgImportMorseClaimableAccountsResponse.state_hash": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MsgImportMorseClaimableAccountsResponse.num_accounts": + return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgImportMorseClaimableAccountsResponse")) @@ -1598,6 +1721,13 @@ func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) ProtoMethods() 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) } @@ -1627,6 +1757,18 @@ func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) ProtoMethods() 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 { @@ -1676,6 +1818,59 @@ func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) ProtoMethods() return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgImportMorseClaimableAccountsResponse: 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 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.StateHash = append(x.StateHash[:0], dAtA[iNdEx:postIndex]...) + if x.StateHash == nil { + x.StateHash = []byte{} + } + 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:]) @@ -1798,13 +1993,24 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{1} } +// MsgImportMorseClaimableAccounts is used to create the on-chain MorseClaimableAccounts ONLY ONCE (per network / re-genesis). type MsgImportMorseClaimableAccounts struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - MorseAccountState string `protobuf:"bytes,2,opt,name=morseAccountState,proto3" json:"morseAccountState,omitempty"` + // 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"` + // the account state derived from the Morse state export and the `poktrolld migrate collect-morse-accounts` command. + MorseAccountState *MorseAccountState `protobuf:"bytes,2,opt,name=morse_account_state,json=morseAccountState,proto3" json:"morse_account_state,omitempty"` + // expected sha256 hash of the morse_account_state. If this hash does not match the on-chain + // computation, the transaction will fail. Social consensus regarding the correctness of + // morse_account_state should have be achieved off-chain and can be verified on-chain by + // comparing this hash with that of a locally derived Morse state export: + // E.g., `poktrolld migrate collect-morse-accounts $<(pocket util export-genesis-for-reset)`. + // See: `pocket util export-genesis-for-migration --help` & `poktrolld migrate collect-morse-accounts --help` + // for more details. + MorseAccountStateHash []byte `protobuf:"bytes,3,opt,name=morse_account_state_hash,json=morseAccountStateHash,proto3" json:"morse_account_state_hash,omitempty"` } func (x *MsgImportMorseClaimableAccounts) Reset() { @@ -1834,17 +2040,30 @@ func (x *MsgImportMorseClaimableAccounts) GetAuthority() string { return "" } -func (x *MsgImportMorseClaimableAccounts) GetMorseAccountState() string { +func (x *MsgImportMorseClaimableAccounts) GetMorseAccountState() *MorseAccountState { if x != nil { return x.MorseAccountState } - return "" + return nil +} + +func (x *MsgImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { + if x != nil { + return x.MorseAccountStateHash + } + return nil } type MsgImportMorseClaimableAccountsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. + StateHash []byte `protobuf:"bytes,1,opt,name=state_hash,json=stateHash,proto3" json:"state_hash,omitempty"` + // Number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. + // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. + NumAccounts uint64 `protobuf:"varint,2,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts,omitempty"` } func (x *MsgImportMorseClaimableAccountsResponse) Reset() { @@ -1867,6 +2086,20 @@ func (*MsgImportMorseClaimableAccountsResponse) Descriptor() ([]byte, []int) { return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{3} } +func (x *MsgImportMorseClaimableAccountsResponse) GetStateHash() []byte { + if x != nil { + return x.StateHash + } + return nil +} + +func (x *MsgImportMorseClaimableAccountsResponse) 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{ @@ -1878,62 +2111,82 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 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, - 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, - 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, 0x3d, 0x0a, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x37, 0x82, 0xe7, 0xb0, 0x2a, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x24, 0x70, - 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, 0x7d, - 0x0a, 0x1f, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, + 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x6f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, + 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, 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, 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, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, + 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x3a, 0x37, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x24, 0x70, 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, 0xb4, 0x02, 0x0a, 0x1f, 0x4d, 0x73, 0x67, 0x49, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, + 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, + 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x12, 0x72, 0x0a, 0x13, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 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, 0x1b, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x13, + 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x55, 0x0a, 0x18, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x1c, 0xea, 0xde, 0x1f, 0x18, 0x6d, 0x6f, + 0x72, 0x73, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x52, 0x15, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x3a, 0x0e, 0x82, + 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x8d, 0x01, + 0x0a, 0x27, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, - 0x2c, 0x0a, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6d, 0x6f, 0x72, 0x73, - 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x0e, 0x82, - 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x29, 0x0a, - 0x27, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, - 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x81, 0x02, 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, + 0x73, 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, 0x0c, 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, 0x81, 0x02, + 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, 0x90, 0x01, 0x0a, 0x1c, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, - 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x12, 0x33, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, - 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, + 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, 0x90, 0x01, 0x0a, 0x1c, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x33, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, - 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 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, + 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 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, - 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, + 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 +2208,20 @@ var file_poktroll_migration_tx_proto_goTypes = []interface{}{ (*MsgImportMorseClaimableAccounts)(nil), // 2: poktroll.migration.MsgImportMorseClaimableAccounts (*MsgImportMorseClaimableAccountsResponse)(nil), // 3: poktroll.migration.MsgImportMorseClaimableAccountsResponse (*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.ImportMorseClaimableAccounts:input_type -> poktroll.migration.MsgImportMorseClaimableAccounts - 1, // 3: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.MsgUpdateParamsResponse - 3, // 4: poktroll.migration.Msg.ImportMorseClaimableAccounts:output_type -> poktroll.migration.MsgImportMorseClaimableAccountsResponse - 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.MsgImportMorseClaimableAccounts.morse_account_state:type_name -> poktroll.migration.MorseAccountState + 0, // 2: poktroll.migration.Msg.UpdateParams:input_type -> poktroll.migration.MsgUpdateParams + 2, // 3: poktroll.migration.Msg.ImportMorseClaimableAccounts:input_type -> poktroll.migration.MsgImportMorseClaimableAccounts + 1, // 4: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.MsgUpdateParamsResponse + 3, // 5: poktroll.migration.Msg.ImportMorseClaimableAccounts:output_type -> poktroll.migration.MsgImportMorseClaimableAccountsResponse + 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() } @@ -1974,6 +2229,7 @@ func file_poktroll_migration_tx_proto_init() { if File_poktroll_migration_tx_proto != nil { return } + file_poktroll_migration_morse_onchain_proto_init() file_poktroll_migration_params_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_migration_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 1c991ffe5..7abbf806d 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -6,6 +6,7 @@ import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; +import "poktroll/migration/morse_onchain.proto"; import "poktroll/migration/params.proto"; option go_package = "github.com/pokt-network/poktroll/x/migration/types"; @@ -38,11 +39,30 @@ message MsgUpdateParams { // MsgUpdateParams message. message MsgUpdateParamsResponse {} +// MsgImportMorseClaimableAccounts is used to create the on-chain MorseClaimableAccounts ONLY ONCE (per network / re-genesis). message MsgImportMorseClaimableAccounts { option (cosmos.msg.v1.signer) = "authority"; - string authority = 1; - string morseAccountState = 2; -} -message MsgImportMorseClaimableAccountsResponse {} + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // the account state derived from the Morse state export and the `poktrolld migrate collect-morse-accounts` command. + MorseAccountState morse_account_state = 2 [(gogoproto.jsontag) = "morse_account_state", (gogoproto.nullable) = false]; + // expected sha256 hash of the morse_account_state. If this hash does not match the on-chain + // computation, the transaction will fail. Social consensus regarding the correctness of + // morse_account_state should have be achieved off-chain and can be verified on-chain by + // comparing this hash with that of a locally derived Morse state export: + // E.g., `poktrolld migrate collect-morse-accounts $<(pocket util export-genesis-for-reset)`. + // See: `pocket util export-genesis-for-migration --help` & `poktrolld migrate collect-morse-accounts --help` + // for more details. + bytes morse_account_state_hash = 3 [(gogoproto.jsontag) = "morse_account_state_hash"]; +} + +message MsgImportMorseClaimableAccountsResponse { + // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. + bytes state_hash = 1 [(gogoproto.jsontag) = "state_hash"]; + // Number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. + // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. + 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 32ead25d7..db1bb45a3 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -116,9 +116,20 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +// MsgImportMorseClaimableAccounts is used to create the on-chain MorseClaimableAccounts ONLY ONCE (per network / re-genesis). type MsgImportMorseClaimableAccounts struct { - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - MorseAccountState string `protobuf:"bytes,2,opt,name=morseAccountState,proto3" json:"morseAccountState,omitempty"` + // 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"` + // the account state derived from the Morse state export and the `poktrolld migrate collect-morse-accounts` command. + MorseAccountState MorseAccountState `protobuf:"bytes,2,opt,name=morse_account_state,json=morseAccountState,proto3" json:"morse_account_state"` + // expected sha256 hash of the morse_account_state. If this hash does not match the on-chain + // computation, the transaction will fail. Social consensus regarding the correctness of + // morse_account_state should have be achieved off-chain and can be verified on-chain by + // comparing this hash with that of a locally derived Morse state export: + // E.g., `poktrolld migrate collect-morse-accounts $<(pocket util export-genesis-for-reset)`. + // See: `pocket util export-genesis-for-migration --help` & `poktrolld migrate collect-morse-accounts --help` + // for more details. + MorseAccountStateHash []byte `protobuf:"bytes,3,opt,name=morse_account_state_hash,json=morseAccountStateHash,proto3" json:"morse_account_state_hash"` } func (m *MsgImportMorseClaimableAccounts) Reset() { *m = MsgImportMorseClaimableAccounts{} } @@ -157,14 +168,26 @@ func (m *MsgImportMorseClaimableAccounts) GetAuthority() string { return "" } -func (m *MsgImportMorseClaimableAccounts) GetMorseAccountState() string { +func (m *MsgImportMorseClaimableAccounts) GetMorseAccountState() MorseAccountState { if m != nil { return m.MorseAccountState } - return "" + return MorseAccountState{} +} + +func (m *MsgImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { + if m != nil { + return m.MorseAccountStateHash + } + return nil } type MsgImportMorseClaimableAccountsResponse struct { + // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. + StateHash []byte `protobuf:"bytes,1,opt,name=state_hash,json=stateHash,proto3" json:"state_hash"` + // Number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. + // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. + NumAccounts uint64 `protobuf:"varint,2,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts"` } func (m *MsgImportMorseClaimableAccountsResponse) Reset() { @@ -198,6 +221,20 @@ func (m *MsgImportMorseClaimableAccountsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgImportMorseClaimableAccountsResponse proto.InternalMessageInfo +func (m *MsgImportMorseClaimableAccountsResponse) GetStateHash() []byte { + if m != nil { + return m.StateHash + } + return nil +} + +func (m *MsgImportMorseClaimableAccountsResponse) 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 +245,42 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 448 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, - 0x2d, 0x97, 0xbc, 0x6f, 0x71, 0xba, 0x67, 0x6e, 0x41, 0x7e, 0x51, 0x89, 0x6f, 0x7e, 0x51, 0x71, - 0xaa, 0x73, 0x4e, 0x62, 0x66, 0x6e, 0x62, 0x52, 0x4e, 0xaa, 0x63, 0x72, 0x72, 0x7e, 0x69, 0x5e, - 0x49, 0xb1, 0x90, 0x0c, 0x86, 0x6f, 0x91, 0xfd, 0xa4, 0xc3, 0x25, 0x98, 0x0b, 0xd2, 0x07, 0x55, - 0x1e, 0x5c, 0x92, 0x58, 0x92, 0x0a, 0xf6, 0x1e, 0x67, 0x10, 0xa6, 0x84, 0x15, 0x1f, 0xaa, 0x17, - 0x94, 0x34, 0xb9, 0xd4, 0x09, 0x58, 0x0f, 0x73, 0xa9, 0x51, 0x23, 0x13, 0x17, 0xb3, 0x6f, 0x71, - 0xba, 0x50, 0x02, 0x17, 0x0f, 0x4a, 0x64, 0x28, 0x63, 0x0b, 0x44, 0x34, 0xef, 0x4a, 0x69, 0x13, - 0xa1, 0x08, 0x66, 0x93, 0xd0, 0x04, 0x46, 0x2e, 0x19, 0xbc, 0x21, 0x62, 0x8c, 0xc3, 0x34, 0x7c, - 0x9a, 0xa4, 0xac, 0xc9, 0xd0, 0x04, 0x73, 0x92, 0x14, 0x6b, 0x03, 0x28, 0x25, 0x38, 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, 0xbb, 0x74, 0xf3, 0x52, 0x4b, - 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0xb1, 0x26, 0x92, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, - 0x2a, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xca, 0x33, 0x83, 0xe7, 0x96, 0x03, 0x00, 0x00, + // 557 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xbf, 0x6b, 0xdb, 0x40, + 0x14, 0xf6, 0x39, 0x6d, 0xc0, 0x17, 0x93, 0x36, 0x6a, 0x4a, 0x1c, 0x25, 0x48, 0xc6, 0xfd, 0x65, + 0x5c, 0x6c, 0x51, 0x1b, 0x5a, 0x48, 0xe9, 0x10, 0x75, 0x69, 0x07, 0x43, 0x50, 0xc8, 0xd2, 0xc5, + 0x3d, 0xcb, 0x42, 0x12, 0xf1, 0xdd, 0x89, 0xbb, 0x53, 0x9b, 0x6c, 0x6d, 0xc7, 0x42, 0x21, 0x7f, + 0x46, 0x47, 0x0f, 0xf9, 0x07, 0xba, 0x65, 0x0c, 0x9d, 0x32, 0x89, 0x62, 0x0f, 0x06, 0xff, 0x15, + 0x45, 0xbf, 0x1c, 0xdb, 0x51, 0xd2, 0x92, 0x45, 0xd2, 0xbd, 0xf7, 0xbd, 0xef, 0x7d, 0xef, 0xe3, + 0x9d, 0xe0, 0x96, 0x47, 0x0f, 0x05, 0xa3, 0xfd, 0xbe, 0x86, 0x5d, 0x9b, 0x21, 0xe1, 0x52, 0xa2, + 0x89, 0xa3, 0x86, 0xc7, 0xa8, 0xa0, 0x92, 0x94, 0x26, 0x1b, 0xd3, 0xa4, 0xbc, 0x86, 0xb0, 0x4b, + 0xa8, 0x16, 0x3d, 0x63, 0x98, 0xbc, 0x61, 0x52, 0x8e, 0x29, 0xd7, 0x30, 0xb7, 0xb5, 0x4f, 0x2f, + 0xc2, 0x57, 0x92, 0xd8, 0x8c, 0x13, 0x9d, 0xe8, 0xa4, 0xc5, 0x87, 0x24, 0xb5, 0x6e, 0x53, 0x9b, + 0xc6, 0xf1, 0xf0, 0x2b, 0x89, 0x3e, 0xcd, 0x50, 0x83, 0x29, 0xe3, 0x56, 0x87, 0x12, 0xd3, 0x41, + 0x2e, 0x49, 0x70, 0x6a, 0x06, 0xce, 0x43, 0x0c, 0xe1, 0x84, 0xbe, 0xf2, 0x0b, 0xc0, 0x7b, 0x6d, + 0x6e, 0x1f, 0x78, 0x3d, 0x24, 0xac, 0xbd, 0x28, 0x23, 0xbd, 0x84, 0x05, 0xe4, 0x0b, 0x87, 0x32, + 0x57, 0x1c, 0x97, 0x40, 0x19, 0x54, 0x0b, 0x7a, 0xe9, 0xf7, 0x69, 0x7d, 0x3d, 0xd1, 0xb5, 0xdb, + 0xeb, 0x31, 0x8b, 0xf3, 0x7d, 0xc1, 0x5c, 0x62, 0x1b, 0x97, 0x50, 0xe9, 0x0d, 0x5c, 0x8e, 0xb9, + 0x4b, 0xf9, 0x32, 0xa8, 0xae, 0x34, 0xe5, 0xc6, 0x55, 0x5b, 0x1a, 0x71, 0x0f, 0xbd, 0x70, 0x16, + 0xa8, 0xb9, 0x9f, 0xe3, 0x41, 0x0d, 0x18, 0x49, 0xd1, 0xce, 0xab, 0x6f, 0xe3, 0x41, 0xed, 0x92, + 0xee, 0xfb, 0x78, 0x50, 0x7b, 0x3c, 0x95, 0x7f, 0x34, 0x33, 0xc0, 0x82, 0xde, 0xca, 0x26, 0xdc, + 0x58, 0x08, 0x19, 0x16, 0xf7, 0x28, 0xe1, 0x56, 0xe5, 0x34, 0x0f, 0xd5, 0x36, 0xb7, 0xdf, 0x63, + 0x8f, 0x32, 0xd1, 0x0e, 0x0d, 0x7a, 0xdb, 0x47, 0x2e, 0x46, 0xdd, 0xbe, 0xb5, 0x6b, 0x9a, 0xd4, + 0x27, 0xe2, 0xf6, 0xe3, 0x32, 0xf8, 0x20, 0xb6, 0x1c, 0xc5, 0x4c, 0x1d, 0x2e, 0x90, 0xb0, 0x92, + 0xd9, 0x9f, 0x64, 0xcd, 0x1e, 0x09, 0x48, 0xfa, 0xee, 0x87, 0x60, 0x7d, 0x2b, 0xb4, 0x61, 0x12, + 0xa8, 0x59, 0x4c, 0xc6, 0x1a, 0x5e, 0xc4, 0x4b, 0x07, 0xb0, 0x94, 0x81, 0xec, 0x38, 0x88, 0x3b, + 0xa5, 0xa5, 0x32, 0xa8, 0x16, 0xf5, 0xed, 0x49, 0xa0, 0x5e, 0x8b, 0x31, 0x1e, 0x5e, 0xa1, 0x7c, + 0x87, 0xb8, 0xb3, 0xb3, 0x3a, 0x6f, 0x7d, 0xe5, 0x07, 0x80, 0xcf, 0xfe, 0x61, 0x5b, 0x6a, 0xb1, + 0x54, 0x87, 0x70, 0x46, 0x04, 0x88, 0x44, 0xac, 0x4e, 0x02, 0x75, 0x26, 0x6a, 0x14, 0x78, 0xda, + 0x4a, 0x6a, 0xc1, 0x22, 0xf1, 0x71, 0xaa, 0x2d, 0x5e, 0x95, 0x3b, 0xfa, 0xfd, 0x49, 0xa0, 0xce, + 0xc5, 0x8d, 0x15, 0xe2, 0xe3, 0xb4, 0x57, 0xf3, 0x6b, 0x1e, 0x2e, 0xb5, 0xb9, 0x2d, 0x7d, 0x84, + 0xc5, 0xb9, 0x4d, 0x7d, 0x94, 0xe9, 0xf2, 0xfc, 0x2e, 0xc8, 0xcf, 0xff, 0x03, 0x34, 0x9d, 0xe6, + 0x04, 0xc0, 0xed, 0x1b, 0xb7, 0xa5, 0x75, 0x0d, 0xdb, 0x4d, 0x45, 0xf2, 0xeb, 0x5b, 0x14, 0xa5, + 0x92, 0xe4, 0xbb, 0x5f, 0xc2, 0x6b, 0xa2, 0xef, 0x9d, 0x0d, 0x15, 0x70, 0x3e, 0x54, 0xc0, 0xc5, + 0x50, 0x01, 0x7f, 0x86, 0x0a, 0x38, 0x19, 0x29, 0xb9, 0xf3, 0x91, 0x92, 0xbb, 0x18, 0x29, 0xb9, + 0x0f, 0x4d, 0xdb, 0x15, 0x8e, 0xdf, 0x6d, 0x98, 0x14, 0x6b, 0x61, 0xaf, 0x3a, 0xb1, 0xc4, 0x67, + 0xca, 0x0e, 0xb5, 0xcc, 0x1b, 0x24, 0x8e, 0x3d, 0x8b, 0x77, 0x97, 0xa3, 0x5f, 0x40, 0xeb, 0x6f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xe3, 0x2d, 0xb8, 0x70, 0xdb, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -443,13 +487,23 @@ func (m *MsgImportMorseClaimableAccounts) MarshalToSizedBuffer(dAtA []byte) (int _ = i var l int _ = l - if len(m.MorseAccountState) > 0 { - i -= len(m.MorseAccountState) - copy(dAtA[i:], m.MorseAccountState) - i = encodeVarintTx(dAtA, i, uint64(len(m.MorseAccountState))) + if len(m.MorseAccountStateHash) > 0 { + i -= len(m.MorseAccountStateHash) + copy(dAtA[i:], m.MorseAccountStateHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.MorseAccountStateHash))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a + } + { + size, err := m.MorseAccountState.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) @@ -480,6 +534,18 @@ func (m *MsgImportMorseClaimableAccountsResponse) MarshalToSizedBuffer(dAtA []by _ = 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 } @@ -528,7 +594,9 @@ func (m *MsgImportMorseClaimableAccounts) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.MorseAccountState) + l = m.MorseAccountState.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.MorseAccountStateHash) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -541,6 +609,13 @@ func (m *MsgImportMorseClaimableAccountsResponse) 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 } @@ -780,7 +855,7 @@ func (m *MsgImportMorseClaimableAccounts) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MorseAccountState", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -790,23 +865,58 @@ func (m *MsgImportMorseClaimableAccounts) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MorseAccountState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MorseAccountStateHash", 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.MorseAccountState = string(dAtA[iNdEx:postIndex]) + m.MorseAccountStateHash = append(m.MorseAccountStateHash[:0], dAtA[iNdEx:postIndex]...) + if m.MorseAccountStateHash == nil { + m.MorseAccountStateHash = []byte{} + } iNdEx = postIndex default: iNdEx = preIndex @@ -858,6 +968,59 @@ func (m *MsgImportMorseClaimableAccountsResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgImportMorseClaimableAccountsResponse: 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 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.StateHash = append(m.StateHash[:0], dAtA[iNdEx:postIndex]...) + if m.StateHash == nil { + m.StateHash = []byte{} + } + 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 dc4be6f6629cba3e93308d37e1d5abab1650a419 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 14 Feb 2025 08:53:22 +0100 Subject: [PATCH 04/81] feat: implement MsgImportMorseClaimableAccounts --- api/poktroll/migration/event.pulsar.go | 253 +++++++++--------- proto/poktroll/migration/event.proto | 25 ++ x/migration/keeper/morse_claimable_account.go | 15 +- .../keeper/morse_claimable_account_test.go | 2 +- ..._server_import_morse_claimable_accounts.go | 46 +++- ...er_import_morse_claimable_accounts_test.go | 101 +++++++ x/migration/module/genesis.go | 2 +- x/migration/types/errors.go | 4 +- ...message_import_morse_claimable_accounts.go | 48 +++- ...ge_import_morse_claimable_accounts_test.go | 8 +- 10 files changed, 352 insertions(+), 152 deletions(-) create mode 100644 proto/poktroll/migration/event.proto create mode 100644 x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index 718a05eec..e6ca4fc52 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -3,11 +3,11 @@ package migration import ( _ "cosmossdk.io/api/cosmos/base/v1beta1" - _ "github.com/pokt-network/poktroll/api/poktroll/shared" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" + _ "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -17,29 +17,29 @@ import ( ) var ( - md_EventCreateMorseAccountState protoreflect.MessageDescriptor - fd_EventCreateMorseAccountState_created_at_height protoreflect.FieldDescriptor - fd_EventCreateMorseAccountState_morse_account_state_hash protoreflect.FieldDescriptor - fd_EventCreateMorseAccountState_num_accounts protoreflect.FieldDescriptor + md_EventImportMorseClaimableAccounts protoreflect.MessageDescriptor + fd_EventImportMorseClaimableAccounts_created_at_height protoreflect.FieldDescriptor + fd_EventImportMorseClaimableAccounts_morse_account_state_hash protoreflect.FieldDescriptor + fd_EventImportMorseClaimableAccounts_num_accounts protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_event_proto_init() - md_EventCreateMorseAccountState = File_poktroll_migration_event_proto.Messages().ByName("EventCreateMorseAccountState") - fd_EventCreateMorseAccountState_created_at_height = md_EventCreateMorseAccountState.Fields().ByName("created_at_height") - fd_EventCreateMorseAccountState_morse_account_state_hash = md_EventCreateMorseAccountState.Fields().ByName("morse_account_state_hash") - fd_EventCreateMorseAccountState_num_accounts = md_EventCreateMorseAccountState.Fields().ByName("num_accounts") + md_EventImportMorseClaimableAccounts = File_poktroll_migration_event_proto.Messages().ByName("EventImportMorseClaimableAccounts") + fd_EventImportMorseClaimableAccounts_created_at_height = md_EventImportMorseClaimableAccounts.Fields().ByName("created_at_height") + fd_EventImportMorseClaimableAccounts_morse_account_state_hash = md_EventImportMorseClaimableAccounts.Fields().ByName("morse_account_state_hash") + fd_EventImportMorseClaimableAccounts_num_accounts = md_EventImportMorseClaimableAccounts.Fields().ByName("num_accounts") } -var _ protoreflect.Message = (*fastReflection_EventCreateMorseAccountState)(nil) +var _ protoreflect.Message = (*fastReflection_EventImportMorseClaimableAccounts)(nil) -type fastReflection_EventCreateMorseAccountState EventCreateMorseAccountState +type fastReflection_EventImportMorseClaimableAccounts EventImportMorseClaimableAccounts -func (x *EventCreateMorseAccountState) ProtoReflect() protoreflect.Message { - return (*fastReflection_EventCreateMorseAccountState)(x) +func (x *EventImportMorseClaimableAccounts) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventImportMorseClaimableAccounts)(x) } -func (x *EventCreateMorseAccountState) slowProtoReflect() protoreflect.Message { +func (x *EventImportMorseClaimableAccounts) slowProtoReflect() protoreflect.Message { mi := &file_poktroll_migration_event_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -51,43 +51,43 @@ func (x *EventCreateMorseAccountState) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_EventCreateMorseAccountState_messageType fastReflection_EventCreateMorseAccountState_messageType -var _ protoreflect.MessageType = fastReflection_EventCreateMorseAccountState_messageType{} +var _fastReflection_EventImportMorseClaimableAccounts_messageType fastReflection_EventImportMorseClaimableAccounts_messageType +var _ protoreflect.MessageType = fastReflection_EventImportMorseClaimableAccounts_messageType{} -type fastReflection_EventCreateMorseAccountState_messageType struct{} +type fastReflection_EventImportMorseClaimableAccounts_messageType struct{} -func (x fastReflection_EventCreateMorseAccountState_messageType) Zero() protoreflect.Message { - return (*fastReflection_EventCreateMorseAccountState)(nil) +func (x fastReflection_EventImportMorseClaimableAccounts_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventImportMorseClaimableAccounts)(nil) } -func (x fastReflection_EventCreateMorseAccountState_messageType) New() protoreflect.Message { - return new(fastReflection_EventCreateMorseAccountState) +func (x fastReflection_EventImportMorseClaimableAccounts_messageType) New() protoreflect.Message { + return new(fastReflection_EventImportMorseClaimableAccounts) } -func (x fastReflection_EventCreateMorseAccountState_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_EventCreateMorseAccountState +func (x fastReflection_EventImportMorseClaimableAccounts_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventImportMorseClaimableAccounts } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_EventCreateMorseAccountState) Descriptor() protoreflect.MessageDescriptor { - return md_EventCreateMorseAccountState +func (x *fastReflection_EventImportMorseClaimableAccounts) Descriptor() protoreflect.MessageDescriptor { + return md_EventImportMorseClaimableAccounts } // 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_EventCreateMorseAccountState) Type() protoreflect.MessageType { - return _fastReflection_EventCreateMorseAccountState_messageType +func (x *fastReflection_EventImportMorseClaimableAccounts) Type() protoreflect.MessageType { + return _fastReflection_EventImportMorseClaimableAccounts_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_EventCreateMorseAccountState) New() protoreflect.Message { - return new(fastReflection_EventCreateMorseAccountState) +func (x *fastReflection_EventImportMorseClaimableAccounts) New() protoreflect.Message { + return new(fastReflection_EventImportMorseClaimableAccounts) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_EventCreateMorseAccountState) Interface() protoreflect.ProtoMessage { - return (*EventCreateMorseAccountState)(x) +func (x *fastReflection_EventImportMorseClaimableAccounts) Interface() protoreflect.ProtoMessage { + return (*EventImportMorseClaimableAccounts)(x) } // Range iterates over every populated field in an undefined order, @@ -95,22 +95,22 @@ func (x *fastReflection_EventCreateMorseAccountState) Interface() protoreflect.P // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_EventCreateMorseAccountState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_EventImportMorseClaimableAccounts) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.CreatedAtHeight != int64(0) { value := protoreflect.ValueOfInt64(x.CreatedAtHeight) - if !f(fd_EventCreateMorseAccountState_created_at_height, value) { + if !f(fd_EventImportMorseClaimableAccounts_created_at_height, value) { return } } if len(x.MorseAccountStateHash) != 0 { value := protoreflect.ValueOfBytes(x.MorseAccountStateHash) - if !f(fd_EventCreateMorseAccountState_morse_account_state_hash, value) { + if !f(fd_EventImportMorseClaimableAccounts_morse_account_state_hash, value) { return } } if x.NumAccounts != uint64(0) { value := protoreflect.ValueOfUint64(x.NumAccounts) - if !f(fd_EventCreateMorseAccountState_num_accounts, value) { + if !f(fd_EventImportMorseClaimableAccounts_num_accounts, value) { return } } @@ -127,19 +127,19 @@ func (x *fastReflection_EventCreateMorseAccountState) Range(f func(protoreflect. // 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_EventCreateMorseAccountState) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_EventImportMorseClaimableAccounts) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.migration.EventCreateMorseAccountState.created_at_height": + case "poktroll.migration.EventImportMorseClaimableAccounts.created_at_height": return x.CreatedAtHeight != int64(0) - case "poktroll.migration.EventCreateMorseAccountState.morse_account_state_hash": + case "poktroll.migration.EventImportMorseClaimableAccounts.morse_account_state_hash": return len(x.MorseAccountStateHash) != 0 - case "poktroll.migration.EventCreateMorseAccountState.num_accounts": + case "poktroll.migration.EventImportMorseClaimableAccounts.num_accounts": return x.NumAccounts != uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventCreateMorseAccountState")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventImportMorseClaimableAccounts")) } - panic(fmt.Errorf("message poktroll.migration.EventCreateMorseAccountState does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.EventImportMorseClaimableAccounts does not contain field %s", fd.FullName())) } } @@ -149,19 +149,19 @@ func (x *fastReflection_EventCreateMorseAccountState) Has(fd protoreflect.FieldD // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventCreateMorseAccountState) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_EventImportMorseClaimableAccounts) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.migration.EventCreateMorseAccountState.created_at_height": + case "poktroll.migration.EventImportMorseClaimableAccounts.created_at_height": x.CreatedAtHeight = int64(0) - case "poktroll.migration.EventCreateMorseAccountState.morse_account_state_hash": + case "poktroll.migration.EventImportMorseClaimableAccounts.morse_account_state_hash": x.MorseAccountStateHash = nil - case "poktroll.migration.EventCreateMorseAccountState.num_accounts": + case "poktroll.migration.EventImportMorseClaimableAccounts.num_accounts": x.NumAccounts = uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventCreateMorseAccountState")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventImportMorseClaimableAccounts")) } - panic(fmt.Errorf("message poktroll.migration.EventCreateMorseAccountState does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.EventImportMorseClaimableAccounts does not contain field %s", fd.FullName())) } } @@ -171,22 +171,22 @@ func (x *fastReflection_EventCreateMorseAccountState) Clear(fd protoreflect.Fiel // 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_EventCreateMorseAccountState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventImportMorseClaimableAccounts) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.migration.EventCreateMorseAccountState.created_at_height": + case "poktroll.migration.EventImportMorseClaimableAccounts.created_at_height": value := x.CreatedAtHeight return protoreflect.ValueOfInt64(value) - case "poktroll.migration.EventCreateMorseAccountState.morse_account_state_hash": + case "poktroll.migration.EventImportMorseClaimableAccounts.morse_account_state_hash": value := x.MorseAccountStateHash return protoreflect.ValueOfBytes(value) - case "poktroll.migration.EventCreateMorseAccountState.num_accounts": + case "poktroll.migration.EventImportMorseClaimableAccounts.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.EventCreateMorseAccountState")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventImportMorseClaimableAccounts")) } - panic(fmt.Errorf("message poktroll.migration.EventCreateMorseAccountState does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message poktroll.migration.EventImportMorseClaimableAccounts does not contain field %s", descriptor.FullName())) } } @@ -200,19 +200,19 @@ func (x *fastReflection_EventCreateMorseAccountState) Get(descriptor protoreflec // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventCreateMorseAccountState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_EventImportMorseClaimableAccounts) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.migration.EventCreateMorseAccountState.created_at_height": + case "poktroll.migration.EventImportMorseClaimableAccounts.created_at_height": x.CreatedAtHeight = value.Int() - case "poktroll.migration.EventCreateMorseAccountState.morse_account_state_hash": + case "poktroll.migration.EventImportMorseClaimableAccounts.morse_account_state_hash": x.MorseAccountStateHash = value.Bytes() - case "poktroll.migration.EventCreateMorseAccountState.num_accounts": + case "poktroll.migration.EventImportMorseClaimableAccounts.num_accounts": x.NumAccounts = value.Uint() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventCreateMorseAccountState")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventImportMorseClaimableAccounts")) } - panic(fmt.Errorf("message poktroll.migration.EventCreateMorseAccountState does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.EventImportMorseClaimableAccounts does not contain field %s", fd.FullName())) } } @@ -226,48 +226,48 @@ func (x *fastReflection_EventCreateMorseAccountState) Set(fd protoreflect.FieldD // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventCreateMorseAccountState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventImportMorseClaimableAccounts) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.EventCreateMorseAccountState.created_at_height": - panic(fmt.Errorf("field created_at_height of message poktroll.migration.EventCreateMorseAccountState is not mutable")) - case "poktroll.migration.EventCreateMorseAccountState.morse_account_state_hash": - panic(fmt.Errorf("field morse_account_state_hash of message poktroll.migration.EventCreateMorseAccountState is not mutable")) - case "poktroll.migration.EventCreateMorseAccountState.num_accounts": - panic(fmt.Errorf("field num_accounts of message poktroll.migration.EventCreateMorseAccountState is not mutable")) + case "poktroll.migration.EventImportMorseClaimableAccounts.created_at_height": + panic(fmt.Errorf("field created_at_height of message poktroll.migration.EventImportMorseClaimableAccounts is not mutable")) + case "poktroll.migration.EventImportMorseClaimableAccounts.morse_account_state_hash": + panic(fmt.Errorf("field morse_account_state_hash of message poktroll.migration.EventImportMorseClaimableAccounts is not mutable")) + case "poktroll.migration.EventImportMorseClaimableAccounts.num_accounts": + panic(fmt.Errorf("field num_accounts of message poktroll.migration.EventImportMorseClaimableAccounts is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventCreateMorseAccountState")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventImportMorseClaimableAccounts")) } - panic(fmt.Errorf("message poktroll.migration.EventCreateMorseAccountState does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.EventImportMorseClaimableAccounts 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_EventCreateMorseAccountState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventImportMorseClaimableAccounts) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.EventCreateMorseAccountState.created_at_height": + case "poktroll.migration.EventImportMorseClaimableAccounts.created_at_height": return protoreflect.ValueOfInt64(int64(0)) - case "poktroll.migration.EventCreateMorseAccountState.morse_account_state_hash": + case "poktroll.migration.EventImportMorseClaimableAccounts.morse_account_state_hash": return protoreflect.ValueOfBytes(nil) - case "poktroll.migration.EventCreateMorseAccountState.num_accounts": + case "poktroll.migration.EventImportMorseClaimableAccounts.num_accounts": return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventCreateMorseAccountState")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventImportMorseClaimableAccounts")) } - panic(fmt.Errorf("message poktroll.migration.EventCreateMorseAccountState does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.EventImportMorseClaimableAccounts 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_EventCreateMorseAccountState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_EventImportMorseClaimableAccounts) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.EventCreateMorseAccountState", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.EventImportMorseClaimableAccounts", d.FullName())) } panic("unreachable") } @@ -275,7 +275,7 @@ func (x *fastReflection_EventCreateMorseAccountState) WhichOneof(d protoreflect. // 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_EventCreateMorseAccountState) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_EventImportMorseClaimableAccounts) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -286,7 +286,7 @@ func (x *fastReflection_EventCreateMorseAccountState) GetUnknown() protoreflect. // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventCreateMorseAccountState) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_EventImportMorseClaimableAccounts) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -298,7 +298,7 @@ func (x *fastReflection_EventCreateMorseAccountState) SetUnknown(fields protoref // 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_EventCreateMorseAccountState) IsValid() bool { +func (x *fastReflection_EventImportMorseClaimableAccounts) IsValid() bool { return x != nil } @@ -308,9 +308,9 @@ func (x *fastReflection_EventCreateMorseAccountState) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_EventCreateMorseAccountState) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_EventImportMorseClaimableAccounts) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*EventCreateMorseAccountState) + x := input.Message.Interface().(*EventImportMorseClaimableAccounts) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -342,7 +342,7 @@ func (x *fastReflection_EventCreateMorseAccountState) ProtoMethods() *protoiface } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*EventCreateMorseAccountState) + x := input.Message.Interface().(*EventImportMorseClaimableAccounts) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -389,7 +389,7 @@ func (x *fastReflection_EventCreateMorseAccountState) ProtoMethods() *protoiface }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*EventCreateMorseAccountState) + x := input.Message.Interface().(*EventImportMorseClaimableAccounts) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -421,10 +421,10 @@ func (x *fastReflection_EventCreateMorseAccountState) ProtoMethods() *protoiface fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventCreateMorseAccountState: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventImportMorseClaimableAccounts: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventCreateMorseAccountState: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventImportMorseClaimableAccounts: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -547,8 +547,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// EventUploadMorseState is emitted when the MorseAccountState is created on-chain. -type EventCreateMorseAccountState struct { +// EventImportMorseClaimableAccounts is emitted when the MorseClaimableAccounts are created on-chain. +type EventImportMorseClaimableAccounts struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -562,8 +562,8 @@ type EventCreateMorseAccountState struct { NumAccounts uint64 `protobuf:"varint,3,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts,omitempty"` } -func (x *EventCreateMorseAccountState) Reset() { - *x = EventCreateMorseAccountState{} +func (x *EventImportMorseClaimableAccounts) Reset() { + *x = EventImportMorseClaimableAccounts{} if protoimpl.UnsafeEnabled { mi := &file_poktroll_migration_event_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -571,32 +571,32 @@ func (x *EventCreateMorseAccountState) Reset() { } } -func (x *EventCreateMorseAccountState) String() string { +func (x *EventImportMorseClaimableAccounts) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EventCreateMorseAccountState) ProtoMessage() {} +func (*EventImportMorseClaimableAccounts) ProtoMessage() {} -// Deprecated: Use EventCreateMorseAccountState.ProtoReflect.Descriptor instead. -func (*EventCreateMorseAccountState) Descriptor() ([]byte, []int) { +// Deprecated: Use EventImportMorseClaimableAccounts.ProtoReflect.Descriptor instead. +func (*EventImportMorseClaimableAccounts) Descriptor() ([]byte, []int) { return file_poktroll_migration_event_proto_rawDescGZIP(), []int{0} } -func (x *EventCreateMorseAccountState) GetCreatedAtHeight() int64 { +func (x *EventImportMorseClaimableAccounts) GetCreatedAtHeight() int64 { if x != nil { return x.CreatedAtHeight } return 0 } -func (x *EventCreateMorseAccountState) GetMorseAccountStateHash() []byte { +func (x *EventImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { if x != nil { return x.MorseAccountStateHash } return nil } -func (x *EventCreateMorseAccountState) GetNumAccounts() uint64 { +func (x *EventImportMorseClaimableAccounts) GetNumAccounts() uint64 { if x != nil { return x.NumAccounts } @@ -618,34 +618,35 @@ var file_poktroll_migration_event_proto_rawDesc = []byte{ 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x6f, - 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xed, 0x01, 0x0a, - 0x1c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x72, 0x73, - 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x41, 0x0a, - 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, - 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x12, 0x55, 0x0a, 0x18, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x1c, 0xea, 0xde, 0x1f, 0x18, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x52, 0x15, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 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, 0x03, 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, 0x42, 0xb6, 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, 0x0a, 0x45, 0x76, 0x65, - 0x6e, 0x74, 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, + 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf2, 0x01, 0x0a, + 0x21, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x15, 0xea, + 0xde, 0x1f, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x52, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x48, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x55, 0x0a, 0x18, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x1c, 0xea, 0xde, 0x1f, 0x18, 0x6d, 0x6f, 0x72, + 0x73, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x52, 0x15, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x53, 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, 0x03, 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, 0x42, 0xb6, 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, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 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 ( @@ -662,7 +663,7 @@ func file_poktroll_migration_event_proto_rawDescGZIP() []byte { var file_poktroll_migration_event_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_poktroll_migration_event_proto_goTypes = []interface{}{ - (*EventCreateMorseAccountState)(nil), // 0: poktroll.migration.EventCreateMorseAccountState + (*EventImportMorseClaimableAccounts)(nil), // 0: poktroll.migration.EventImportMorseClaimableAccounts } var file_poktroll_migration_event_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -680,7 +681,7 @@ func file_poktroll_migration_event_proto_init() { file_poktroll_migration_morse_onchain_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_migration_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EventCreateMorseAccountState); i { + switch v := v.(*EventImportMorseClaimableAccounts); i { case 0: return &v.state case 1: diff --git a/proto/poktroll/migration/event.proto b/proto/poktroll/migration/event.proto new file mode 100644 index 000000000..60b013d65 --- /dev/null +++ b/proto/poktroll/migration/event.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package poktroll.migration; + +option go_package = "github.com/pokt-network/poktroll/x/migration/types"; +option (gogoproto.stable_marshaler_all) = true; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +import "poktroll/shared/service.proto"; +import "poktroll/migration/morse_onchain.proto"; + +// EventImportMorseClaimableAccounts is emitted when the MorseClaimableAccounts are created on-chain. +message EventImportMorseClaimableAccounts { + // The height (on Shannon) at which the MorseAccountState was created on-chain. + int64 created_at_height = 1 [(gogoproto.jsontag) = "created_at_height"]; + + // The sha256 has of the MorseAccountState. + bytes morse_account_state_hash = 2 [(gogoproto.jsontag) = "morse_account_state_hash"]; + + // The number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. + // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. + uint64 num_accounts = 3 [(gogoproto.jsontag) = "num_accounts"]; +} diff --git a/x/migration/keeper/morse_claimable_account.go b/x/migration/keeper/morse_claimable_account.go index ef03a246c..a229da248 100644 --- a/x/migration/keeper/morse_claimable_account.go +++ b/x/migration/keeper/morse_claimable_account.go @@ -53,8 +53,8 @@ func (k Keeper) RemoveMorseClaimableAccount( )) } -// GetAllMorseClaimableAccount returns all morseClaimableAccount -func (k Keeper) GetAllMorseClaimableAccount(ctx context.Context) (list []types.MorseClaimableAccount) { +// GetAllMorseClaimableAccounts returns all morseClaimableAccount +func (k Keeper) GetAllMorseClaimableAccounts(ctx context.Context) (list []types.MorseClaimableAccount) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.MorseClaimableAccountKeyPrefix)) iterator := storetypes.KVStorePrefixIterator(store, []byte{}) @@ -69,3 +69,14 @@ func (k Keeper) GetAllMorseClaimableAccount(ctx context.Context) (list []types.M return } + +// ImportFromMorseAccountState imports the MorseClaimableAccounts from the given MorseAccountState. +// It returns the state hash of the imported MorseAccountState. +func (k Keeper) ImportFromMorseAccountState( + ctx context.Context, + morseAccountState *types.MorseAccountState, +) { + for _, morseAccount := range morseAccountState.Accounts { + k.SetMorseClaimableAccount(ctx, *morseAccount) + } +} diff --git a/x/migration/keeper/morse_claimable_account_test.go b/x/migration/keeper/morse_claimable_account_test.go index e99deb091..d7ac9a1a4 100644 --- a/x/migration/keeper/morse_claimable_account_test.go +++ b/x/migration/keeper/morse_claimable_account_test.go @@ -60,6 +60,6 @@ func TestMorseClaimableAccountGetAll(t *testing.T) { morseClaimableAccounts := createNMorseClaimableAccount(keeper, ctx, 10) require.ElementsMatch(t, nullify.Fill(morseClaimableAccounts), - nullify.Fill(keeper.GetAllMorseClaimableAccount(ctx)), + nullify.Fill(keeper.GetAllMorseClaimableAccounts(ctx)), ) } diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts.go index 7e23ba4b0..c222e75ed 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts.go @@ -3,16 +3,50 @@ package keeper import ( "context" - "github.com/pokt-network/poktroll/x/migration/types" sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) +func (k msgServer) ImportMorseClaimableAccounts(ctx context.Context, msg *migrationtypes.MsgImportMorseClaimableAccounts) (*migrationtypes.MsgImportMorseClaimableAccountsResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + logger := sdkCtx.Logger().With("method", "CreateMorseAccountState") + + // Validate the import message. + if err := msg.ValidateBasic(); err != nil { + logger.Info(err.Error()) + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + // Check if MorseClaimableAccounts have already been imported. + if morseClaimableAccounts := k.GetAllMorseClaimableAccounts(sdkCtx); len(morseClaimableAccounts) > 0 { + err := migrationtypes.ErrMorseAccountState.Wrap("Morse claimable accounts already imported") + logger.Info(err.Error()) + return nil, status.Error(codes.FailedPrecondition, err.Error()) + } -func (k msgServer) ImportMorseClaimableAccounts(goCtx context.Context, msg *types.MsgImportMorseClaimableAccounts) (*types.MsgImportMorseClaimableAccountsResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) + // Import MorseClaimableAccounts. + k.ImportFromMorseAccountState(sdkCtx, &msg.MorseAccountState) - // TODO: Handling the message - _ = ctx + // Emit the corresponding event. + if err := sdkCtx.EventManager().EmitTypedEvent( + &migrationtypes.EventImportMorseClaimableAccounts{ + CreatedAtHeight: sdkCtx.BlockHeight(), + // DEV_NOTE: The MorseAccountStateHash is validated in msg#ValidateBasic(). + MorseAccountStateHash: msg.MorseAccountStateHash, + NumAccounts: uint64(len(msg.MorseAccountState.Accounts)), + }, + ); err != nil { + logger.Info(err.Error()) + return nil, err + } - return &types.MsgImportMorseClaimableAccountsResponse{}, nil + // Return the response. + return &migrationtypes.MsgImportMorseClaimableAccountsResponse{ + // DEV_NOTE: The MorseAccountStateHash is validated in msg#ValidateBasic(). + StateHash: msg.MorseAccountStateHash, + NumAccounts: uint64(len(msg.MorseAccountState.Accounts)), + }, nil } diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go new file mode 100644 index 000000000..974e83392 --- /dev/null +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go @@ -0,0 +1,101 @@ +package keeper_test + +import ( + "testing" + + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/pokt-network/poktroll/testutil/events" + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/testutil/testmigration" + "github.com/pokt-network/poktroll/x/migration/keeper" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" +) + +func TestMorseAccountStateMsgServerCreate_Success(t *testing.T) { + k, ctx := keepertest.MigrationKeeper(t) + srv := keeper.NewMsgServerImpl(k) + + numAccounts := 10 + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts) + + // Assert that the MorseAccountState is not set initially. + morseClaimableAccounts := k.GetAllMorseClaimableAccounts(ctx) + require.Equal(t, 0, len(morseClaimableAccounts)) + + // Create the on-chain MorseAccountState. + msgImportMorseClaimableAccounts, err := migrationtypes.NewMsgImportMorseClaimableAccounts( + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + *accountState, + ) + require.NoError(t, err) + + res, err := srv.ImportMorseClaimableAccounts(ctx, msgImportMorseClaimableAccounts) + require.NoError(t, err) + + // Assert that the response matches expectations. + expectedUploadMsg := &migrationtypes.MsgImportMorseClaimableAccounts{ + Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + MorseAccountState: *accountState, + } + expectedStateHash, err := expectedUploadMsg.MorseAccountState.GetHash() + require.NoError(t, err) + require.NotEmpty(t, expectedStateHash) + require.Len(t, expectedStateHash, 32) + + expectedRes := &migrationtypes.MsgImportMorseClaimableAccountsResponse{ + StateHash: expectedStateHash, + NumAccounts: uint64(numAccounts), + } + require.Equal(t, expectedRes, res) + + // Assert that the MorseAccountState was created and matches expectations. + morseClaimableAccounts = k.GetAllMorseClaimableAccounts(ctx) + require.Greater(t, len(morseClaimableAccounts), 0) + require.NoError(t, err) + + // Assert that the EventCreateMorseAccountState event was emitted. + evts := ctx.EventManager().Events() + filteredEvts := events.FilterEvents[*migrationtypes.EventImportMorseClaimableAccounts](t, evts) + require.Equal(t, 1, len(filteredEvts)) + + expectedEvent := &migrationtypes.EventImportMorseClaimableAccounts{ + CreatedAtHeight: ctx.BlockHeight(), + MorseAccountStateHash: expectedStateHash, + NumAccounts: uint64(numAccounts), + } + require.Equal(t, expectedEvent, filteredEvts[0]) +} + +func TestMorseAccountStateMsgServerCreate_ErrorAlreadySet(t *testing.T) { + k, ctx := keepertest.MigrationKeeper(t) + srv := keeper.NewMsgServerImpl(k) + + // Assert that the MorseAccountState is not set initially. + morseClaimableAccounts := k.GetAllMorseClaimableAccounts(ctx) + require.Equal(t, 0, len(morseClaimableAccounts)) + + numAccounts := 10 + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts) + k.ImportFromMorseAccountState(ctx, accountState) + + // Assert that the MorseAccountState have been set. + morseClaimableAccounts = k.GetAllMorseClaimableAccounts(ctx) + require.Equal(t, 10, len(morseClaimableAccounts)) + + // Assert that the MorseAccountState can ONLY be set once. + msgImportMorseClaimableAccounts, err := migrationtypes.NewMsgImportMorseClaimableAccounts( + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + *accountState, + ) + require.NoError(t, err) + + _, err = srv.ImportMorseClaimableAccounts(ctx, msgImportMorseClaimableAccounts) + stat := status.Convert(err) + require.Equal(t, codes.FailedPrecondition, stat.Code()) + require.ErrorContains(t, err, "Morse claimable accounts already imported") +} diff --git a/x/migration/module/genesis.go b/x/migration/module/genesis.go index b2a866b81..6f1da6862 100644 --- a/x/migration/module/genesis.go +++ b/x/migration/module/genesis.go @@ -24,7 +24,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - genesis.MorseClaimableAccountList = k.GetAllMorseClaimableAccount(ctx) + genesis.MorseClaimableAccountList = k.GetAllMorseClaimableAccounts(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/migration/types/errors.go b/x/migration/types/errors.go index ca50b521e..e7889ff78 100644 --- a/x/migration/types/errors.go +++ b/x/migration/types/errors.go @@ -8,6 +8,6 @@ import ( // x/migration module sentinel errors var ( - ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") - ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error") + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrMorseAccountState = sdkerrors.Register(ModuleName, 1101, "morse account state is invalid") ) diff --git a/x/migration/types/message_import_morse_claimable_accounts.go b/x/migration/types/message_import_morse_claimable_accounts.go index 3653d4245..e1a9a761a 100644 --- a/x/migration/types/message_import_morse_claimable_accounts.go +++ b/x/migration/types/message_import_morse_claimable_accounts.go @@ -1,25 +1,51 @@ package types import ( - errorsmod "cosmossdk.io/errors" + "bytes" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) var _ sdk.Msg = &MsgImportMorseClaimableAccounts{} -func NewMsgImportMorseClaimableAccounts(authority string, morseAccountState string) *MsgImportMorseClaimableAccounts { - return &MsgImportMorseClaimableAccounts{ - Authority: authority, - MorseAccountState: morseAccountState, +func NewMsgImportMorseClaimableAccounts( + authority string, + morseAccountState MorseAccountState, +) (*MsgImportMorseClaimableAccounts, error) { + morseAccountStateHash, err := morseAccountState.GetHash() + if err != nil { + return nil, err } + + return &MsgImportMorseClaimableAccounts{ + Authority: authority, + MorseAccountState: morseAccountState, + MorseAccountStateHash: morseAccountStateHash, + }, nil } func (msg *MsgImportMorseClaimableAccounts) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Authority) - if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid authority address (%s)", err) - } - return nil -} + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid authority address (%s)", err) + } + + actualHash, err := msg.MorseAccountState.GetHash() + if err != nil { + return err + } + expectedHash := msg.GetMorseAccountStateHash() + if len(expectedHash) == 0 { + return ErrMorseAccountState.Wrapf("expected hash is empty") + } + + if !bytes.Equal(actualHash, expectedHash) { + return ErrMorseAccountState.Wrapf( + "Morse account state hash (%x) doesn't match expected: (%x)", + actualHash, expectedHash, + ) + } + + return nil +} diff --git a/x/migration/types/message_import_morse_claimable_accounts_test.go b/x/migration/types/message_import_morse_claimable_accounts_test.go index 08b992e1e..038c59a1a 100644 --- a/x/migration/types/message_import_morse_claimable_accounts_test.go +++ b/x/migration/types/message_import_morse_claimable_accounts_test.go @@ -5,10 +5,14 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/testutil/sample" ) func TestMsgImportMorseClaimableAccounts_ValidateBasic(t *testing.T) { + validMsg, err := NewMsgImportMorseClaimableAccounts(sample.AccAddress(), MorseAccountState{}) + require.NoError(t, err) + tests := []struct { name string msg MsgImportMorseClaimableAccounts @@ -22,9 +26,7 @@ func TestMsgImportMorseClaimableAccounts_ValidateBasic(t *testing.T) { err: sdkerrors.ErrInvalidAddress, }, { name: "valid address", - msg: MsgImportMorseClaimableAccounts{ - Authority: sample.AccAddress(), - }, + msg: *validMsg, }, } for _, tt := range tests { From 2edeb3feb6644ef693b28933a4c707e750a69873 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 14 Feb 2025 13:33:27 +0100 Subject: [PATCH 05/81] fix: linter errors --- x/migration/simulation/import_morse_claimable_accounts.go | 5 +++-- x/migration/types/message_import_morse_claimable_accounts.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/x/migration/simulation/import_morse_claimable_accounts.go b/x/migration/simulation/import_morse_claimable_accounts.go index 7d35effcc..c561b1248 100644 --- a/x/migration/simulation/import_morse_claimable_accounts.go +++ b/x/migration/simulation/import_morse_claimable_accounts.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 SimulateMsgImportMorseClaimableAccounts( diff --git a/x/migration/types/message_import_morse_claimable_accounts.go b/x/migration/types/message_import_morse_claimable_accounts.go index e1a9a761a..cba065608 100644 --- a/x/migration/types/message_import_morse_claimable_accounts.go +++ b/x/migration/types/message_import_morse_claimable_accounts.go @@ -7,7 +7,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -var _ sdk.Msg = &MsgImportMorseClaimableAccounts{} +var _ sdk.Msg = (*MsgImportMorseClaimableAccounts)(nil) func NewMsgImportMorseClaimableAccounts( authority string, From 66d7870efaa389746c29f9fd0fc3a14cde9788d3 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 14 Feb 2025 13:37:57 +0100 Subject: [PATCH 06/81] chore: add omitted files --- x/migration/types/event.pb.go | 404 ++++++++++++++++++++++++++++++++++ 1 file changed, 404 insertions(+) create mode 100644 x/migration/types/event.pb.go diff --git a/x/migration/types/event.pb.go b/x/migration/types/event.pb.go new file mode 100644 index 000000000..9ccab2666 --- /dev/null +++ b/x/migration/types/event.pb.go @@ -0,0 +1,404 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/migration/event.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + _ "github.com/pokt-network/poktroll/x/shared/types" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventImportMorseClaimableAccounts is emitted when the MorseClaimableAccounts are created on-chain. +type EventImportMorseClaimableAccounts struct { + // The height (on Shannon) at which the MorseAccountState was created on-chain. + CreatedAtHeight int64 `protobuf:"varint,1,opt,name=created_at_height,json=createdAtHeight,proto3" json:"created_at_height"` + // The sha256 has of the MorseAccountState. + MorseAccountStateHash []byte `protobuf:"bytes,2,opt,name=morse_account_state_hash,json=morseAccountStateHash,proto3" json:"morse_account_state_hash"` + // The number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. + // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. + NumAccounts uint64 `protobuf:"varint,3,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts"` +} + +func (m *EventImportMorseClaimableAccounts) Reset() { *m = EventImportMorseClaimableAccounts{} } +func (m *EventImportMorseClaimableAccounts) String() string { return proto.CompactTextString(m) } +func (*EventImportMorseClaimableAccounts) ProtoMessage() {} +func (*EventImportMorseClaimableAccounts) Descriptor() ([]byte, []int) { + return fileDescriptor_d5b0bc9ed37905e1, []int{0} +} +func (m *EventImportMorseClaimableAccounts) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventImportMorseClaimableAccounts) 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 *EventImportMorseClaimableAccounts) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventImportMorseClaimableAccounts.Merge(m, src) +} +func (m *EventImportMorseClaimableAccounts) XXX_Size() int { + return m.Size() +} +func (m *EventImportMorseClaimableAccounts) XXX_DiscardUnknown() { + xxx_messageInfo_EventImportMorseClaimableAccounts.DiscardUnknown(m) +} + +var xxx_messageInfo_EventImportMorseClaimableAccounts proto.InternalMessageInfo + +func (m *EventImportMorseClaimableAccounts) GetCreatedAtHeight() int64 { + if m != nil { + return m.CreatedAtHeight + } + return 0 +} + +func (m *EventImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { + if m != nil { + return m.MorseAccountStateHash + } + return nil +} + +func (m *EventImportMorseClaimableAccounts) GetNumAccounts() uint64 { + if m != nil { + return m.NumAccounts + } + return 0 +} + +func init() { + proto.RegisterType((*EventImportMorseClaimableAccounts)(nil), "poktroll.migration.EventImportMorseClaimableAccounts") +} + +func init() { proto.RegisterFile("poktroll/migration/event.proto", fileDescriptor_d5b0bc9ed37905e1) } + +var fileDescriptor_d5b0bc9ed37905e1 = []byte{ + // 360 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xcd, 0x8e, 0xd3, 0x30, + 0x14, 0x85, 0x6b, 0x8a, 0x58, 0x84, 0x4a, 0x40, 0x44, 0xa5, 0x50, 0x81, 0x5b, 0x58, 0xa0, 0x6e, + 0xa8, 0x55, 0xfa, 0x04, 0x0d, 0x42, 0x2a, 0x0b, 0x24, 0x54, 0xc4, 0x86, 0x4d, 0xe4, 0xb8, 0x56, + 0x1c, 0x35, 0xf6, 0x8d, 0xec, 0x9b, 0x02, 0x6f, 0xc1, 0x63, 0xb1, 0xec, 0xb2, 0xab, 0x0a, 0xa5, + 0xbb, 0x2e, 0xe7, 0x09, 0x46, 0xf9, 0xab, 0x66, 0x34, 0x33, 0x3b, 0xfb, 0x7c, 0xc7, 0xd7, 0xe7, + 0x1e, 0x8f, 0xe6, 0xb0, 0x45, 0x0b, 0x59, 0xc6, 0x74, 0x9a, 0x58, 0x8e, 0x29, 0x18, 0x26, 0x77, + 0xd2, 0xe0, 0x2c, 0xb7, 0x80, 0xe0, 0xfb, 0x1d, 0x9f, 0x5d, 0xf8, 0xe8, 0x95, 0x00, 0xa7, 0xc1, + 0x45, 0xb5, 0x83, 0x35, 0x97, 0xc6, 0x3e, 0x7a, 0x99, 0x40, 0x02, 0x8d, 0x5e, 0x9d, 0x5a, 0x95, + 0x36, 0x1e, 0x16, 0x73, 0x27, 0xd9, 0x6e, 0x1e, 0x4b, 0xe4, 0x73, 0x26, 0x20, 0x35, 0x2d, 0x7f, + 0x73, 0x09, 0xe1, 0x14, 0xb7, 0x72, 0xc3, 0x9c, 0xb4, 0xbb, 0x54, 0xc8, 0x16, 0xbf, 0xbf, 0x27, + 0xa3, 0x06, 0xeb, 0x64, 0x04, 0x46, 0x28, 0xde, 0x8d, 0x79, 0x77, 0x45, 0xbc, 0xb7, 0x9f, 0xab, + 0xec, 0x5f, 0x74, 0x0e, 0x16, 0xbf, 0x56, 0x96, 0x4f, 0x19, 0x4f, 0x35, 0x8f, 0x33, 0xb9, 0x14, + 0x02, 0x0a, 0x83, 0xce, 0x5f, 0x7a, 0x2f, 0x84, 0x95, 0x1c, 0xe5, 0x26, 0xe2, 0x18, 0x29, 0x99, + 0x26, 0x0a, 0x03, 0x32, 0x21, 0xd3, 0x7e, 0x38, 0x3c, 0x1f, 0xc7, 0x77, 0xe1, 0xfa, 0x59, 0x2b, + 0x2d, 0x71, 0x55, 0x0b, 0xfe, 0x0f, 0x2f, 0x68, 0xfe, 0xe7, 0xcd, 0xd0, 0xc8, 0x21, 0x47, 0x19, + 0x29, 0xee, 0x54, 0xf0, 0x68, 0x42, 0xa6, 0x83, 0xf0, 0xf5, 0xf9, 0x38, 0x7e, 0xd0, 0xb3, 0x1e, + 0xd6, 0xa4, 0x4d, 0xf4, 0xbd, 0xd2, 0x57, 0xdc, 0x29, 0x7f, 0xe1, 0x0d, 0x4c, 0xa1, 0xbb, 0x07, + 0x2e, 0xe8, 0x4f, 0xc8, 0xf4, 0x71, 0xf8, 0xfc, 0x7c, 0x1c, 0xdf, 0xd2, 0xd7, 0x4f, 0x4d, 0xa1, + 0xbb, 0x75, 0xc2, 0x6f, 0xff, 0x4a, 0x4a, 0xf6, 0x25, 0x25, 0x87, 0x92, 0x92, 0xff, 0x25, 0x25, + 0x7f, 0x4f, 0xb4, 0xb7, 0x3f, 0xd1, 0xde, 0xe1, 0x44, 0x7b, 0x3f, 0x3f, 0x26, 0x29, 0xaa, 0x22, + 0x9e, 0x09, 0xd0, 0xac, 0x6a, 0xf1, 0x83, 0x91, 0xf8, 0x0b, 0xec, 0x96, 0x5d, 0x2a, 0xfd, 0x7d, + 0xa3, 0x54, 0xfc, 0x93, 0x4b, 0x17, 0x3f, 0xa9, 0xdb, 0x5c, 0x5c, 0x07, 0x00, 0x00, 0xff, 0xff, + 0xe7, 0xcb, 0xa5, 0x40, 0x1b, 0x02, 0x00, 0x00, +} + +func (m *EventImportMorseClaimableAccounts) 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 *EventImportMorseClaimableAccounts) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventImportMorseClaimableAccounts) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NumAccounts != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumAccounts)) + i-- + dAtA[i] = 0x18 + } + if len(m.MorseAccountStateHash) > 0 { + i -= len(m.MorseAccountStateHash) + copy(dAtA[i:], m.MorseAccountStateHash) + i = encodeVarintEvent(dAtA, i, uint64(len(m.MorseAccountStateHash))) + i-- + dAtA[i] = 0x12 + } + if m.CreatedAtHeight != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.CreatedAtHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { + offset -= sovEvent(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventImportMorseClaimableAccounts) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CreatedAtHeight != 0 { + n += 1 + sovEvent(uint64(m.CreatedAtHeight)) + } + l = len(m.MorseAccountStateHash) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.NumAccounts != 0 { + n += 1 + sovEvent(uint64(m.NumAccounts)) + } + return n +} + +func sovEvent(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvent(x uint64) (n int) { + return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventImportMorseClaimableAccounts) 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 ErrIntOverflowEvent + } + 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: EventImportMorseClaimableAccounts: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventImportMorseClaimableAccounts: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAtHeight", wireType) + } + m.CreatedAtHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreatedAtHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MorseAccountStateHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MorseAccountStateHash = append(m.MorseAccountStateHash[:0], dAtA[iNdEx:postIndex]...) + if m.MorseAccountStateHash == nil { + m.MorseAccountStateHash = []byte{} + } + iNdEx = postIndex + case 3: + 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 ErrIntOverflowEvent + } + 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 := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvent(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvent + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvent + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvent + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvent + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvent + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvent + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") +) From 1b102b79d01a4b3d0ccb9d1310097e5df84f8999 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 14 Feb 2025 16:56:26 +0100 Subject: [PATCH 07/81] chore: self-review improvement --- api/poktroll/migration/event.pulsar.go | 1 + api/poktroll/migration/tx.pulsar.go | 2 +- proto/poktroll/migration/tx.proto | 2 +- ..._server_import_morse_claimable_accounts.go | 9 ++++++-- ...er_import_morse_claimable_accounts_test.go | 23 +++++++++++++++++-- x/migration/module/autocli.go | 1 + x/migration/types/errors.go | 1 + x/migration/types/tx.pb.go | 2 +- 8 files changed, 34 insertions(+), 7 deletions(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index e6ca4fc52..f9296d2fe 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -8,6 +8,7 @@ import ( runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "github.com/pokt-network/poktroll/api/poktroll/shared" + prot protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index f91c33325..303317e2b 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -2005,7 +2005,7 @@ type MsgImportMorseClaimableAccounts struct { MorseAccountState *MorseAccountState `protobuf:"bytes,2,opt,name=morse_account_state,json=morseAccountState,proto3" json:"morse_account_state,omitempty"` // expected sha256 hash of the morse_account_state. If this hash does not match the on-chain // computation, the transaction will fail. Social consensus regarding the correctness of - // morse_account_state should have be achieved off-chain and can be verified on-chain by + // morse_account_state should have been achieved off-chain and can be verified on-chain by // comparing this hash with that of a locally derived Morse state export: // E.g., `poktrolld migrate collect-morse-accounts $<(pocket util export-genesis-for-reset)`. // See: `pocket util export-genesis-for-migration --help` & `poktrolld migrate collect-morse-accounts --help` diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 7abbf806d..c1b81ab35 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -51,7 +51,7 @@ message MsgImportMorseClaimableAccounts { // expected sha256 hash of the morse_account_state. If this hash does not match the on-chain // computation, the transaction will fail. Social consensus regarding the correctness of - // morse_account_state should have be achieved off-chain and can be verified on-chain by + // morse_account_state should have been achieved off-chain and can be verified on-chain by // comparing this hash with that of a locally derived Morse state export: // E.g., `poktrolld migrate collect-morse-accounts $<(pocket util export-genesis-for-reset)`. // See: `pocket util export-genesis-for-migration --help` & `poktrolld migrate collect-morse-accounts --help` diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts.go index c222e75ed..dcc093b2f 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts.go @@ -14,6 +14,11 @@ func (k msgServer) ImportMorseClaimableAccounts(ctx context.Context, msg *migrat sdkCtx := sdk.UnwrapSDKContext(ctx) logger := sdkCtx.Logger().With("method", "CreateMorseAccountState") + if msg.GetAuthority() != k.GetAuthority() { + err := migrationtypes.ErrUnauthorized.Wrapf("invalid authority address (%s)", msg.GetAuthority()) + return nil, status.Error(codes.PermissionDenied, err.Error()) + } + // Validate the import message. if err := msg.ValidateBasic(); err != nil { logger.Info(err.Error()) @@ -39,8 +44,8 @@ func (k msgServer) ImportMorseClaimableAccounts(ctx context.Context, msg *migrat NumAccounts: uint64(len(msg.MorseAccountState.Accounts)), }, ); err != nil { - logger.Info(err.Error()) - return nil, err + logger.Error(err.Error()) + return nil, status.Error(codes.Internal, err.Error()) } // Return the response. diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go index 974e83392..f0b3c7800 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go @@ -16,7 +16,7 @@ import ( migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) -func TestMorseAccountStateMsgServerCreate_Success(t *testing.T) { +func TestMsgServer_ImportMorseClaimableAccounts_Success(t *testing.T) { k, ctx := keepertest.MigrationKeeper(t) srv := keeper.NewMsgServerImpl(k) @@ -71,7 +71,7 @@ func TestMorseAccountStateMsgServerCreate_Success(t *testing.T) { require.Equal(t, expectedEvent, filteredEvts[0]) } -func TestMorseAccountStateMsgServerCreate_ErrorAlreadySet(t *testing.T) { +func TestMsgServer_ImportMorseClaimableAccounts_ErrorAlreadySet(t *testing.T) { k, ctx := keepertest.MigrationKeeper(t) srv := keeper.NewMsgServerImpl(k) @@ -99,3 +99,22 @@ func TestMorseAccountStateMsgServerCreate_ErrorAlreadySet(t *testing.T) { require.Equal(t, codes.FailedPrecondition, stat.Code()) require.ErrorContains(t, err, "Morse claimable accounts already imported") } + +func TestMsgServer_ImportMorseClaimableAccounts_ErrorInvalidAuthority(t *testing.T) { + k, ctx := keepertest.MigrationKeeper(t) + srv := keeper.NewMsgServerImpl(k) + + numAccounts := 10 + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts) + + msgImportMorseClaimableAccounts, err := migrationtypes.NewMsgImportMorseClaimableAccounts( + authtypes.NewModuleAddress("invalid_authority").String(), + *accountState, + ) + require.NoError(t, err) + + _, err = srv.ImportMorseClaimableAccounts(ctx, msgImportMorseClaimableAccounts) + stat := status.Convert(err) + require.Equal(t, codes.PermissionDenied, stat.Code()) + require.ErrorContains(t, err, "invalid authority address") +} diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index 062a49ce2..38485e870 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -48,6 +48,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Use: "import-morse-claimable-accounts [morse-account-state]", Short: "Send a import_morse_claimable_accounts tx", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morseAccountState"}}, + Skip: true, // skipped because authority gated }, // this line is used by ignite scaffolding # autocli/tx }, diff --git a/x/migration/types/errors.go b/x/migration/types/errors.go index e7889ff78..d49cef446 100644 --- a/x/migration/types/errors.go +++ b/x/migration/types/errors.go @@ -10,4 +10,5 @@ import ( var ( ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") ErrMorseAccountState = sdkerrors.Register(ModuleName, 1101, "morse account state is invalid") + ErrUnauthorized = sdkerrors.Register(ModuleName, 1102, "unauthorized") ) diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index db1bb45a3..825cf2158 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -124,7 +124,7 @@ type MsgImportMorseClaimableAccounts struct { MorseAccountState MorseAccountState `protobuf:"bytes,2,opt,name=morse_account_state,json=morseAccountState,proto3" json:"morse_account_state"` // expected sha256 hash of the morse_account_state. If this hash does not match the on-chain // computation, the transaction will fail. Social consensus regarding the correctness of - // morse_account_state should have be achieved off-chain and can be verified on-chain by + // morse_account_state should have been achieved off-chain and can be verified on-chain by // comparing this hash with that of a locally derived Morse state export: // E.g., `poktrolld migrate collect-morse-accounts $<(pocket util export-genesis-for-reset)`. // See: `pocket util export-genesis-for-migration --help` & `poktrolld migrate collect-morse-accounts --help` From fa66108724e1a232d426af504d4d4cffb26d2c4c Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 14 Feb 2025 16:57:21 +0100 Subject: [PATCH 08/81] fix: imports --- api/poktroll/migration/event.pulsar.go | 1 - 1 file changed, 1 deletion(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index f9296d2fe..e6ca4fc52 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -8,7 +8,6 @@ import ( runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "github.com/pokt-network/poktroll/api/poktroll/shared" - prot protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" From c9fd7bea6555250330d43a78857823c1c2464895 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 14 Feb 2025 17:14:26 +0100 Subject: [PATCH 09/81] chore: self-review improvements --- .../message_import_morse_claimable_accounts_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/x/migration/types/message_import_morse_claimable_accounts_test.go b/x/migration/types/message_import_morse_claimable_accounts_test.go index 038c59a1a..fdf6fae60 100644 --- a/x/migration/types/message_import_morse_claimable_accounts_test.go +++ b/x/migration/types/message_import_morse_claimable_accounts_test.go @@ -13,6 +13,9 @@ func TestMsgImportMorseClaimableAccounts_ValidateBasic(t *testing.T) { validMsg, err := NewMsgImportMorseClaimableAccounts(sample.AccAddress(), MorseAccountState{}) require.NoError(t, err) + invalidMsg := *validMsg + invalidMsg.MorseAccountStateHash = []byte("invalid_hash") + tests := []struct { name string msg MsgImportMorseClaimableAccounts @@ -24,7 +27,13 @@ func TestMsgImportMorseClaimableAccounts_ValidateBasic(t *testing.T) { Authority: "invalid_address", }, err: sdkerrors.ErrInvalidAddress, - }, { + }, + { + name: "invalid morse account state hash", + msg: invalidMsg, + err: ErrMorseAccountState, + }, + { name: "valid address", msg: *validMsg, }, From ac5ab60fad451b6686eebfe688e2717c982cbe6b Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 17 Feb 2025 14:27:33 +0100 Subject: [PATCH 10/81] refactor: morse src address & shannon dest address --- .../migration/morse_onchain.pulsar.go | 282 +++++++++++------- cmd/poktrolld/cmd/migrate/types.go | 2 +- proto/poktroll/migration/morse_onchain.proto | 17 +- testutil/testmigration/fixtures.go | 2 +- x/migration/keeper/morse_claimable_account.go | 2 +- .../keeper/morse_claimable_account_test.go | 12 +- .../query_morse_claimable_account_test.go | 4 +- x/migration/module/genesis_test.go | 4 +- x/migration/types/genesis.go | 8 +- x/migration/types/genesis_test.go | 10 +- x/migration/types/morse_onchain.pb.go | 184 ++++++++---- 11 files changed, 329 insertions(+), 198 deletions(-) diff --git a/api/poktroll/migration/morse_onchain.pulsar.go b/api/poktroll/migration/morse_onchain.pulsar.go index 7a94aa62e..79e595792 100644 --- a/api/poktroll/migration/morse_onchain.pulsar.go +++ b/api/poktroll/migration/morse_onchain.pulsar.go @@ -510,19 +510,21 @@ func (x *fastReflection_MorseAccountState) ProtoMethods() *protoiface.Methods { } var ( - md_MorseClaimableAccount protoreflect.MessageDescriptor - fd_MorseClaimableAccount_address protoreflect.FieldDescriptor - fd_MorseClaimableAccount_public_key protoreflect.FieldDescriptor - fd_MorseClaimableAccount_unstaked_balance protoreflect.FieldDescriptor - fd_MorseClaimableAccount_supplier_stake protoreflect.FieldDescriptor - fd_MorseClaimableAccount_application_stake protoreflect.FieldDescriptor - fd_MorseClaimableAccount_claimed_at_height protoreflect.FieldDescriptor + md_MorseClaimableAccount protoreflect.MessageDescriptor + fd_MorseClaimableAccount_shannon_dest_address protoreflect.FieldDescriptor + fd_MorseClaimableAccount_morse_src_address protoreflect.FieldDescriptor + fd_MorseClaimableAccount_public_key protoreflect.FieldDescriptor + fd_MorseClaimableAccount_unstaked_balance protoreflect.FieldDescriptor + fd_MorseClaimableAccount_supplier_stake protoreflect.FieldDescriptor + fd_MorseClaimableAccount_application_stake protoreflect.FieldDescriptor + fd_MorseClaimableAccount_claimed_at_height protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_morse_onchain_proto_init() md_MorseClaimableAccount = File_poktroll_migration_morse_onchain_proto.Messages().ByName("MorseClaimableAccount") - fd_MorseClaimableAccount_address = md_MorseClaimableAccount.Fields().ByName("address") + fd_MorseClaimableAccount_shannon_dest_address = md_MorseClaimableAccount.Fields().ByName("shannon_dest_address") + fd_MorseClaimableAccount_morse_src_address = md_MorseClaimableAccount.Fields().ByName("morse_src_address") fd_MorseClaimableAccount_public_key = md_MorseClaimableAccount.Fields().ByName("public_key") fd_MorseClaimableAccount_unstaked_balance = md_MorseClaimableAccount.Fields().ByName("unstaked_balance") fd_MorseClaimableAccount_supplier_stake = md_MorseClaimableAccount.Fields().ByName("supplier_stake") @@ -595,9 +597,15 @@ func (x *fastReflection_MorseClaimableAccount) Interface() protoreflect.ProtoMes // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MorseClaimableAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Address) != 0 { - value := protoreflect.ValueOfBytes(x.Address) - if !f(fd_MorseClaimableAccount_address, value) { + if x.ShannonDestAddress != "" { + value := protoreflect.ValueOfString(x.ShannonDestAddress) + if !f(fd_MorseClaimableAccount_shannon_dest_address, value) { + return + } + } + if x.MorseSrcAddress != "" { + value := protoreflect.ValueOfString(x.MorseSrcAddress) + if !f(fd_MorseClaimableAccount_morse_src_address, value) { return } } @@ -646,8 +654,10 @@ func (x *fastReflection_MorseClaimableAccount) Range(f func(protoreflect.FieldDe // a repeated field is populated if it is non-empty. func (x *fastReflection_MorseClaimableAccount) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.migration.MorseClaimableAccount.address": - return len(x.Address) != 0 + case "poktroll.migration.MorseClaimableAccount.shannon_dest_address": + return x.ShannonDestAddress != "" + case "poktroll.migration.MorseClaimableAccount.morse_src_address": + return x.MorseSrcAddress != "" case "poktroll.migration.MorseClaimableAccount.public_key": return len(x.PublicKey) != 0 case "poktroll.migration.MorseClaimableAccount.unstaked_balance": @@ -674,8 +684,10 @@ func (x *fastReflection_MorseClaimableAccount) Has(fd protoreflect.FieldDescript // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MorseClaimableAccount) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.migration.MorseClaimableAccount.address": - x.Address = nil + case "poktroll.migration.MorseClaimableAccount.shannon_dest_address": + x.ShannonDestAddress = "" + case "poktroll.migration.MorseClaimableAccount.morse_src_address": + x.MorseSrcAddress = "" case "poktroll.migration.MorseClaimableAccount.public_key": x.PublicKey = nil case "poktroll.migration.MorseClaimableAccount.unstaked_balance": @@ -702,9 +714,12 @@ func (x *fastReflection_MorseClaimableAccount) Clear(fd protoreflect.FieldDescri // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MorseClaimableAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.migration.MorseClaimableAccount.address": - value := x.Address - return protoreflect.ValueOfBytes(value) + case "poktroll.migration.MorseClaimableAccount.shannon_dest_address": + value := x.ShannonDestAddress + return protoreflect.ValueOfString(value) + case "poktroll.migration.MorseClaimableAccount.morse_src_address": + value := x.MorseSrcAddress + return protoreflect.ValueOfString(value) case "poktroll.migration.MorseClaimableAccount.public_key": value := x.PublicKey return protoreflect.ValueOfBytes(value) @@ -740,8 +755,10 @@ func (x *fastReflection_MorseClaimableAccount) Get(descriptor protoreflect.Field // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MorseClaimableAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.migration.MorseClaimableAccount.address": - x.Address = value.Bytes() + case "poktroll.migration.MorseClaimableAccount.shannon_dest_address": + x.ShannonDestAddress = value.Interface().(string) + case "poktroll.migration.MorseClaimableAccount.morse_src_address": + x.MorseSrcAddress = value.Interface().(string) case "poktroll.migration.MorseClaimableAccount.public_key": x.PublicKey = value.Bytes() case "poktroll.migration.MorseClaimableAccount.unstaked_balance": @@ -787,8 +804,10 @@ func (x *fastReflection_MorseClaimableAccount) Mutable(fd protoreflect.FieldDesc x.ApplicationStake = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.ApplicationStake.ProtoReflect()) - case "poktroll.migration.MorseClaimableAccount.address": - panic(fmt.Errorf("field address of message poktroll.migration.MorseClaimableAccount is not mutable")) + case "poktroll.migration.MorseClaimableAccount.shannon_dest_address": + panic(fmt.Errorf("field shannon_dest_address of message poktroll.migration.MorseClaimableAccount is not mutable")) + case "poktroll.migration.MorseClaimableAccount.morse_src_address": + panic(fmt.Errorf("field morse_src_address of message poktroll.migration.MorseClaimableAccount is not mutable")) case "poktroll.migration.MorseClaimableAccount.public_key": panic(fmt.Errorf("field public_key of message poktroll.migration.MorseClaimableAccount is not mutable")) case "poktroll.migration.MorseClaimableAccount.claimed_at_height": @@ -806,8 +825,10 @@ func (x *fastReflection_MorseClaimableAccount) Mutable(fd protoreflect.FieldDesc // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MorseClaimableAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.MorseClaimableAccount.address": - return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MorseClaimableAccount.shannon_dest_address": + return protoreflect.ValueOfString("") + case "poktroll.migration.MorseClaimableAccount.morse_src_address": + return protoreflect.ValueOfString("") case "poktroll.migration.MorseClaimableAccount.public_key": return protoreflect.ValueOfBytes(nil) case "poktroll.migration.MorseClaimableAccount.unstaked_balance": @@ -890,7 +911,11 @@ func (x *fastReflection_MorseClaimableAccount) ProtoMethods() *protoiface.Method var n int var l int _ = l - l = len(x.Address) + l = len(x.ShannonDestAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MorseSrcAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -945,7 +970,7 @@ func (x *fastReflection_MorseClaimableAccount) ProtoMethods() *protoiface.Method if x.ClaimedAtHeight != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimedAtHeight)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x40 } if x.ApplicationStake != nil { encoded, err := options.Marshal(x.ApplicationStake) @@ -959,7 +984,7 @@ func (x *fastReflection_MorseClaimableAccount) ProtoMethods() *protoiface.Method copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x3a } if x.SupplierStake != nil { encoded, err := options.Marshal(x.SupplierStake) @@ -973,7 +998,7 @@ func (x *fastReflection_MorseClaimableAccount) ProtoMethods() *protoiface.Method copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x32 } if x.UnstakedBalance != nil { encoded, err := options.Marshal(x.UnstakedBalance) @@ -987,19 +1012,26 @@ func (x *fastReflection_MorseClaimableAccount) ProtoMethods() *protoiface.Method copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x2a } if len(x.PublicKey) > 0 { i -= len(x.PublicKey) copy(dAtA[i:], x.PublicKey) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) i-- + dAtA[i] = 0x22 + } + if len(x.MorseSrcAddress) > 0 { + i -= len(x.MorseSrcAddress) + copy(dAtA[i:], x.MorseSrcAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseSrcAddress))) + i-- dAtA[i] = 0x12 } - if len(x.Address) > 0 { - i -= len(x.Address) - copy(dAtA[i:], x.Address) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + if len(x.ShannonDestAddress) > 0 { + i -= len(x.ShannonDestAddress) + copy(dAtA[i:], x.ShannonDestAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ShannonDestAddress))) i-- dAtA[i] = 0xa } @@ -1054,9 +1086,9 @@ func (x *fastReflection_MorseClaimableAccount) ProtoMethods() *protoiface.Method switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ShannonDestAddress", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1066,27 +1098,57 @@ func (x *fastReflection_MorseClaimableAccount) ProtoMethods() *protoiface.Method } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Address = append(x.Address[:0], dAtA[iNdEx:postIndex]...) - if x.Address == nil { - x.Address = []byte{} - } + x.ShannonDestAddress = 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 MorseSrcAddress", 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.MorseSrcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) } @@ -1120,7 +1182,7 @@ func (x *fastReflection_MorseClaimableAccount) ProtoMethods() *protoiface.Method x.PublicKey = []byte{} } iNdEx = postIndex - case 3: + case 5: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UnstakedBalance", wireType) } @@ -1156,7 +1218,7 @@ func (x *fastReflection_MorseClaimableAccount) ProtoMethods() *protoiface.Method return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 4: + case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierStake", wireType) } @@ -1192,7 +1254,7 @@ func (x *fastReflection_MorseClaimableAccount) ProtoMethods() *protoiface.Method return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 5: + case 7: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ApplicationStake", wireType) } @@ -1228,7 +1290,7 @@ func (x *fastReflection_MorseClaimableAccount) ProtoMethods() *protoiface.Method return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 6: + case 8: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) } @@ -1341,12 +1403,14 @@ type MorseClaimableAccount struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // A hex-encoded representation of the address corresponding to a Morse application's ed25519 public key. - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. + ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address,omitempty"` + // The hex-encoded address of the Morse account whose balance will be claimed. + MorseSrcAddress string `protobuf:"bytes,2,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` // The ed25519 public key of the account. - PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // The unstaked upokt tokens (i.e. account balance) available for claiming. - UnstakedBalance *v1beta1.Coin `protobuf:"bytes,3,opt,name=unstaked_balance,json=unstakedBalance,proto3" json:"unstaked_balance,omitempty"` + UnstakedBalance *v1beta1.Coin `protobuf:"bytes,5,opt,name=unstaked_balance,json=unstakedBalance,proto3" json:"unstaked_balance,omitempty"` // The staked tokens associated with a supplier actor which corresponds to this account address. // DEV_NOTE: A few contextual notes related to Morse: // - A Supplier is called a Servicer or Node (not a full node) in Morse @@ -1354,11 +1418,11 @@ type MorseClaimableAccount struct { // - Automatically, the top 100 staked Servicers are validator // - This only accounts for servicer stake balance transition // TODO_MAINNET(@Olshansk): Develop a strategy for bootstrapping validators in Shannon by working with the cosmos ecosystem - SupplierStake *v1beta1.Coin `protobuf:"bytes,4,opt,name=supplier_stake,json=supplierStake,proto3" json:"supplier_stake,omitempty"` + SupplierStake *v1beta1.Coin `protobuf:"bytes,6,opt,name=supplier_stake,json=supplierStake,proto3" json:"supplier_stake,omitempty"` // The staked tokens associated with an application actor which corresponds to this account address. - ApplicationStake *v1beta1.Coin `protobuf:"bytes,5,opt,name=application_stake,json=applicationStake,proto3" json:"application_stake,omitempty"` + ApplicationStake *v1beta1.Coin `protobuf:"bytes,7,opt,name=application_stake,json=applicationStake,proto3" json:"application_stake,omitempty"` // The Shannon height at which the account was claimed. - ClaimedAtHeight int64 `protobuf:"varint,6,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` + ClaimedAtHeight int64 `protobuf:"varint,8,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` } func (x *MorseClaimableAccount) Reset() { @@ -1381,11 +1445,18 @@ func (*MorseClaimableAccount) Descriptor() ([]byte, []int) { return file_poktroll_migration_morse_onchain_proto_rawDescGZIP(), []int{1} } -func (x *MorseClaimableAccount) GetAddress() []byte { +func (x *MorseClaimableAccount) GetShannonDestAddress() string { if x != nil { - return x.Address + return x.ShannonDestAddress } - return nil + return "" +} + +func (x *MorseClaimableAccount) GetMorseSrcAddress() string { + if x != nil { + return x.MorseSrcAddress + } + return "" } func (x *MorseClaimableAccount) GetPublicKey() []byte { @@ -1442,54 +1513,59 @@ var file_poktroll_migration_morse_onchain_proto_rawDesc = []byte{ 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, - 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0xa6, 0x04, 0x0a, 0x15, 0x4d, + 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0xf7, 0x04, 0x0a, 0x15, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x54, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3a, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, - 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3b, 0x0a, 0x0a, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x1c, - 0xfa, 0xde, 0x1f, 0x18, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x65, 0x64, 0x32, 0x35, 0x35, - 0x31, 0x39, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x5e, 0x0a, 0x10, 0x75, 0x6e, 0x73, 0x74, 0x61, - 0x6b, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x18, 0xc8, 0xde, - 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x10, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x5f, 0x62, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x16, 0xc8, 0xde, 0x1f, 0x00, - 0xea, 0xde, 0x1f, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, - 0x6b, 0x65, 0x52, 0x0d, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x74, 0x61, 0x6b, - 0x65, 0x12, 0x61, 0x0a, 0x11, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x19, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, - 0x11, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, - 0x6b, 0x65, 0x52, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, - 0x74, 0x61, 0x6b, 0x65, 0x12, 0x5d, 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x42, - 0x31, 0xea, 0xde, 0x1f, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0xf2, 0xde, 0x1f, 0x18, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x22, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x42, 0xbd, 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, 0x11, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x4f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, - 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, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x62, 0x0a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, + 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x30, 0xea, 0xde, 0x1f, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, + 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, + 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6d, 0x6f, 0x72, 0x73, + 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, + 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, + 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3b, 0x0a, 0x0a, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x1c, 0xfa, 0xde, 0x1f, 0x18, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x65, 0x64, 0x32, 0x35, + 0x35, 0x31, 0x39, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x5e, 0x0a, 0x10, 0x75, 0x6e, 0x73, 0x74, + 0x61, 0x6b, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x18, 0xc8, + 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x10, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x5f, + 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, + 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x0e, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x16, 0xc8, 0xde, 0x1f, + 0x00, 0xea, 0xde, 0x1f, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x73, 0x74, + 0x61, 0x6b, 0x65, 0x52, 0x0d, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x74, 0x61, + 0x6b, 0x65, 0x12, 0x61, 0x0a, 0x11, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x19, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, + 0x1f, 0x11, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, + 0x61, 0x6b, 0x65, 0x52, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x5d, 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, + 0x42, 0x31, 0xea, 0xde, 0x1f, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0xf2, 0xde, 0x1f, 0x18, 0x79, 0x61, 0x6d, 0x6c, 0x3a, + 0x22, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x22, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x42, 0xbd, 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, 0x11, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x4f, 0x6e, 0x63, 0x68, 0x61, 0x69, + 0x6e, 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/cmd/poktrolld/cmd/migrate/types.go b/cmd/poktrolld/cmd/migrate/types.go index 9d5223215..009d19378 100644 --- a/cmd/poktrolld/cmd/migrate/types.go +++ b/cmd/poktrolld/cmd/migrate/types.go @@ -125,7 +125,7 @@ func (miw *morseImportWorkspace) addAccount( accountIdx = miw.nextIdx() importAccount := &migrationtypes.MorseClaimableAccount{ - Address: exportAccount.Value.Address, + MorseSrcAddress: exportAccount.Value.Address.String(), PublicKey: exportAccount.Value.PubKey.Value, UnstakedBalance: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 0), SupplierStake: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 0), diff --git a/proto/poktroll/migration/morse_onchain.proto b/proto/poktroll/migration/morse_onchain.proto index 3c5229ec7..9b3700d63 100644 --- a/proto/poktroll/migration/morse_onchain.proto +++ b/proto/poktroll/migration/morse_onchain.proto @@ -20,14 +20,17 @@ message MorseAccountState { // account which is claimable as part of the Morse -> Shannon migration. // They are intended to be created during MorseAccountState import (see: MsgImportMorseClaimableAccount). message MorseClaimableAccount { - // A hex-encoded representation of the address corresponding to a Morse application's ed25519 public key. - bytes address = 1 [(gogoproto.jsontag) = "address", (gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address"]; + // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. + string shannon_dest_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "shannon_dest_address"]; + + // The hex-encoded address of the Morse account whose balance will be claimed. + string morse_src_address = 2 [(gogoproto.jsontag) = "morse_src_address"]; // The ed25519 public key of the account. - bytes public_key = 2 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; + bytes public_key = 4 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; // The unstaked upokt tokens (i.e. account balance) available for claiming. - cosmos.base.v1beta1.Coin unstaked_balance = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "unstaked_balance"]; + cosmos.base.v1beta1.Coin unstaked_balance = 5 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "unstaked_balance"]; // The staked tokens associated with a supplier actor which corresponds to this account address. // DEV_NOTE: A few contextual notes related to Morse: @@ -36,12 +39,12 @@ message MorseClaimableAccount { // - Automatically, the top 100 staked Servicers are validator // - This only accounts for servicer stake balance transition // TODO_MAINNET(@Olshansk): Develop a strategy for bootstrapping validators in Shannon by working with the cosmos ecosystem - cosmos.base.v1beta1.Coin supplier_stake = 4 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "supplier_stake"]; + cosmos.base.v1beta1.Coin supplier_stake = 6 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "supplier_stake"]; // The staked tokens associated with an application actor which corresponds to this account address. - cosmos.base.v1beta1.Coin application_stake = 5 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "application_stake"]; + cosmos.base.v1beta1.Coin application_stake = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "application_stake"]; // The Shannon height at which the account was claimed. - int64 claimed_at_height = 6 [(gogoproto.jsontag) = "claimed_at_height", (gogoproto.moretags) = "yaml:\"claimed_at_height\""]; + int64 claimed_at_height = 8 [(gogoproto.jsontag) = "claimed_at_height", (gogoproto.moretags) = "yaml:\"claimed_at_height\""]; } diff --git a/testutil/testmigration/fixtures.go b/testutil/testmigration/fixtures.go index d4db4cfcc..b77a34a1f 100644 --- a/testutil/testmigration/fixtures.go +++ b/testutil/testmigration/fixtures.go @@ -119,7 +119,7 @@ func NewMorseStateExportAndAccountState( // Add the account to the morseAccountState. morseAccountState.Accounts[i-1] = &migrationtypes.MorseClaimableAccount{ - Address: pubKey.Address(), + MorseSrcAddress: pubKey.Address().String(), UnstakedBalance: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, balanceAmount), SupplierStake: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, supplierStakeAmount), ApplicationStake: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, appStakeAmount), diff --git a/x/migration/keeper/morse_claimable_account.go b/x/migration/keeper/morse_claimable_account.go index a229da248..5cdf1cc51 100644 --- a/x/migration/keeper/morse_claimable_account.go +++ b/x/migration/keeper/morse_claimable_account.go @@ -16,7 +16,7 @@ func (k Keeper) SetMorseClaimableAccount(ctx context.Context, morseClaimableAcco store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.MorseClaimableAccountKeyPrefix)) morseClaimableAccountBz := k.cdc.MustMarshal(&morseClaimableAccount) store.Set(types.MorseClaimableAccountKey( - morseClaimableAccount.Address.String(), + morseClaimableAccount.MorseSrcAddress, ), morseClaimableAccountBz) } diff --git a/x/migration/keeper/morse_claimable_account_test.go b/x/migration/keeper/morse_claimable_account_test.go index d7ac9a1a4..bc21a90bf 100644 --- a/x/migration/keeper/morse_claimable_account_test.go +++ b/x/migration/keeper/morse_claimable_account_test.go @@ -20,7 +20,7 @@ var _ = strconv.IntSize func createNMorseClaimableAccount(keeper keeper.Keeper, ctx context.Context, n int) []types.MorseClaimableAccount { morseClaimableAccounts := make([]types.MorseClaimableAccount, n) for i := range morseClaimableAccounts { - morseClaimableAccounts[i].Address = []byte(sample.MorseAddressHex()) + morseClaimableAccounts[i].MorseSrcAddress = sample.MorseAddressHex() keeper.SetMorseClaimableAccount(ctx, morseClaimableAccounts[i]) } @@ -30,13 +30,13 @@ func createNMorseClaimableAccount(keeper keeper.Keeper, ctx context.Context, n i func TestMorseClaimableAccountGet(t *testing.T) { keeper, ctx := keepertest.MigrationKeeper(t) morseClaimableAccounts := createNMorseClaimableAccount(keeper, ctx, 10) - for _, item := range morseClaimableAccounts { + for _, morseClaimableAccount := range morseClaimableAccounts { rst, found := keeper.GetMorseClaimableAccount(ctx, - item.Address.String(), + morseClaimableAccount.MorseSrcAddress, ) require.True(t, found) require.Equal(t, - nullify.Fill(&item), + nullify.Fill(&morseClaimableAccount), nullify.Fill(&rst), ) } @@ -46,10 +46,10 @@ func TestMorseClaimableAccountRemove(t *testing.T) { morseClaimableAccounts := createNMorseClaimableAccount(keeper, ctx, 10) for _, item := range morseClaimableAccounts { keeper.RemoveMorseClaimableAccount(ctx, - item.Address.String(), + item.MorseSrcAddress, ) _, found := keeper.GetMorseClaimableAccount(ctx, - item.Address.String(), + item.MorseSrcAddress, ) require.False(t, found) } diff --git a/x/migration/keeper/query_morse_claimable_account_test.go b/x/migration/keeper/query_morse_claimable_account_test.go index b76dc0c67..397191954 100644 --- a/x/migration/keeper/query_morse_claimable_account_test.go +++ b/x/migration/keeper/query_morse_claimable_account_test.go @@ -29,14 +29,14 @@ func TestMorseClaimableAccountQuerySingle(t *testing.T) { { desc: "First", request: &types.QueryGetMorseClaimableAccountRequest{ - Address: msgs[0].Address.String(), + Address: msgs[0].MorseSrcAddress, }, response: &types.QueryGetMorseClaimableAccountResponse{MorseClaimableAccount: msgs[0]}, }, { desc: "Second", request: &types.QueryGetMorseClaimableAccountRequest{ - Address: msgs[1].Address.String(), + Address: msgs[1].MorseSrcAddress, }, response: &types.QueryGetMorseClaimableAccountResponse{MorseClaimableAccount: msgs[1]}, }, diff --git a/x/migration/module/genesis_test.go b/x/migration/module/genesis_test.go index b4486cd3d..fefeac91c 100644 --- a/x/migration/module/genesis_test.go +++ b/x/migration/module/genesis_test.go @@ -18,10 +18,10 @@ func TestGenesis(t *testing.T) { MorseClaimableAccountList: []types.MorseClaimableAccount{ { - Address: []byte(sample.MorseAddressHex()), + MorseSrcAddress: sample.MorseAddressHex(), }, { - Address: []byte(sample.MorseAddressHex()), + MorseSrcAddress: sample.MorseAddressHex(), }, }, // this line is used by starport scaffolding # genesis/test/state diff --git a/x/migration/types/genesis.go b/x/migration/types/genesis.go index 03e5725aa..0d7d6fc7e 100644 --- a/x/migration/types/genesis.go +++ b/x/migration/types/genesis.go @@ -23,11 +23,11 @@ func (gs GenesisState) Validate() error { morseClaimableAccountIndexMap := make(map[string]struct{}) for _, morseClaimableAccounts := range gs.MorseClaimableAccountList { - index := string(MorseClaimableAccountKey(morseClaimableAccounts.Address.String())) - if _, ok := morseClaimableAccountIndexMap[index]; ok { - return fmt.Errorf("duplicated index for morseClaimableAccount") + morseSrcAddrIdx := string(MorseClaimableAccountKey(morseClaimableAccounts.MorseSrcAddress)) + if _, ok := morseClaimableAccountIndexMap[morseSrcAddrIdx]; ok { + return fmt.Errorf("duplicated morseSrcAddrIdx for morseClaimableAccount") } - morseClaimableAccountIndexMap[index] = struct{}{} + morseClaimableAccountIndexMap[morseSrcAddrIdx] = struct{}{} } // this line is used by starport scaffolding # genesis/types/validate diff --git a/x/migration/types/genesis_test.go b/x/migration/types/genesis_test.go index 33d880d9e..ab22c81b8 100644 --- a/x/migration/types/genesis_test.go +++ b/x/migration/types/genesis_test.go @@ -10,7 +10,7 @@ import ( ) func TestGenesisState_Validate(t *testing.T) { - duplicateMorseAddress := []byte(sample.MorseAddressHex()) + duplicateMorseAddress := sample.MorseAddressHex() tests := []struct { desc string @@ -28,10 +28,10 @@ func TestGenesisState_Validate(t *testing.T) { MorseClaimableAccountList: []types.MorseClaimableAccount{ { - Address: []byte(sample.MorseAddressHex()), + MorseSrcAddress: sample.MorseAddressHex(), }, { - Address: []byte(sample.MorseAddressHex()), + MorseSrcAddress: sample.MorseAddressHex(), }, }, // this line is used by starport scaffolding # types/genesis/validField @@ -43,10 +43,10 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ MorseClaimableAccountList: []types.MorseClaimableAccount{ { - Address: duplicateMorseAddress, + MorseSrcAddress: duplicateMorseAddress, }, { - Address: duplicateMorseAddress, + MorseSrcAddress: duplicateMorseAddress, }, }, }, diff --git a/x/migration/types/morse_onchain.pb.go b/x/migration/types/morse_onchain.pb.go index d2f37fab7..eafa84e5c 100644 --- a/x/migration/types/morse_onchain.pb.go +++ b/x/migration/types/morse_onchain.pb.go @@ -6,7 +6,6 @@ package types import ( crypto_ed25519 "crypto/ed25519" fmt "fmt" - github_com_cometbft_cometbft_crypto "github.com/cometbft/cometbft/crypto" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" @@ -74,12 +73,14 @@ func (m *MorseAccountState) GetAccounts() []*MorseClaimableAccount { // account which is claimable as part of the Morse -> Shannon migration. // They are intended to be created during MorseAccountState import (see: MsgImportMorseClaimableAccount). type MorseClaimableAccount struct { - // A hex-encoded representation of the address corresponding to a Morse application's ed25519 public key. - Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address"` + // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. + ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address"` + // The hex-encoded address of the Morse account whose balance will be claimed. + MorseSrcAddress string `protobuf:"bytes,2,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address"` // The ed25519 public key of the account. - PublicKey crypto_ed25519.PublicKey `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3,casttype=crypto/ed25519.PublicKey" json:"public_key,omitempty"` + PublicKey crypto_ed25519.PublicKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3,casttype=crypto/ed25519.PublicKey" json:"public_key,omitempty"` // The unstaked upokt tokens (i.e. account balance) available for claiming. - UnstakedBalance types.Coin `protobuf:"bytes,3,opt,name=unstaked_balance,json=unstakedBalance,proto3" json:"unstaked_balance"` + UnstakedBalance types.Coin `protobuf:"bytes,5,opt,name=unstaked_balance,json=unstakedBalance,proto3" json:"unstaked_balance"` // The staked tokens associated with a supplier actor which corresponds to this account address. // DEV_NOTE: A few contextual notes related to Morse: // - A Supplier is called a Servicer or Node (not a full node) in Morse @@ -87,11 +88,11 @@ type MorseClaimableAccount struct { // - Automatically, the top 100 staked Servicers are validator // - This only accounts for servicer stake balance transition // TODO_MAINNET(@Olshansk): Develop a strategy for bootstrapping validators in Shannon by working with the cosmos ecosystem - SupplierStake types.Coin `protobuf:"bytes,4,opt,name=supplier_stake,json=supplierStake,proto3" json:"supplier_stake"` + SupplierStake types.Coin `protobuf:"bytes,6,opt,name=supplier_stake,json=supplierStake,proto3" json:"supplier_stake"` // The staked tokens associated with an application actor which corresponds to this account address. - ApplicationStake types.Coin `protobuf:"bytes,5,opt,name=application_stake,json=applicationStake,proto3" json:"application_stake"` + ApplicationStake types.Coin `protobuf:"bytes,7,opt,name=application_stake,json=applicationStake,proto3" json:"application_stake"` // The Shannon height at which the account was claimed. - ClaimedAtHeight int64 `protobuf:"varint,6,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height" yaml:"claimed_at_height"` + ClaimedAtHeight int64 `protobuf:"varint,8,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height" yaml:"claimed_at_height"` } func (m *MorseClaimableAccount) Reset() { *m = MorseClaimableAccount{} } @@ -123,11 +124,18 @@ func (m *MorseClaimableAccount) XXX_DiscardUnknown() { var xxx_messageInfo_MorseClaimableAccount proto.InternalMessageInfo -func (m *MorseClaimableAccount) GetAddress() github_com_cometbft_cometbft_crypto.Address { +func (m *MorseClaimableAccount) GetShannonDestAddress() string { if m != nil { - return m.Address + return m.ShannonDestAddress } - return nil + return "" +} + +func (m *MorseClaimableAccount) GetMorseSrcAddress() string { + if m != nil { + return m.MorseSrcAddress + } + return "" } func (m *MorseClaimableAccount) GetPublicKey() crypto_ed25519.PublicKey { @@ -175,39 +183,42 @@ func init() { } var fileDescriptor_e74ea76a959fdb61 = []byte{ - // 512 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x41, 0x8b, 0xd3, 0x40, - 0x18, 0x6d, 0xb6, 0xeb, 0xaa, 0xb3, 0x6a, 0xb7, 0x41, 0x25, 0x2d, 0x92, 0x94, 0x1c, 0xa4, 0x22, - 0x4e, 0x68, 0x65, 0x0f, 0xae, 0xa7, 0x66, 0x2f, 0x82, 0x08, 0x4b, 0xd6, 0x83, 0x08, 0x1a, 0x26, - 0x93, 0xd9, 0x34, 0x34, 0xc9, 0x84, 0xcc, 0x44, 0x0d, 0xfe, 0x09, 0x7f, 0x85, 0xbf, 0x65, 0x8f, - 0x7b, 0xdc, 0x53, 0x90, 0xf6, 0xd6, 0xe3, 0x1e, 0xf7, 0x24, 0xc9, 0x64, 0x4a, 0x31, 0x42, 0x6f, - 0xdf, 0x7b, 0xdf, 0x7b, 0x6f, 0x86, 0xf9, 0xbe, 0x01, 0xcf, 0x53, 0xba, 0xe0, 0x19, 0x8d, 0x22, - 0x2b, 0x0e, 0x83, 0x0c, 0xf1, 0x90, 0x26, 0x56, 0x4c, 0x33, 0x46, 0x5c, 0x9a, 0xe0, 0x39, 0x0a, - 0x13, 0x98, 0x66, 0x94, 0x53, 0x55, 0x95, 0x3a, 0xb8, 0xd1, 0x0d, 0x07, 0x98, 0xb2, 0x98, 0x32, - 0xb7, 0x56, 0x58, 0x02, 0x08, 0xf9, 0x50, 0x17, 0xc8, 0xf2, 0x10, 0x23, 0xd6, 0xb7, 0x89, 0x47, - 0x38, 0x9a, 0x58, 0x98, 0xca, 0xb8, 0xe1, 0xe3, 0x80, 0x06, 0x54, 0xf8, 0xaa, 0x4a, 0xb0, 0xe6, - 0x4f, 0xd0, 0xff, 0x50, 0x9d, 0x3d, 0xc3, 0x98, 0xe6, 0x09, 0x3f, 0xe7, 0x88, 0x13, 0xf5, 0x02, - 0xdc, 0x43, 0x02, 0x33, 0x6d, 0x6f, 0xd4, 0x1d, 0x1f, 0x4e, 0x5f, 0xc0, 0xf6, 0x65, 0x60, 0x6d, - 0x3c, 0x8d, 0x50, 0x18, 0x23, 0x2f, 0x92, 0x09, 0xb6, 0xb1, 0x2e, 0x8d, 0x8d, 0xfd, 0xa6, 0x34, - 0x7a, 0x05, 0x8a, 0xa3, 0x13, 0x53, 0x32, 0xa6, 0xb3, 0x69, 0x9a, 0xbf, 0xf7, 0xc1, 0x93, 0xff, - 0x86, 0xa8, 0x1f, 0xc1, 0x5d, 0xe4, 0xfb, 0x19, 0x61, 0x4c, 0x53, 0x46, 0xca, 0xf8, 0x81, 0x7d, - 0xb2, 0x2e, 0x0d, 0x49, 0xdd, 0x96, 0xc6, 0xcb, 0x20, 0xe4, 0xf3, 0xdc, 0x83, 0x98, 0xc6, 0x16, - 0xa6, 0x31, 0xe1, 0xde, 0x05, 0xdf, 0x2a, 0xb2, 0x22, 0xe5, 0x14, 0xce, 0x84, 0xdc, 0x91, 0x3e, - 0xf5, 0x2d, 0x00, 0x69, 0xee, 0x45, 0x21, 0x76, 0x17, 0xa4, 0xd0, 0xf6, 0xea, 0xe0, 0x67, 0xb7, - 0xa5, 0xa1, 0x09, 0x83, 0x45, 0xfc, 0xe9, 0xf1, 0xf1, 0xe4, 0x0d, 0x3c, 0xab, 0x45, 0xef, 0x49, - 0xe1, 0xdc, 0x4f, 0x65, 0xa9, 0x7e, 0x05, 0x47, 0x79, 0xc2, 0x38, 0x5a, 0x10, 0xdf, 0xf5, 0x50, - 0x84, 0x12, 0x4c, 0xb4, 0xee, 0x48, 0x19, 0x1f, 0x4e, 0x07, 0xb0, 0x19, 0x44, 0xf5, 0xf4, 0xb0, - 0x79, 0x7a, 0x78, 0x4a, 0xc3, 0xc4, 0xd6, 0x2e, 0x4b, 0xa3, 0xb3, 0x2e, 0x8d, 0x96, 0xd5, 0xe9, - 0x49, 0xc6, 0x16, 0x84, 0xfa, 0x09, 0x3c, 0x62, 0x79, 0x9a, 0x46, 0x21, 0xc9, 0xdc, 0xba, 0xa3, - 0xed, 0xef, 0x4a, 0x7f, 0xda, 0xa4, 0xff, 0x63, 0x74, 0x1e, 0x4a, 0x7c, 0x5e, 0x41, 0x15, 0x81, - 0x3e, 0xaa, 0x30, 0xae, 0xc7, 0xd6, 0x84, 0xdf, 0xd9, 0x15, 0x3e, 0x68, 0xc2, 0xdb, 0x5e, 0xe7, - 0x68, 0x8b, 0x12, 0x47, 0x7c, 0x01, 0x7d, 0x5c, 0xcd, 0x90, 0xf8, 0x2e, 0xe2, 0xee, 0x9c, 0x84, - 0xc1, 0x9c, 0x6b, 0x07, 0x23, 0x65, 0xdc, 0xb5, 0x27, 0x55, 0x46, 0xab, 0x79, 0x53, 0x1a, 0x9a, - 0x58, 0x8c, 0x56, 0xcb, 0x74, 0x7a, 0x0d, 0x37, 0xe3, 0xef, 0x6a, 0xc6, 0x3e, 0xbb, 0x5c, 0xea, - 0xca, 0xd5, 0x52, 0x57, 0xae, 0x97, 0xba, 0xf2, 0x67, 0xa9, 0x2b, 0xbf, 0x56, 0x7a, 0xe7, 0x6a, - 0xa5, 0x77, 0xae, 0x57, 0x7a, 0xe7, 0xf3, 0x74, 0x6b, 0x19, 0xaa, 0x35, 0x7d, 0x95, 0x10, 0xfe, - 0x9d, 0x66, 0x0b, 0x6b, 0xf3, 0xd1, 0x7e, 0x6c, 0x7d, 0x35, 0x5e, 0xa4, 0x84, 0x79, 0x07, 0xf5, - 0xfa, 0xbf, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x1b, 0xa4, 0x56, 0x94, 0x8d, 0x03, 0x00, 0x00, + // 549 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x3f, 0x6f, 0xd3, 0x40, + 0x14, 0x8f, 0xdb, 0x52, 0xda, 0x2b, 0x90, 0xc6, 0x4a, 0x91, 0x13, 0x21, 0x3b, 0xca, 0x80, 0xc2, + 0x50, 0x9b, 0x04, 0x75, 0x00, 0xa6, 0xb8, 0x0c, 0x48, 0x08, 0xa9, 0x72, 0x16, 0x84, 0x04, 0xd6, + 0xf9, 0x7c, 0x38, 0xa7, 0xd8, 0x77, 0xd6, 0xdd, 0x05, 0x88, 0xf8, 0x12, 0x7c, 0x18, 0x3e, 0x44, + 0xc7, 0x8a, 0xa9, 0x93, 0x85, 0x92, 0x2d, 0x63, 0x17, 0x24, 0x26, 0x64, 0x9f, 0x1d, 0x55, 0x75, + 0xa5, 0x6e, 0xf7, 0x7e, 0xff, 0x9e, 0x7d, 0xf7, 0x1e, 0x78, 0x9a, 0xb2, 0x99, 0xe4, 0x2c, 0x8e, + 0x9d, 0x84, 0x44, 0x1c, 0x4a, 0xc2, 0xa8, 0x93, 0x30, 0x2e, 0xb0, 0xcf, 0x28, 0x9a, 0x42, 0x42, + 0xed, 0x94, 0x33, 0xc9, 0x74, 0xbd, 0xd2, 0xd9, 0x1b, 0x5d, 0xb7, 0x83, 0x98, 0x48, 0x98, 0xf0, + 0x0b, 0x85, 0xa3, 0x0a, 0x25, 0xef, 0x9a, 0xaa, 0x72, 0x02, 0x28, 0xb0, 0xf3, 0x75, 0x18, 0x60, + 0x09, 0x87, 0x0e, 0x62, 0x55, 0x5c, 0xb7, 0x1d, 0xb1, 0x88, 0x29, 0x5f, 0x7e, 0x52, 0x68, 0xff, + 0x07, 0x68, 0xbd, 0xcf, 0x7b, 0x8f, 0x11, 0x62, 0x73, 0x2a, 0x27, 0x12, 0x4a, 0xac, 0x7f, 0x01, + 0x7b, 0x50, 0xd5, 0xc2, 0xd8, 0xea, 0x6d, 0x0f, 0x0e, 0x46, 0xcf, 0xec, 0xfa, 0xc7, 0xd8, 0x85, + 0xf1, 0x34, 0x86, 0x24, 0x81, 0x41, 0x5c, 0x25, 0xb8, 0xd6, 0x3a, 0xb3, 0x36, 0xf6, 0xab, 0xcc, + 0x6a, 0x2e, 0x60, 0x12, 0xbf, 0xea, 0x57, 0x48, 0xdf, 0xdb, 0x90, 0xfd, 0xbf, 0x3b, 0xe0, 0xe8, + 0xd6, 0x10, 0x3d, 0x00, 0x6d, 0x31, 0x85, 0x94, 0x32, 0xea, 0x87, 0x58, 0x48, 0x1f, 0x86, 0x21, + 0xc7, 0x42, 0x18, 0x5a, 0x4f, 0x1b, 0xec, 0xbb, 0xcf, 0xd7, 0x99, 0x75, 0x2b, 0xff, 0xfb, 0xd7, + 0x71, 0xbb, 0xbc, 0x94, 0xb1, 0x42, 0x26, 0x92, 0x13, 0x1a, 0x79, 0x7a, 0xa9, 0x7e, 0x83, 0x85, + 0x2c, 0x19, 0x7d, 0x0c, 0x5a, 0xea, 0xda, 0x05, 0x47, 0x9b, 0x06, 0x5b, 0x45, 0x83, 0xa3, 0x75, + 0x66, 0xd5, 0x49, 0xaf, 0x59, 0x40, 0x13, 0x8e, 0xaa, 0x88, 0xd7, 0x00, 0xa4, 0xf3, 0x20, 0x26, + 0xc8, 0x9f, 0xe1, 0x85, 0xb1, 0xd3, 0xd3, 0x06, 0x0f, 0xdc, 0x27, 0xff, 0x32, 0xcb, 0x40, 0x7c, + 0x91, 0x4a, 0xe6, 0xe0, 0x70, 0x74, 0x72, 0x32, 0x7c, 0x69, 0x9f, 0x15, 0xa2, 0x77, 0x78, 0xe1, + 0xed, 0xa7, 0xd5, 0x51, 0xff, 0x0c, 0x0e, 0xe7, 0x54, 0x48, 0x38, 0xc3, 0xa1, 0x1f, 0xc0, 0x18, + 0x52, 0x84, 0x8d, 0x7b, 0x3d, 0x6d, 0x70, 0x30, 0xea, 0xd8, 0xe5, 0x4f, 0xe4, 0x6f, 0x69, 0x97, + 0x6f, 0x69, 0x9f, 0x32, 0x42, 0x5d, 0xe3, 0x3c, 0xb3, 0x1a, 0xeb, 0xcc, 0xaa, 0x59, 0xbd, 0x66, + 0x85, 0xb8, 0x0a, 0xd0, 0x3f, 0x80, 0x47, 0x62, 0x9e, 0xa6, 0x31, 0xc1, 0xdc, 0x2f, 0x18, 0x63, + 0xf7, 0xae, 0xf4, 0xc7, 0x65, 0xfa, 0x0d, 0xa3, 0xf7, 0xb0, 0xaa, 0x27, 0x79, 0xa9, 0x43, 0xd0, + 0x82, 0x79, 0x8d, 0x8a, 0x39, 0x28, 0xc3, 0xef, 0xdf, 0x15, 0xde, 0x29, 0xc3, 0xeb, 0x5e, 0xef, + 0xf0, 0x1a, 0xa4, 0x5a, 0x7c, 0x02, 0x2d, 0x94, 0x0f, 0x05, 0x0e, 0x7d, 0x28, 0xfd, 0x29, 0x26, + 0xd1, 0x54, 0x1a, 0x7b, 0x3d, 0x6d, 0xb0, 0xed, 0x0e, 0xf3, 0x8c, 0x1a, 0x79, 0x95, 0x59, 0x86, + 0x9a, 0xb4, 0x1a, 0xd5, 0xf7, 0x9a, 0x25, 0x36, 0x96, 0x6f, 0x0b, 0xc4, 0x3d, 0x3b, 0x5f, 0x9a, + 0xda, 0xc5, 0xd2, 0xd4, 0x2e, 0x97, 0xa6, 0xf6, 0x67, 0x69, 0x6a, 0x3f, 0x57, 0x66, 0xe3, 0x62, + 0x65, 0x36, 0x2e, 0x57, 0x66, 0xe3, 0xe3, 0x28, 0x22, 0x72, 0x3a, 0x0f, 0x6c, 0xc4, 0x12, 0x27, + 0x9f, 0xfb, 0x63, 0x8a, 0xe5, 0x37, 0xc6, 0x67, 0xce, 0x66, 0x73, 0xbf, 0x5f, 0xdb, 0x5d, 0xb9, + 0x48, 0xb1, 0x08, 0x76, 0x8b, 0x7d, 0x7a, 0xf1, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x39, 0xb7, 0x2d, + 0x34, 0xde, 0x03, 0x00, 0x00, } func (m *MorseAccountState) Marshal() (dAtA []byte, err error) { @@ -270,7 +281,7 @@ func (m *MorseClaimableAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.ClaimedAtHeight != 0 { i = encodeVarintMorseOnchain(dAtA, i, uint64(m.ClaimedAtHeight)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x40 } { size, err := m.ApplicationStake.MarshalToSizedBuffer(dAtA[:i]) @@ -281,7 +292,7 @@ func (m *MorseClaimableAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintMorseOnchain(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x3a { size, err := m.SupplierStake.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -291,7 +302,7 @@ func (m *MorseClaimableAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintMorseOnchain(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x32 { size, err := m.UnstakedBalance.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -301,18 +312,25 @@ func (m *MorseClaimableAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintMorseOnchain(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x2a if len(m.PublicKey) > 0 { i -= len(m.PublicKey) copy(dAtA[i:], m.PublicKey) i = encodeVarintMorseOnchain(dAtA, i, uint64(len(m.PublicKey))) i-- + dAtA[i] = 0x22 + } + if len(m.MorseSrcAddress) > 0 { + i -= len(m.MorseSrcAddress) + copy(dAtA[i:], m.MorseSrcAddress) + i = encodeVarintMorseOnchain(dAtA, i, uint64(len(m.MorseSrcAddress))) + i-- dAtA[i] = 0x12 } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintMorseOnchain(dAtA, i, uint64(len(m.Address))) + if len(m.ShannonDestAddress) > 0 { + i -= len(m.ShannonDestAddress) + copy(dAtA[i:], m.ShannonDestAddress) + i = encodeVarintMorseOnchain(dAtA, i, uint64(len(m.ShannonDestAddress))) i-- dAtA[i] = 0xa } @@ -351,7 +369,11 @@ func (m *MorseClaimableAccount) Size() (n int) { } var l int _ = l - l = len(m.Address) + l = len(m.ShannonDestAddress) + if l > 0 { + n += 1 + l + sovMorseOnchain(uint64(l)) + } + l = len(m.MorseSrcAddress) if l > 0 { n += 1 + l + sovMorseOnchain(uint64(l)) } @@ -492,9 +514,9 @@ func (m *MorseClaimableAccount) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ShannonDestAddress", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMorseOnchain @@ -504,27 +526,57 @@ func (m *MorseClaimableAccount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthMorseOnchain } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthMorseOnchain } if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) - if m.Address == nil { - m.Address = []byte{} - } + m.ShannonDestAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MorseSrcAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOnchain + } + 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 ErrInvalidLengthMorseOnchain + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMorseOnchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MorseSrcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) } @@ -558,7 +610,7 @@ func (m *MorseClaimableAccount) Unmarshal(dAtA []byte) error { m.PublicKey = []byte{} } iNdEx = postIndex - case 3: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UnstakedBalance", wireType) } @@ -591,7 +643,7 @@ func (m *MorseClaimableAccount) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SupplierStake", wireType) } @@ -624,7 +676,7 @@ func (m *MorseClaimableAccount) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ApplicationStake", wireType) } @@ -657,7 +709,7 @@ func (m *MorseClaimableAccount) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 8: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) } From fc252cf43b96db3ee93e3239cbadc537938d8175 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 17 Feb 2025 10:29:06 +0100 Subject: [PATCH 11/81] scaffold: message claim_morse_account --module migration --signer shannon_dest_address morse_src_address morse_signature --response morse_src_address --response claimed_balance:coin --response claimed_at_height:int --- api/poktroll/migration/tx.pulsar.go | 1347 ++++++++++++++++- api/poktroll/migration/tx_grpc.pb.go | 38 + proto/poktroll/migration/tx.proto | 26 +- .../keeper/msg_server_claim_morse_account.go | 17 + x/migration/module/autocli.go | 6 + x/migration/module/simulation.go | 23 + x/migration/simulation/claim_morse_account.go | 28 + x/migration/types/codec.go | 3 + .../types/message_claim_morse_account.go | 25 + .../types/message_claim_morse_account_test.go | 40 + x/migration/types/tx.pb.go | 641 +++++++- 11 files changed, 2111 insertions(+), 83 deletions(-) create mode 100644 x/migration/keeper/msg_server_claim_morse_account.go create mode 100644 x/migration/simulation/claim_morse_account.go create mode 100644 x/migration/types/message_claim_morse_account.go create mode 100644 x/migration/types/message_claim_morse_account_test.go diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index 303317e2b..3948b3d6d 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -3,6 +3,7 @@ package migration import ( _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" _ "cosmossdk.io/api/cosmos/msg/v1" fmt "fmt" _ "github.com/cosmos/cosmos-proto" @@ -1906,6 +1907,1101 @@ func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) ProtoMethods() } } +var ( + md_MsgClaimMorseAccount protoreflect.MessageDescriptor + fd_MsgClaimMorseAccount_shannonDestAddress protoreflect.FieldDescriptor + fd_MsgClaimMorseAccount_morseSrcAddress protoreflect.FieldDescriptor + fd_MsgClaimMorseAccount_morseSignature protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_tx_proto_init() + md_MsgClaimMorseAccount = File_poktroll_migration_tx_proto.Messages().ByName("MsgClaimMorseAccount") + fd_MsgClaimMorseAccount_shannonDestAddress = md_MsgClaimMorseAccount.Fields().ByName("shannonDestAddress") + fd_MsgClaimMorseAccount_morseSrcAddress = md_MsgClaimMorseAccount.Fields().ByName("morseSrcAddress") + fd_MsgClaimMorseAccount_morseSignature = md_MsgClaimMorseAccount.Fields().ByName("morseSignature") +} + +var _ protoreflect.Message = (*fastReflection_MsgClaimMorseAccount)(nil) + +type fastReflection_MsgClaimMorseAccount MsgClaimMorseAccount + +func (x *MsgClaimMorseAccount) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClaimMorseAccount)(x) +} + +func (x *MsgClaimMorseAccount) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_tx_proto_msgTypes[4] + 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_MsgClaimMorseAccount_messageType fastReflection_MsgClaimMorseAccount_messageType +var _ protoreflect.MessageType = fastReflection_MsgClaimMorseAccount_messageType{} + +type fastReflection_MsgClaimMorseAccount_messageType struct{} + +func (x fastReflection_MsgClaimMorseAccount_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClaimMorseAccount)(nil) +} +func (x fastReflection_MsgClaimMorseAccount_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClaimMorseAccount) +} +func (x fastReflection_MsgClaimMorseAccount_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimMorseAccount +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClaimMorseAccount) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimMorseAccount +} + +// 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_MsgClaimMorseAccount) Type() protoreflect.MessageType { + return _fastReflection_MsgClaimMorseAccount_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClaimMorseAccount) New() protoreflect.Message { + return new(fastReflection_MsgClaimMorseAccount) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClaimMorseAccount) Interface() protoreflect.ProtoMessage { + return (*MsgClaimMorseAccount)(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_MsgClaimMorseAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ShannonDestAddress != "" { + value := protoreflect.ValueOfString(x.ShannonDestAddress) + if !f(fd_MsgClaimMorseAccount_shannonDestAddress, value) { + return + } + } + if x.MorseSrcAddress != "" { + value := protoreflect.ValueOfString(x.MorseSrcAddress) + if !f(fd_MsgClaimMorseAccount_morseSrcAddress, value) { + return + } + } + if x.MorseSignature != "" { + value := protoreflect.ValueOfString(x.MorseSignature) + if !f(fd_MsgClaimMorseAccount_morseSignature, 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_MsgClaimMorseAccount) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseAccount.shannonDestAddress": + return x.ShannonDestAddress != "" + case "poktroll.migration.MsgClaimMorseAccount.morseSrcAddress": + return x.MorseSrcAddress != "" + case "poktroll.migration.MsgClaimMorseAccount.morseSignature": + return x.MorseSignature != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseAccount 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_MsgClaimMorseAccount) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseAccount.shannonDestAddress": + x.ShannonDestAddress = "" + case "poktroll.migration.MsgClaimMorseAccount.morseSrcAddress": + x.MorseSrcAddress = "" + case "poktroll.migration.MsgClaimMorseAccount.morseSignature": + x.MorseSignature = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseAccount 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_MsgClaimMorseAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MsgClaimMorseAccount.shannonDestAddress": + value := x.ShannonDestAddress + return protoreflect.ValueOfString(value) + case "poktroll.migration.MsgClaimMorseAccount.morseSrcAddress": + value := x.MorseSrcAddress + return protoreflect.ValueOfString(value) + case "poktroll.migration.MsgClaimMorseAccount.morseSignature": + value := x.MorseSignature + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseAccount 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_MsgClaimMorseAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseAccount.shannonDestAddress": + x.ShannonDestAddress = value.Interface().(string) + case "poktroll.migration.MsgClaimMorseAccount.morseSrcAddress": + x.MorseSrcAddress = value.Interface().(string) + case "poktroll.migration.MsgClaimMorseAccount.morseSignature": + x.MorseSignature = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseAccount 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_MsgClaimMorseAccount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseAccount.shannonDestAddress": + panic(fmt.Errorf("field shannonDestAddress of message poktroll.migration.MsgClaimMorseAccount is not mutable")) + case "poktroll.migration.MsgClaimMorseAccount.morseSrcAddress": + panic(fmt.Errorf("field morseSrcAddress of message poktroll.migration.MsgClaimMorseAccount is not mutable")) + case "poktroll.migration.MsgClaimMorseAccount.morseSignature": + panic(fmt.Errorf("field morseSignature of message poktroll.migration.MsgClaimMorseAccount is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseAccount 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_MsgClaimMorseAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseAccount.shannonDestAddress": + return protoreflect.ValueOfString("") + case "poktroll.migration.MsgClaimMorseAccount.morseSrcAddress": + return protoreflect.ValueOfString("") + case "poktroll.migration.MsgClaimMorseAccount.morseSignature": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseAccount 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_MsgClaimMorseAccount) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MsgClaimMorseAccount", 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_MsgClaimMorseAccount) 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_MsgClaimMorseAccount) 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_MsgClaimMorseAccount) 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_MsgClaimMorseAccount) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClaimMorseAccount) + 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.ShannonDestAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MorseSrcAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MorseSignature) + 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().(*MsgClaimMorseAccount) + 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.MorseSignature) > 0 { + i -= len(x.MorseSignature) + copy(dAtA[i:], x.MorseSignature) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseSignature))) + i-- + dAtA[i] = 0x1a + } + if len(x.MorseSrcAddress) > 0 { + i -= len(x.MorseSrcAddress) + copy(dAtA[i:], x.MorseSrcAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseSrcAddress))) + i-- + dAtA[i] = 0x12 + } + if len(x.ShannonDestAddress) > 0 { + i -= len(x.ShannonDestAddress) + copy(dAtA[i:], x.ShannonDestAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ShannonDestAddress))) + 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().(*MsgClaimMorseAccount) + 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: MsgClaimMorseAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimMorseAccount: 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 ShannonDestAddress", 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.ShannonDestAddress = 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 MorseSrcAddress", 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.MorseSrcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MorseSignature", 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.MorseSignature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgClaimMorseAccountResponse protoreflect.MessageDescriptor + fd_MsgClaimMorseAccountResponse_morseSrcAddress protoreflect.FieldDescriptor + fd_MsgClaimMorseAccountResponse_claimedBalance protoreflect.FieldDescriptor + fd_MsgClaimMorseAccountResponse_claimedAtHeight protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_tx_proto_init() + md_MsgClaimMorseAccountResponse = File_poktroll_migration_tx_proto.Messages().ByName("MsgClaimMorseAccountResponse") + fd_MsgClaimMorseAccountResponse_morseSrcAddress = md_MsgClaimMorseAccountResponse.Fields().ByName("morseSrcAddress") + fd_MsgClaimMorseAccountResponse_claimedBalance = md_MsgClaimMorseAccountResponse.Fields().ByName("claimedBalance") + fd_MsgClaimMorseAccountResponse_claimedAtHeight = md_MsgClaimMorseAccountResponse.Fields().ByName("claimedAtHeight") +} + +var _ protoreflect.Message = (*fastReflection_MsgClaimMorseAccountResponse)(nil) + +type fastReflection_MsgClaimMorseAccountResponse MsgClaimMorseAccountResponse + +func (x *MsgClaimMorseAccountResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClaimMorseAccountResponse)(x) +} + +func (x *MsgClaimMorseAccountResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_tx_proto_msgTypes[5] + 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_MsgClaimMorseAccountResponse_messageType fastReflection_MsgClaimMorseAccountResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgClaimMorseAccountResponse_messageType{} + +type fastReflection_MsgClaimMorseAccountResponse_messageType struct{} + +func (x fastReflection_MsgClaimMorseAccountResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClaimMorseAccountResponse)(nil) +} +func (x fastReflection_MsgClaimMorseAccountResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClaimMorseAccountResponse) +} +func (x fastReflection_MsgClaimMorseAccountResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimMorseAccountResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClaimMorseAccountResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimMorseAccountResponse +} + +// 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_MsgClaimMorseAccountResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgClaimMorseAccountResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClaimMorseAccountResponse) New() protoreflect.Message { + return new(fastReflection_MsgClaimMorseAccountResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClaimMorseAccountResponse) Interface() protoreflect.ProtoMessage { + return (*MsgClaimMorseAccountResponse)(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_MsgClaimMorseAccountResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.MorseSrcAddress != "" { + value := protoreflect.ValueOfString(x.MorseSrcAddress) + if !f(fd_MsgClaimMorseAccountResponse_morseSrcAddress, value) { + return + } + } + if x.ClaimedBalance != nil { + value := protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) + if !f(fd_MsgClaimMorseAccountResponse_claimedBalance, value) { + return + } + } + if x.ClaimedAtHeight != int32(0) { + value := protoreflect.ValueOfInt32(x.ClaimedAtHeight) + if !f(fd_MsgClaimMorseAccountResponse_claimedAtHeight, 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_MsgClaimMorseAccountResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseAccountResponse.morseSrcAddress": + return x.MorseSrcAddress != "" + case "poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance": + return x.ClaimedBalance != nil + case "poktroll.migration.MsgClaimMorseAccountResponse.claimedAtHeight": + return x.ClaimedAtHeight != int32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseAccountResponse 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_MsgClaimMorseAccountResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseAccountResponse.morseSrcAddress": + x.MorseSrcAddress = "" + case "poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance": + x.ClaimedBalance = nil + case "poktroll.migration.MsgClaimMorseAccountResponse.claimedAtHeight": + x.ClaimedAtHeight = int32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseAccountResponse 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_MsgClaimMorseAccountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MsgClaimMorseAccountResponse.morseSrcAddress": + value := x.MorseSrcAddress + return protoreflect.ValueOfString(value) + case "poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance": + value := x.ClaimedBalance + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.MsgClaimMorseAccountResponse.claimedAtHeight": + value := x.ClaimedAtHeight + return protoreflect.ValueOfInt32(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseAccountResponse 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_MsgClaimMorseAccountResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseAccountResponse.morseSrcAddress": + x.MorseSrcAddress = value.Interface().(string) + case "poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance": + x.ClaimedBalance = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.migration.MsgClaimMorseAccountResponse.claimedAtHeight": + x.ClaimedAtHeight = int32(value.Int()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseAccountResponse 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_MsgClaimMorseAccountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance": + if x.ClaimedBalance == nil { + x.ClaimedBalance = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) + case "poktroll.migration.MsgClaimMorseAccountResponse.morseSrcAddress": + panic(fmt.Errorf("field morseSrcAddress of message poktroll.migration.MsgClaimMorseAccountResponse is not mutable")) + case "poktroll.migration.MsgClaimMorseAccountResponse.claimedAtHeight": + panic(fmt.Errorf("field claimedAtHeight of message poktroll.migration.MsgClaimMorseAccountResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseAccountResponse 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_MsgClaimMorseAccountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseAccountResponse.morseSrcAddress": + return protoreflect.ValueOfString("") + case "poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.MsgClaimMorseAccountResponse.claimedAtHeight": + return protoreflect.ValueOfInt32(int32(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseAccountResponse 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_MsgClaimMorseAccountResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MsgClaimMorseAccountResponse", 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_MsgClaimMorseAccountResponse) 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_MsgClaimMorseAccountResponse) 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_MsgClaimMorseAccountResponse) 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_MsgClaimMorseAccountResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClaimMorseAccountResponse) + 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.MorseSrcAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ClaimedBalance != nil { + l = options.Size(x.ClaimedBalance) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ClaimedAtHeight != 0 { + n += 1 + runtime.Sov(uint64(x.ClaimedAtHeight)) + } + 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().(*MsgClaimMorseAccountResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.ClaimedAtHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimedAtHeight)) + i-- + dAtA[i] = 0x18 + } + if x.ClaimedBalance != nil { + encoded, err := options.Marshal(x.ClaimedBalance) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.MorseSrcAddress) > 0 { + i -= len(x.MorseSrcAddress) + copy(dAtA[i:], x.MorseSrcAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseSrcAddress))) + 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().(*MsgClaimMorseAccountResponse) + 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: MsgClaimMorseAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimMorseAccountResponse: 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 MorseSrcAddress", 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.MorseSrcAddress = 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 ClaimedBalance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ClaimedBalance == nil { + x.ClaimedBalance = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedBalance); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) + } + x.ClaimedAtHeight = 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.ClaimedAtHeight |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + 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 @@ -2100,6 +3196,108 @@ func (x *MsgImportMorseClaimableAccountsResponse) GetNumAccounts() uint64 { return 0 } +type MsgClaimMorseAccount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannonDestAddress,proto3" json:"shannonDestAddress,omitempty"` + MorseSrcAddress string `protobuf:"bytes,2,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` + MorseSignature string `protobuf:"bytes,3,opt,name=morseSignature,proto3" json:"morseSignature,omitempty"` +} + +func (x *MsgClaimMorseAccount) Reset() { + *x = MsgClaimMorseAccount{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClaimMorseAccount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClaimMorseAccount) ProtoMessage() {} + +// Deprecated: Use MsgClaimMorseAccount.ProtoReflect.Descriptor instead. +func (*MsgClaimMorseAccount) Descriptor() ([]byte, []int) { + return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgClaimMorseAccount) GetShannonDestAddress() string { + if x != nil { + return x.ShannonDestAddress + } + return "" +} + +func (x *MsgClaimMorseAccount) GetMorseSrcAddress() string { + if x != nil { + return x.MorseSrcAddress + } + return "" +} + +func (x *MsgClaimMorseAccount) GetMorseSignature() string { + if x != nil { + return x.MorseSignature + } + return "" +} + +type MsgClaimMorseAccountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MorseSrcAddress string `protobuf:"bytes,1,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` + ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimedBalance,proto3" json:"claimedBalance,omitempty"` + ClaimedAtHeight int32 `protobuf:"varint,3,opt,name=claimedAtHeight,proto3" json:"claimedAtHeight,omitempty"` +} + +func (x *MsgClaimMorseAccountResponse) Reset() { + *x = MsgClaimMorseAccountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClaimMorseAccountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClaimMorseAccountResponse) ProtoMessage() {} + +// Deprecated: Use MsgClaimMorseAccountResponse.ProtoReflect.Descriptor instead. +func (*MsgClaimMorseAccountResponse) Descriptor() ([]byte, []int) { + return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{5} +} + +func (x *MsgClaimMorseAccountResponse) GetMorseSrcAddress() string { + if x != nil { + return x.MorseSrcAddress + } + return "" +} + +func (x *MsgClaimMorseAccountResponse) GetClaimedBalance() *v1beta1.Coin { + if x != nil { + return x.ClaimedBalance + } + return nil +} + +func (x *MsgClaimMorseAccountResponse) GetClaimedAtHeight() int32 { + if x != nil { + return x.ClaimedAtHeight + } + return 0 +} + var File_poktroll_migration_tx_proto protoreflect.FileDescriptor var file_poktroll_migration_tx_proto_rawDesc = []byte{ @@ -2116,7 +3314,9 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x6f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 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, 0xc1, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, + 0x6e, 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, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, @@ -2158,35 +3358,66 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 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, 0x81, 0x02, - 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, + 0x52, 0x0b, 0x6e, 0x75, 0x6d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0xb1, 0x01, + 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, + 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, + 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x26, 0x0a, 0x0e, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x17, 0x82, 0xe7, 0xb0, 0x2a, 0x12, 0x73, + 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x22, 0xbb, 0x01, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, + 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x6f, 0x72, + 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x47, 0x0a, 0x0e, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, + 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x32, + 0xf2, 0x02, 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, 0x90, 0x01, 0x0a, 0x1c, 0x49, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, + 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x33, 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, 0x90, 0x01, 0x0a, 0x1c, 0x49, 0x6d, 0x70, 0x6f, - 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x33, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, - 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, - 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 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, + 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, + 0x3b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, + 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x11, + 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, + 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x30, 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, + 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 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 ( @@ -2201,27 +3432,33 @@ 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, 4) +var file_poktroll_migration_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_poktroll_migration_tx_proto_goTypes = []interface{}{ (*MsgUpdateParams)(nil), // 0: poktroll.migration.MsgUpdateParams (*MsgUpdateParamsResponse)(nil), // 1: poktroll.migration.MsgUpdateParamsResponse (*MsgImportMorseClaimableAccounts)(nil), // 2: poktroll.migration.MsgImportMorseClaimableAccounts (*MsgImportMorseClaimableAccountsResponse)(nil), // 3: poktroll.migration.MsgImportMorseClaimableAccountsResponse - (*Params)(nil), // 4: poktroll.migration.Params - (*MorseAccountState)(nil), // 5: poktroll.migration.MorseAccountState + (*MsgClaimMorseAccount)(nil), // 4: poktroll.migration.MsgClaimMorseAccount + (*MsgClaimMorseAccountResponse)(nil), // 5: poktroll.migration.MsgClaimMorseAccountResponse + (*Params)(nil), // 6: poktroll.migration.Params + (*MorseAccountState)(nil), // 7: poktroll.migration.MorseAccountState + (*v1beta1.Coin)(nil), // 8: cosmos.base.v1beta1.Coin } var file_poktroll_migration_tx_proto_depIdxs = []int32{ - 4, // 0: poktroll.migration.MsgUpdateParams.params:type_name -> poktroll.migration.Params - 5, // 1: poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state:type_name -> poktroll.migration.MorseAccountState - 0, // 2: poktroll.migration.Msg.UpdateParams:input_type -> poktroll.migration.MsgUpdateParams - 2, // 3: poktroll.migration.Msg.ImportMorseClaimableAccounts:input_type -> poktroll.migration.MsgImportMorseClaimableAccounts - 1, // 4: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.MsgUpdateParamsResponse - 3, // 5: poktroll.migration.Msg.ImportMorseClaimableAccounts:output_type -> poktroll.migration.MsgImportMorseClaimableAccountsResponse - 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 + 6, // 0: poktroll.migration.MsgUpdateParams.params:type_name -> poktroll.migration.Params + 7, // 1: poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state:type_name -> poktroll.migration.MorseAccountState + 8, // 2: poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance:type_name -> cosmos.base.v1beta1.Coin + 0, // 3: poktroll.migration.Msg.UpdateParams:input_type -> poktroll.migration.MsgUpdateParams + 2, // 4: poktroll.migration.Msg.ImportMorseClaimableAccounts:input_type -> poktroll.migration.MsgImportMorseClaimableAccounts + 4, // 5: poktroll.migration.Msg.ClaimMorseAccount:input_type -> poktroll.migration.MsgClaimMorseAccount + 1, // 6: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.MsgUpdateParamsResponse + 3, // 7: poktroll.migration.Msg.ImportMorseClaimableAccounts:output_type -> poktroll.migration.MsgImportMorseClaimableAccountsResponse + 5, // 8: poktroll.migration.Msg.ClaimMorseAccount:output_type -> poktroll.migration.MsgClaimMorseAccountResponse + 6, // [6:9] is the sub-list for method output_type + 3, // [3:6] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_poktroll_migration_tx_proto_init() } @@ -2280,6 +3517,30 @@ func file_poktroll_migration_tx_proto_init() { return nil } } + file_poktroll_migration_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClaimMorseAccount); 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[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClaimMorseAccountResponse); 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{ @@ -2287,7 +3548,7 @@ func file_poktroll_migration_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_migration_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/api/poktroll/migration/tx_grpc.pb.go b/api/poktroll/migration/tx_grpc.pb.go index 3c65727fe..cd76ece4e 100644 --- a/api/poktroll/migration/tx_grpc.pb.go +++ b/api/poktroll/migration/tx_grpc.pb.go @@ -21,6 +21,7 @@ const _ = grpc.SupportPackageIsVersion8 const ( Msg_UpdateParams_FullMethodName = "/poktroll.migration.Msg/UpdateParams" Msg_ImportMorseClaimableAccounts_FullMethodName = "/poktroll.migration.Msg/ImportMorseClaimableAccounts" + Msg_ClaimMorseAccount_FullMethodName = "/poktroll.migration.Msg/ClaimMorseAccount" ) // MsgClient is the client API for Msg service. @@ -33,6 +34,7 @@ type MsgClient interface { // parameters. The authority defaults to the x/gov module account. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) ImportMorseClaimableAccounts(ctx context.Context, in *MsgImportMorseClaimableAccounts, opts ...grpc.CallOption) (*MsgImportMorseClaimableAccountsResponse, error) + ClaimMorseAccount(ctx context.Context, in *MsgClaimMorseAccount, opts ...grpc.CallOption) (*MsgClaimMorseAccountResponse, error) } type msgClient struct { @@ -63,6 +65,16 @@ func (c *msgClient) ImportMorseClaimableAccounts(ctx context.Context, in *MsgImp return out, nil } +func (c *msgClient) ClaimMorseAccount(ctx context.Context, in *MsgClaimMorseAccount, opts ...grpc.CallOption) (*MsgClaimMorseAccountResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgClaimMorseAccountResponse) + err := c.cc.Invoke(ctx, Msg_ClaimMorseAccount_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 @@ -73,6 +85,7 @@ type MsgServer interface { // parameters. The authority defaults to the x/gov module account. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) ImportMorseClaimableAccounts(context.Context, *MsgImportMorseClaimableAccounts) (*MsgImportMorseClaimableAccountsResponse, error) + ClaimMorseAccount(context.Context, *MsgClaimMorseAccount) (*MsgClaimMorseAccountResponse, error) mustEmbedUnimplementedMsgServer() } @@ -86,6 +99,9 @@ func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (* func (UnimplementedMsgServer) ImportMorseClaimableAccounts(context.Context, *MsgImportMorseClaimableAccounts) (*MsgImportMorseClaimableAccountsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ImportMorseClaimableAccounts not implemented") } +func (UnimplementedMsgServer) ClaimMorseAccount(context.Context, *MsgClaimMorseAccount) (*MsgClaimMorseAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClaimMorseAccount not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -135,6 +151,24 @@ func _Msg_ImportMorseClaimableAccounts_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _Msg_ClaimMorseAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClaimMorseAccount) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ClaimMorseAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_ClaimMorseAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ClaimMorseAccount(ctx, req.(*MsgClaimMorseAccount)) + } + 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) @@ -150,6 +184,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "ImportMorseClaimableAccounts", Handler: _Msg_ImportMorseClaimableAccounts_Handler, }, + { + MethodName: "ClaimMorseAccount", + Handler: _Msg_ClaimMorseAccount_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/migration/tx.proto", diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index c1b81ab35..fa80833b4 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -8,6 +8,7 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "poktroll/migration/morse_onchain.proto"; import "poktroll/migration/params.proto"; +import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/pokt-network/poktroll/x/migration/types"; option (gogoproto.stable_marshaler_all) = true; @@ -15,22 +16,23 @@ 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 ImportMorseClaimableAccounts (MsgImportMorseClaimableAccounts) returns (MsgImportMorseClaimableAccountsResponse); + rpc ClaimMorseAccount (MsgClaimMorseAccount ) returns (MsgClaimMorseAccountResponse ); } // MsgUpdateParams is the Msg/UpdateParams request type. message 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]; } @@ -44,7 +46,7 @@ message MsgImportMorseClaimableAccounts { option (cosmos.msg.v1.signer) = "authority"; // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // the account state derived from the Morse state export and the `poktrolld migrate collect-morse-accounts` command. MorseAccountState morse_account_state = 2 [(gogoproto.jsontag) = "morse_account_state", (gogoproto.nullable) = false]; @@ -60,9 +62,25 @@ message MsgImportMorseClaimableAccounts { } message MsgImportMorseClaimableAccountsResponse { + // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. bytes state_hash = 1 [(gogoproto.jsontag) = "state_hash"]; + // Number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. uint64 num_accounts = 2 [(gogoproto.jsontag) = "num_accounts"]; } + +message MsgClaimMorseAccount { + option (cosmos.msg.v1.signer) = "shannonDestAddress"; + string shannonDestAddress = 1; + string morseSrcAddress = 2; + string morseSignature = 3; +} + +message MsgClaimMorseAccountResponse { + string morseSrcAddress = 1; + cosmos.base.v1beta1.Coin claimedBalance = 2 [(gogoproto.nullable) = false]; + int32 claimedAtHeight = 3; +} + diff --git a/x/migration/keeper/msg_server_claim_morse_account.go b/x/migration/keeper/msg_server_claim_morse_account.go new file mode 100644 index 000000000..ef657a205 --- /dev/null +++ b/x/migration/keeper/msg_server_claim_morse_account.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + +) + +func (k msgServer) ClaimMorseAccount(goCtx context.Context, msg *types.MsgClaimMorseAccount) (*types.MsgClaimMorseAccountResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgClaimMorseAccountResponse{}, nil +} diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index 38485e870..b93bd3365 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -50,6 +50,12 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morseAccountState"}}, Skip: true, // skipped because authority gated }, + { + RpcMethod: "ClaimMorseAccount", + Use: "claim-morse-account [morse-src-address] [morse-signature]", + Short: "Send a claim_morse_account tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morseSrcAddress"}, {ProtoField: "morseSignature"}}, + }, // this line is used by ignite scaffolding # autocli/tx }, }, diff --git a/x/migration/module/simulation.go b/x/migration/module/simulation.go index 4ade18a81..47596f99f 100644 --- a/x/migration/module/simulation.go +++ b/x/migration/module/simulation.go @@ -27,6 +27,10 @@ const ( // TODO: Determine the simulation weight value defaultWeightMsgImportMorseClaimableAccounts int = 100 + opWeightMsgClaimMorseAccount = "op_weight_msg_claim_morse_account" + // TODO: Determine the simulation weight value + defaultWeightMsgClaimMorseAccount int = 100 + // this line is used by starport scaffolding # simapp/module/const ) @@ -61,6 +65,17 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp migrationsimulation.SimulateMsgImportMorseClaimableAccounts(am.accountKeeper, am.bankKeeper, am.keeper), )) + var weightMsgClaimMorseAccount int + simState.AppParams.GetOrGenerate(opWeightMsgClaimMorseAccount, &weightMsgClaimMorseAccount, nil, + func(_ *rand.Rand) { + weightMsgClaimMorseAccount = defaultWeightMsgClaimMorseAccount + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgClaimMorseAccount, + migrationsimulation.SimulateMsgClaimMorseAccount(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations @@ -77,6 +92,14 @@ func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.Wei return nil }, ), + simulation.NewWeightedProposalMsg( + opWeightMsgClaimMorseAccount, + defaultWeightMsgClaimMorseAccount, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + migrationsimulation.SimulateMsgClaimMorseAccount(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, + ), // this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/migration/simulation/claim_morse_account.go b/x/migration/simulation/claim_morse_account.go new file mode 100644 index 000000000..c646b784b --- /dev/null +++ b/x/migration/simulation/claim_morse_account.go @@ -0,0 +1,28 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + " +) + +func SimulateMsgClaimMorseAccount( + 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.MsgClaimMorseAccount{ + ShannonDestAddress: simAccount.Address.String(), + } + + // TODO: Handling the ClaimMorseAccount simulation + + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "ClaimMorseAccount simulation not implemented"), nil, nil + } +} diff --git a/x/migration/types/codec.go b/x/migration/types/codec.go index eafcdd61a..7c2642ad2 100644 --- a/x/migration/types/codec.go +++ b/x/migration/types/codec.go @@ -11,6 +11,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgImportMorseClaimableAccounts{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgClaimMorseAccount{}, + ) // this line is used by starport scaffolding # 3 registry.RegisterImplementations((*sdk.Msg)(nil), diff --git a/x/migration/types/message_claim_morse_account.go b/x/migration/types/message_claim_morse_account.go new file mode 100644 index 000000000..0a31a94dd --- /dev/null +++ b/x/migration/types/message_claim_morse_account.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 = &MsgClaimMorseAccount{} + +func NewMsgClaimMorseAccount(shannonDestAddress string, morseSrcAddress string, morseSignature string) *MsgClaimMorseAccount { + return &MsgClaimMorseAccount{ + ShannonDestAddress: shannonDestAddress, + MorseSrcAddress: morseSrcAddress, + MorseSignature: morseSignature, + } +} + +func (msg *MsgClaimMorseAccount) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.ShannonDestAddress) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid shannonDestAddress address (%s)", err) + } + return nil +} diff --git a/x/migration/types/message_claim_morse_account_test.go b/x/migration/types/message_claim_morse_account_test.go new file mode 100644 index 000000000..83ca6ac00 --- /dev/null +++ b/x/migration/types/message_claim_morse_account_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/pokt-network/poktroll/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgClaimMorseAccount + err error + }{ + { + name: "invalid address", + msg: MsgClaimMorseAccount{ + ShannonDestAddress: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgClaimMorseAccount{ + ShannonDestAddress: 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) + }) + } +} diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 825cf2158..a1df8e846 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" @@ -235,52 +236,176 @@ func (m *MsgImportMorseClaimableAccountsResponse) GetNumAccounts() uint64 { return 0 } +type MsgClaimMorseAccount struct { + ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannonDestAddress,proto3" json:"shannonDestAddress,omitempty"` + MorseSrcAddress string `protobuf:"bytes,2,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` + MorseSignature string `protobuf:"bytes,3,opt,name=morseSignature,proto3" json:"morseSignature,omitempty"` +} + +func (m *MsgClaimMorseAccount) Reset() { *m = MsgClaimMorseAccount{} } +func (m *MsgClaimMorseAccount) String() string { return proto.CompactTextString(m) } +func (*MsgClaimMorseAccount) ProtoMessage() {} +func (*MsgClaimMorseAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_21658240592266b6, []int{4} +} +func (m *MsgClaimMorseAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimMorseAccount) 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 *MsgClaimMorseAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimMorseAccount.Merge(m, src) +} +func (m *MsgClaimMorseAccount) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimMorseAccount) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimMorseAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimMorseAccount proto.InternalMessageInfo + +func (m *MsgClaimMorseAccount) GetShannonDestAddress() string { + if m != nil { + return m.ShannonDestAddress + } + return "" +} + +func (m *MsgClaimMorseAccount) GetMorseSrcAddress() string { + if m != nil { + return m.MorseSrcAddress + } + return "" +} + +func (m *MsgClaimMorseAccount) GetMorseSignature() string { + if m != nil { + return m.MorseSignature + } + return "" +} + +type MsgClaimMorseAccountResponse struct { + MorseSrcAddress string `protobuf:"bytes,1,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` + ClaimedBalance types.Coin `protobuf:"bytes,2,opt,name=claimedBalance,proto3" json:"claimedBalance"` + ClaimedAtHeight int32 `protobuf:"varint,3,opt,name=claimedAtHeight,proto3" json:"claimedAtHeight,omitempty"` +} + +func (m *MsgClaimMorseAccountResponse) Reset() { *m = MsgClaimMorseAccountResponse{} } +func (m *MsgClaimMorseAccountResponse) String() string { return proto.CompactTextString(m) } +func (*MsgClaimMorseAccountResponse) ProtoMessage() {} +func (*MsgClaimMorseAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_21658240592266b6, []int{5} +} +func (m *MsgClaimMorseAccountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimMorseAccountResponse) 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 *MsgClaimMorseAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimMorseAccountResponse.Merge(m, src) +} +func (m *MsgClaimMorseAccountResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimMorseAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimMorseAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimMorseAccountResponse proto.InternalMessageInfo + +func (m *MsgClaimMorseAccountResponse) GetMorseSrcAddress() string { + if m != nil { + return m.MorseSrcAddress + } + return "" +} + +func (m *MsgClaimMorseAccountResponse) GetClaimedBalance() types.Coin { + if m != nil { + return m.ClaimedBalance + } + return types.Coin{} +} + +func (m *MsgClaimMorseAccountResponse) GetClaimedAtHeight() int32 { + if m != nil { + return m.ClaimedAtHeight + } + return 0 +} + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.migration.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.migration.MsgUpdateParamsResponse") proto.RegisterType((*MsgImportMorseClaimableAccounts)(nil), "poktroll.migration.MsgImportMorseClaimableAccounts") proto.RegisterType((*MsgImportMorseClaimableAccountsResponse)(nil), "poktroll.migration.MsgImportMorseClaimableAccountsResponse") + proto.RegisterType((*MsgClaimMorseAccount)(nil), "poktroll.migration.MsgClaimMorseAccount") + proto.RegisterType((*MsgClaimMorseAccountResponse)(nil), "poktroll.migration.MsgClaimMorseAccountResponse") } func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 557 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xbf, 0x6b, 0xdb, 0x40, - 0x14, 0xf6, 0x39, 0x6d, 0xc0, 0x17, 0x93, 0x36, 0x6a, 0x4a, 0x1c, 0x25, 0x48, 0xc6, 0xfd, 0x65, - 0x5c, 0x6c, 0x51, 0x1b, 0x5a, 0x48, 0xe9, 0x10, 0x75, 0x69, 0x07, 0x43, 0x50, 0xc8, 0xd2, 0xc5, - 0x3d, 0xcb, 0x42, 0x12, 0xf1, 0xdd, 0x89, 0xbb, 0x53, 0x9b, 0x6c, 0x6d, 0xc7, 0x42, 0x21, 0x7f, - 0x46, 0x47, 0x0f, 0xf9, 0x07, 0xba, 0x65, 0x0c, 0x9d, 0x32, 0x89, 0x62, 0x0f, 0x06, 0xff, 0x15, - 0x45, 0xbf, 0x1c, 0xdb, 0x51, 0xd2, 0x92, 0x45, 0xd2, 0xbd, 0xf7, 0xbd, 0xef, 0x7d, 0xef, 0xe3, - 0x9d, 0xe0, 0x96, 0x47, 0x0f, 0x05, 0xa3, 0xfd, 0xbe, 0x86, 0x5d, 0x9b, 0x21, 0xe1, 0x52, 0xa2, - 0x89, 0xa3, 0x86, 0xc7, 0xa8, 0xa0, 0x92, 0x94, 0x26, 0x1b, 0xd3, 0xa4, 0xbc, 0x86, 0xb0, 0x4b, - 0xa8, 0x16, 0x3d, 0x63, 0x98, 0xbc, 0x61, 0x52, 0x8e, 0x29, 0xd7, 0x30, 0xb7, 0xb5, 0x4f, 0x2f, - 0xc2, 0x57, 0x92, 0xd8, 0x8c, 0x13, 0x9d, 0xe8, 0xa4, 0xc5, 0x87, 0x24, 0xb5, 0x6e, 0x53, 0x9b, - 0xc6, 0xf1, 0xf0, 0x2b, 0x89, 0x3e, 0xcd, 0x50, 0x83, 0x29, 0xe3, 0x56, 0x87, 0x12, 0xd3, 0x41, - 0x2e, 0x49, 0x70, 0x6a, 0x06, 0xce, 0x43, 0x0c, 0xe1, 0x84, 0xbe, 0xf2, 0x0b, 0xc0, 0x7b, 0x6d, - 0x6e, 0x1f, 0x78, 0x3d, 0x24, 0xac, 0xbd, 0x28, 0x23, 0xbd, 0x84, 0x05, 0xe4, 0x0b, 0x87, 0x32, - 0x57, 0x1c, 0x97, 0x40, 0x19, 0x54, 0x0b, 0x7a, 0xe9, 0xf7, 0x69, 0x7d, 0x3d, 0xd1, 0xb5, 0xdb, - 0xeb, 0x31, 0x8b, 0xf3, 0x7d, 0xc1, 0x5c, 0x62, 0x1b, 0x97, 0x50, 0xe9, 0x0d, 0x5c, 0x8e, 0xb9, - 0x4b, 0xf9, 0x32, 0xa8, 0xae, 0x34, 0xe5, 0xc6, 0x55, 0x5b, 0x1a, 0x71, 0x0f, 0xbd, 0x70, 0x16, - 0xa8, 0xb9, 0x9f, 0xe3, 0x41, 0x0d, 0x18, 0x49, 0xd1, 0xce, 0xab, 0x6f, 0xe3, 0x41, 0xed, 0x92, - 0xee, 0xfb, 0x78, 0x50, 0x7b, 0x3c, 0x95, 0x7f, 0x34, 0x33, 0xc0, 0x82, 0xde, 0xca, 0x26, 0xdc, - 0x58, 0x08, 0x19, 0x16, 0xf7, 0x28, 0xe1, 0x56, 0xe5, 0x34, 0x0f, 0xd5, 0x36, 0xb7, 0xdf, 0x63, - 0x8f, 0x32, 0xd1, 0x0e, 0x0d, 0x7a, 0xdb, 0x47, 0x2e, 0x46, 0xdd, 0xbe, 0xb5, 0x6b, 0x9a, 0xd4, - 0x27, 0xe2, 0xf6, 0xe3, 0x32, 0xf8, 0x20, 0xb6, 0x1c, 0xc5, 0x4c, 0x1d, 0x2e, 0x90, 0xb0, 0x92, - 0xd9, 0x9f, 0x64, 0xcd, 0x1e, 0x09, 0x48, 0xfa, 0xee, 0x87, 0x60, 0x7d, 0x2b, 0xb4, 0x61, 0x12, - 0xa8, 0x59, 0x4c, 0xc6, 0x1a, 0x5e, 0xc4, 0x4b, 0x07, 0xb0, 0x94, 0x81, 0xec, 0x38, 0x88, 0x3b, - 0xa5, 0xa5, 0x32, 0xa8, 0x16, 0xf5, 0xed, 0x49, 0xa0, 0x5e, 0x8b, 0x31, 0x1e, 0x5e, 0xa1, 0x7c, - 0x87, 0xb8, 0xb3, 0xb3, 0x3a, 0x6f, 0x7d, 0xe5, 0x07, 0x80, 0xcf, 0xfe, 0x61, 0x5b, 0x6a, 0xb1, - 0x54, 0x87, 0x70, 0x46, 0x04, 0x88, 0x44, 0xac, 0x4e, 0x02, 0x75, 0x26, 0x6a, 0x14, 0x78, 0xda, - 0x4a, 0x6a, 0xc1, 0x22, 0xf1, 0x71, 0xaa, 0x2d, 0x5e, 0x95, 0x3b, 0xfa, 0xfd, 0x49, 0xa0, 0xce, - 0xc5, 0x8d, 0x15, 0xe2, 0xe3, 0xb4, 0x57, 0xf3, 0x6b, 0x1e, 0x2e, 0xb5, 0xb9, 0x2d, 0x7d, 0x84, - 0xc5, 0xb9, 0x4d, 0x7d, 0x94, 0xe9, 0xf2, 0xfc, 0x2e, 0xc8, 0xcf, 0xff, 0x03, 0x34, 0x9d, 0xe6, - 0x04, 0xc0, 0xed, 0x1b, 0xb7, 0xa5, 0x75, 0x0d, 0xdb, 0x4d, 0x45, 0xf2, 0xeb, 0x5b, 0x14, 0xa5, - 0x92, 0xe4, 0xbb, 0x5f, 0xc2, 0x6b, 0xa2, 0xef, 0x9d, 0x0d, 0x15, 0x70, 0x3e, 0x54, 0xc0, 0xc5, - 0x50, 0x01, 0x7f, 0x86, 0x0a, 0x38, 0x19, 0x29, 0xb9, 0xf3, 0x91, 0x92, 0xbb, 0x18, 0x29, 0xb9, - 0x0f, 0x4d, 0xdb, 0x15, 0x8e, 0xdf, 0x6d, 0x98, 0x14, 0x6b, 0x61, 0xaf, 0x3a, 0xb1, 0xc4, 0x67, - 0xca, 0x0e, 0xb5, 0xcc, 0x1b, 0x24, 0x8e, 0x3d, 0x8b, 0x77, 0x97, 0xa3, 0x5f, 0x40, 0xeb, 0x6f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xe3, 0x2d, 0xb8, 0x70, 0xdb, 0x04, 0x00, 0x00, + // 720 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xbf, 0x4f, 0xdb, 0x40, + 0x14, 0xce, 0x85, 0x1f, 0x52, 0x0e, 0x14, 0x8a, 0x4b, 0x45, 0x30, 0xc8, 0x46, 0x69, 0x4b, 0x23, + 0x2a, 0xec, 0x02, 0x52, 0x2b, 0x51, 0x75, 0xc0, 0x54, 0x2a, 0x1d, 0x22, 0x21, 0x23, 0x96, 0x2e, + 0xe9, 0xc5, 0x39, 0xd9, 0x16, 0xf1, 0x9d, 0xe5, 0xbb, 0x50, 0xd8, 0xaa, 0x8e, 0x95, 0x2a, 0xf1, + 0x67, 0x74, 0xa4, 0x12, 0x5b, 0xa7, 0x6e, 0x8c, 0xa8, 0x13, 0x53, 0x54, 0x85, 0x01, 0x29, 0x63, + 0xff, 0x82, 0xca, 0xf6, 0x39, 0x24, 0x8e, 0xa1, 0x88, 0x05, 0xe2, 0xef, 0x7d, 0xef, 0xbd, 0xef, + 0x7d, 0xf7, 0xee, 0xe0, 0xbc, 0x4f, 0xf7, 0x79, 0x40, 0x9b, 0x4d, 0xdd, 0x73, 0xed, 0x00, 0x71, + 0x97, 0x12, 0x9d, 0x1f, 0x6a, 0x7e, 0x40, 0x39, 0x95, 0xa4, 0x24, 0xa8, 0xf5, 0x82, 0xf2, 0x34, + 0xf2, 0x5c, 0x42, 0xf5, 0xe8, 0x6f, 0x4c, 0x93, 0x67, 0x2d, 0xca, 0x3c, 0xca, 0x74, 0x8f, 0xd9, + 0xfa, 0xc1, 0x6a, 0xf8, 0x4f, 0x04, 0xe6, 0xe2, 0x40, 0x2d, 0xfa, 0xd2, 0xe3, 0x0f, 0x11, 0x9a, + 0xb1, 0xa9, 0x4d, 0x63, 0x3c, 0xfc, 0x25, 0xd0, 0xa5, 0x0c, 0x35, 0x1e, 0x0d, 0x18, 0xae, 0x51, + 0x62, 0x39, 0xc8, 0x25, 0x82, 0xa7, 0x66, 0xf0, 0x7c, 0x14, 0x20, 0x2f, 0x29, 0xaf, 0x08, 0x49, + 0x75, 0xc4, 0xb0, 0x7e, 0xb0, 0x5a, 0xc7, 0x1c, 0xad, 0xea, 0x16, 0x4d, 0x0a, 0x94, 0x7f, 0x01, + 0x38, 0x55, 0x65, 0xf6, 0x9e, 0xdf, 0x40, 0x1c, 0xef, 0x44, 0x99, 0xd2, 0x4b, 0x58, 0x40, 0x2d, + 0xee, 0xd0, 0xc0, 0xe5, 0x47, 0x25, 0xb0, 0x08, 0x2a, 0x05, 0xa3, 0xf4, 0xfb, 0x74, 0x65, 0x46, + 0xe8, 0xde, 0x6c, 0x34, 0x02, 0xcc, 0xd8, 0x2e, 0x0f, 0x5c, 0x62, 0x9b, 0xd7, 0x54, 0xe9, 0x0d, + 0x1c, 0x8f, 0x7b, 0x97, 0xf2, 0x8b, 0xa0, 0x32, 0xb1, 0x26, 0x6b, 0xc3, 0xb6, 0x69, 0x71, 0x0f, + 0xa3, 0x70, 0xd6, 0x56, 0x73, 0xdf, 0xaf, 0x4e, 0x96, 0x81, 0x29, 0x92, 0x36, 0x5e, 0x7d, 0xb9, + 0x3a, 0x59, 0xbe, 0x2e, 0xf7, 0xf5, 0xea, 0x64, 0xf9, 0x49, 0x6f, 0xbc, 0xc3, 0xbe, 0x01, 0x53, + 0x7a, 0xcb, 0x73, 0x70, 0x36, 0x05, 0x99, 0x98, 0xf9, 0x94, 0x30, 0x5c, 0x3e, 0xcd, 0x43, 0xb5, + 0xca, 0xec, 0xf7, 0x9e, 0x4f, 0x03, 0x5e, 0x0d, 0x0d, 0xdc, 0x6a, 0x22, 0xd7, 0x43, 0xf5, 0x26, + 0xde, 0xb4, 0x2c, 0xda, 0x22, 0xfc, 0xfe, 0xe3, 0x06, 0xf0, 0x61, 0x7c, 0x24, 0x28, 0xae, 0x54, + 0x63, 0x1c, 0x71, 0x2c, 0x66, 0x7f, 0x9a, 0x35, 0x7b, 0x24, 0x40, 0xf4, 0xdd, 0x0d, 0xc9, 0xc6, + 0x7c, 0x68, 0x43, 0xb7, 0xad, 0x66, 0x55, 0x32, 0xa7, 0xbd, 0x34, 0x5f, 0xda, 0x83, 0xa5, 0x0c, + 0x66, 0xcd, 0x41, 0xcc, 0x29, 0x8d, 0x2c, 0x82, 0xca, 0xa4, 0xb1, 0xd0, 0x6d, 0xab, 0x37, 0x72, + 0xcc, 0x47, 0x43, 0x25, 0xb7, 0x11, 0x73, 0x36, 0x8a, 0x83, 0xd6, 0x97, 0xbf, 0x01, 0xf8, 0xec, + 0x3f, 0xb6, 0x25, 0x16, 0x4b, 0x2b, 0x10, 0xf6, 0x89, 0x00, 0x91, 0x88, 0x62, 0xb7, 0xad, 0xf6, + 0xa1, 0x66, 0x81, 0x25, 0xad, 0xa4, 0x75, 0x38, 0x49, 0x5a, 0x5e, 0xa2, 0x2d, 0x5e, 0x95, 0x51, + 0xe3, 0x41, 0xb7, 0xad, 0x0e, 0xe0, 0xe6, 0x04, 0x69, 0x79, 0x49, 0xaf, 0xf2, 0x0f, 0x00, 0x67, + 0xaa, 0xcc, 0x8e, 0x44, 0xf4, 0x9b, 0x28, 0x69, 0x50, 0x62, 0x0e, 0x22, 0x84, 0x92, 0xb7, 0x98, + 0x71, 0x71, 0x54, 0xf1, 0x21, 0x9a, 0x19, 0x11, 0xa9, 0x02, 0xa7, 0x22, 0x07, 0x76, 0x03, 0x2b, + 0x21, 0xe7, 0x23, 0x72, 0x1a, 0x96, 0x96, 0x60, 0x31, 0x86, 0x5c, 0x9b, 0x20, 0xde, 0x0a, 0x70, + 0xe4, 0x6f, 0xc1, 0x4c, 0xa1, 0x1b, 0xb3, 0xa1, 0x75, 0x19, 0xad, 0xca, 0x3f, 0x01, 0x5c, 0xc8, + 0xd2, 0xdc, 0x33, 0x2e, 0x43, 0x0b, 0xc8, 0xd6, 0xf2, 0x0e, 0x16, 0xad, 0xb0, 0x0c, 0x6e, 0x18, + 0xa8, 0x89, 0x88, 0x95, 0x2c, 0xd9, 0x9c, 0x26, 0x76, 0x34, 0xbc, 0xdd, 0x9a, 0xb8, 0xdd, 0xda, + 0x16, 0x75, 0x89, 0x31, 0x1a, 0x2e, 0x96, 0x99, 0x4a, 0x0b, 0x5b, 0x0a, 0x64, 0x93, 0x6f, 0x63, + 0xd7, 0x76, 0x78, 0x34, 0xd5, 0x98, 0x99, 0x86, 0xd7, 0xfe, 0xe6, 0xe1, 0x48, 0x95, 0xd9, 0xd2, + 0x47, 0x38, 0x39, 0xf0, 0x36, 0x3c, 0xce, 0xdc, 0xeb, 0xc1, 0xdb, 0x27, 0x3f, 0xbf, 0x03, 0xa9, + 0x67, 0xc3, 0x31, 0x80, 0x0b, 0xb7, 0xde, 0xcf, 0xf5, 0x1b, 0xaa, 0xdd, 0x96, 0x24, 0xbf, 0xbe, + 0x47, 0x52, 0x4f, 0x12, 0x85, 0xd3, 0xc3, 0xab, 0x56, 0xb9, 0xa1, 0xe2, 0x10, 0x53, 0x7e, 0x71, + 0x57, 0x66, 0xd2, 0x50, 0x1e, 0xfb, 0x1c, 0xbe, 0x84, 0xc6, 0xce, 0x59, 0x47, 0x01, 0xe7, 0x1d, + 0x05, 0x5c, 0x74, 0x14, 0xf0, 0xa7, 0xa3, 0x80, 0xe3, 0x4b, 0x25, 0x77, 0x7e, 0xa9, 0xe4, 0x2e, + 0x2e, 0x95, 0xdc, 0x87, 0x35, 0xdb, 0xe5, 0x4e, 0xab, 0xae, 0x59, 0xd4, 0xd3, 0xc3, 0x06, 0x2b, + 0x04, 0xf3, 0x4f, 0x34, 0xd8, 0xd7, 0x33, 0x1f, 0x49, 0x7e, 0xe4, 0x63, 0x56, 0x1f, 0x8f, 0x5e, + 0xf9, 0xf5, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x6c, 0xb5, 0x8b, 0x84, 0xde, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -299,6 +424,7 @@ type MsgClient interface { // parameters. The authority defaults to the x/gov module account. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) ImportMorseClaimableAccounts(ctx context.Context, in *MsgImportMorseClaimableAccounts, opts ...grpc.CallOption) (*MsgImportMorseClaimableAccountsResponse, error) + ClaimMorseAccount(ctx context.Context, in *MsgClaimMorseAccount, opts ...grpc.CallOption) (*MsgClaimMorseAccountResponse, error) } type msgClient struct { @@ -327,12 +453,22 @@ func (c *msgClient) ImportMorseClaimableAccounts(ctx context.Context, in *MsgImp return out, nil } +func (c *msgClient) ClaimMorseAccount(ctx context.Context, in *MsgClaimMorseAccount, opts ...grpc.CallOption) (*MsgClaimMorseAccountResponse, error) { + out := new(MsgClaimMorseAccountResponse) + err := c.cc.Invoke(ctx, "/poktroll.migration.Msg/ClaimMorseAccount", 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) ImportMorseClaimableAccounts(context.Context, *MsgImportMorseClaimableAccounts) (*MsgImportMorseClaimableAccountsResponse, error) + ClaimMorseAccount(context.Context, *MsgClaimMorseAccount) (*MsgClaimMorseAccountResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -345,6 +481,9 @@ func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateP func (*UnimplementedMsgServer) ImportMorseClaimableAccounts(ctx context.Context, req *MsgImportMorseClaimableAccounts) (*MsgImportMorseClaimableAccountsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ImportMorseClaimableAccounts not implemented") } +func (*UnimplementedMsgServer) ClaimMorseAccount(ctx context.Context, req *MsgClaimMorseAccount) (*MsgClaimMorseAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClaimMorseAccount not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -386,6 +525,24 @@ func _Msg_ImportMorseClaimableAccounts_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _Msg_ClaimMorseAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClaimMorseAccount) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ClaimMorseAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.migration.Msg/ClaimMorseAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ClaimMorseAccount(ctx, req.(*MsgClaimMorseAccount)) + } + return interceptor(ctx, in, info, handler) +} + var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "poktroll.migration.Msg", @@ -399,6 +556,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "ImportMorseClaimableAccounts", Handler: _Msg_ImportMorseClaimableAccounts_Handler, }, + { + MethodName: "ClaimMorseAccount", + Handler: _Msg_ClaimMorseAccount_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/migration/tx.proto", @@ -549,6 +710,95 @@ func (m *MsgImportMorseClaimableAccountsResponse) MarshalToSizedBuffer(dAtA []by return len(dAtA) - i, nil } +func (m *MsgClaimMorseAccount) 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 *MsgClaimMorseAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimMorseAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MorseSignature) > 0 { + i -= len(m.MorseSignature) + copy(dAtA[i:], m.MorseSignature) + i = encodeVarintTx(dAtA, i, uint64(len(m.MorseSignature))) + i-- + dAtA[i] = 0x1a + } + if len(m.MorseSrcAddress) > 0 { + i -= len(m.MorseSrcAddress) + copy(dAtA[i:], m.MorseSrcAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.MorseSrcAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.ShannonDestAddress) > 0 { + i -= len(m.ShannonDestAddress) + copy(dAtA[i:], m.ShannonDestAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.ShannonDestAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgClaimMorseAccountResponse) 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 *MsgClaimMorseAccountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimMorseAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ClaimedAtHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ClaimedAtHeight)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.ClaimedBalance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.MorseSrcAddress) > 0 { + i -= len(m.MorseSrcAddress) + copy(dAtA[i:], m.MorseSrcAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.MorseSrcAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -619,6 +869,45 @@ func (m *MsgImportMorseClaimableAccountsResponse) Size() (n int) { return n } +func (m *MsgClaimMorseAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ShannonDestAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MorseSrcAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MorseSignature) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgClaimMorseAccountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MorseSrcAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ClaimedBalance.Size() + n += 1 + l + sovTx(uint64(l)) + if m.ClaimedAtHeight != 0 { + n += 1 + sovTx(uint64(m.ClaimedAtHeight)) + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1042,6 +1331,286 @@ func (m *MsgImportMorseClaimableAccountsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgClaimMorseAccount) 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: MsgClaimMorseAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimMorseAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShannonDestAddress", 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.ShannonDestAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MorseSrcAddress", 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.MorseSrcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MorseSignature", 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.MorseSignature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgClaimMorseAccountResponse) 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: MsgClaimMorseAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimMorseAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MorseSrcAddress", 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.MorseSrcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedBalance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ClaimedBalance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) + } + m.ClaimedAtHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClaimedAtHeight |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 9b0af5ec7ff724a474df519cc52775b8b9eb56a5 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 17 Feb 2025 10:35:51 +0100 Subject: [PATCH 12/81] chore: update types, fix test, regenerate protobufs --- api/poktroll/migration/event.pulsar.go | 1 + api/poktroll/migration/tx.pulsar.go | 287 ++++++++++-------- proto/poktroll/migration/tx.proto | 29 +- .../keeper/msg_server_claim_morse_account.go | 9 +- x/migration/simulation/claim_morse_account.go | 4 +- .../types/message_claim_morse_account.go | 3 + x/migration/types/tx.pb.go | 122 ++++---- 7 files changed, 255 insertions(+), 200 deletions(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index e6ca4fc52..f9296d2fe 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -8,6 +8,7 @@ import ( runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "github.com/pokt-network/poktroll/api/poktroll/shared" + prot protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index 3948b3d6d..aaf24860b 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -1908,18 +1908,18 @@ func (x *fastReflection_MsgImportMorseClaimableAccountsResponse) ProtoMethods() } var ( - md_MsgClaimMorseAccount protoreflect.MessageDescriptor - fd_MsgClaimMorseAccount_shannonDestAddress protoreflect.FieldDescriptor - fd_MsgClaimMorseAccount_morseSrcAddress protoreflect.FieldDescriptor - fd_MsgClaimMorseAccount_morseSignature protoreflect.FieldDescriptor + md_MsgClaimMorseAccount protoreflect.MessageDescriptor + fd_MsgClaimMorseAccount_shannon_dest_address protoreflect.FieldDescriptor + fd_MsgClaimMorseAccount_morse_src_address protoreflect.FieldDescriptor + fd_MsgClaimMorseAccount_morse_signature protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_tx_proto_init() md_MsgClaimMorseAccount = File_poktroll_migration_tx_proto.Messages().ByName("MsgClaimMorseAccount") - fd_MsgClaimMorseAccount_shannonDestAddress = md_MsgClaimMorseAccount.Fields().ByName("shannonDestAddress") - fd_MsgClaimMorseAccount_morseSrcAddress = md_MsgClaimMorseAccount.Fields().ByName("morseSrcAddress") - fd_MsgClaimMorseAccount_morseSignature = md_MsgClaimMorseAccount.Fields().ByName("morseSignature") + fd_MsgClaimMorseAccount_shannon_dest_address = md_MsgClaimMorseAccount.Fields().ByName("shannon_dest_address") + fd_MsgClaimMorseAccount_morse_src_address = md_MsgClaimMorseAccount.Fields().ByName("morse_src_address") + fd_MsgClaimMorseAccount_morse_signature = md_MsgClaimMorseAccount.Fields().ByName("morse_signature") } var _ protoreflect.Message = (*fastReflection_MsgClaimMorseAccount)(nil) @@ -1989,19 +1989,19 @@ func (x *fastReflection_MsgClaimMorseAccount) Interface() protoreflect.ProtoMess func (x *fastReflection_MsgClaimMorseAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.ShannonDestAddress != "" { value := protoreflect.ValueOfString(x.ShannonDestAddress) - if !f(fd_MsgClaimMorseAccount_shannonDestAddress, value) { + if !f(fd_MsgClaimMorseAccount_shannon_dest_address, value) { return } } if x.MorseSrcAddress != "" { value := protoreflect.ValueOfString(x.MorseSrcAddress) - if !f(fd_MsgClaimMorseAccount_morseSrcAddress, value) { + if !f(fd_MsgClaimMorseAccount_morse_src_address, value) { return } } if x.MorseSignature != "" { value := protoreflect.ValueOfString(x.MorseSignature) - if !f(fd_MsgClaimMorseAccount_morseSignature, value) { + if !f(fd_MsgClaimMorseAccount_morse_signature, value) { return } } @@ -2020,11 +2020,11 @@ func (x *fastReflection_MsgClaimMorseAccount) Range(f func(protoreflect.FieldDes // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgClaimMorseAccount) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.migration.MsgClaimMorseAccount.shannonDestAddress": + case "poktroll.migration.MsgClaimMorseAccount.shannon_dest_address": return x.ShannonDestAddress != "" - case "poktroll.migration.MsgClaimMorseAccount.morseSrcAddress": + case "poktroll.migration.MsgClaimMorseAccount.morse_src_address": return x.MorseSrcAddress != "" - case "poktroll.migration.MsgClaimMorseAccount.morseSignature": + case "poktroll.migration.MsgClaimMorseAccount.morse_signature": return x.MorseSignature != "" default: if fd.IsExtension() { @@ -2042,11 +2042,11 @@ func (x *fastReflection_MsgClaimMorseAccount) Has(fd protoreflect.FieldDescripto // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgClaimMorseAccount) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.migration.MsgClaimMorseAccount.shannonDestAddress": + case "poktroll.migration.MsgClaimMorseAccount.shannon_dest_address": x.ShannonDestAddress = "" - case "poktroll.migration.MsgClaimMorseAccount.morseSrcAddress": + case "poktroll.migration.MsgClaimMorseAccount.morse_src_address": x.MorseSrcAddress = "" - case "poktroll.migration.MsgClaimMorseAccount.morseSignature": + case "poktroll.migration.MsgClaimMorseAccount.morse_signature": x.MorseSignature = "" default: if fd.IsExtension() { @@ -2064,13 +2064,13 @@ func (x *fastReflection_MsgClaimMorseAccount) Clear(fd protoreflect.FieldDescrip // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgClaimMorseAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.migration.MsgClaimMorseAccount.shannonDestAddress": + case "poktroll.migration.MsgClaimMorseAccount.shannon_dest_address": value := x.ShannonDestAddress return protoreflect.ValueOfString(value) - case "poktroll.migration.MsgClaimMorseAccount.morseSrcAddress": + case "poktroll.migration.MsgClaimMorseAccount.morse_src_address": value := x.MorseSrcAddress return protoreflect.ValueOfString(value) - case "poktroll.migration.MsgClaimMorseAccount.morseSignature": + case "poktroll.migration.MsgClaimMorseAccount.morse_signature": value := x.MorseSignature return protoreflect.ValueOfString(value) default: @@ -2093,11 +2093,11 @@ func (x *fastReflection_MsgClaimMorseAccount) Get(descriptor protoreflect.FieldD // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgClaimMorseAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.migration.MsgClaimMorseAccount.shannonDestAddress": + case "poktroll.migration.MsgClaimMorseAccount.shannon_dest_address": x.ShannonDestAddress = value.Interface().(string) - case "poktroll.migration.MsgClaimMorseAccount.morseSrcAddress": + case "poktroll.migration.MsgClaimMorseAccount.morse_src_address": x.MorseSrcAddress = value.Interface().(string) - case "poktroll.migration.MsgClaimMorseAccount.morseSignature": + case "poktroll.migration.MsgClaimMorseAccount.morse_signature": x.MorseSignature = value.Interface().(string) default: if fd.IsExtension() { @@ -2119,12 +2119,12 @@ func (x *fastReflection_MsgClaimMorseAccount) Set(fd protoreflect.FieldDescripto // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgClaimMorseAccount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.MsgClaimMorseAccount.shannonDestAddress": - panic(fmt.Errorf("field shannonDestAddress of message poktroll.migration.MsgClaimMorseAccount is not mutable")) - case "poktroll.migration.MsgClaimMorseAccount.morseSrcAddress": - panic(fmt.Errorf("field morseSrcAddress of message poktroll.migration.MsgClaimMorseAccount is not mutable")) - case "poktroll.migration.MsgClaimMorseAccount.morseSignature": - panic(fmt.Errorf("field morseSignature of message poktroll.migration.MsgClaimMorseAccount is not mutable")) + case "poktroll.migration.MsgClaimMorseAccount.shannon_dest_address": + panic(fmt.Errorf("field shannon_dest_address of message poktroll.migration.MsgClaimMorseAccount is not mutable")) + case "poktroll.migration.MsgClaimMorseAccount.morse_src_address": + panic(fmt.Errorf("field morse_src_address of message poktroll.migration.MsgClaimMorseAccount is not mutable")) + case "poktroll.migration.MsgClaimMorseAccount.morse_signature": + panic(fmt.Errorf("field morse_signature of message poktroll.migration.MsgClaimMorseAccount is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccount")) @@ -2138,11 +2138,11 @@ func (x *fastReflection_MsgClaimMorseAccount) Mutable(fd protoreflect.FieldDescr // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgClaimMorseAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.MsgClaimMorseAccount.shannonDestAddress": + case "poktroll.migration.MsgClaimMorseAccount.shannon_dest_address": return protoreflect.ValueOfString("") - case "poktroll.migration.MsgClaimMorseAccount.morseSrcAddress": + case "poktroll.migration.MsgClaimMorseAccount.morse_src_address": return protoreflect.ValueOfString("") - case "poktroll.migration.MsgClaimMorseAccount.morseSignature": + case "poktroll.migration.MsgClaimMorseAccount.morse_signature": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -2456,18 +2456,18 @@ func (x *fastReflection_MsgClaimMorseAccount) ProtoMethods() *protoiface.Methods } var ( - md_MsgClaimMorseAccountResponse protoreflect.MessageDescriptor - fd_MsgClaimMorseAccountResponse_morseSrcAddress protoreflect.FieldDescriptor - fd_MsgClaimMorseAccountResponse_claimedBalance protoreflect.FieldDescriptor - fd_MsgClaimMorseAccountResponse_claimedAtHeight protoreflect.FieldDescriptor + md_MsgClaimMorseAccountResponse protoreflect.MessageDescriptor + fd_MsgClaimMorseAccountResponse_morse_src_address protoreflect.FieldDescriptor + fd_MsgClaimMorseAccountResponse_claimed_balance protoreflect.FieldDescriptor + fd_MsgClaimMorseAccountResponse_claimed_at_height protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_tx_proto_init() md_MsgClaimMorseAccountResponse = File_poktroll_migration_tx_proto.Messages().ByName("MsgClaimMorseAccountResponse") - fd_MsgClaimMorseAccountResponse_morseSrcAddress = md_MsgClaimMorseAccountResponse.Fields().ByName("morseSrcAddress") - fd_MsgClaimMorseAccountResponse_claimedBalance = md_MsgClaimMorseAccountResponse.Fields().ByName("claimedBalance") - fd_MsgClaimMorseAccountResponse_claimedAtHeight = md_MsgClaimMorseAccountResponse.Fields().ByName("claimedAtHeight") + fd_MsgClaimMorseAccountResponse_morse_src_address = md_MsgClaimMorseAccountResponse.Fields().ByName("morse_src_address") + fd_MsgClaimMorseAccountResponse_claimed_balance = md_MsgClaimMorseAccountResponse.Fields().ByName("claimed_balance") + fd_MsgClaimMorseAccountResponse_claimed_at_height = md_MsgClaimMorseAccountResponse.Fields().ByName("claimed_at_height") } var _ protoreflect.Message = (*fastReflection_MsgClaimMorseAccountResponse)(nil) @@ -2537,19 +2537,19 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) Interface() protoreflect.P func (x *fastReflection_MsgClaimMorseAccountResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.MorseSrcAddress != "" { value := protoreflect.ValueOfString(x.MorseSrcAddress) - if !f(fd_MsgClaimMorseAccountResponse_morseSrcAddress, value) { + if !f(fd_MsgClaimMorseAccountResponse_morse_src_address, value) { return } } if x.ClaimedBalance != nil { value := protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) - if !f(fd_MsgClaimMorseAccountResponse_claimedBalance, value) { + if !f(fd_MsgClaimMorseAccountResponse_claimed_balance, value) { return } } - if x.ClaimedAtHeight != int32(0) { - value := protoreflect.ValueOfInt32(x.ClaimedAtHeight) - if !f(fd_MsgClaimMorseAccountResponse_claimedAtHeight, value) { + if x.ClaimedAtHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.ClaimedAtHeight) + if !f(fd_MsgClaimMorseAccountResponse_claimed_at_height, value) { return } } @@ -2568,12 +2568,12 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) Range(f func(protoreflect. // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgClaimMorseAccountResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.migration.MsgClaimMorseAccountResponse.morseSrcAddress": + case "poktroll.migration.MsgClaimMorseAccountResponse.morse_src_address": return x.MorseSrcAddress != "" - case "poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance": + case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance": return x.ClaimedBalance != nil - case "poktroll.migration.MsgClaimMorseAccountResponse.claimedAtHeight": - return x.ClaimedAtHeight != int32(0) + case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_at_height": + return x.ClaimedAtHeight != int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) @@ -2590,12 +2590,12 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) Has(fd protoreflect.FieldD // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgClaimMorseAccountResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.migration.MsgClaimMorseAccountResponse.morseSrcAddress": + case "poktroll.migration.MsgClaimMorseAccountResponse.morse_src_address": x.MorseSrcAddress = "" - case "poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance": + case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance": x.ClaimedBalance = nil - case "poktroll.migration.MsgClaimMorseAccountResponse.claimedAtHeight": - x.ClaimedAtHeight = int32(0) + case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_at_height": + x.ClaimedAtHeight = int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) @@ -2612,15 +2612,15 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) Clear(fd protoreflect.Fiel // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgClaimMorseAccountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.migration.MsgClaimMorseAccountResponse.morseSrcAddress": + case "poktroll.migration.MsgClaimMorseAccountResponse.morse_src_address": value := x.MorseSrcAddress return protoreflect.ValueOfString(value) - case "poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance": + case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance": value := x.ClaimedBalance return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "poktroll.migration.MsgClaimMorseAccountResponse.claimedAtHeight": + case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_at_height": value := x.ClaimedAtHeight - return protoreflect.ValueOfInt32(value) + return protoreflect.ValueOfInt64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) @@ -2641,12 +2641,12 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) Get(descriptor protoreflec // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgClaimMorseAccountResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.migration.MsgClaimMorseAccountResponse.morseSrcAddress": + case "poktroll.migration.MsgClaimMorseAccountResponse.morse_src_address": x.MorseSrcAddress = value.Interface().(string) - case "poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance": + case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance": x.ClaimedBalance = value.Message().Interface().(*v1beta1.Coin) - case "poktroll.migration.MsgClaimMorseAccountResponse.claimedAtHeight": - x.ClaimedAtHeight = int32(value.Int()) + case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_at_height": + x.ClaimedAtHeight = value.Int() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) @@ -2667,15 +2667,15 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) Set(fd protoreflect.FieldD // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgClaimMorseAccountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance": + case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance": if x.ClaimedBalance == nil { x.ClaimedBalance = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) - case "poktroll.migration.MsgClaimMorseAccountResponse.morseSrcAddress": - panic(fmt.Errorf("field morseSrcAddress of message poktroll.migration.MsgClaimMorseAccountResponse is not mutable")) - case "poktroll.migration.MsgClaimMorseAccountResponse.claimedAtHeight": - panic(fmt.Errorf("field claimedAtHeight of message poktroll.migration.MsgClaimMorseAccountResponse is not mutable")) + case "poktroll.migration.MsgClaimMorseAccountResponse.morse_src_address": + panic(fmt.Errorf("field morse_src_address of message poktroll.migration.MsgClaimMorseAccountResponse is not mutable")) + case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_at_height": + panic(fmt.Errorf("field claimed_at_height of message poktroll.migration.MsgClaimMorseAccountResponse is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) @@ -2689,13 +2689,13 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) Mutable(fd protoreflect.Fi // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgClaimMorseAccountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.MsgClaimMorseAccountResponse.morseSrcAddress": + case "poktroll.migration.MsgClaimMorseAccountResponse.morse_src_address": return protoreflect.ValueOfString("") - case "poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance": + case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "poktroll.migration.MsgClaimMorseAccountResponse.claimedAtHeight": - return protoreflect.ValueOfInt32(int32(0)) + case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_at_height": + return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) @@ -2962,7 +2962,7 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) ProtoMethods() *protoiface } b := dAtA[iNdEx] iNdEx++ - x.ClaimedAtHeight |= int32(b&0x7F) << shift + x.ClaimedAtHeight |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -3150,6 +3150,10 @@ func (x *MsgImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { return nil } +// MsgImportMorseClaimableAccountsResponse is used to execute a claim (one-time minting of tokens on Shannon), +// of the balance of the given Morse account, according to the MorseAccountState, to the balance +// of the given Shannon account (who MUST also be the signer of this message). +// Authz grant(s) MAY be used to delegate the authority to create a claim on behalf of another Shannon account. type MsgImportMorseClaimableAccountsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3201,9 +3205,12 @@ type MsgClaimMorseAccount struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannonDestAddress,proto3" json:"shannonDestAddress,omitempty"` - MorseSrcAddress string `protobuf:"bytes,2,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` - MorseSignature string `protobuf:"bytes,3,opt,name=morseSignature,proto3" json:"morseSignature,omitempty"` + // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. + ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address,omitempty"` + // The hex-encoded address of the Morse account whose balance will be claimed. + MorseSrcAddress string `protobuf:"bytes,2,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` + // The hex-encoded signature, by the Morse account, of this message (where this field is nil). + MorseSignature string `protobuf:"bytes,3,opt,name=morse_signature,json=morseSignature,proto3" json:"morse_signature,omitempty"` } func (x *MsgClaimMorseAccount) Reset() { @@ -3252,9 +3259,12 @@ type MsgClaimMorseAccountResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MorseSrcAddress string `protobuf:"bytes,1,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` - ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimedBalance,proto3" json:"claimedBalance,omitempty"` - ClaimedAtHeight int32 `protobuf:"varint,3,opt,name=claimedAtHeight,proto3" json:"claimedAtHeight,omitempty"` + // The hex-encoded address of the Morse account whose balance will be claimed. + MorseSrcAddress string `protobuf:"bytes,1,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` + // The balance which was claimed. + ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance,omitempty"` + // The height (on Shannon) at which the claim was created. + ClaimedAtHeight int64 `protobuf:"varint,3,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` } func (x *MsgClaimMorseAccountResponse) Reset() { @@ -3291,7 +3301,7 @@ func (x *MsgClaimMorseAccountResponse) GetClaimedBalance() *v1beta1.Coin { return nil } -func (x *MsgClaimMorseAccountResponse) GetClaimedAtHeight() int32 { +func (x *MsgClaimMorseAccountResponse) GetClaimedAtHeight() int64 { if x != nil { return x.ClaimedAtHeight } @@ -3358,66 +3368,75 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 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, 0x22, 0xb1, 0x01, + 0x52, 0x0b, 0x6e, 0x75, 0x6d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x96, 0x02, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, - 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, - 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x26, 0x0a, 0x0e, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x17, 0x82, 0xe7, 0xb0, 0x2a, 0x12, 0x73, - 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x22, 0xbb, 0x01, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, - 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x6f, 0x72, - 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x47, 0x0a, 0x0e, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, - 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x32, - 0xf2, 0x02, 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, 0x90, 0x01, 0x0a, 0x1c, 0x49, 0x6d, - 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, - 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x33, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, - 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, - 0x3b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, - 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x11, - 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, - 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x30, 0x2e, 0x70, 0x6f, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x62, 0x0a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, + 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xea, 0xde, 0x1f, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, + 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, + 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6d, 0x6f, + 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, + 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, + 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3c, 0x0a, + 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xea, 0xde, 0x1f, 0x0f, 0x6d, 0x6f, 0x72, 0x73, + 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0e, 0x6d, 0x6f, 0x72, + 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x19, 0x82, 0xe7, 0xb0, + 0x2a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xea, 0x01, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, + 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, + 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, + 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x17, + 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, + 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x32, 0xf2, 0x02, 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, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 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, 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, 0x90, 0x01, + 0x0a, 0x1c, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x33, 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, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, + 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, + 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x6f, 0x0a, 0x11, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, + 0x30, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, + 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 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 ( @@ -3447,7 +3466,7 @@ var file_poktroll_migration_tx_proto_goTypes = []interface{}{ var file_poktroll_migration_tx_proto_depIdxs = []int32{ 6, // 0: poktroll.migration.MsgUpdateParams.params:type_name -> poktroll.migration.Params 7, // 1: poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state:type_name -> poktroll.migration.MorseAccountState - 8, // 2: poktroll.migration.MsgClaimMorseAccountResponse.claimedBalance:type_name -> cosmos.base.v1beta1.Coin + 8, // 2: poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance:type_name -> cosmos.base.v1beta1.Coin 0, // 3: poktroll.migration.Msg.UpdateParams:input_type -> poktroll.migration.MsgUpdateParams 2, // 4: poktroll.migration.Msg.ImportMorseClaimableAccounts:input_type -> poktroll.migration.MsgImportMorseClaimableAccounts 4, // 5: poktroll.migration.Msg.ClaimMorseAccount:input_type -> poktroll.migration.MsgClaimMorseAccount diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index fa80833b4..6f131e815 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -61,6 +61,10 @@ message MsgImportMorseClaimableAccounts { bytes morse_account_state_hash = 3 [(gogoproto.jsontag) = "morse_account_state_hash"]; } +// MsgImportMorseClaimableAccountsResponse is used to execute a claim (one-time minting of tokens on Shannon), +// of the balance of the given Morse account, according to the MorseAccountState, to the balance +// of the given Shannon account (who MUST also be the signer of this message). +// Authz grant(s) MAY be used to delegate the authority to create a claim on behalf of another Shannon account. message MsgImportMorseClaimableAccountsResponse { // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. @@ -72,15 +76,26 @@ message MsgImportMorseClaimableAccountsResponse { } message MsgClaimMorseAccount { - option (cosmos.msg.v1.signer) = "shannonDestAddress"; - string shannonDestAddress = 1; - string morseSrcAddress = 2; - string morseSignature = 3; + option (cosmos.msg.v1.signer) = "shannon_dest_address"; + + // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. + string shannon_dest_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "shannon_dest_address"]; + + // The hex-encoded address of the Morse account whose balance will be claimed. + string morse_src_address = 2 [(gogoproto.jsontag) = "morse_src_address"]; + + // The hex-encoded signature, by the Morse account, of this message (where this field is nil). + string morse_signature = 3 [(gogoproto.jsontag) = "morse_signature"]; } message MsgClaimMorseAccountResponse { - string morseSrcAddress = 1; - cosmos.base.v1beta1.Coin claimedBalance = 2 [(gogoproto.nullable) = false]; - int32 claimedAtHeight = 3; + // The hex-encoded address of the Morse account whose balance will be claimed. + string morse_src_address = 1 [(gogoproto.jsontag) = "morse_src_address"]; + + // The balance which was claimed. + cosmos.base.v1beta1.Coin claimed_balance = 2 [(gogoproto.jsontag) = "claimed_balance", (gogoproto.nullable) = false]; + + // The height (on Shannon) at which the claim was created. + int64 claimed_at_height = 3; } diff --git a/x/migration/keeper/msg_server_claim_morse_account.go b/x/migration/keeper/msg_server_claim_morse_account.go index ef657a205..afb6ec19e 100644 --- a/x/migration/keeper/msg_server_claim_morse_account.go +++ b/x/migration/keeper/msg_server_claim_morse_account.go @@ -4,14 +4,15 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - + + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) -func (k msgServer) ClaimMorseAccount(goCtx context.Context, msg *types.MsgClaimMorseAccount) (*types.MsgClaimMorseAccountResponse, error) { +func (k msgServer) ClaimMorseAccount(goCtx context.Context, msg *migrationtypes.MsgClaimMorseAccount) (*migrationtypes.MsgClaimMorseAccountResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - // TODO: Handling the message + // TODO_UPNEXT(@bryanchriswhite#1034): Handling the message _ = ctx - return &types.MsgClaimMorseAccountResponse{}, nil + return &migrationtypes.MsgClaimMorseAccountResponse{}, nil } diff --git a/x/migration/simulation/claim_morse_account.go b/x/migration/simulation/claim_morse_account.go index c646b784b..f02716e76 100644 --- a/x/migration/simulation/claim_morse_account.go +++ b/x/migration/simulation/claim_morse_account.go @@ -6,7 +6,9 @@ import ( "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 SimulateMsgClaimMorseAccount( diff --git a/x/migration/types/message_claim_morse_account.go b/x/migration/types/message_claim_morse_account.go index 0a31a94dd..585857d19 100644 --- a/x/migration/types/message_claim_morse_account.go +++ b/x/migration/types/message_claim_morse_account.go @@ -17,6 +17,9 @@ func NewMsgClaimMorseAccount(shannonDestAddress string, morseSrcAddress string, } func (msg *MsgClaimMorseAccount) ValidateBasic() error { + + // TODO_UPNEXT(@bryanchriswhite#1034): Add validation + _, err := sdk.AccAddressFromBech32(msg.ShannonDestAddress) if err != nil { return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid shannonDestAddress address (%s)", err) diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index a1df8e846..ddfa51908 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -183,6 +183,10 @@ func (m *MsgImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { return nil } +// MsgImportMorseClaimableAccountsResponse is used to execute a claim (one-time minting of tokens on Shannon), +// of the balance of the given Morse account, according to the MorseAccountState, to the balance +// of the given Shannon account (who MUST also be the signer of this message). +// Authz grant(s) MAY be used to delegate the authority to create a claim on behalf of another Shannon account. type MsgImportMorseClaimableAccountsResponse struct { // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. StateHash []byte `protobuf:"bytes,1,opt,name=state_hash,json=stateHash,proto3" json:"state_hash"` @@ -237,9 +241,12 @@ func (m *MsgImportMorseClaimableAccountsResponse) GetNumAccounts() uint64 { } type MsgClaimMorseAccount struct { - ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannonDestAddress,proto3" json:"shannonDestAddress,omitempty"` - MorseSrcAddress string `protobuf:"bytes,2,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` - MorseSignature string `protobuf:"bytes,3,opt,name=morseSignature,proto3" json:"morseSignature,omitempty"` + // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. + ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address"` + // The hex-encoded address of the Morse account whose balance will be claimed. + MorseSrcAddress string `protobuf:"bytes,2,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address"` + // The hex-encoded signature, by the Morse account, of this message (where this field is nil). + MorseSignature string `protobuf:"bytes,3,opt,name=morse_signature,json=morseSignature,proto3" json:"morse_signature"` } func (m *MsgClaimMorseAccount) Reset() { *m = MsgClaimMorseAccount{} } @@ -293,9 +300,12 @@ func (m *MsgClaimMorseAccount) GetMorseSignature() string { } type MsgClaimMorseAccountResponse struct { - MorseSrcAddress string `protobuf:"bytes,1,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` - ClaimedBalance types.Coin `protobuf:"bytes,2,opt,name=claimedBalance,proto3" json:"claimedBalance"` - ClaimedAtHeight int32 `protobuf:"varint,3,opt,name=claimedAtHeight,proto3" json:"claimedAtHeight,omitempty"` + // The hex-encoded address of the Morse account whose balance will be claimed. + MorseSrcAddress string `protobuf:"bytes,1,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address"` + // The balance which was claimed. + ClaimedBalance types.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance"` + // The height (on Shannon) at which the claim was created. + ClaimedAtHeight int64 `protobuf:"varint,3,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` } func (m *MsgClaimMorseAccountResponse) Reset() { *m = MsgClaimMorseAccountResponse{} } @@ -341,7 +351,7 @@ func (m *MsgClaimMorseAccountResponse) GetClaimedBalance() types.Coin { return types.Coin{} } -func (m *MsgClaimMorseAccountResponse) GetClaimedAtHeight() int32 { +func (m *MsgClaimMorseAccountResponse) GetClaimedAtHeight() int64 { if m != nil { return m.ClaimedAtHeight } @@ -360,52 +370,56 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 720 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xbf, 0x4f, 0xdb, 0x40, - 0x14, 0xce, 0x85, 0x1f, 0x52, 0x0e, 0x14, 0x8a, 0x4b, 0x45, 0x30, 0xc8, 0x46, 0x69, 0x4b, 0x23, - 0x2a, 0xec, 0x02, 0x52, 0x2b, 0x51, 0x75, 0xc0, 0x54, 0x2a, 0x1d, 0x22, 0x21, 0x23, 0x96, 0x2e, - 0xe9, 0xc5, 0x39, 0xd9, 0x16, 0xf1, 0x9d, 0xe5, 0xbb, 0x50, 0xd8, 0xaa, 0x8e, 0x95, 0x2a, 0xf1, - 0x67, 0x74, 0xa4, 0x12, 0x5b, 0xa7, 0x6e, 0x8c, 0xa8, 0x13, 0x53, 0x54, 0x85, 0x01, 0x29, 0x63, - 0xff, 0x82, 0xca, 0xf6, 0x39, 0x24, 0x8e, 0xa1, 0x88, 0x05, 0xe2, 0xef, 0x7d, 0xef, 0xbd, 0xef, - 0x7d, 0xf7, 0xee, 0xe0, 0xbc, 0x4f, 0xf7, 0x79, 0x40, 0x9b, 0x4d, 0xdd, 0x73, 0xed, 0x00, 0x71, - 0x97, 0x12, 0x9d, 0x1f, 0x6a, 0x7e, 0x40, 0x39, 0x95, 0xa4, 0x24, 0xa8, 0xf5, 0x82, 0xf2, 0x34, - 0xf2, 0x5c, 0x42, 0xf5, 0xe8, 0x6f, 0x4c, 0x93, 0x67, 0x2d, 0xca, 0x3c, 0xca, 0x74, 0x8f, 0xd9, - 0xfa, 0xc1, 0x6a, 0xf8, 0x4f, 0x04, 0xe6, 0xe2, 0x40, 0x2d, 0xfa, 0xd2, 0xe3, 0x0f, 0x11, 0x9a, - 0xb1, 0xa9, 0x4d, 0x63, 0x3c, 0xfc, 0x25, 0xd0, 0xa5, 0x0c, 0x35, 0x1e, 0x0d, 0x18, 0xae, 0x51, - 0x62, 0x39, 0xc8, 0x25, 0x82, 0xa7, 0x66, 0xf0, 0x7c, 0x14, 0x20, 0x2f, 0x29, 0xaf, 0x08, 0x49, - 0x75, 0xc4, 0xb0, 0x7e, 0xb0, 0x5a, 0xc7, 0x1c, 0xad, 0xea, 0x16, 0x4d, 0x0a, 0x94, 0x7f, 0x01, - 0x38, 0x55, 0x65, 0xf6, 0x9e, 0xdf, 0x40, 0x1c, 0xef, 0x44, 0x99, 0xd2, 0x4b, 0x58, 0x40, 0x2d, - 0xee, 0xd0, 0xc0, 0xe5, 0x47, 0x25, 0xb0, 0x08, 0x2a, 0x05, 0xa3, 0xf4, 0xfb, 0x74, 0x65, 0x46, - 0xe8, 0xde, 0x6c, 0x34, 0x02, 0xcc, 0xd8, 0x2e, 0x0f, 0x5c, 0x62, 0x9b, 0xd7, 0x54, 0xe9, 0x0d, - 0x1c, 0x8f, 0x7b, 0x97, 0xf2, 0x8b, 0xa0, 0x32, 0xb1, 0x26, 0x6b, 0xc3, 0xb6, 0x69, 0x71, 0x0f, - 0xa3, 0x70, 0xd6, 0x56, 0x73, 0xdf, 0xaf, 0x4e, 0x96, 0x81, 0x29, 0x92, 0x36, 0x5e, 0x7d, 0xb9, - 0x3a, 0x59, 0xbe, 0x2e, 0xf7, 0xf5, 0xea, 0x64, 0xf9, 0x49, 0x6f, 0xbc, 0xc3, 0xbe, 0x01, 0x53, - 0x7a, 0xcb, 0x73, 0x70, 0x36, 0x05, 0x99, 0x98, 0xf9, 0x94, 0x30, 0x5c, 0x3e, 0xcd, 0x43, 0xb5, - 0xca, 0xec, 0xf7, 0x9e, 0x4f, 0x03, 0x5e, 0x0d, 0x0d, 0xdc, 0x6a, 0x22, 0xd7, 0x43, 0xf5, 0x26, - 0xde, 0xb4, 0x2c, 0xda, 0x22, 0xfc, 0xfe, 0xe3, 0x06, 0xf0, 0x61, 0x7c, 0x24, 0x28, 0xae, 0x54, - 0x63, 0x1c, 0x71, 0x2c, 0x66, 0x7f, 0x9a, 0x35, 0x7b, 0x24, 0x40, 0xf4, 0xdd, 0x0d, 0xc9, 0xc6, - 0x7c, 0x68, 0x43, 0xb7, 0xad, 0x66, 0x55, 0x32, 0xa7, 0xbd, 0x34, 0x5f, 0xda, 0x83, 0xa5, 0x0c, - 0x66, 0xcd, 0x41, 0xcc, 0x29, 0x8d, 0x2c, 0x82, 0xca, 0xa4, 0xb1, 0xd0, 0x6d, 0xab, 0x37, 0x72, - 0xcc, 0x47, 0x43, 0x25, 0xb7, 0x11, 0x73, 0x36, 0x8a, 0x83, 0xd6, 0x97, 0xbf, 0x01, 0xf8, 0xec, - 0x3f, 0xb6, 0x25, 0x16, 0x4b, 0x2b, 0x10, 0xf6, 0x89, 0x00, 0x91, 0x88, 0x62, 0xb7, 0xad, 0xf6, - 0xa1, 0x66, 0x81, 0x25, 0xad, 0xa4, 0x75, 0x38, 0x49, 0x5a, 0x5e, 0xa2, 0x2d, 0x5e, 0x95, 0x51, - 0xe3, 0x41, 0xb7, 0xad, 0x0e, 0xe0, 0xe6, 0x04, 0x69, 0x79, 0x49, 0xaf, 0xf2, 0x0f, 0x00, 0x67, - 0xaa, 0xcc, 0x8e, 0x44, 0xf4, 0x9b, 0x28, 0x69, 0x50, 0x62, 0x0e, 0x22, 0x84, 0x92, 0xb7, 0x98, - 0x71, 0x71, 0x54, 0xf1, 0x21, 0x9a, 0x19, 0x11, 0xa9, 0x02, 0xa7, 0x22, 0x07, 0x76, 0x03, 0x2b, - 0x21, 0xe7, 0x23, 0x72, 0x1a, 0x96, 0x96, 0x60, 0x31, 0x86, 0x5c, 0x9b, 0x20, 0xde, 0x0a, 0x70, - 0xe4, 0x6f, 0xc1, 0x4c, 0xa1, 0x1b, 0xb3, 0xa1, 0x75, 0x19, 0xad, 0xca, 0x3f, 0x01, 0x5c, 0xc8, - 0xd2, 0xdc, 0x33, 0x2e, 0x43, 0x0b, 0xc8, 0xd6, 0xf2, 0x0e, 0x16, 0xad, 0xb0, 0x0c, 0x6e, 0x18, - 0xa8, 0x89, 0x88, 0x95, 0x2c, 0xd9, 0x9c, 0x26, 0x76, 0x34, 0xbc, 0xdd, 0x9a, 0xb8, 0xdd, 0xda, - 0x16, 0x75, 0x89, 0x31, 0x1a, 0x2e, 0x96, 0x99, 0x4a, 0x0b, 0x5b, 0x0a, 0x64, 0x93, 0x6f, 0x63, - 0xd7, 0x76, 0x78, 0x34, 0xd5, 0x98, 0x99, 0x86, 0xd7, 0xfe, 0xe6, 0xe1, 0x48, 0x95, 0xd9, 0xd2, - 0x47, 0x38, 0x39, 0xf0, 0x36, 0x3c, 0xce, 0xdc, 0xeb, 0xc1, 0xdb, 0x27, 0x3f, 0xbf, 0x03, 0xa9, - 0x67, 0xc3, 0x31, 0x80, 0x0b, 0xb7, 0xde, 0xcf, 0xf5, 0x1b, 0xaa, 0xdd, 0x96, 0x24, 0xbf, 0xbe, - 0x47, 0x52, 0x4f, 0x12, 0x85, 0xd3, 0xc3, 0xab, 0x56, 0xb9, 0xa1, 0xe2, 0x10, 0x53, 0x7e, 0x71, - 0x57, 0x66, 0xd2, 0x50, 0x1e, 0xfb, 0x1c, 0xbe, 0x84, 0xc6, 0xce, 0x59, 0x47, 0x01, 0xe7, 0x1d, - 0x05, 0x5c, 0x74, 0x14, 0xf0, 0xa7, 0xa3, 0x80, 0xe3, 0x4b, 0x25, 0x77, 0x7e, 0xa9, 0xe4, 0x2e, - 0x2e, 0x95, 0xdc, 0x87, 0x35, 0xdb, 0xe5, 0x4e, 0xab, 0xae, 0x59, 0xd4, 0xd3, 0xc3, 0x06, 0x2b, - 0x04, 0xf3, 0x4f, 0x34, 0xd8, 0xd7, 0x33, 0x1f, 0x49, 0x7e, 0xe4, 0x63, 0x56, 0x1f, 0x8f, 0x5e, - 0xf9, 0xf5, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x6c, 0xb5, 0x8b, 0x84, 0xde, 0x06, 0x00, 0x00, + // 772 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x4f, 0x4f, 0xdb, 0x48, + 0x14, 0x8f, 0xc3, 0x2e, 0x52, 0x06, 0x94, 0x6c, 0x4c, 0x10, 0x49, 0x40, 0x36, 0xca, 0xfe, 0x8b, + 0xb2, 0xc2, 0xe6, 0x8f, 0xb4, 0x2b, 0xb1, 0xbb, 0x87, 0x98, 0x1e, 0xe8, 0x21, 0x12, 0x32, 0xe2, + 0xd2, 0x1e, 0xdc, 0x89, 0x33, 0xb2, 0x2d, 0xe2, 0x99, 0xc8, 0x33, 0xa1, 0x70, 0xab, 0x7a, 0xac, + 0x54, 0x89, 0x53, 0x3f, 0x43, 0x8f, 0x1c, 0xf8, 0x02, 0xbd, 0x71, 0x44, 0x3d, 0x71, 0xb2, 0xaa, + 0x70, 0x40, 0xf2, 0xb1, 0x9f, 0xa0, 0xb2, 0x3d, 0x0e, 0xf9, 0xe3, 0x50, 0xca, 0x25, 0xf1, 0xbc, + 0xf7, 0x7b, 0xef, 0xfd, 0xde, 0xef, 0x8d, 0x9f, 0xc1, 0x6a, 0x8f, 0x1c, 0x33, 0x8f, 0x74, 0xbb, + 0xaa, 0xeb, 0x58, 0x1e, 0x64, 0x0e, 0xc1, 0x2a, 0x3b, 0x55, 0x7a, 0x1e, 0x61, 0x44, 0x14, 0x13, + 0xa7, 0x32, 0x74, 0x56, 0x8b, 0xd0, 0x75, 0x30, 0x51, 0xa3, 0xdf, 0x18, 0x56, 0x5d, 0x31, 0x09, + 0x75, 0x09, 0x55, 0x5d, 0x6a, 0xa9, 0x27, 0x5b, 0xe1, 0x1f, 0x77, 0x54, 0x62, 0x87, 0x11, 0x9d, + 0xd4, 0xf8, 0xc0, 0x5d, 0x25, 0x8b, 0x58, 0x24, 0xb6, 0x87, 0x4f, 0xdc, 0xfa, 0x47, 0x0a, 0x1b, + 0x97, 0x78, 0x14, 0x19, 0x04, 0x9b, 0x36, 0x74, 0x30, 0xc7, 0xc9, 0x29, 0xb8, 0x1e, 0xf4, 0xa0, + 0x9b, 0xa4, 0x97, 0x38, 0xa5, 0x36, 0xa4, 0x48, 0x3d, 0xd9, 0x6a, 0x23, 0x06, 0xb7, 0x54, 0x93, + 0x24, 0x09, 0x6a, 0x9f, 0x04, 0x50, 0x68, 0x51, 0xeb, 0xa8, 0xd7, 0x81, 0x0c, 0x1d, 0x44, 0x91, + 0xe2, 0xdf, 0x20, 0x07, 0xfb, 0xcc, 0x26, 0x9e, 0xc3, 0xce, 0xca, 0xc2, 0xba, 0x50, 0xcf, 0x69, + 0xe5, 0xcf, 0x97, 0x1b, 0x25, 0xce, 0xbb, 0xd9, 0xe9, 0x78, 0x88, 0xd2, 0x43, 0xe6, 0x39, 0xd8, + 0xd2, 0xef, 0xa1, 0xe2, 0xff, 0x60, 0x3e, 0xae, 0x5d, 0xce, 0xae, 0x0b, 0xf5, 0x85, 0xed, 0xaa, + 0x32, 0x2d, 0x9b, 0x12, 0xd7, 0xd0, 0x72, 0x57, 0xbe, 0x9c, 0xf9, 0x78, 0x77, 0xd1, 0x10, 0x74, + 0x1e, 0xb4, 0xfb, 0xcf, 0xdb, 0xbb, 0x8b, 0xc6, 0x7d, 0xba, 0x77, 0x77, 0x17, 0x8d, 0xdf, 0x86, + 0xed, 0x9d, 0x8e, 0x34, 0x38, 0xc1, 0xb7, 0x56, 0x01, 0x2b, 0x13, 0x26, 0x1d, 0xd1, 0x1e, 0xc1, + 0x14, 0xd5, 0x2e, 0xb3, 0x40, 0x6e, 0x51, 0xeb, 0xb9, 0xdb, 0x23, 0x1e, 0x6b, 0x85, 0x02, 0xee, + 0x75, 0xa1, 0xe3, 0xc2, 0x76, 0x17, 0x35, 0x4d, 0x93, 0xf4, 0x31, 0x7b, 0x7a, 0xbb, 0x1e, 0x58, + 0x8a, 0x47, 0x02, 0xe3, 0x4c, 0x06, 0x65, 0x90, 0x21, 0xde, 0xfb, 0xef, 0x69, 0xbd, 0x47, 0x04, + 0x78, 0xdd, 0xc3, 0x10, 0xac, 0xad, 0x86, 0x32, 0x04, 0xbe, 0x9c, 0x96, 0x49, 0x2f, 0xba, 0x93, + 0x78, 0xf1, 0x08, 0x94, 0x53, 0x90, 0x86, 0x0d, 0xa9, 0x5d, 0x9e, 0x5b, 0x17, 0xea, 0x8b, 0xda, + 0x5a, 0xe0, 0xcb, 0x33, 0x31, 0xfa, 0xf2, 0x54, 0xca, 0x7d, 0x48, 0xed, 0xdd, 0xfc, 0xb8, 0xf4, + 0xb5, 0xf7, 0x02, 0xf8, 0xf3, 0x3b, 0xb2, 0x25, 0x12, 0x8b, 0x1b, 0x00, 0x8c, 0x90, 0x10, 0x22, + 0x12, 0xf9, 0xc0, 0x97, 0x47, 0xac, 0x7a, 0x8e, 0x26, 0xa5, 0xc4, 0x1d, 0xb0, 0x88, 0xfb, 0x6e, + 0xc2, 0x2d, 0xbe, 0x2a, 0x3f, 0x69, 0xbf, 0x04, 0xbe, 0x3c, 0x66, 0xd7, 0x17, 0x70, 0xdf, 0x4d, + 0x6a, 0xd5, 0x3e, 0x64, 0x41, 0xa9, 0x45, 0xad, 0x88, 0xc4, 0xa8, 0x88, 0x62, 0x1b, 0x94, 0xa8, + 0x0d, 0x31, 0x26, 0xd8, 0xe8, 0x20, 0xca, 0x0c, 0x18, 0x0f, 0x8b, 0x8f, 0x71, 0x33, 0xf0, 0xe5, + 0x54, 0xff, 0xcc, 0xf1, 0x8a, 0x1c, 0xfd, 0x0c, 0x51, 0xc6, 0x3d, 0x62, 0x13, 0xc4, 0x83, 0x30, + 0xa8, 0x67, 0x0e, 0x0b, 0x64, 0xa3, 0x02, 0xcb, 0x81, 0x2f, 0x4f, 0x3b, 0xf5, 0x42, 0x64, 0x3a, + 0xf4, 0xcc, 0x24, 0xc5, 0x7f, 0xa0, 0xc0, 0x51, 0x8e, 0x85, 0x21, 0xeb, 0x7b, 0x28, 0x9a, 0x56, + 0x4e, 0x5b, 0x0a, 0x7c, 0x79, 0xd2, 0xa5, 0xe7, 0xe3, 0xf0, 0xe4, 0xbc, 0x5b, 0x09, 0xa7, 0x93, + 0xda, 0x47, 0x2d, 0x10, 0xc0, 0x5a, 0x9a, 0x30, 0xc3, 0xe9, 0xa4, 0x92, 0x17, 0x7e, 0x88, 0xfc, + 0x4b, 0x50, 0x30, 0xc3, 0xfc, 0xa8, 0x63, 0xb4, 0x61, 0x17, 0x62, 0x33, 0xb9, 0xe3, 0x15, 0x85, + 0x6b, 0x18, 0x2e, 0x17, 0x85, 0x2f, 0x17, 0x65, 0x8f, 0x38, 0x58, 0x5b, 0xe1, 0xf7, 0x7a, 0x32, + 0x52, 0xcf, 0x73, 0x83, 0x16, 0x9f, 0xc5, 0x06, 0x28, 0x26, 0x10, 0xc8, 0x0c, 0x1b, 0x39, 0x96, + 0xcd, 0x22, 0x6d, 0xe6, 0xf4, 0x24, 0xb6, 0xc9, 0xf6, 0x23, 0xf3, 0xf6, 0xd7, 0x2c, 0x98, 0x6b, + 0x51, 0x4b, 0x7c, 0x05, 0x16, 0xc7, 0xf6, 0xd5, 0xaf, 0xa9, 0xef, 0xda, 0xf8, 0x46, 0xa8, 0xfe, + 0xf5, 0x08, 0xd0, 0x50, 0xb5, 0x73, 0x01, 0xac, 0x3d, 0xb8, 0x33, 0x76, 0x66, 0x64, 0x7b, 0x28, + 0xa8, 0xfa, 0xef, 0x13, 0x82, 0x86, 0x94, 0x08, 0x28, 0x4e, 0x5f, 0xff, 0xfa, 0x8c, 0x8c, 0x53, + 0xc8, 0xea, 0xe6, 0x63, 0x91, 0x49, 0xc1, 0xea, 0xcf, 0x6f, 0xc2, 0xed, 0xac, 0x1d, 0x5c, 0x0d, + 0x24, 0xe1, 0x7a, 0x20, 0x09, 0x37, 0x03, 0x49, 0xf8, 0x32, 0x90, 0x84, 0xf3, 0x5b, 0x29, 0x73, + 0x7d, 0x2b, 0x65, 0x6e, 0x6e, 0xa5, 0xcc, 0x8b, 0x6d, 0xcb, 0x61, 0x76, 0xbf, 0xad, 0x98, 0xc4, + 0x55, 0xc3, 0x02, 0x1b, 0x18, 0xb1, 0xd7, 0xc4, 0x3b, 0x56, 0x53, 0x17, 0x37, 0x3b, 0xeb, 0x21, + 0xda, 0x9e, 0x8f, 0xbe, 0x3c, 0x3b, 0xdf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x17, 0x88, 0x75, + 0x72, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1585,7 +1599,7 @@ func (m *MsgClaimMorseAccountResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ClaimedAtHeight |= int32(b&0x7F) << shift + m.ClaimedAtHeight |= int64(b&0x7F) << shift if b < 0x80 { break } From a1ec09c6c15b004320d32ce8a637a369c161dfaa Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 17 Feb 2025 10:38:07 +0100 Subject: [PATCH 13/81] chore: update autocli --- x/migration/module/autocli.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index b93bd3365..28a23df15 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -52,9 +52,9 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, { RpcMethod: "ClaimMorseAccount", - Use: "claim-morse-account [morse-src-address] [morse-signature]", + Use: "claim-morse-account [morse-src-address-hex] [morse-signature-hex]", Short: "Send a claim_morse_account tx", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morseSrcAddress"}, {ProtoField: "morseSignature"}}, + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morse_src_address"}, {ProtoField: "morse_signature"}}, }, // this line is used by ignite scaffolding # autocli/tx }, From 42481a249bda3f75df7df9f61cbd52581590c01e Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 17 Feb 2025 10:55:29 +0100 Subject: [PATCH 14/81] fix: imports --- api/poktroll/migration/event.pulsar.go | 1 - 1 file changed, 1 deletion(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index f9296d2fe..e6ca4fc52 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -8,7 +8,6 @@ import ( runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "github.com/pokt-network/poktroll/api/poktroll/shared" - prot protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" From 29f2e658c7301ffc869079e8f09ce0fadb2b6723 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 17 Feb 2025 14:46:09 +0100 Subject: [PATCH 15/81] chore: self review improvements --- api/poktroll/migration/tx.pulsar.go | 5 ++++- proto/poktroll/migration/tx.proto | 5 ++++- x/migration/module/autocli.go | 3 ++- x/migration/types/tx.pb.go | 5 ++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index aaf24860b..1c7229bf2 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -3151,7 +3151,7 @@ func (x *MsgImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { } // MsgImportMorseClaimableAccountsResponse is used to execute a claim (one-time minting of tokens on Shannon), -// of the balance of the given Morse account, according to the MorseAccountState, to the balance +// of the balance of the given Morse account, according to the on-chain MorseClaimableAccounts, to the balance // of the given Shannon account (who MUST also be the signer of this message). // Authz grant(s) MAY be used to delegate the authority to create a claim on behalf of another Shannon account. type MsgImportMorseClaimableAccountsResponse struct { @@ -3200,6 +3200,9 @@ func (x *MsgImportMorseClaimableAccountsResponse) GetNumAccounts() uint64 { return 0 } +// MsgClaimMorseAccount is an on-chain, persisted data structure which represents the state of a claimable account. +// It is initially created by the (one-time) MsgImportMorseClaimableAccounts message, and is subsequently updated +// by the MsgClaimMorseAccount message, when it is claimed (also a one-time event, per claimable account). type MsgClaimMorseAccount struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 6f131e815..59f35d985 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -62,7 +62,7 @@ message MsgImportMorseClaimableAccounts { } // MsgImportMorseClaimableAccountsResponse is used to execute a claim (one-time minting of tokens on Shannon), -// of the balance of the given Morse account, according to the MorseAccountState, to the balance +// of the balance of the given Morse account, according to the on-chain MorseClaimableAccounts, to the balance // of the given Shannon account (who MUST also be the signer of this message). // Authz grant(s) MAY be used to delegate the authority to create a claim on behalf of another Shannon account. message MsgImportMorseClaimableAccountsResponse { @@ -75,6 +75,9 @@ message MsgImportMorseClaimableAccountsResponse { uint64 num_accounts = 2 [(gogoproto.jsontag) = "num_accounts"]; } +// MsgClaimMorseAccount is an on-chain, persisted data structure which represents the state of a claimable account. +// It is initially created by the (one-time) MsgImportMorseClaimableAccounts message, and is subsequently updated +// by the MsgClaimMorseAccount message, when it is claimed (also a one-time event, per claimable account). message MsgClaimMorseAccount { option (cosmos.msg.v1.signer) = "shannon_dest_address"; diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index 28a23df15..ddf2ab7a8 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -53,7 +53,8 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { { RpcMethod: "ClaimMorseAccount", Use: "claim-morse-account [morse-src-address-hex] [morse-signature-hex]", - Short: "Send a claim_morse_account tx", + Short: "Claim the account balance of the given Morse account address", + Long: "Claim the account balance of the given Morse account address, by signing the message with the private key of the Morse account.", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morse_src_address"}, {ProtoField: "morse_signature"}}, }, // this line is used by ignite scaffolding # autocli/tx diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index ddfa51908..38857d9d2 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -184,7 +184,7 @@ func (m *MsgImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { } // MsgImportMorseClaimableAccountsResponse is used to execute a claim (one-time minting of tokens on Shannon), -// of the balance of the given Morse account, according to the MorseAccountState, to the balance +// of the balance of the given Morse account, according to the on-chain MorseClaimableAccounts, to the balance // of the given Shannon account (who MUST also be the signer of this message). // Authz grant(s) MAY be used to delegate the authority to create a claim on behalf of another Shannon account. type MsgImportMorseClaimableAccountsResponse struct { @@ -240,6 +240,9 @@ func (m *MsgImportMorseClaimableAccountsResponse) GetNumAccounts() uint64 { return 0 } +// MsgClaimMorseAccount is an on-chain, persisted data structure which represents the state of a claimable account. +// It is initially created by the (one-time) MsgImportMorseClaimableAccounts message, and is subsequently updated +// by the MsgClaimMorseAccount message, when it is claimed (also a one-time event, per claimable account). type MsgClaimMorseAccount struct { // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address"` From 5af7f01b9135db3988227b449b85a83ebecedebb Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 17 Feb 2025 14:51:26 +0100 Subject: [PATCH 16/81] chore: self review improvements --- x/migration/module/autocli.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index ddf2ab7a8..306b7c52f 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -56,6 +56,8 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Short: "Claim the account balance of the given Morse account address", Long: "Claim the account balance of the given Morse account address, by signing the message with the private key of the Morse account.", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morse_src_address"}, {ProtoField: "morse_signature"}}, + Skip: true, // skipped because autoCLI cannot handle signing + // TODO_UPNEXT(@bryanchriswhite#1034): Add morse account claiming CLI. }, // this line is used by ignite scaffolding # autocli/tx }, From 9bf879f60d7b885f689cf865c45e4e73d8a07a88 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 17 Feb 2025 17:23:08 +0100 Subject: [PATCH 17/81] refactor: add bank & acct mod deps to migration mod --- testutil/keeper/migration.go | 21 +++++++++++++++++++++ x/migration/keeper/keeper.go | 15 +++++++++++---- x/migration/module/module.go | 2 ++ 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/testutil/keeper/migration.go b/testutil/keeper/migration.go index fd85baf9f..8dcf73c38 100644 --- a/testutil/keeper/migration.go +++ b/testutil/keeper/migration.go @@ -1,6 +1,7 @@ package keeper import ( + "context" "testing" "cosmossdk.io/log" @@ -16,7 +17,9 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + "github.com/pokt-network/poktroll/testutil/proof/mocks" "github.com/pokt-network/poktroll/x/migration/keeper" "github.com/pokt-network/poktroll/x/migration/types" ) @@ -33,11 +36,29 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { cdc := codec.NewProtoCodec(registry) authority := authtypes.NewModuleAddress(govtypes.ModuleName) + ctrl := gomock.NewController(t) + mockBankKeeper := mocks.NewMockBankKeeper(ctrl) + mockBankKeeper.EXPECT(). + SpendableCoins(gomock.Any(), gomock.Any()). + DoAndReturn( + func(ctx context.Context, addr sdk.AccAddress) sdk.Coins { + mapMu.RLock() + defer mapMu.RUnlock() + if coins, ok := mapAccAddrCoins[addr.String()]; ok { + return coins + } + return sdk.Coins{} + }, + ).AnyTimes() + mockAccountKeeper := mocks.NewMockAccountKeeper(ctrl) + k := keeper.NewKeeper( cdc, runtime.NewKVStoreService(storeKey), log.NewNopLogger(), authority.String(), + mockAccountKeeper, + mockBankKeeper, ) ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) diff --git a/x/migration/keeper/keeper.go b/x/migration/keeper/keeper.go index af25b6e3d..b4019db3f 100644 --- a/x/migration/keeper/keeper.go +++ b/x/migration/keeper/keeper.go @@ -20,6 +20,9 @@ type ( // the address capable of executing a MsgUpdateParams message. Typically, this // should be the x/gov module account. authority string + + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper } ) @@ -28,6 +31,8 @@ func NewKeeper( storeService store.KVStoreService, logger log.Logger, authority string, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, ) Keeper { if _, err := sdk.AccAddressFromBech32(authority); err != nil { @@ -35,10 +40,12 @@ func NewKeeper( } return Keeper{ - cdc: cdc, - storeService: storeService, - authority: authority, - logger: logger, + cdc: cdc, + storeService: storeService, + authority: authority, + logger: logger, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, } } diff --git a/x/migration/module/module.go b/x/migration/module/module.go index 9632fab53..53cb8fc7d 100644 --- a/x/migration/module/module.go +++ b/x/migration/module/module.go @@ -202,6 +202,8 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { in.StoreService, in.Logger, authority.String(), + in.AccountKeeper, + in.BankKeeper, ) m := NewAppModule( in.Cdc, From 0bcc12b3aec49085702a22b8c295f4c3b73110b0 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 17 Feb 2025 17:23:18 +0100 Subject: [PATCH 18/81] chore: add mint permission to migration module --- app/app_config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/app/app_config.go b/app/app_config.go index 0c91af588..64a1e8279 100644 --- a/app/app_config.go +++ b/app/app_config.go @@ -236,6 +236,7 @@ var ( {Account: sessionmoduletypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner, authtypes.Staking}}, {Account: tokenomicsmoduletypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner, authtypes.Staking}}, {Account: proofmoduletypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner, authtypes.Staking}}, + {Account: migrationmoduletypes.ModuleName, Permissions: []string{authtypes.Minter}}, // this line is used by starport scaffolding # stargate/app/maccPerms } } From 869f596006898256f00f168fa4aecefe9aafb40c Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 17 Feb 2025 17:23:58 +0100 Subject: [PATCH 19/81] chore: add EventMorseAccountClaimed proto type --- api/poktroll/migration/event.pulsar.go | 754 ++++++++++++++++++++++++- proto/poktroll/migration/event.proto | 15 + x/migration/types/event.pb.go | 369 +++++++++++- 3 files changed, 1092 insertions(+), 46 deletions(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index e6ca4fc52..603c1b800 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -2,7 +2,7 @@ package migration import ( - _ "cosmossdk.io/api/cosmos/base/v1beta1" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" @@ -534,6 +534,617 @@ func (x *fastReflection_EventImportMorseClaimableAccounts) ProtoMethods() *proto } } +var ( + md_EventMorseAccountClaimed protoreflect.MessageDescriptor + fd_EventMorseAccountClaimed_claimed_at_height protoreflect.FieldDescriptor + fd_EventMorseAccountClaimed_claimed_balance protoreflect.FieldDescriptor + fd_EventMorseAccountClaimed_shannon_dest_address protoreflect.FieldDescriptor + fd_EventMorseAccountClaimed_morse_src_address protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_event_proto_init() + md_EventMorseAccountClaimed = File_poktroll_migration_event_proto.Messages().ByName("EventMorseAccountClaimed") + fd_EventMorseAccountClaimed_claimed_at_height = md_EventMorseAccountClaimed.Fields().ByName("claimed_at_height") + fd_EventMorseAccountClaimed_claimed_balance = md_EventMorseAccountClaimed.Fields().ByName("claimed_balance") + fd_EventMorseAccountClaimed_shannon_dest_address = md_EventMorseAccountClaimed.Fields().ByName("shannon_dest_address") + fd_EventMorseAccountClaimed_morse_src_address = md_EventMorseAccountClaimed.Fields().ByName("morse_src_address") +} + +var _ protoreflect.Message = (*fastReflection_EventMorseAccountClaimed)(nil) + +type fastReflection_EventMorseAccountClaimed EventMorseAccountClaimed + +func (x *EventMorseAccountClaimed) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventMorseAccountClaimed)(x) +} + +func (x *EventMorseAccountClaimed) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_event_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventMorseAccountClaimed_messageType fastReflection_EventMorseAccountClaimed_messageType +var _ protoreflect.MessageType = fastReflection_EventMorseAccountClaimed_messageType{} + +type fastReflection_EventMorseAccountClaimed_messageType struct{} + +func (x fastReflection_EventMorseAccountClaimed_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventMorseAccountClaimed)(nil) +} +func (x fastReflection_EventMorseAccountClaimed_messageType) New() protoreflect.Message { + return new(fastReflection_EventMorseAccountClaimed) +} +func (x fastReflection_EventMorseAccountClaimed_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventMorseAccountClaimed +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventMorseAccountClaimed) Descriptor() protoreflect.MessageDescriptor { + return md_EventMorseAccountClaimed +} + +// 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_EventMorseAccountClaimed) Type() protoreflect.MessageType { + return _fastReflection_EventMorseAccountClaimed_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventMorseAccountClaimed) New() protoreflect.Message { + return new(fastReflection_EventMorseAccountClaimed) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventMorseAccountClaimed) Interface() protoreflect.ProtoMessage { + return (*EventMorseAccountClaimed)(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_EventMorseAccountClaimed) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ClaimedAtHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.ClaimedAtHeight) + if !f(fd_EventMorseAccountClaimed_claimed_at_height, value) { + return + } + } + if x.ClaimedBalance != nil { + value := protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) + if !f(fd_EventMorseAccountClaimed_claimed_balance, value) { + return + } + } + if x.ShannonDestAddress != "" { + value := protoreflect.ValueOfString(x.ShannonDestAddress) + if !f(fd_EventMorseAccountClaimed_shannon_dest_address, value) { + return + } + } + if x.MorseSrcAddress != "" { + value := protoreflect.ValueOfString(x.MorseSrcAddress) + if !f(fd_EventMorseAccountClaimed_morse_src_address, 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_EventMorseAccountClaimed) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.EventMorseAccountClaimed.claimed_at_height": + return x.ClaimedAtHeight != int64(0) + case "poktroll.migration.EventMorseAccountClaimed.claimed_balance": + return x.ClaimedBalance != nil + case "poktroll.migration.EventMorseAccountClaimed.shannon_dest_address": + return x.ShannonDestAddress != "" + case "poktroll.migration.EventMorseAccountClaimed.morse_src_address": + return x.MorseSrcAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseAccountClaimed")) + } + panic(fmt.Errorf("message poktroll.migration.EventMorseAccountClaimed 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_EventMorseAccountClaimed) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.EventMorseAccountClaimed.claimed_at_height": + x.ClaimedAtHeight = int64(0) + case "poktroll.migration.EventMorseAccountClaimed.claimed_balance": + x.ClaimedBalance = nil + case "poktroll.migration.EventMorseAccountClaimed.shannon_dest_address": + x.ShannonDestAddress = "" + case "poktroll.migration.EventMorseAccountClaimed.morse_src_address": + x.MorseSrcAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseAccountClaimed")) + } + panic(fmt.Errorf("message poktroll.migration.EventMorseAccountClaimed 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_EventMorseAccountClaimed) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.EventMorseAccountClaimed.claimed_at_height": + value := x.ClaimedAtHeight + return protoreflect.ValueOfInt64(value) + case "poktroll.migration.EventMorseAccountClaimed.claimed_balance": + value := x.ClaimedBalance + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.EventMorseAccountClaimed.shannon_dest_address": + value := x.ShannonDestAddress + return protoreflect.ValueOfString(value) + case "poktroll.migration.EventMorseAccountClaimed.morse_src_address": + value := x.MorseSrcAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseAccountClaimed")) + } + panic(fmt.Errorf("message poktroll.migration.EventMorseAccountClaimed 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_EventMorseAccountClaimed) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.EventMorseAccountClaimed.claimed_at_height": + x.ClaimedAtHeight = value.Int() + case "poktroll.migration.EventMorseAccountClaimed.claimed_balance": + x.ClaimedBalance = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.migration.EventMorseAccountClaimed.shannon_dest_address": + x.ShannonDestAddress = value.Interface().(string) + case "poktroll.migration.EventMorseAccountClaimed.morse_src_address": + x.MorseSrcAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseAccountClaimed")) + } + panic(fmt.Errorf("message poktroll.migration.EventMorseAccountClaimed 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_EventMorseAccountClaimed) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.EventMorseAccountClaimed.claimed_balance": + if x.ClaimedBalance == nil { + x.ClaimedBalance = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) + case "poktroll.migration.EventMorseAccountClaimed.claimed_at_height": + panic(fmt.Errorf("field claimed_at_height of message poktroll.migration.EventMorseAccountClaimed is not mutable")) + case "poktroll.migration.EventMorseAccountClaimed.shannon_dest_address": + panic(fmt.Errorf("field shannon_dest_address of message poktroll.migration.EventMorseAccountClaimed is not mutable")) + case "poktroll.migration.EventMorseAccountClaimed.morse_src_address": + panic(fmt.Errorf("field morse_src_address of message poktroll.migration.EventMorseAccountClaimed is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseAccountClaimed")) + } + panic(fmt.Errorf("message poktroll.migration.EventMorseAccountClaimed 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_EventMorseAccountClaimed) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.EventMorseAccountClaimed.claimed_at_height": + return protoreflect.ValueOfInt64(int64(0)) + case "poktroll.migration.EventMorseAccountClaimed.claimed_balance": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.EventMorseAccountClaimed.shannon_dest_address": + return protoreflect.ValueOfString("") + case "poktroll.migration.EventMorseAccountClaimed.morse_src_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseAccountClaimed")) + } + panic(fmt.Errorf("message poktroll.migration.EventMorseAccountClaimed 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_EventMorseAccountClaimed) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.EventMorseAccountClaimed", 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_EventMorseAccountClaimed) 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_EventMorseAccountClaimed) 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_EventMorseAccountClaimed) 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_EventMorseAccountClaimed) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventMorseAccountClaimed) + 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.ClaimedAtHeight != 0 { + n += 1 + runtime.Sov(uint64(x.ClaimedAtHeight)) + } + if x.ClaimedBalance != nil { + l = options.Size(x.ClaimedBalance) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ShannonDestAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MorseSrcAddress) + 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().(*EventMorseAccountClaimed) + 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.MorseSrcAddress) > 0 { + i -= len(x.MorseSrcAddress) + copy(dAtA[i:], x.MorseSrcAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseSrcAddress))) + i-- + dAtA[i] = 0x22 + } + if len(x.ShannonDestAddress) > 0 { + i -= len(x.ShannonDestAddress) + copy(dAtA[i:], x.ShannonDestAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ShannonDestAddress))) + i-- + dAtA[i] = 0x1a + } + if x.ClaimedBalance != nil { + encoded, err := options.Marshal(x.ClaimedBalance) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.ClaimedAtHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimedAtHeight)) + i-- + dAtA[i] = 0x8 + } + 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().(*EventMorseAccountClaimed) + 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: EventMorseAccountClaimed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventMorseAccountClaimed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) + } + x.ClaimedAtHeight = 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.ClaimedAtHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedBalance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ClaimedBalance == nil { + x.ClaimedBalance = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedBalance); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ShannonDestAddress", 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.ShannonDestAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MorseSrcAddress", 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.MorseSrcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -603,6 +1214,70 @@ func (x *EventImportMorseClaimableAccounts) GetNumAccounts() uint64 { return 0 } +// TODO_IN_THIS_COMMIT: comments... +type EventMorseAccountClaimed struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The height (on Shannon) at which the claim was executed (i.e. claimed). + ClaimedAtHeight int64 `protobuf:"varint,1,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` + // The balance which was claimed. + ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance,omitempty"` + // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. + ShannonDestAddress string `protobuf:"bytes,3,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address,omitempty"` + // The hex-encoded address of the Morse account whose balance will be claimed. + MorseSrcAddress string `protobuf:"bytes,4,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` +} + +func (x *EventMorseAccountClaimed) Reset() { + *x = EventMorseAccountClaimed{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_event_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventMorseAccountClaimed) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventMorseAccountClaimed) ProtoMessage() {} + +// Deprecated: Use EventMorseAccountClaimed.ProtoReflect.Descriptor instead. +func (*EventMorseAccountClaimed) Descriptor() ([]byte, []int) { + return file_poktroll_migration_event_proto_rawDescGZIP(), []int{1} +} + +func (x *EventMorseAccountClaimed) GetClaimedAtHeight() int64 { + if x != nil { + return x.ClaimedAtHeight + } + return 0 +} + +func (x *EventMorseAccountClaimed) GetClaimedBalance() *v1beta1.Coin { + if x != nil { + return x.ClaimedBalance + } + return nil +} + +func (x *EventMorseAccountClaimed) GetShannonDestAddress() string { + if x != nil { + return x.ShannonDestAddress + } + return "" +} + +func (x *EventMorseAccountClaimed) GetMorseSrcAddress() string { + if x != nil { + return x.MorseSrcAddress + } + return "" +} + var File_poktroll_migration_event_proto protoreflect.FileDescriptor var file_poktroll_migration_event_proto_rawDesc = []byte{ @@ -634,19 +1309,41 @@ var file_poktroll_migration_event_proto_rawDesc = []byte{ 0x6e, 0x75, 0x6d, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x03, 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, 0x42, 0xb6, 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, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 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, + 0x73, 0x22, 0xe1, 0x02, 0x0a, 0x18, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x12, 0x41, + 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x12, 0x5b, 0x0a, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x17, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x0f, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0e, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x62, + 0x0a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xea, 0xde, + 0x1f, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x12, + 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, + 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0xb6, 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, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 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 ( @@ -661,16 +1358,19 @@ func file_poktroll_migration_event_proto_rawDescGZIP() []byte { return file_poktroll_migration_event_proto_rawDescData } -var file_poktroll_migration_event_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_migration_event_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_poktroll_migration_event_proto_goTypes = []interface{}{ (*EventImportMorseClaimableAccounts)(nil), // 0: poktroll.migration.EventImportMorseClaimableAccounts + (*EventMorseAccountClaimed)(nil), // 1: poktroll.migration.EventMorseAccountClaimed + (*v1beta1.Coin)(nil), // 2: cosmos.base.v1beta1.Coin } var file_poktroll_migration_event_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 2, // 0: poktroll.migration.EventMorseAccountClaimed.claimed_balance:type_name -> cosmos.base.v1beta1.Coin + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] 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 } func init() { file_poktroll_migration_event_proto_init() } @@ -692,6 +1392,18 @@ func file_poktroll_migration_event_proto_init() { return nil } } + file_poktroll_migration_event_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventMorseAccountClaimed); 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{ @@ -699,7 +1411,7 @@ func file_poktroll_migration_event_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_migration_event_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/poktroll/migration/event.proto b/proto/poktroll/migration/event.proto index 60b013d65..3c109c4da 100644 --- a/proto/poktroll/migration/event.proto +++ b/proto/poktroll/migration/event.proto @@ -23,3 +23,18 @@ message EventImportMorseClaimableAccounts { // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. uint64 num_accounts = 3 [(gogoproto.jsontag) = "num_accounts"]; } + +// TODO_IN_THIS_COMMIT: comments... +message EventMorseAccountClaimed { + // The height (on Shannon) at which the claim was executed (i.e. claimed). + int64 claimed_at_height = 1 [(gogoproto.jsontag) = "claimed_at_height"]; + + // The balance which was claimed. + cosmos.base.v1beta1.Coin claimed_balance = 2 [(gogoproto.jsontag) = "claimed_balance", (gogoproto.nullable) = false]; + + // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. + string shannon_dest_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "shannon_dest_address"]; + + // The hex-encoded address of the Morse account whose balance will be claimed. + string morse_src_address = 4 [(gogoproto.jsontag) = "morse_src_address"]; +} \ No newline at end of file diff --git a/x/migration/types/event.pb.go b/x/migration/types/event.pb.go index 9ccab2666..456a5b509 100644 --- a/x/migration/types/event.pb.go +++ b/x/migration/types/event.pb.go @@ -6,7 +6,7 @@ package types import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" _ "github.com/pokt-network/poktroll/x/shared/types" @@ -87,37 +87,116 @@ func (m *EventImportMorseClaimableAccounts) GetNumAccounts() uint64 { return 0 } +// TODO_IN_THIS_COMMIT: comments... +type EventMorseAccountClaimed struct { + // The height (on Shannon) at which the claim was executed (i.e. claimed). + ClaimedAtHeight int64 `protobuf:"varint,1,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height"` + // The balance which was claimed. + ClaimedBalance types.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance"` + // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. + ShannonDestAddress string `protobuf:"bytes,3,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address"` + // The hex-encoded address of the Morse account whose balance will be claimed. + MorseSrcAddress string `protobuf:"bytes,4,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address"` +} + +func (m *EventMorseAccountClaimed) Reset() { *m = EventMorseAccountClaimed{} } +func (m *EventMorseAccountClaimed) String() string { return proto.CompactTextString(m) } +func (*EventMorseAccountClaimed) ProtoMessage() {} +func (*EventMorseAccountClaimed) Descriptor() ([]byte, []int) { + return fileDescriptor_d5b0bc9ed37905e1, []int{1} +} +func (m *EventMorseAccountClaimed) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventMorseAccountClaimed) 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 *EventMorseAccountClaimed) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventMorseAccountClaimed.Merge(m, src) +} +func (m *EventMorseAccountClaimed) XXX_Size() int { + return m.Size() +} +func (m *EventMorseAccountClaimed) XXX_DiscardUnknown() { + xxx_messageInfo_EventMorseAccountClaimed.DiscardUnknown(m) +} + +var xxx_messageInfo_EventMorseAccountClaimed proto.InternalMessageInfo + +func (m *EventMorseAccountClaimed) GetClaimedAtHeight() int64 { + if m != nil { + return m.ClaimedAtHeight + } + return 0 +} + +func (m *EventMorseAccountClaimed) GetClaimedBalance() types.Coin { + if m != nil { + return m.ClaimedBalance + } + return types.Coin{} +} + +func (m *EventMorseAccountClaimed) GetShannonDestAddress() string { + if m != nil { + return m.ShannonDestAddress + } + return "" +} + +func (m *EventMorseAccountClaimed) GetMorseSrcAddress() string { + if m != nil { + return m.MorseSrcAddress + } + return "" +} + func init() { proto.RegisterType((*EventImportMorseClaimableAccounts)(nil), "poktroll.migration.EventImportMorseClaimableAccounts") + proto.RegisterType((*EventMorseAccountClaimed)(nil), "poktroll.migration.EventMorseAccountClaimed") } func init() { proto.RegisterFile("poktroll/migration/event.proto", fileDescriptor_d5b0bc9ed37905e1) } var fileDescriptor_d5b0bc9ed37905e1 = []byte{ - // 360 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xcd, 0x8e, 0xd3, 0x30, - 0x14, 0x85, 0x6b, 0x8a, 0x58, 0x84, 0x4a, 0x40, 0x44, 0xa5, 0x50, 0x81, 0x5b, 0x58, 0xa0, 0x6e, - 0xa8, 0x55, 0xfa, 0x04, 0x0d, 0x42, 0x2a, 0x0b, 0x24, 0x54, 0xc4, 0x86, 0x4d, 0xe4, 0xb8, 0x56, - 0x1c, 0x35, 0xf6, 0x8d, 0xec, 0x9b, 0x02, 0x6f, 0xc1, 0x63, 0xb1, 0xec, 0xb2, 0xab, 0x0a, 0xa5, - 0xbb, 0x2e, 0xe7, 0x09, 0x46, 0xf9, 0xab, 0x66, 0x34, 0x33, 0x3b, 0xfb, 0x7c, 0xc7, 0xd7, 0xe7, - 0x1e, 0x8f, 0xe6, 0xb0, 0x45, 0x0b, 0x59, 0xc6, 0x74, 0x9a, 0x58, 0x8e, 0x29, 0x18, 0x26, 0x77, - 0xd2, 0xe0, 0x2c, 0xb7, 0x80, 0xe0, 0xfb, 0x1d, 0x9f, 0x5d, 0xf8, 0xe8, 0x95, 0x00, 0xa7, 0xc1, - 0x45, 0xb5, 0x83, 0x35, 0x97, 0xc6, 0x3e, 0x7a, 0x99, 0x40, 0x02, 0x8d, 0x5e, 0x9d, 0x5a, 0x95, - 0x36, 0x1e, 0x16, 0x73, 0x27, 0xd9, 0x6e, 0x1e, 0x4b, 0xe4, 0x73, 0x26, 0x20, 0x35, 0x2d, 0x7f, - 0x73, 0x09, 0xe1, 0x14, 0xb7, 0x72, 0xc3, 0x9c, 0xb4, 0xbb, 0x54, 0xc8, 0x16, 0xbf, 0xbf, 0x27, - 0xa3, 0x06, 0xeb, 0x64, 0x04, 0x46, 0x28, 0xde, 0x8d, 0x79, 0x77, 0x45, 0xbc, 0xb7, 0x9f, 0xab, - 0xec, 0x5f, 0x74, 0x0e, 0x16, 0xbf, 0x56, 0x96, 0x4f, 0x19, 0x4f, 0x35, 0x8f, 0x33, 0xb9, 0x14, - 0x02, 0x0a, 0x83, 0xce, 0x5f, 0x7a, 0x2f, 0x84, 0x95, 0x1c, 0xe5, 0x26, 0xe2, 0x18, 0x29, 0x99, - 0x26, 0x0a, 0x03, 0x32, 0x21, 0xd3, 0x7e, 0x38, 0x3c, 0x1f, 0xc7, 0x77, 0xe1, 0xfa, 0x59, 0x2b, - 0x2d, 0x71, 0x55, 0x0b, 0xfe, 0x0f, 0x2f, 0x68, 0xfe, 0xe7, 0xcd, 0xd0, 0xc8, 0x21, 0x47, 0x19, - 0x29, 0xee, 0x54, 0xf0, 0x68, 0x42, 0xa6, 0x83, 0xf0, 0xf5, 0xf9, 0x38, 0x7e, 0xd0, 0xb3, 0x1e, - 0xd6, 0xa4, 0x4d, 0xf4, 0xbd, 0xd2, 0x57, 0xdc, 0x29, 0x7f, 0xe1, 0x0d, 0x4c, 0xa1, 0xbb, 0x07, - 0x2e, 0xe8, 0x4f, 0xc8, 0xf4, 0x71, 0xf8, 0xfc, 0x7c, 0x1c, 0xdf, 0xd2, 0xd7, 0x4f, 0x4d, 0xa1, - 0xbb, 0x75, 0xc2, 0x6f, 0xff, 0x4a, 0x4a, 0xf6, 0x25, 0x25, 0x87, 0x92, 0x92, 0xff, 0x25, 0x25, - 0x7f, 0x4f, 0xb4, 0xb7, 0x3f, 0xd1, 0xde, 0xe1, 0x44, 0x7b, 0x3f, 0x3f, 0x26, 0x29, 0xaa, 0x22, - 0x9e, 0x09, 0xd0, 0xac, 0x6a, 0xf1, 0x83, 0x91, 0xf8, 0x0b, 0xec, 0x96, 0x5d, 0x2a, 0xfd, 0x7d, - 0xa3, 0x54, 0xfc, 0x93, 0x4b, 0x17, 0x3f, 0xa9, 0xdb, 0x5c, 0x5c, 0x07, 0x00, 0x00, 0xff, 0xff, - 0xe7, 0xcb, 0xa5, 0x40, 0x1b, 0x02, 0x00, 0x00, + // 501 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0xe3, 0xb6, 0x42, 0xc2, 0xad, 0x08, 0x58, 0xa9, 0x48, 0x2b, 0xb0, 0x43, 0x0f, 0x28, + 0x97, 0xda, 0xb4, 0x7d, 0x82, 0xb8, 0x20, 0x95, 0x43, 0x25, 0xe4, 0x88, 0x0b, 0x1c, 0xac, 0xf5, + 0x7a, 0x64, 0x5b, 0x8d, 0x77, 0xa3, 0xdd, 0x49, 0x80, 0xb7, 0xe0, 0x61, 0x78, 0x88, 0x1e, 0x2b, + 0x4e, 0x3d, 0x59, 0x90, 0xdc, 0x7c, 0xe4, 0x09, 0x90, 0x77, 0xd7, 0x56, 0xff, 0xde, 0x76, 0x7f, + 0xdf, 0xec, 0xcc, 0x7c, 0x3b, 0x63, 0xbb, 0x73, 0x7e, 0x81, 0x82, 0xcf, 0x66, 0x41, 0x59, 0x64, + 0x82, 0x60, 0xc1, 0x59, 0x00, 0x4b, 0x60, 0xe8, 0xcf, 0x05, 0x47, 0xee, 0x38, 0xad, 0xee, 0x77, + 0xfa, 0xfe, 0x1e, 0xe5, 0xb2, 0xe4, 0x32, 0x56, 0x11, 0x81, 0xbe, 0xe8, 0xf0, 0xfd, 0x41, 0xc6, + 0x33, 0xae, 0x79, 0x73, 0x32, 0xd4, 0xd5, 0x31, 0x41, 0x42, 0x24, 0x04, 0xcb, 0xa3, 0x04, 0x90, + 0x1c, 0x05, 0x94, 0x17, 0xcc, 0xe8, 0xaf, 0xbb, 0x26, 0x64, 0x4e, 0x04, 0xa4, 0x81, 0x04, 0xb1, + 0x2c, 0x28, 0x18, 0xf9, 0xed, 0x03, 0x3d, 0x96, 0x5c, 0x48, 0x88, 0x39, 0xa3, 0x39, 0x69, 0xd3, + 0x1c, 0xfc, 0xb3, 0xec, 0x37, 0x1f, 0x9a, 0xde, 0x3f, 0x96, 0x73, 0x2e, 0xf0, 0xbc, 0x09, 0x39, + 0x9d, 0x91, 0xa2, 0x24, 0xc9, 0x0c, 0x26, 0x94, 0xf2, 0x05, 0x43, 0xe9, 0x4c, 0xec, 0x17, 0x54, + 0x00, 0x41, 0x48, 0x63, 0x82, 0x71, 0x0e, 0x45, 0x96, 0xe3, 0xd0, 0x1a, 0x59, 0xe3, 0xcd, 0x70, + 0xb7, 0xae, 0xbc, 0xfb, 0x62, 0xd4, 0x37, 0x68, 0x82, 0x67, 0x0a, 0x38, 0x9f, 0xed, 0xa1, 0xae, + 0x4f, 0x74, 0xd2, 0x58, 0x22, 0x41, 0x88, 0x73, 0x22, 0xf3, 0xe1, 0xc6, 0xc8, 0x1a, 0xef, 0x84, + 0xaf, 0xea, 0xca, 0x7b, 0x34, 0x26, 0xda, 0x55, 0x8a, 0xe9, 0x68, 0xda, 0xf0, 0x33, 0x22, 0x73, + 0xe7, 0xc4, 0xde, 0x61, 0x8b, 0xb2, 0x7d, 0x20, 0x87, 0x9b, 0x23, 0x6b, 0xbc, 0x15, 0x3e, 0xaf, + 0x2b, 0xef, 0x16, 0x8f, 0xb6, 0xd9, 0xa2, 0x6c, 0xed, 0x1c, 0xfc, 0xdd, 0xb0, 0x87, 0xca, 0xf4, + 0xf9, 0x8d, 0x9c, 0xca, 0x35, 0xa4, 0xca, 0xab, 0x3e, 0x3e, 0xe2, 0xf5, 0xae, 0x18, 0xf5, 0x0d, + 0xea, 0xbc, 0x7e, 0xb5, 0x5b, 0x14, 0x27, 0x64, 0x46, 0x18, 0x05, 0x65, 0x71, 0xfb, 0x78, 0xcf, + 0x37, 0x93, 0x6f, 0xa6, 0xea, 0x9b, 0xa9, 0xfa, 0xa7, 0xbc, 0x60, 0xe1, 0xcb, 0xcb, 0xca, 0xeb, + 0xd5, 0x95, 0x77, 0xf7, 0x65, 0xf4, 0xcc, 0x80, 0x50, 0xdf, 0x9d, 0xc4, 0x1e, 0xc8, 0x9c, 0x30, + 0xc6, 0x59, 0x9c, 0x82, 0xc4, 0x98, 0xa4, 0xa9, 0x00, 0xa9, 0x9d, 0x3f, 0x0d, 0xdf, 0xd5, 0x95, + 0xf7, 0xa0, 0xfe, 0xfb, 0xd7, 0xe1, 0xc0, 0x14, 0x9f, 0x68, 0x32, 0x45, 0x51, 0xb0, 0x2c, 0x72, + 0x4c, 0xf4, 0x7b, 0x90, 0x68, 0x94, 0xe6, 0x0f, 0xf4, 0x20, 0xa4, 0xa0, 0x5d, 0x81, 0x2d, 0x55, + 0x40, 0xfd, 0xc1, 0x3d, 0x31, 0xea, 0x2b, 0x34, 0x15, 0xd4, 0xa4, 0x08, 0x3f, 0x5d, 0xae, 0x5c, + 0xeb, 0x6a, 0xe5, 0x5a, 0xd7, 0x2b, 0xd7, 0xfa, 0xb3, 0x72, 0xad, 0x9f, 0x6b, 0xb7, 0x77, 0xb5, + 0x76, 0x7b, 0xd7, 0x6b, 0xb7, 0xf7, 0xe5, 0x38, 0x2b, 0x30, 0x5f, 0x24, 0x3e, 0xe5, 0x65, 0xd0, + 0x6c, 0xea, 0x21, 0x03, 0xfc, 0xc6, 0xc5, 0x45, 0xd0, 0xad, 0xed, 0xf7, 0x1b, 0x8b, 0x8b, 0x3f, + 0xe6, 0x20, 0x93, 0x27, 0x6a, 0x63, 0x4f, 0xfe, 0x07, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x11, 0x5d, + 0x08, 0x7f, 0x03, 0x00, 0x00, } func (m *EventImportMorseClaimableAccounts) Marshal() (dAtA []byte, err error) { @@ -160,6 +239,58 @@ func (m *EventImportMorseClaimableAccounts) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } +func (m *EventMorseAccountClaimed) 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 *EventMorseAccountClaimed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventMorseAccountClaimed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MorseSrcAddress) > 0 { + i -= len(m.MorseSrcAddress) + copy(dAtA[i:], m.MorseSrcAddress) + i = encodeVarintEvent(dAtA, i, uint64(len(m.MorseSrcAddress))) + i-- + dAtA[i] = 0x22 + } + if len(m.ShannonDestAddress) > 0 { + i -= len(m.ShannonDestAddress) + copy(dAtA[i:], m.ShannonDestAddress) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ShannonDestAddress))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.ClaimedBalance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.ClaimedAtHeight != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.ClaimedAtHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { offset -= sovEvent(v) base := offset @@ -190,6 +321,28 @@ func (m *EventImportMorseClaimableAccounts) Size() (n int) { return n } +func (m *EventMorseAccountClaimed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ClaimedAtHeight != 0 { + n += 1 + sovEvent(uint64(m.ClaimedAtHeight)) + } + l = m.ClaimedBalance.Size() + n += 1 + l + sovEvent(uint64(l)) + l = len(m.ShannonDestAddress) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.MorseSrcAddress) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + func sovEvent(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -318,6 +471,172 @@ func (m *EventImportMorseClaimableAccounts) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventMorseAccountClaimed) 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 ErrIntOverflowEvent + } + 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: EventMorseAccountClaimed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventMorseAccountClaimed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) + } + m.ClaimedAtHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClaimedAtHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedBalance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ClaimedBalance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShannonDestAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ShannonDestAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MorseSrcAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MorseSrcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvent(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 774713d0db8d55216cc7babbc919cd2e1654b8b9 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 17 Feb 2025 17:24:14 +0100 Subject: [PATCH 20/81] feat: implement morse account claiming --- .../keeper/msg_server_claim_morse_account.go | 106 +++++++++++++++++- x/migration/types/errors.go | 7 +- x/migration/types/expected_keepers.go | 2 + .../types/message_claim_morse_account.go | 22 +++- 4 files changed, 125 insertions(+), 12 deletions(-) diff --git a/x/migration/keeper/msg_server_claim_morse_account.go b/x/migration/keeper/msg_server_claim_morse_account.go index afb6ec19e..7aca9d728 100644 --- a/x/migration/keeper/msg_server_claim_morse_account.go +++ b/x/migration/keeper/msg_server_claim_morse_account.go @@ -3,16 +3,110 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/errors" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) -func (k msgServer) ClaimMorseAccount(goCtx context.Context, msg *migrationtypes.MsgClaimMorseAccount) (*migrationtypes.MsgClaimMorseAccountResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) +func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.MsgClaimMorseAccount) (*migrationtypes.MsgClaimMorseAccountResponse, error) { + sdkCtx := cosmostypes.UnwrapSDKContext(ctx) - // TODO_UPNEXT(@bryanchriswhite#1034): Handling the message - _ = ctx + if err := msg.ValidateBasic(); err != nil { + return nil, status.Error( + codes.InvalidArgument, + migrationtypes.ErrMorseClaimableAccount.Wrap(err.Error()).Error(), + ) + } - return &migrationtypes.MsgClaimMorseAccountResponse{}, nil + shannonAccAddr, err := cosmostypes.AccAddressFromBech32(msg.ShannonDestAddress) + // DEV_NOTE: This SHOULD NEVER happen as the shannonDestAddress is validated + // in MsgClaimMorseAccount#ValidateBasic(). + if err != nil { + return nil, status.Error( + codes.InvalidArgument, + errors.ErrInvalidAddress.Wrapf( + "failed to parse shannon destination address (%s): %s", + msg.ShannonDestAddress, err, + ).Error(), + ) + } + + // Ensure that a claim for the given morseSrcAddress does not already exist. + morseAccountClaim, isFound := k.GetMorseClaimableAccount( + sdkCtx, + msg.MorseSrcAddress, + ) + if !isFound { + return nil, status.Error( + codes.NotFound, + migrationtypes.ErrMorseClaimableAccount.Wrapf( + "no morse claimable account exists with address %q", + msg.MorseSrcAddress, + ).Error(), + ) + } + + k.SetMorseClaimableAccount( + sdkCtx, + morseAccountClaim, + ) + + // Add any actor stakes to the account balance because we're not creating + // a shannon actor (i.e. not a re-stake claim). + totalTokens := morseAccountClaim.UnstakedBalance. + Add(morseAccountClaim.ApplicationStake). + Add(morseAccountClaim.SupplierStake) + + // Mint the sum of the account balance (totalTokens) and any actor stakes to the migration module account. + if err = k.bankKeeper.MintCoins(ctx, migrationtypes.ModuleName, cosmostypes.NewCoins(totalTokens)); err != nil { + return nil, status.Error( + codes.Internal, + migrationtypes.ErrMorseClaimableAccount.Wrapf( + "failed to mint coins: %v", + err, + ).Error(), + ) + } + + // Transfer the totalTokens to the shannonDestAddress account. + if err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, + migrationtypes.ModuleName, + shannonAccAddr, + cosmostypes.NewCoins(totalTokens), + ); err != nil { + return nil, status.Error( + codes.Internal, + migrationtypes.ErrMorseClaimableAccount.Wrapf( + "failed to send coins: %v", + err, + ).Error(), + ) + } + + // Emit an event which signals that the morse account has been claimed. + event := migrationtypes.EventMorseAccountClaimed{ + ClaimedAtHeight: sdkCtx.BlockHeight(), + ShannonDestAddress: msg.ShannonDestAddress, + MorseSrcAddress: msg.MorseSrcAddress, + ClaimedBalance: totalTokens, + } + if err = sdkCtx.EventManager().EmitTypedEvent(&event); err != nil { + return nil, status.Error( + codes.Internal, + migrationtypes.ErrMorseClaimableAccount.Wrapf( + "failed to emit event type %T: %v", + &event, + err, + ).Error(), + ) + } + + return &migrationtypes.MsgClaimMorseAccountResponse{ + MorseSrcAddress: msg.MorseSrcAddress, + ClaimedBalance: totalTokens, + ClaimedAtHeight: sdkCtx.BlockHeight(), + }, nil } diff --git a/x/migration/types/errors.go b/x/migration/types/errors.go index d49cef446..c5f3f5bd8 100644 --- a/x/migration/types/errors.go +++ b/x/migration/types/errors.go @@ -8,7 +8,8 @@ import ( // x/migration module sentinel errors var ( - ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") - ErrMorseAccountState = sdkerrors.Register(ModuleName, 1101, "morse account state is invalid") - ErrUnauthorized = sdkerrors.Register(ModuleName, 1102, "unauthorized") + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrMorseAccountState = sdkerrors.Register(ModuleName, 1101, "morse account state is invalid") + ErrUnauthorized = sdkerrors.Register(ModuleName, 1102, "unauthorized") + ErrMorseClaimableAccount = sdkerrors.Register(ModuleName, 1103, "morse claimable account is invalid") ) diff --git a/x/migration/types/expected_keepers.go b/x/migration/types/expected_keepers.go index 4a50d01a9..3902ed53a 100644 --- a/x/migration/types/expected_keepers.go +++ b/x/migration/types/expected_keepers.go @@ -15,6 +15,8 @@ type AccountKeeper interface { // BankKeeper defines the expected interface for the Bank module. type BankKeeper interface { SpendableCoins(context.Context, sdk.AccAddress) sdk.Coins + MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error // Methods imported from bank should be defined here } diff --git a/x/migration/types/message_claim_morse_account.go b/x/migration/types/message_claim_morse_account.go index 585857d19..261a3b0ae 100644 --- a/x/migration/types/message_claim_morse_account.go +++ b/x/migration/types/message_claim_morse_account.go @@ -1,19 +1,35 @@ package types import ( + "encoding/hex" + errorsmod "cosmossdk.io/errors" + cometcrypto "github.com/cometbft/cometbft/crypto/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/gogoproto/proto" ) var _ sdk.Msg = &MsgClaimMorseAccount{} -func NewMsgClaimMorseAccount(shannonDestAddress string, morseSrcAddress string, morseSignature string) *MsgClaimMorseAccount { - return &MsgClaimMorseAccount{ +func NewMsgClaimMorseAccount( + shannonDestAddress string, + morseSrcAddress string, + morsePrivateKey cometcrypto.PrivKey, +) (*MsgClaimMorseAccount, error) { + msg := &MsgClaimMorseAccount{ ShannonDestAddress: shannonDestAddress, MorseSrcAddress: morseSrcAddress, - MorseSignature: morseSignature, } + msgBz, err := proto.Marshal(msg) + if err != nil { + return nil, err + } + + morseSignature, err := morsePrivateKey.Sign(msgBz) + msg.MorseSignature = hex.EncodeToString(morseSignature) + + return msg, nil } func (msg *MsgClaimMorseAccount) ValidateBasic() error { From 44165d4a3162dc36f63cbdb2bf1f2510ffd4134e Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 17 Feb 2025 17:24:19 +0100 Subject: [PATCH 21/81] test: unit Morse account claiming --- .../msg_server_claim_morse_acount_test.go | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 x/migration/keeper/msg_server_claim_morse_acount_test.go diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go new file mode 100644 index 000000000..6b38a1e41 --- /dev/null +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -0,0 +1,49 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/app/volatile" + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/testutil/sample" + "github.com/pokt-network/poktroll/x/migration/keeper" + "github.com/pokt-network/poktroll/x/migration/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func TestMorseAccountClaimMsgServerCreate(t *testing.T) { + k, ctx := keepertest.MigrationKeeper(t) + srv := keeper.NewMsgServerImpl(k) + for i := 0; i < 5; i++ { + msgClaim := &types.MsgClaimMorseAccount{ + ShannonDestAddress: sample.AccAddress(), + MorseSrcAddress: sample.MorseAddressHex(), + } + _, err := srv.ClaimMorseAccount(ctx, msgClaim) + require.NoError(t, err) + rst, found := k.GetMorseClaimableAccount(ctx, + msgClaim.MorseSrcAddress, + ) + require.True(t, found) + + expectedRes := &types.MsgClaimMorseAccountResponse{ + MorseSrcAddress: msgClaim.MorseSrcAddress, + ClaimedBalance: sdk.NewInt64Coin(volatile.DenomuPOKT, 0), + ClaimedAtHeight: 0, + } + require.Equal(t, expectedRes, rst) + + // assert each event was emitted... + // assert that the morse account was clamed... + } +} + +// TODO_IN_THIS_COMMIT: error cases... +// - invalid ValidateBasic() +// - MorseClaimableAccount not found From 9280288b275865d4eafb77891adb3b1265ae64e7 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 17 Feb 2025 17:24:26 +0100 Subject: [PATCH 22/81] test: integration morse account claim --- .../morse_account_import_and_claim_test.go | 111 ++++++++++++++++++ testutil/integration/app.go | 58 +++++---- testutil/integration/suites/param_configs.go | 13 ++ testutil/integration/suites/update_params.go | 2 + testutil/keeper/migration.go | 11 +- testutil/keeper/tokenomics.go | 21 ++++ testutil/testmigration/fixtures.go | 20 +++- x/tokenomics/types/expected_keepers.go | 7 ++ 8 files changed, 210 insertions(+), 33 deletions(-) create mode 100644 tests/integration/migration/morse_account_import_and_claim_test.go diff --git a/tests/integration/migration/morse_account_import_and_claim_test.go b/tests/integration/migration/morse_account_import_and_claim_test.go new file mode 100644 index 000000000..6d7715f50 --- /dev/null +++ b/tests/integration/migration/morse_account_import_and_claim_test.go @@ -0,0 +1,111 @@ +package migration + +import ( + "testing" + + "cosmossdk.io/depinject" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/cmd/poktrolld/cmd" + "github.com/pokt-network/poktroll/pkg/client/query" + "github.com/pokt-network/poktroll/testutil/integration" + "github.com/pokt-network/poktroll/testutil/sample" + "github.com/pokt-network/poktroll/testutil/testmigration" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" +) + +// TODO_IN_THIS_COMMIT: confirm whether this is necessary... +func init() { + cmd.InitSDKConfig() +} + +func TestMsgServer_CreateMorseAccountClaim(t *testing.T) { + app := integration.NewCompleteIntegrationApp(t) + + // Generate Morse claimable accounts. + numAccounts := 10 + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts) + + msgImport, err := migrationtypes.NewMsgImportMorseClaimableAccounts( + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + *accountState, + ) + require.NoError(t, err) + + // Import Morse claimable accounts. + resAny, err := app.RunMsg(t, msgImport) + require.NoError(t, err) + + msgImportRes, ok := resAny.(*migrationtypes.MsgImportMorseClaimableAccountsResponse) + require.True(t, ok) + + morseAccountStateHash, err := accountState.GetHash() + require.NoError(t, err) + + expectedMsgImportRes := &migrationtypes.MsgImportMorseClaimableAccountsResponse{ + StateHash: morseAccountStateHash, + NumAccounts: uint64(numAccounts), + } + require.Equal(t, expectedMsgImportRes, msgImportRes) + + deps := depinject.Supply(app.QueryHelper()) + bankClient, err := query.NewBankQuerier(deps) + require.NoError(t, err) + + // Assert that the shannonDestAddr account initially has a zero balance. + shannonDestAddr := sample.AccAddress() + shannonDestBalance, err := bankClient.GetBalance(app.GetSdkCtx(), shannonDestAddr) + require.NoError(t, err) + require.Equal(t, int64(0), shannonDestBalance.Amount.Int64()) + + morsePrivateKey := testmigration.NewMorsePrivateKey(t, 1) + morseDestAddr := morsePrivateKey.PubKey().Address().String() + require.Equal(t, morseDestAddr, accountState.Accounts[0].MorseSrcAddress) + + morseClaimMsg, err := migrationtypes.NewMsgClaimMorseAccount( + shannonDestAddr, + morseDestAddr, + morsePrivateKey, + ) + require.NoError(t, err) + + // Claim a Morse claimable account. + resAny, err = app.RunMsg(t, morseClaimMsg) + require.NoError(t, err) + + expectedBalance := sdk.NewInt64Coin(volatile.DenomuPOKT, 1110111) + expectedClaimAccountRes := &migrationtypes.MsgClaimMorseAccountResponse{ + MorseSrcAddress: morseDestAddr, + ClaimedBalance: expectedBalance, + ClaimedAtHeight: app.GetSdkCtx().BlockHeight() - 1, + } + + claimAccountRes, ok := resAny.(*migrationtypes.MsgClaimMorseAccountResponse) + require.True(t, ok) + require.Equal(t, expectedClaimAccountRes, claimAccountRes) + + // Assert that the MorseClaimableAccount was updated on-chain. + expectedMorseClaimableAccount := accountState.Accounts[0] + morseAccountQuerier := migrationtypes.NewQueryClient(app.QueryHelper()) + morseClaimableAcctRes, err := morseAccountQuerier.MorseClaimableAccount(app.GetSdkCtx(), &migrationtypes.QueryGetMorseClaimableAccountRequest{ + Address: morseDestAddr, + }) + require.NoError(t, err) + require.Equal(t, *expectedMorseClaimableAccount, morseClaimableAcctRes.MorseClaimableAccount) + + // Assert that the shannonDestAddr account balance has been updated. + shannonDestBalance, err = bankClient.GetBalance(app.GetSdkCtx(), shannonDestAddr) + require.NoError(t, err) + require.Equal(t, expectedBalance, *shannonDestBalance) + + // Assert that the migration module account balance returns to zero. + migrationModuleAddress := authtypes.NewModuleAddress(migrationtypes.ModuleName).String() + migrationModuleBalance, err := bankClient.GetBalance(app.GetSdkCtx(), migrationModuleAddress) + require.NoError(t, err) + require.Equal(t, sdk.NewCoin(volatile.DenomuPOKT, math.ZeroInt()), *migrationModuleBalance) +} diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 04305089a..c2ce36e89 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -61,6 +61,9 @@ import ( gatewaykeeper "github.com/pokt-network/poktroll/x/gateway/keeper" gateway "github.com/pokt-network/poktroll/x/gateway/module" gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" + migrationkeeper "github.com/pokt-network/poktroll/x/migration/keeper" + migration "github.com/pokt-network/poktroll/x/migration/module" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" proofkeeper "github.com/pokt-network/poktroll/x/proof/keeper" proof "github.com/pokt-network/poktroll/x/proof/module" prooftypes "github.com/pokt-network/poktroll/x/proof/types" @@ -273,6 +276,7 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOptionFn) *Ap cosmostypes.RegisterInterfaces(registry) cryptocodec.RegisterInterfaces(registry) banktypes.RegisterInterfaces(registry) + migrationtypes.RegisterInterfaces(registry) // Prepare all the store keys storeKeys := storetypes.NewKVStoreKeys( @@ -287,6 +291,7 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOptionFn) *Ap prooftypes.StoreKey, servicetypes.StoreKey, authtypes.StoreKey, + migrationtypes.StoreKey, ) // Prepare the codec @@ -322,6 +327,7 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOptionFn) *Ap apptypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking}, suppliertypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking}, prooftypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + migrationtypes.ModuleName: {authtypes.Minter}, } // Prepare the account keeper and module @@ -512,6 +518,22 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOptionFn) *Ap supplierKeeper, ) + // Prepare the migration keeper and module + migrationKeeper := migrationkeeper.NewKeeper( + cdc, + runtime.NewKVStoreService(storeKeys[migrationtypes.StoreKey]), + logger, + authority.String(), + accountKeeper, + bankKeeper, + ) + migrationModule := migration.NewAppModule( + cdc, + migrationKeeper, + accountKeeper, + bankKeeper, + ) + // Prepare the message & query routers msgRouter := baseapp.NewMsgServiceRouter() queryHelper := baseapp.NewQueryServerTestHelper(sdkCtx, registry) @@ -544,6 +566,7 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOptionFn) *Ap prooftypes.ModuleName: proofModule, authtypes.ModuleName: authModule, sessiontypes.ModuleName: sessionModule, + migrationtypes.ModuleName: migrationModule, } // Initialize the integration integrationApp @@ -563,32 +586,11 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOptionFn) *Ap opts..., ) - // Register the message servers - banktypes.RegisterMsgServer(msgRouter, bankkeeper.NewMsgServerImpl(bankKeeper)) - tokenomicstypes.RegisterMsgServer(msgRouter, tokenomicskeeper.NewMsgServerImpl(tokenomicsKeeper)) - servicetypes.RegisterMsgServer(msgRouter, servicekeeper.NewMsgServerImpl(serviceKeeper)) - sharedtypes.RegisterMsgServer(msgRouter, sharedkeeper.NewMsgServerImpl(sharedKeeper)) - gatewaytypes.RegisterMsgServer(msgRouter, gatewaykeeper.NewMsgServerImpl(gatewayKeeper)) - apptypes.RegisterMsgServer(msgRouter, appkeeper.NewMsgServerImpl(applicationKeeper)) - suppliertypes.RegisterMsgServer(msgRouter, supplierkeeper.NewMsgServerImpl(supplierKeeper)) - prooftypes.RegisterMsgServer(msgRouter, proofkeeper.NewMsgServerImpl(proofKeeper)) - authtypes.RegisterMsgServer(msgRouter, authkeeper.NewMsgServerImpl(accountKeeper)) - sessiontypes.RegisterMsgServer(msgRouter, sessionkeeper.NewMsgServerImpl(sessionKeeper)) - authz.RegisterMsgServer(msgRouter, authzKeeper) - - // Register query servers - banktypes.RegisterQueryServer(queryHelper, bankKeeper) - authz.RegisterQueryServer(queryHelper, authzKeeper) - tokenomicstypes.RegisterQueryServer(queryHelper, tokenomicsKeeper) - servicetypes.RegisterQueryServer(queryHelper, serviceKeeper) - sharedtypes.RegisterQueryServer(queryHelper, sharedKeeper) - gatewaytypes.RegisterQueryServer(queryHelper, gatewayKeeper) - apptypes.RegisterQueryServer(queryHelper, applicationKeeper) - suppliertypes.RegisterQueryServer(queryHelper, supplierKeeper) - prooftypes.RegisterQueryServer(queryHelper, proofKeeper) - // TODO_TECHDEBT: What is the query server for authtypes? - // authtypes.RegisterQueryServer(queryHelper, accountKeeper) - sessiontypes.RegisterQueryServer(queryHelper, sessionKeeper) + // Register the message & query servers. + configurator := module.NewConfigurator(cdc, msgRouter, queryHelper) + for _, mod := range integrationApp.GetModuleManager().Modules { + mod.(module.HasServices).RegisterServices(configurator) + } // Need to go to the next block to finalize the genesis and setup. // This has to be after the params are set, as the params are stored in the @@ -963,6 +965,10 @@ func (app *App) setupDefaultActorsState( app.NextBlock(t) } +func (app *App) GetModuleManager() module.Manager { + return app.moduleManager +} + // fundAccount mints and sends amountUpokt tokens to the given recipientAddr. // // TODO_IMPROVE: Eliminate usage of and remove this function in favor of diff --git a/testutil/integration/suites/param_configs.go b/testutil/integration/suites/param_configs.go index 5d0d09838..4acf0d132 100644 --- a/testutil/integration/suites/param_configs.go +++ b/testutil/integration/suites/param_configs.go @@ -7,6 +7,7 @@ import ( "github.com/pokt-network/poktroll/testutil/sample" apptypes "github.com/pokt-network/poktroll/x/application/types" gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" servicetypes "github.com/pokt-network/poktroll/x/service/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" @@ -246,4 +247,16 @@ var ( DefaultParams: tokenomicstypes.DefaultParams(), NewParamClientFn: tokenomicstypes.NewQueryClient, } + + MigrationModuleParamConfig = ModuleParamConfig{ + ParamsMsgs: ModuleParamsMessages{ + MsgUpdateParams: migrationtypes.MsgUpdateParams{}, + MsgUpdateParamsResponse: migrationtypes.MsgUpdateParamsResponse{}, + QueryParamsRequest: migrationtypes.QueryParamsRequest{}, + QueryParamsResponse: migrationtypes.QueryParamsResponse{}, + }, + ValidParams: migrationtypes.DefaultParams(), + DefaultParams: migrationtypes.DefaultParams(), + NewParamClientFn: migrationtypes.NewQueryClient, + } ) diff --git a/testutil/integration/suites/update_params.go b/testutil/integration/suites/update_params.go index edc5ccabb..35ff026ee 100644 --- a/testutil/integration/suites/update_params.go +++ b/testutil/integration/suites/update_params.go @@ -14,6 +14,7 @@ import ( "github.com/pokt-network/poktroll/testutil/cases" apptypes "github.com/pokt-network/poktroll/x/application/types" gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" servicetypes "github.com/pokt-network/poktroll/x/service/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" @@ -45,6 +46,7 @@ var ( suppliertypes.ModuleName: SupplierModuleParamConfig, prooftypes.ModuleName: ProofModuleParamConfig, tokenomicstypes.ModuleName: TokenomicsModuleParamConfig, + migrationtypes.ModuleName: MigrationModuleParamConfig, } // paramConfigsPath is the path, relative to the project root, to the go file diff --git a/testutil/keeper/migration.go b/testutil/keeper/migration.go index 8dcf73c38..363ac76e1 100644 --- a/testutil/keeper/migration.go +++ b/testutil/keeper/migration.go @@ -19,7 +19,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" - "github.com/pokt-network/poktroll/testutil/proof/mocks" + "github.com/pokt-network/poktroll/testutil/migration/mocks" "github.com/pokt-network/poktroll/x/migration/keeper" "github.com/pokt-network/poktroll/x/migration/types" ) @@ -50,6 +50,15 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { return sdk.Coins{} }, ).AnyTimes() + + mockBankKeeper.EXPECT(). + MintCoins(gomock.Any(), gomock.Any(), gomock.Any()). + AnyTimes() + + mockBankKeeper.EXPECT(). + SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + AnyTimes() + mockAccountKeeper := mocks.NewMockAccountKeeper(ctrl) k := keeper.NewKeeper( diff --git a/testutil/keeper/tokenomics.go b/testutil/keeper/tokenomics.go index 1be0f350f..f3c70cc99 100644 --- a/testutil/keeper/tokenomics.go +++ b/testutil/keeper/tokenomics.go @@ -36,6 +36,8 @@ import ( apptypes "github.com/pokt-network/poktroll/x/application/types" gatewaykeeper "github.com/pokt-network/poktroll/x/gateway/keeper" gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" + migrationkeeper "github.com/pokt-network/poktroll/x/migration/keeper" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" proofkeeper "github.com/pokt-network/poktroll/x/proof/keeper" prooftypes "github.com/pokt-network/poktroll/x/proof/types" servicekeeper "github.com/pokt-network/poktroll/x/service/keeper" @@ -67,6 +69,7 @@ type TokenomicsModuleKeepers struct { tokenomicstypes.SharedKeeper tokenomicstypes.SessionKeeper tokenomicstypes.ServiceKeeper + tokenomicstypes.MigrationKeeper Codec *codec.ProtoCodec } @@ -324,6 +327,7 @@ func NewTokenomicsModuleKeepers( prooftypes.StoreKey, sharedtypes.StoreKey, servicetypes.StoreKey, + migrationtypes.StoreKey, ) // Construct a multistore & mount store keys for each keeper that will interact with the state store. @@ -523,6 +527,22 @@ func NewTokenomicsModuleKeepers( require.NoError(t, err) } + migrationKeeper := migrationkeeper.NewKeeper( + cdc, + runtime.NewKVStoreService(keys[migrationtypes.StoreKey]), + logger, + authority.String(), + accountKeeper, + bankKeeper, + ) + + require.NoError(t, migrationKeeper.SetParams(sdkCtx, migrationtypes.DefaultParams())) + + if params, ok := cfg.moduleParams[migrationtypes.ModuleName]; ok { + err := migrationKeeper.SetParams(ctx, *params.(*migrationtypes.Params)) + require.NoError(t, err) + } + keepers := TokenomicsModuleKeepers{ Keeper: &tokenomicsKeeper, AccountKeeper: &accountKeeper, @@ -533,6 +553,7 @@ func NewTokenomicsModuleKeepers( SharedKeeper: &sharedKeeper, SessionKeeper: &sessionKeeper, ServiceKeeper: &serviceKeeper, + MigrationKeeper: &migrationKeeper, Codec: cdc, } diff --git a/testutil/testmigration/fixtures.go b/testutil/testmigration/fixtures.go index b77a34a1f..23b073cf8 100644 --- a/testutil/testmigration/fixtures.go +++ b/testutil/testmigration/fixtures.go @@ -3,7 +3,6 @@ package testmigration import ( "encoding/binary" "fmt" - "math/rand" cometcrypto "github.com/cometbft/cometbft/crypto/ed25519" cmtjson "github.com/cometbft/cometbft/libs/json" @@ -69,10 +68,7 @@ func NewMorseStateExportAndAccountState( } for i := 1; i < numAccounts+1; i++ { - seedUint := rand.Uint64() - seedBz := make([]byte, 8) - binary.LittleEndian.PutUint64(seedBz, seedUint) - privKey := cometcrypto.GenPrivKeyFromSecret(seedBz) + privKey := NewMorsePrivateKey(t, uint64(i)) pubKey := privKey.PubKey() balanceAmount := int64(1e6*i + i) // i_000_00i appStakeAmount := int64(1e5*i + (i * 10)) // i00_0i0 @@ -120,12 +116,24 @@ func NewMorseStateExportAndAccountState( // Add the account to the morseAccountState. morseAccountState.Accounts[i-1] = &migrationtypes.MorseClaimableAccount{ MorseSrcAddress: pubKey.Address().String(), + PublicKey: pubKey.Bytes(), UnstakedBalance: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, balanceAmount), SupplierStake: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, supplierStakeAmount), ApplicationStake: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, appStakeAmount), - PublicKey: pubKey.Bytes(), + // ShannonDestAddress: (intentionally omitted). + // ClaimedAtHeight: (intentionally omitted) } } return morseStateExport, morseAccountState } + +// NewMorsePrivateKey creates a new ed25519 private key from the given seed. +func NewMorsePrivateKey(t gocuke.TestingT, seed uint64) cometcrypto.PrivKey { + t.Helper() + + seedBz := make([]byte, 8) + binary.LittleEndian.PutUint64(seedBz, seed) + + return cometcrypto.GenPrivKeyFromSecret(seedBz) +} diff --git a/x/tokenomics/types/expected_keepers.go b/x/tokenomics/types/expected_keepers.go index ba26ae4fa..13b62cbdf 100644 --- a/x/tokenomics/types/expected_keepers.go +++ b/x/tokenomics/types/expected_keepers.go @@ -9,6 +9,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" apptypes "github.com/pokt-network/poktroll/x/application/types" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" servicetypes "github.com/pokt-network/poktroll/x/service/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" @@ -98,3 +99,9 @@ type ServiceKeeper interface { GetParams(ctx context.Context) servicetypes.Params SetParams(ctx context.Context, params servicetypes.Params) error } + +type MigrationKeeper interface { + ImportFromMorseAccountState(ctx context.Context, morseAccountState *migrationtypes.MorseAccountState) + GetMorseClaimableAccount(ctx context.Context, morseHexAddress string) (morseAccount migrationtypes.MorseClaimableAccount, isFound bool) + GetAllMorseClaimableAccounts(ctx context.Context) (morseAccounts []migrationtypes.MorseClaimableAccount) +} From 8e1a53378af2c4f1ece8950f1a4d23c28920828f Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 18 Feb 2025 11:23:01 +0100 Subject: [PATCH 23/81] chore: add migration module mocks pkg --- Makefile | 1 + testutil/migration/mocks/mocks.go | 11 +++++++++++ x/migration/types/expected_keepers.go | 2 ++ 3 files changed, 14 insertions(+) create mode 100644 testutil/migration/mocks/mocks.go diff --git a/Makefile b/Makefile index 75fbe43c5..d2fd54e48 100644 --- a/Makefile +++ b/Makefile @@ -201,6 +201,7 @@ go_mockgen: ## Use `mockgen` to generate mocks used for testing purposes of all go generate ./x/service/types/ go generate ./x/proof/types/ go generate ./x/tokenomics/types/ + go generate ./x/migration/types/ find . -name interface.go | xargs -I {} go generate {} .PHONY: go_testgen_fixtures diff --git a/testutil/migration/mocks/mocks.go b/testutil/migration/mocks/mocks.go new file mode 100644 index 000000000..595954e65 --- /dev/null +++ b/testutil/migration/mocks/mocks.go @@ -0,0 +1,11 @@ +package mocks + +// This file is in place to declare the package for dynamically generated structs. +// +// Note that this does not follow the Cosmos SDK pattern of committing Mocks to main. +// For example, they commit auto-generate code to main: https://github.com/cosmos/cosmos-sdk/blob/main/x/gov/testutil/expected_keepers_mocks.go +// Documentation on how Cosmos uses mockgen can be found here: https://docs.cosmos.network/main/build/building-modules/testing#unit-tests +// +// IMPORTANT: We have attempted to use `.gitkeep` files instead, but it causes a circular dependency issue with protobuf and mock generation +// since we are leveraging `ignite` to compile `.proto` files which runs `go mod tidy` before generating, requiring the entire dependency tree +// to be valid before mock implementations have been generated. diff --git a/x/migration/types/expected_keepers.go b/x/migration/types/expected_keepers.go index 3902ed53a..64aa3a3e3 100644 --- a/x/migration/types/expected_keepers.go +++ b/x/migration/types/expected_keepers.go @@ -1,3 +1,5 @@ +//go:generate go run go.uber.org/mock/mockgen -destination ../../../testutil/migration/mocks/expected_keepers_mock.go -package mocks . AccountKeeper,BankKeeper + package types import ( From 93004e6bc732dfcbdd3dcb75ad655ea9ba6db845 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 18 Feb 2025 11:26:42 +0100 Subject: [PATCH 24/81] chore: validation, testing, etc. --- .../morse_account_import_and_claim_test.go | 16 +- x/migration/keeper/morse_claimable_account.go | 3 + .../keeper/msg_server_claim_morse_account.go | 53 ++--- .../msg_server_claim_morse_acount_test.go | 188 ++++++++++++++++-- ..._server_import_morse_claimable_accounts.go | 2 +- ...er_import_morse_claimable_accounts_test.go | 3 + x/migration/types/errors.go | 8 +- .../types/message_claim_morse_account.go | 10 +- .../types/message_claim_morse_account_test.go | 24 ++- ...message_import_morse_claimable_accounts.go | 4 +- ...ge_import_morse_claimable_accounts_test.go | 2 +- x/migration/types/types.go | 5 + 12 files changed, 249 insertions(+), 69 deletions(-) diff --git a/tests/integration/migration/morse_account_import_and_claim_test.go b/tests/integration/migration/morse_account_import_and_claim_test.go index 6d7715f50..9143c38cc 100644 --- a/tests/integration/migration/morse_account_import_and_claim_test.go +++ b/tests/integration/migration/morse_account_import_and_claim_test.go @@ -64,12 +64,12 @@ func TestMsgServer_CreateMorseAccountClaim(t *testing.T) { require.Equal(t, int64(0), shannonDestBalance.Amount.Int64()) morsePrivateKey := testmigration.NewMorsePrivateKey(t, 1) - morseDestAddr := morsePrivateKey.PubKey().Address().String() - require.Equal(t, morseDestAddr, accountState.Accounts[0].MorseSrcAddress) + morseSrcAddr := morsePrivateKey.PubKey().Address().String() + require.Equal(t, morseSrcAddr, accountState.Accounts[0].MorseSrcAddress) morseClaimMsg, err := migrationtypes.NewMsgClaimMorseAccount( shannonDestAddr, - morseDestAddr, + morseSrcAddr, morsePrivateKey, ) require.NoError(t, err) @@ -80,7 +80,7 @@ func TestMsgServer_CreateMorseAccountClaim(t *testing.T) { expectedBalance := sdk.NewInt64Coin(volatile.DenomuPOKT, 1110111) expectedClaimAccountRes := &migrationtypes.MsgClaimMorseAccountResponse{ - MorseSrcAddress: morseDestAddr, + MorseSrcAddress: morseSrcAddr, ClaimedBalance: expectedBalance, ClaimedAtHeight: app.GetSdkCtx().BlockHeight() - 1, } @@ -90,13 +90,15 @@ func TestMsgServer_CreateMorseAccountClaim(t *testing.T) { require.Equal(t, expectedClaimAccountRes, claimAccountRes) // Assert that the MorseClaimableAccount was updated on-chain. - expectedMorseClaimableAccount := accountState.Accounts[0] + expectedMorseClaimableAccount := *accountState.Accounts[0] + expectedMorseClaimableAccount.ClaimedAtHeight = app.GetSdkCtx().BlockHeight() - 1 + morseAccountQuerier := migrationtypes.NewQueryClient(app.QueryHelper()) morseClaimableAcctRes, err := morseAccountQuerier.MorseClaimableAccount(app.GetSdkCtx(), &migrationtypes.QueryGetMorseClaimableAccountRequest{ - Address: morseDestAddr, + Address: morseSrcAddr, }) require.NoError(t, err) - require.Equal(t, *expectedMorseClaimableAccount, morseClaimableAcctRes.MorseClaimableAccount) + require.Equal(t, expectedMorseClaimableAccount, morseClaimableAcctRes.MorseClaimableAccount) // Assert that the shannonDestAddr account balance has been updated. shannonDestBalance, err = bankClient.GetBalance(app.GetSdkCtx(), shannonDestAddr) diff --git a/x/migration/keeper/morse_claimable_account.go b/x/migration/keeper/morse_claimable_account.go index 5cdf1cc51..dd3e3e43a 100644 --- a/x/migration/keeper/morse_claimable_account.go +++ b/x/migration/keeper/morse_claimable_account.go @@ -72,11 +72,14 @@ func (k Keeper) GetAllMorseClaimableAccounts(ctx context.Context) (list []types. // ImportFromMorseAccountState imports the MorseClaimableAccounts from the given MorseAccountState. // It returns the state hash of the imported MorseAccountState. +// DEV_NOTE: It assumes that the MorseAccountState has already been validated. func (k Keeper) ImportFromMorseAccountState( ctx context.Context, morseAccountState *types.MorseAccountState, ) { for _, morseAccount := range morseAccountState.Accounts { + // DEV_NOTE: Ensure all MorseClaimableAccounts are initially unclaimed. + morseAccount.ClaimedAtHeight = 0 k.SetMorseClaimableAccount(ctx, *morseAccount) } } diff --git a/x/migration/keeper/msg_server_claim_morse_account.go b/x/migration/keeper/msg_server_claim_morse_account.go index 7aca9d728..0035ed266 100644 --- a/x/migration/keeper/msg_server_claim_morse_account.go +++ b/x/migration/keeper/msg_server_claim_morse_account.go @@ -15,10 +15,7 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms sdkCtx := cosmostypes.UnwrapSDKContext(ctx) if err := msg.ValidateBasic(); err != nil { - return nil, status.Error( - codes.InvalidArgument, - migrationtypes.ErrMorseClaimableAccount.Wrap(err.Error()).Error(), - ) + return nil, status.Error(codes.InvalidArgument, err.Error()) } shannonAccAddr, err := cosmostypes.AccAddressFromBech32(msg.ShannonDestAddress) @@ -34,41 +31,51 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms ) } - // Ensure that a claim for the given morseSrcAddress does not already exist. - morseAccountClaim, isFound := k.GetMorseClaimableAccount( + // Ensure that a MorseClaimableAccount exists for the given morseSrcAddress. + morseClaimableAccount, isFound := k.GetMorseClaimableAccount( sdkCtx, msg.MorseSrcAddress, ) if !isFound { return nil, status.Error( codes.NotFound, - migrationtypes.ErrMorseClaimableAccount.Wrapf( + migrationtypes.ErrMorseAccountClaim.Wrapf( "no morse claimable account exists with address %q", msg.MorseSrcAddress, ).Error(), ) } + // Ensure that the given MorseClaimableAccount has not already been claimed. + if morseClaimableAccount.ClaimedAtHeight > 0 || + morseClaimableAccount.ShannonDestAddress != "" { + return nil, status.Error( + codes.FailedPrecondition, + migrationtypes.ErrMorseAccountClaim.Wrapf( + "morse address %q has already been claimed at height %d by shannon address %q", + msg.MorseSrcAddress, + morseClaimableAccount.ClaimedAtHeight, + morseClaimableAccount.ShannonDestAddress, + ).Error(), + ) + } + + // Update the MorseClaimableAccount + morseClaimableAccount.ClaimedAtHeight = sdkCtx.BlockHeight() k.SetMorseClaimableAccount( sdkCtx, - morseAccountClaim, + morseClaimableAccount, ) // Add any actor stakes to the account balance because we're not creating // a shannon actor (i.e. not a re-stake claim). - totalTokens := morseAccountClaim.UnstakedBalance. - Add(morseAccountClaim.ApplicationStake). - Add(morseAccountClaim.SupplierStake) + totalTokens := morseClaimableAccount.UnstakedBalance. + Add(morseClaimableAccount.ApplicationStake). + Add(morseClaimableAccount.SupplierStake) // Mint the sum of the account balance (totalTokens) and any actor stakes to the migration module account. if err = k.bankKeeper.MintCoins(ctx, migrationtypes.ModuleName, cosmostypes.NewCoins(totalTokens)); err != nil { - return nil, status.Error( - codes.Internal, - migrationtypes.ErrMorseClaimableAccount.Wrapf( - "failed to mint coins: %v", - err, - ).Error(), - ) + return nil, status.Error(codes.Internal, err.Error()) } // Transfer the totalTokens to the shannonDestAddress account. @@ -77,13 +84,7 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms shannonAccAddr, cosmostypes.NewCoins(totalTokens), ); err != nil { - return nil, status.Error( - codes.Internal, - migrationtypes.ErrMorseClaimableAccount.Wrapf( - "failed to send coins: %v", - err, - ).Error(), - ) + return nil, status.Error(codes.Internal, err.Error()) } // Emit an event which signals that the morse account has been claimed. @@ -96,7 +97,7 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms if err = sdkCtx.EventManager().EmitTypedEvent(&event); err != nil { return nil, status.Error( codes.Internal, - migrationtypes.ErrMorseClaimableAccount.Wrapf( + migrationtypes.ErrMorseAccountClaim.Wrapf( "failed to emit event type %T: %v", &event, err, diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go index 6b38a1e41..736d12544 100644 --- a/x/migration/keeper/msg_server_claim_morse_acount_test.go +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -5,45 +5,189 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" - "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/testutil/events" keepertest "github.com/pokt-network/poktroll/testutil/keeper" "github.com/pokt-network/poktroll/testutil/sample" + "github.com/pokt-network/poktroll/testutil/testmigration" "github.com/pokt-network/poktroll/x/migration/keeper" - "github.com/pokt-network/poktroll/x/migration/types" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) // Prevent strconv unused error var _ = strconv.IntSize -func TestMorseAccountClaimMsgServerCreate(t *testing.T) { +func TestMsgServer_ClaimMorseAccount_Success(t *testing.T) { k, ctx := keepertest.MigrationKeeper(t) srv := keeper.NewMsgServerImpl(k) - for i := 0; i < 5; i++ { - msgClaim := &types.MsgClaimMorseAccount{ - ShannonDestAddress: sample.AccAddress(), - MorseSrcAddress: sample.MorseAddressHex(), - } - _, err := srv.ClaimMorseAccount(ctx, msgClaim) - require.NoError(t, err) - rst, found := k.GetMorseClaimableAccount(ctx, - msgClaim.MorseSrcAddress, + + // Generate and import Morse claimable accounts. + numAccounts := 6 + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts) + accountStateHash, err := accountState.GetHash() + require.NoError(t, err) + + _, err = srv.ImportMorseClaimableAccounts(ctx, &migrationtypes.MsgImportMorseClaimableAccounts{ + Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + MorseAccountState: *accountState, + MorseAccountStateHash: accountStateHash, + }) + require.NoError(t, err) + + // Claim each MorseClaimableAccount. + for morseAccountIdx, morseAccount := range accountState.Accounts { + // Generate the corresponding morse private key using the account slice index as a seed. + morsePrivKey := testmigration.NewMorsePrivateKey(t, uint64(morseAccountIdx)) + + // Claim the MorseClaimableAccount. + msgClaim, err := migrationtypes.NewMsgClaimMorseAccount( + sample.AccAddress(), + morseAccount.GetMorseSrcAddress(), + morsePrivKey, ) - require.True(t, found) + require.NoError(t, err) + + msgClaimRes, err := srv.ClaimMorseAccount(ctx, msgClaim) + require.NoError(t, err) - expectedRes := &types.MsgClaimMorseAccountResponse{ + // Construct and assert the expected response. + expectedClaimedBalance := morseAccount.GetUnstakedBalance(). + Add(morseAccount.GetSupplierStake()). + Add(morseAccount.GetApplicationStake()) + expectedRes := &migrationtypes.MsgClaimMorseAccountResponse{ MorseSrcAddress: msgClaim.MorseSrcAddress, - ClaimedBalance: sdk.NewInt64Coin(volatile.DenomuPOKT, 0), - ClaimedAtHeight: 0, + ClaimedBalance: expectedClaimedBalance, + ClaimedAtHeight: ctx.BlockHeight(), + } + require.Equal(t, expectedRes, msgClaimRes) + + // Assert that the persisted MorseClaimableAccount is updated. + expectedMorseAccount := morseAccount + expectedMorseAccount.ClaimedAtHeight = ctx.BlockHeight() + foundMorseAccount, found := k.GetMorseClaimableAccount(ctx, msgClaim.MorseSrcAddress) + require.True(t, found) + require.Equal(t, *expectedMorseAccount, foundMorseAccount) + + // Assert that an event is emitted for each claim. + expectedEvent := &migrationtypes.EventMorseAccountClaimed{ + ShannonDestAddress: msgClaim.ShannonDestAddress, + MorseSrcAddress: msgClaim.MorseSrcAddress, + ClaimedBalance: expectedClaimedBalance, + ClaimedAtHeight: ctx.BlockHeight(), } - require.Equal(t, expectedRes, rst) + claimEvents := events.FilterEvents[*migrationtypes.EventMorseAccountClaimed](t, ctx.EventManager().Events()) + require.Equal(t, 1, len(claimEvents)) + require.Equal(t, expectedEvent, claimEvents[0]) - // assert each event was emitted... - // assert that the morse account was clamed... + // Reset the event manager to isolate events between claims. + ctx = ctx.WithEventManager(sdk.NewEventManager()) } } -// TODO_IN_THIS_COMMIT: error cases... -// - invalid ValidateBasic() -// - MorseClaimableAccount not found +func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { + k, ctx := keepertest.MigrationKeeper(t) + srv := keeper.NewMsgServerImpl(k) + + // Generate and import a Morse claimable account. + numAccounts := 1 + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts) + accountStateHash, err := accountState.GetHash() + require.NoError(t, err) + + _, err = srv.ImportMorseClaimableAccounts(ctx, &migrationtypes.MsgImportMorseClaimableAccounts{ + Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + MorseAccountState: *accountState, + MorseAccountStateHash: accountStateHash, + }) + require.NoError(t, err) + + // Generate the corresponding morse private key using the account slice index as a seed. + morsePrivKey := testmigration.NewMorsePrivateKey(t, 0) + + // Claim the MorseClaimableAccount with a random Shannon address. + msgClaim, err := migrationtypes.NewMsgClaimMorseAccount( + sample.AccAddress(), + accountState.Accounts[0].GetMorseSrcAddress(), + morsePrivKey, + ) + require.NoError(t, err) + + t.Run("invalid claim msg", func(t *testing.T) { + // Copy the message and set the morse signature to an empty string. + invalidMsgClaim := *msgClaim + invalidMsgClaim.MorseSignature = "" + + expectedErr := status.Error( + codes.InvalidArgument, + migrationtypes.ErrMorseAccountClaim.Wrapf( + "morseSignature is empty", + ).Error(), + ) + + _, err := srv.ClaimMorseAccount(ctx, &invalidMsgClaim) + require.EqualError(t, err, expectedErr.Error()) + }) + + t.Run("account not found", func(t *testing.T) { + // Copy the message and set the morse src address to a valid but incorrect address. + invalidMsgClaim := *msgClaim + invalidMsgClaim.MorseSrcAddress = sample.MorseAddressHex() + + expectedErr := status.Error( + codes.NotFound, + migrationtypes.ErrMorseAccountClaim.Wrapf( + "no morse claimable account exists with address %q", + invalidMsgClaim.GetMorseSrcAddress(), + ).Error(), + ) + + _, err := srv.ClaimMorseAccount(ctx, &invalidMsgClaim) + require.EqualError(t, err, expectedErr.Error()) + }) + + t.Run("account already claimed (non-zero claimed_at_height)", func(t *testing.T) { + // Set the claimed at height BUT NOT the Shannon destination address. + morseClaimableAccount := *accountState.Accounts[0] + morseClaimableAccount.ClaimedAtHeight = 10 + k.SetMorseClaimableAccount(ctx, morseClaimableAccount) + + expectedErr := status.Error( + codes.FailedPrecondition, + migrationtypes.ErrMorseAccountClaim.Wrapf( + "morse address %q has already been claimed at height %d by shannon address %q", + accountState.Accounts[0].GetMorseSrcAddress(), + 10, + accountState.Accounts[0].GetShannonDestAddress(), + ).Error(), + ) + + _, err := srv.ClaimMorseAccount(ctx, msgClaim) + require.EqualError(t, err, expectedErr.Error()) + }) + + t.Run("account already claimed (non-empty shannon_dest_address)", func(t *testing.T) { + // Set the Shannon destination address BUT NOT the claimed at height. + morseClaimableAccount := *accountState.Accounts[0] + morseClaimableAccount.ClaimedAtHeight = 0 + morseClaimableAccount.ShannonDestAddress = sample.AccAddress() + k.SetMorseClaimableAccount(ctx, morseClaimableAccount) + + expectedErr := status.Error( + codes.FailedPrecondition, + migrationtypes.ErrMorseAccountClaim.Wrapf( + "morse address %q has already been claimed at height %d by shannon address %q", + accountState.Accounts[0].GetMorseSrcAddress(), + 0, + morseClaimableAccount.ShannonDestAddress, + ).Error(), + ) + + _, err := srv.ClaimMorseAccount(ctx, msgClaim) + require.EqualError(t, err, expectedErr.Error()) + }) +} diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts.go index dcc093b2f..5671b5ca2 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts.go @@ -27,7 +27,7 @@ func (k msgServer) ImportMorseClaimableAccounts(ctx context.Context, msg *migrat // Check if MorseClaimableAccounts have already been imported. if morseClaimableAccounts := k.GetAllMorseClaimableAccounts(sdkCtx); len(morseClaimableAccounts) > 0 { - err := migrationtypes.ErrMorseAccountState.Wrap("Morse claimable accounts already imported") + err := migrationtypes.ErrMorseAccountsImport.Wrap("Morse claimable accounts already imported") logger.Info(err.Error()) return nil, status.Error(codes.FailedPrecondition, err.Error()) } diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go index f0b3c7800..6e21625c0 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go @@ -118,3 +118,6 @@ func TestMsgServer_ImportMorseClaimableAccounts_ErrorInvalidAuthority(t *testing require.Equal(t, codes.PermissionDenied, stat.Code()) require.ErrorContains(t, err, "invalid authority address") } + +// TODO_IN_THIS_COMMIT: Test an import with non-zero ClaimedAtHeight for one or +// more accounts; the heights SHOULD be reset to 0 when persisted. diff --git a/x/migration/types/errors.go b/x/migration/types/errors.go index c5f3f5bd8..f1d42ecbe 100644 --- a/x/migration/types/errors.go +++ b/x/migration/types/errors.go @@ -8,8 +8,8 @@ import ( // x/migration module sentinel errors var ( - ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") - ErrMorseAccountState = sdkerrors.Register(ModuleName, 1101, "morse account state is invalid") - ErrUnauthorized = sdkerrors.Register(ModuleName, 1102, "unauthorized") - ErrMorseClaimableAccount = sdkerrors.Register(ModuleName, 1103, "morse claimable account is invalid") + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrMorseAccountsImport = sdkerrors.Register(ModuleName, 1101, "unable to import morse claimable accounts") + ErrUnauthorized = sdkerrors.Register(ModuleName, 1102, "unauthorized") + ErrMorseAccountClaim = sdkerrors.Register(ModuleName, 1103, "unable to claim morse account") ) diff --git a/x/migration/types/message_claim_morse_account.go b/x/migration/types/message_claim_morse_account.go index 261a3b0ae..911286226 100644 --- a/x/migration/types/message_claim_morse_account.go +++ b/x/migration/types/message_claim_morse_account.go @@ -33,11 +33,15 @@ func NewMsgClaimMorseAccount( } func (msg *MsgClaimMorseAccount) ValidateBasic() error { + if len(msg.MorseSignature) == 0 { + return ErrMorseAccountClaim.Wrap("morseSignature is empty") + } - // TODO_UPNEXT(@bryanchriswhite#1034): Add validation + if len(msg.MorseSrcAddress) != MorseAddressHexLengthBytes { + return ErrMorseAccountClaim.Wrapf("invalid morseSrcAddress length (%d)", len(msg.MorseSrcAddress)) + } - _, err := sdk.AccAddressFromBech32(msg.ShannonDestAddress) - if err != nil { + if _, err := sdk.AccAddressFromBech32(msg.ShannonDestAddress); err != nil { return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid shannonDestAddress address (%s)", err) } return nil diff --git a/x/migration/types/message_claim_morse_account_test.go b/x/migration/types/message_claim_morse_account_test.go index 83ca6ac00..8f16b77f6 100644 --- a/x/migration/types/message_claim_morse_account_test.go +++ b/x/migration/types/message_claim_morse_account_test.go @@ -4,8 +4,9 @@ import ( "testing" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/pokt-network/poktroll/testutil/sample" "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/testutil/sample" ) func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { @@ -15,15 +16,27 @@ func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { err error }{ { - name: "invalid address", + name: "invalid ShannonDestAddress", msg: MsgClaimMorseAccount{ ShannonDestAddress: "invalid_address", + MorseSrcAddress: sample.MorseAddressHex(), + MorseSignature: "mock_signature", }, err: sdkerrors.ErrInvalidAddress, }, { - name: "valid address", + name: "invalid MorseSrcAddress", + msg: MsgClaimMorseAccount{ + ShannonDestAddress: sample.AccAddress(), + MorseSrcAddress: "invalid_address", + MorseSignature: "mock_signature", + }, + err: ErrMorseAccountClaim, + }, { + name: "valid claim message", msg: MsgClaimMorseAccount{ ShannonDestAddress: sample.AccAddress(), + MorseSrcAddress: sample.MorseAddressHex(), + MorseSignature: "mock_signature", }, }, } @@ -38,3 +51,8 @@ func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { }) } } + +// TODO_IN_THIS_COMMIT: error cases... +// - empty signature +// - invalid length morse hex addr +// - invalid shannon bech32 addr diff --git a/x/migration/types/message_import_morse_claimable_accounts.go b/x/migration/types/message_import_morse_claimable_accounts.go index cba065608..d66bd5ee6 100644 --- a/x/migration/types/message_import_morse_claimable_accounts.go +++ b/x/migration/types/message_import_morse_claimable_accounts.go @@ -37,11 +37,11 @@ func (msg *MsgImportMorseClaimableAccounts) ValidateBasic() error { expectedHash := msg.GetMorseAccountStateHash() if len(expectedHash) == 0 { - return ErrMorseAccountState.Wrapf("expected hash is empty") + return ErrMorseAccountsImport.Wrapf("expected hash is empty") } if !bytes.Equal(actualHash, expectedHash) { - return ErrMorseAccountState.Wrapf( + return ErrMorseAccountsImport.Wrapf( "Morse account state hash (%x) doesn't match expected: (%x)", actualHash, expectedHash, ) diff --git a/x/migration/types/message_import_morse_claimable_accounts_test.go b/x/migration/types/message_import_morse_claimable_accounts_test.go index fdf6fae60..74a2a69b7 100644 --- a/x/migration/types/message_import_morse_claimable_accounts_test.go +++ b/x/migration/types/message_import_morse_claimable_accounts_test.go @@ -31,7 +31,7 @@ func TestMsgImportMorseClaimableAccounts_ValidateBasic(t *testing.T) { { name: "invalid morse account state hash", msg: invalidMsg, - err: ErrMorseAccountState, + err: ErrMorseAccountsImport, }, { name: "valid address", diff --git a/x/migration/types/types.go b/x/migration/types/types.go index ab1254f4c..00efae8db 100644 --- a/x/migration/types/types.go +++ b/x/migration/types/types.go @@ -1 +1,6 @@ package types + +const ( + MorseAddressLengthBytes = 20 + MorseAddressHexLengthBytes = MorseAddressLengthBytes * 2 +) From 0848fb14707d546ca4cd6c9c59ae044197a0df8a Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 18 Feb 2025 11:30:51 +0100 Subject: [PATCH 25/81] chore: self-review improvements --- api/poktroll/migration/event.pulsar.go | 4 ++-- proto/poktroll/migration/event.proto | 2 +- .../migration/morse_account_import_and_claim_test.go | 6 ------ ...msg_server_import_morse_claimable_accounts_test.go | 11 ++++++----- x/migration/types/event.pb.go | 2 +- x/migration/types/message_claim_morse_account.go | 4 ++++ x/migration/types/message_claim_morse_account_test.go | 5 ----- 7 files changed, 14 insertions(+), 20 deletions(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index 603c1b800..ec5f9587d 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -3,11 +3,11 @@ package migration import ( v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + _ "github.com/pokt-network/poktroll/api/poktroll/shared" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" - _ "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -1214,7 +1214,7 @@ func (x *EventImportMorseClaimableAccounts) GetNumAccounts() uint64 { return 0 } -// TODO_IN_THIS_COMMIT: comments... +// EventMorseAccountClaimed is emitted when a MorseAccount is claimed on-chain. type EventMorseAccountClaimed struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/proto/poktroll/migration/event.proto b/proto/poktroll/migration/event.proto index 3c109c4da..1f7caa0d4 100644 --- a/proto/poktroll/migration/event.proto +++ b/proto/poktroll/migration/event.proto @@ -24,7 +24,7 @@ message EventImportMorseClaimableAccounts { uint64 num_accounts = 3 [(gogoproto.jsontag) = "num_accounts"]; } -// TODO_IN_THIS_COMMIT: comments... +// EventMorseAccountClaimed is emitted when a MorseAccount is claimed on-chain. message EventMorseAccountClaimed { // The height (on Shannon) at which the claim was executed (i.e. claimed). int64 claimed_at_height = 1 [(gogoproto.jsontag) = "claimed_at_height"]; diff --git a/tests/integration/migration/morse_account_import_and_claim_test.go b/tests/integration/migration/morse_account_import_and_claim_test.go index 9143c38cc..64daf7630 100644 --- a/tests/integration/migration/morse_account_import_and_claim_test.go +++ b/tests/integration/migration/morse_account_import_and_claim_test.go @@ -11,7 +11,6 @@ import ( "github.com/stretchr/testify/require" "github.com/pokt-network/poktroll/app/volatile" - "github.com/pokt-network/poktroll/cmd/poktrolld/cmd" "github.com/pokt-network/poktroll/pkg/client/query" "github.com/pokt-network/poktroll/testutil/integration" "github.com/pokt-network/poktroll/testutil/sample" @@ -19,11 +18,6 @@ import ( migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) -// TODO_IN_THIS_COMMIT: confirm whether this is necessary... -func init() { - cmd.InitSDKConfig() -} - func TestMsgServer_CreateMorseAccountClaim(t *testing.T) { app := integration.NewCompleteIntegrationApp(t) diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go index 6e21625c0..294057a76 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go @@ -83,9 +83,13 @@ func TestMsgServer_ImportMorseClaimableAccounts_ErrorAlreadySet(t *testing.T) { _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts) k.ImportFromMorseAccountState(ctx, accountState) - // Assert that the MorseAccountState have been set. + // Assert that the MorseClaimableAccounts are persisted AND unclaimed. morseClaimableAccounts = k.GetAllMorseClaimableAccounts(ctx) - require.Equal(t, 10, len(morseClaimableAccounts)) + require.Equal(t, numAccounts, len(morseClaimableAccounts)) + for _, morseClaimableAccount := range morseClaimableAccounts { + require.Equal(t, int64(0), morseClaimableAccount.ClaimedAtHeight) + require.Equal(t, "", morseClaimableAccount.ShannonDestAddress) + } // Assert that the MorseAccountState can ONLY be set once. msgImportMorseClaimableAccounts, err := migrationtypes.NewMsgImportMorseClaimableAccounts( @@ -118,6 +122,3 @@ func TestMsgServer_ImportMorseClaimableAccounts_ErrorInvalidAuthority(t *testing require.Equal(t, codes.PermissionDenied, stat.Code()) require.ErrorContains(t, err, "invalid authority address") } - -// TODO_IN_THIS_COMMIT: Test an import with non-zero ClaimedAtHeight for one or -// more accounts; the heights SHOULD be reset to 0 when persisted. diff --git a/x/migration/types/event.pb.go b/x/migration/types/event.pb.go index 456a5b509..1aee62c40 100644 --- a/x/migration/types/event.pb.go +++ b/x/migration/types/event.pb.go @@ -87,7 +87,7 @@ func (m *EventImportMorseClaimableAccounts) GetNumAccounts() uint64 { return 0 } -// TODO_IN_THIS_COMMIT: comments... +// EventMorseAccountClaimed is emitted when a MorseAccount is claimed on-chain. type EventMorseAccountClaimed struct { // The height (on Shannon) at which the claim was executed (i.e. claimed). ClaimedAtHeight int64 `protobuf:"varint,1,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height"` diff --git a/x/migration/types/message_claim_morse_account.go b/x/migration/types/message_claim_morse_account.go index 911286226..cc486a9e0 100644 --- a/x/migration/types/message_claim_morse_account.go +++ b/x/migration/types/message_claim_morse_account.go @@ -27,6 +27,10 @@ func NewMsgClaimMorseAccount( } morseSignature, err := morsePrivateKey.Sign(msgBz) + if err != nil { + return nil, err + } + msg.MorseSignature = hex.EncodeToString(morseSignature) return msg, nil diff --git a/x/migration/types/message_claim_morse_account_test.go b/x/migration/types/message_claim_morse_account_test.go index 8f16b77f6..a16d52cbe 100644 --- a/x/migration/types/message_claim_morse_account_test.go +++ b/x/migration/types/message_claim_morse_account_test.go @@ -51,8 +51,3 @@ func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { }) } } - -// TODO_IN_THIS_COMMIT: error cases... -// - empty signature -// - invalid length morse hex addr -// - invalid shannon bech32 addr From 30bfca535ca33ffd1e1fc2d774177c2b65525cb4 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 18 Feb 2025 12:17:07 +0100 Subject: [PATCH 26/81] refactor: s/QueryGetMorseClaimable(.+)/QueryMorseClaimable$1 --- api/poktroll/migration/query.pulsar.go | 464 +++++++++--------- api/poktroll/migration/query_grpc.pb.go | 14 +- proto/poktroll/migration/query.proto | 6 +- .../morse_account_import_and_claim_test.go | 2 +- .../keeper/query_morse_claimable_account.go | 6 +- .../query_morse_claimable_account_test.go | 14 +- x/migration/types/query.pb.go | 174 +++---- x/migration/types/query.pb.gw.go | 4 +- 8 files changed, 342 insertions(+), 342 deletions(-) diff --git a/api/poktroll/migration/query.pulsar.go b/api/poktroll/migration/query.pulsar.go index 2ad17a178..e7ab94433 100644 --- a/api/poktroll/migration/query.pulsar.go +++ b/api/poktroll/migration/query.pulsar.go @@ -808,25 +808,25 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods } var ( - md_QueryGetMorseClaimableAccountRequest protoreflect.MessageDescriptor - fd_QueryGetMorseClaimableAccountRequest_address protoreflect.FieldDescriptor + md_QueryMorseClaimableAccountRequest protoreflect.MessageDescriptor + fd_QueryMorseClaimableAccountRequest_address protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_query_proto_init() - md_QueryGetMorseClaimableAccountRequest = File_poktroll_migration_query_proto.Messages().ByName("QueryGetMorseClaimableAccountRequest") - fd_QueryGetMorseClaimableAccountRequest_address = md_QueryGetMorseClaimableAccountRequest.Fields().ByName("address") + md_QueryMorseClaimableAccountRequest = File_poktroll_migration_query_proto.Messages().ByName("QueryMorseClaimableAccountRequest") + fd_QueryMorseClaimableAccountRequest_address = md_QueryMorseClaimableAccountRequest.Fields().ByName("address") } -var _ protoreflect.Message = (*fastReflection_QueryGetMorseClaimableAccountRequest)(nil) +var _ protoreflect.Message = (*fastReflection_QueryMorseClaimableAccountRequest)(nil) -type fastReflection_QueryGetMorseClaimableAccountRequest QueryGetMorseClaimableAccountRequest +type fastReflection_QueryMorseClaimableAccountRequest QueryMorseClaimableAccountRequest -func (x *QueryGetMorseClaimableAccountRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryGetMorseClaimableAccountRequest)(x) +func (x *QueryMorseClaimableAccountRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryMorseClaimableAccountRequest)(x) } -func (x *QueryGetMorseClaimableAccountRequest) slowProtoReflect() protoreflect.Message { +func (x *QueryMorseClaimableAccountRequest) slowProtoReflect() protoreflect.Message { mi := &file_poktroll_migration_query_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -838,43 +838,43 @@ func (x *QueryGetMorseClaimableAccountRequest) slowProtoReflect() protoreflect.M return mi.MessageOf(x) } -var _fastReflection_QueryGetMorseClaimableAccountRequest_messageType fastReflection_QueryGetMorseClaimableAccountRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryGetMorseClaimableAccountRequest_messageType{} +var _fastReflection_QueryMorseClaimableAccountRequest_messageType fastReflection_QueryMorseClaimableAccountRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryMorseClaimableAccountRequest_messageType{} -type fastReflection_QueryGetMorseClaimableAccountRequest_messageType struct{} +type fastReflection_QueryMorseClaimableAccountRequest_messageType struct{} -func (x fastReflection_QueryGetMorseClaimableAccountRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryGetMorseClaimableAccountRequest)(nil) +func (x fastReflection_QueryMorseClaimableAccountRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryMorseClaimableAccountRequest)(nil) } -func (x fastReflection_QueryGetMorseClaimableAccountRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryGetMorseClaimableAccountRequest) +func (x fastReflection_QueryMorseClaimableAccountRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryMorseClaimableAccountRequest) } -func (x fastReflection_QueryGetMorseClaimableAccountRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryGetMorseClaimableAccountRequest +func (x fastReflection_QueryMorseClaimableAccountRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryMorseClaimableAccountRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryGetMorseClaimableAccountRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryGetMorseClaimableAccountRequest +func (x *fastReflection_QueryMorseClaimableAccountRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryMorseClaimableAccountRequest } // 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_QueryGetMorseClaimableAccountRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryGetMorseClaimableAccountRequest_messageType +func (x *fastReflection_QueryMorseClaimableAccountRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryMorseClaimableAccountRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryGetMorseClaimableAccountRequest) New() protoreflect.Message { - return new(fastReflection_QueryGetMorseClaimableAccountRequest) +func (x *fastReflection_QueryMorseClaimableAccountRequest) New() protoreflect.Message { + return new(fastReflection_QueryMorseClaimableAccountRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryGetMorseClaimableAccountRequest) Interface() protoreflect.ProtoMessage { - return (*QueryGetMorseClaimableAccountRequest)(x) +func (x *fastReflection_QueryMorseClaimableAccountRequest) Interface() protoreflect.ProtoMessage { + return (*QueryMorseClaimableAccountRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -882,10 +882,10 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) Interface() protor // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryGetMorseClaimableAccountRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QueryMorseClaimableAccountRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Address != "" { value := protoreflect.ValueOfString(x.Address) - if !f(fd_QueryGetMorseClaimableAccountRequest_address, value) { + if !f(fd_QueryMorseClaimableAccountRequest_address, value) { return } } @@ -902,15 +902,15 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) Range(f func(proto // 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_QueryGetMorseClaimableAccountRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryMorseClaimableAccountRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.migration.QueryGetMorseClaimableAccountRequest.address": + case "poktroll.migration.QueryMorseClaimableAccountRequest.address": return x.Address != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryGetMorseClaimableAccountRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryMorseClaimableAccountRequest")) } - panic(fmt.Errorf("message poktroll.migration.QueryGetMorseClaimableAccountRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.QueryMorseClaimableAccountRequest does not contain field %s", fd.FullName())) } } @@ -920,15 +920,15 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) Has(fd protoreflec // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetMorseClaimableAccountRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryMorseClaimableAccountRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.migration.QueryGetMorseClaimableAccountRequest.address": + case "poktroll.migration.QueryMorseClaimableAccountRequest.address": x.Address = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryGetMorseClaimableAccountRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryMorseClaimableAccountRequest")) } - panic(fmt.Errorf("message poktroll.migration.QueryGetMorseClaimableAccountRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.QueryMorseClaimableAccountRequest does not contain field %s", fd.FullName())) } } @@ -938,16 +938,16 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) Clear(fd protorefl // 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_QueryGetMorseClaimableAccountRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryMorseClaimableAccountRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.migration.QueryGetMorseClaimableAccountRequest.address": + case "poktroll.migration.QueryMorseClaimableAccountRequest.address": value := x.Address return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryGetMorseClaimableAccountRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryMorseClaimableAccountRequest")) } - panic(fmt.Errorf("message poktroll.migration.QueryGetMorseClaimableAccountRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message poktroll.migration.QueryMorseClaimableAccountRequest does not contain field %s", descriptor.FullName())) } } @@ -961,15 +961,15 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) Get(descriptor pro // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetMorseClaimableAccountRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryMorseClaimableAccountRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.migration.QueryGetMorseClaimableAccountRequest.address": + case "poktroll.migration.QueryMorseClaimableAccountRequest.address": x.Address = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryGetMorseClaimableAccountRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryMorseClaimableAccountRequest")) } - panic(fmt.Errorf("message poktroll.migration.QueryGetMorseClaimableAccountRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.QueryMorseClaimableAccountRequest does not contain field %s", fd.FullName())) } } @@ -983,40 +983,40 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) Set(fd protoreflec // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetMorseClaimableAccountRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryMorseClaimableAccountRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.QueryGetMorseClaimableAccountRequest.address": - panic(fmt.Errorf("field address of message poktroll.migration.QueryGetMorseClaimableAccountRequest is not mutable")) + case "poktroll.migration.QueryMorseClaimableAccountRequest.address": + panic(fmt.Errorf("field address of message poktroll.migration.QueryMorseClaimableAccountRequest is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryGetMorseClaimableAccountRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryMorseClaimableAccountRequest")) } - panic(fmt.Errorf("message poktroll.migration.QueryGetMorseClaimableAccountRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.QueryMorseClaimableAccountRequest 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_QueryGetMorseClaimableAccountRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryMorseClaimableAccountRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.QueryGetMorseClaimableAccountRequest.address": + case "poktroll.migration.QueryMorseClaimableAccountRequest.address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryGetMorseClaimableAccountRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryMorseClaimableAccountRequest")) } - panic(fmt.Errorf("message poktroll.migration.QueryGetMorseClaimableAccountRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.QueryMorseClaimableAccountRequest 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_QueryGetMorseClaimableAccountRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryMorseClaimableAccountRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.QueryGetMorseClaimableAccountRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.QueryMorseClaimableAccountRequest", d.FullName())) } panic("unreachable") } @@ -1024,7 +1024,7 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) WhichOneof(d proto // 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_QueryGetMorseClaimableAccountRequest) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryMorseClaimableAccountRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1035,7 +1035,7 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) GetUnknown() proto // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetMorseClaimableAccountRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryMorseClaimableAccountRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1047,7 +1047,7 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) SetUnknown(fields // 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_QueryGetMorseClaimableAccountRequest) IsValid() bool { +func (x *fastReflection_QueryMorseClaimableAccountRequest) IsValid() bool { return x != nil } @@ -1057,9 +1057,9 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_QueryGetMorseClaimableAccountRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryMorseClaimableAccountRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryGetMorseClaimableAccountRequest) + x := input.Message.Interface().(*QueryMorseClaimableAccountRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1085,7 +1085,7 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) ProtoMethods() *pr } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryGetMorseClaimableAccountRequest) + x := input.Message.Interface().(*QueryMorseClaimableAccountRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1122,7 +1122,7 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) ProtoMethods() *pr }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryGetMorseClaimableAccountRequest) + x := input.Message.Interface().(*QueryMorseClaimableAccountRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1154,10 +1154,10 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) ProtoMethods() *pr fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetMorseClaimableAccountRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryMorseClaimableAccountRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetMorseClaimableAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryMorseClaimableAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1228,25 +1228,25 @@ func (x *fastReflection_QueryGetMorseClaimableAccountRequest) ProtoMethods() *pr } var ( - md_QueryGetMorseClaimableAccountResponse protoreflect.MessageDescriptor - fd_QueryGetMorseClaimableAccountResponse_morseClaimableAccount protoreflect.FieldDescriptor + md_QueryMorseClaimableAccountResponse protoreflect.MessageDescriptor + fd_QueryMorseClaimableAccountResponse_morseClaimableAccount protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_query_proto_init() - md_QueryGetMorseClaimableAccountResponse = File_poktroll_migration_query_proto.Messages().ByName("QueryGetMorseClaimableAccountResponse") - fd_QueryGetMorseClaimableAccountResponse_morseClaimableAccount = md_QueryGetMorseClaimableAccountResponse.Fields().ByName("morseClaimableAccount") + md_QueryMorseClaimableAccountResponse = File_poktroll_migration_query_proto.Messages().ByName("QueryMorseClaimableAccountResponse") + fd_QueryMorseClaimableAccountResponse_morseClaimableAccount = md_QueryMorseClaimableAccountResponse.Fields().ByName("morseClaimableAccount") } -var _ protoreflect.Message = (*fastReflection_QueryGetMorseClaimableAccountResponse)(nil) +var _ protoreflect.Message = (*fastReflection_QueryMorseClaimableAccountResponse)(nil) -type fastReflection_QueryGetMorseClaimableAccountResponse QueryGetMorseClaimableAccountResponse +type fastReflection_QueryMorseClaimableAccountResponse QueryMorseClaimableAccountResponse -func (x *QueryGetMorseClaimableAccountResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryGetMorseClaimableAccountResponse)(x) +func (x *QueryMorseClaimableAccountResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryMorseClaimableAccountResponse)(x) } -func (x *QueryGetMorseClaimableAccountResponse) slowProtoReflect() protoreflect.Message { +func (x *QueryMorseClaimableAccountResponse) slowProtoReflect() protoreflect.Message { mi := &file_poktroll_migration_query_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1258,43 +1258,43 @@ func (x *QueryGetMorseClaimableAccountResponse) slowProtoReflect() protoreflect. return mi.MessageOf(x) } -var _fastReflection_QueryGetMorseClaimableAccountResponse_messageType fastReflection_QueryGetMorseClaimableAccountResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryGetMorseClaimableAccountResponse_messageType{} +var _fastReflection_QueryMorseClaimableAccountResponse_messageType fastReflection_QueryMorseClaimableAccountResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryMorseClaimableAccountResponse_messageType{} -type fastReflection_QueryGetMorseClaimableAccountResponse_messageType struct{} +type fastReflection_QueryMorseClaimableAccountResponse_messageType struct{} -func (x fastReflection_QueryGetMorseClaimableAccountResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryGetMorseClaimableAccountResponse)(nil) +func (x fastReflection_QueryMorseClaimableAccountResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryMorseClaimableAccountResponse)(nil) } -func (x fastReflection_QueryGetMorseClaimableAccountResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryGetMorseClaimableAccountResponse) +func (x fastReflection_QueryMorseClaimableAccountResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryMorseClaimableAccountResponse) } -func (x fastReflection_QueryGetMorseClaimableAccountResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryGetMorseClaimableAccountResponse +func (x fastReflection_QueryMorseClaimableAccountResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryMorseClaimableAccountResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryGetMorseClaimableAccountResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryGetMorseClaimableAccountResponse +func (x *fastReflection_QueryMorseClaimableAccountResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryMorseClaimableAccountResponse } // 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_QueryGetMorseClaimableAccountResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryGetMorseClaimableAccountResponse_messageType +func (x *fastReflection_QueryMorseClaimableAccountResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryMorseClaimableAccountResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryGetMorseClaimableAccountResponse) New() protoreflect.Message { - return new(fastReflection_QueryGetMorseClaimableAccountResponse) +func (x *fastReflection_QueryMorseClaimableAccountResponse) New() protoreflect.Message { + return new(fastReflection_QueryMorseClaimableAccountResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryGetMorseClaimableAccountResponse) Interface() protoreflect.ProtoMessage { - return (*QueryGetMorseClaimableAccountResponse)(x) +func (x *fastReflection_QueryMorseClaimableAccountResponse) Interface() protoreflect.ProtoMessage { + return (*QueryMorseClaimableAccountResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -1302,10 +1302,10 @@ func (x *fastReflection_QueryGetMorseClaimableAccountResponse) Interface() proto // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryGetMorseClaimableAccountResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QueryMorseClaimableAccountResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.MorseClaimableAccount != nil { value := protoreflect.ValueOfMessage(x.MorseClaimableAccount.ProtoReflect()) - if !f(fd_QueryGetMorseClaimableAccountResponse_morseClaimableAccount, value) { + if !f(fd_QueryMorseClaimableAccountResponse_morseClaimableAccount, value) { return } } @@ -1322,15 +1322,15 @@ func (x *fastReflection_QueryGetMorseClaimableAccountResponse) Range(f func(prot // 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_QueryGetMorseClaimableAccountResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryMorseClaimableAccountResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.migration.QueryGetMorseClaimableAccountResponse.morseClaimableAccount": + case "poktroll.migration.QueryMorseClaimableAccountResponse.morseClaimableAccount": return x.MorseClaimableAccount != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryGetMorseClaimableAccountResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryMorseClaimableAccountResponse")) } - panic(fmt.Errorf("message poktroll.migration.QueryGetMorseClaimableAccountResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.QueryMorseClaimableAccountResponse does not contain field %s", fd.FullName())) } } @@ -1340,15 +1340,15 @@ func (x *fastReflection_QueryGetMorseClaimableAccountResponse) Has(fd protorefle // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetMorseClaimableAccountResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryMorseClaimableAccountResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.migration.QueryGetMorseClaimableAccountResponse.morseClaimableAccount": + case "poktroll.migration.QueryMorseClaimableAccountResponse.morseClaimableAccount": x.MorseClaimableAccount = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryGetMorseClaimableAccountResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryMorseClaimableAccountResponse")) } - panic(fmt.Errorf("message poktroll.migration.QueryGetMorseClaimableAccountResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.QueryMorseClaimableAccountResponse does not contain field %s", fd.FullName())) } } @@ -1358,16 +1358,16 @@ func (x *fastReflection_QueryGetMorseClaimableAccountResponse) Clear(fd protoref // 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_QueryGetMorseClaimableAccountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryMorseClaimableAccountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.migration.QueryGetMorseClaimableAccountResponse.morseClaimableAccount": + case "poktroll.migration.QueryMorseClaimableAccountResponse.morseClaimableAccount": value := x.MorseClaimableAccount return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryGetMorseClaimableAccountResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryMorseClaimableAccountResponse")) } - panic(fmt.Errorf("message poktroll.migration.QueryGetMorseClaimableAccountResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message poktroll.migration.QueryMorseClaimableAccountResponse does not contain field %s", descriptor.FullName())) } } @@ -1381,15 +1381,15 @@ func (x *fastReflection_QueryGetMorseClaimableAccountResponse) Get(descriptor pr // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetMorseClaimableAccountResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryMorseClaimableAccountResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.migration.QueryGetMorseClaimableAccountResponse.morseClaimableAccount": + case "poktroll.migration.QueryMorseClaimableAccountResponse.morseClaimableAccount": x.MorseClaimableAccount = value.Message().Interface().(*MorseClaimableAccount) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryGetMorseClaimableAccountResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryMorseClaimableAccountResponse")) } - panic(fmt.Errorf("message poktroll.migration.QueryGetMorseClaimableAccountResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.QueryMorseClaimableAccountResponse does not contain field %s", fd.FullName())) } } @@ -1403,44 +1403,44 @@ func (x *fastReflection_QueryGetMorseClaimableAccountResponse) Set(fd protorefle // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetMorseClaimableAccountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryMorseClaimableAccountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.QueryGetMorseClaimableAccountResponse.morseClaimableAccount": + case "poktroll.migration.QueryMorseClaimableAccountResponse.morseClaimableAccount": if x.MorseClaimableAccount == nil { x.MorseClaimableAccount = new(MorseClaimableAccount) } return protoreflect.ValueOfMessage(x.MorseClaimableAccount.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryGetMorseClaimableAccountResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryMorseClaimableAccountResponse")) } - panic(fmt.Errorf("message poktroll.migration.QueryGetMorseClaimableAccountResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.QueryMorseClaimableAccountResponse 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_QueryGetMorseClaimableAccountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryMorseClaimableAccountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.QueryGetMorseClaimableAccountResponse.morseClaimableAccount": + case "poktroll.migration.QueryMorseClaimableAccountResponse.morseClaimableAccount": m := new(MorseClaimableAccount) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryGetMorseClaimableAccountResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryMorseClaimableAccountResponse")) } - panic(fmt.Errorf("message poktroll.migration.QueryGetMorseClaimableAccountResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.QueryMorseClaimableAccountResponse 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_QueryGetMorseClaimableAccountResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryMorseClaimableAccountResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.QueryGetMorseClaimableAccountResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.QueryMorseClaimableAccountResponse", d.FullName())) } panic("unreachable") } @@ -1448,7 +1448,7 @@ func (x *fastReflection_QueryGetMorseClaimableAccountResponse) WhichOneof(d prot // 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_QueryGetMorseClaimableAccountResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryMorseClaimableAccountResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1459,7 +1459,7 @@ func (x *fastReflection_QueryGetMorseClaimableAccountResponse) GetUnknown() prot // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetMorseClaimableAccountResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryMorseClaimableAccountResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1471,7 +1471,7 @@ func (x *fastReflection_QueryGetMorseClaimableAccountResponse) SetUnknown(fields // 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_QueryGetMorseClaimableAccountResponse) IsValid() bool { +func (x *fastReflection_QueryMorseClaimableAccountResponse) IsValid() bool { return x != nil } @@ -1481,9 +1481,9 @@ func (x *fastReflection_QueryGetMorseClaimableAccountResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_QueryGetMorseClaimableAccountResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryMorseClaimableAccountResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryGetMorseClaimableAccountResponse) + x := input.Message.Interface().(*QueryMorseClaimableAccountResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1509,7 +1509,7 @@ func (x *fastReflection_QueryGetMorseClaimableAccountResponse) ProtoMethods() *p } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryGetMorseClaimableAccountResponse) + x := input.Message.Interface().(*QueryMorseClaimableAccountResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1553,7 +1553,7 @@ func (x *fastReflection_QueryGetMorseClaimableAccountResponse) ProtoMethods() *p }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryGetMorseClaimableAccountResponse) + x := input.Message.Interface().(*QueryMorseClaimableAccountResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1585,10 +1585,10 @@ func (x *fastReflection_QueryGetMorseClaimableAccountResponse) ProtoMethods() *p fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetMorseClaimableAccountResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryMorseClaimableAccountResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetMorseClaimableAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryMorseClaimableAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2747,7 +2747,7 @@ func (x *QueryParamsResponse) GetParams() *Params { return nil } -type QueryGetMorseClaimableAccountRequest struct { +type QueryMorseClaimableAccountRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2755,8 +2755,8 @@ type QueryGetMorseClaimableAccountRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (x *QueryGetMorseClaimableAccountRequest) Reset() { - *x = QueryGetMorseClaimableAccountRequest{} +func (x *QueryMorseClaimableAccountRequest) Reset() { + *x = QueryMorseClaimableAccountRequest{} if protoimpl.UnsafeEnabled { mi := &file_poktroll_migration_query_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2764,25 +2764,25 @@ func (x *QueryGetMorseClaimableAccountRequest) Reset() { } } -func (x *QueryGetMorseClaimableAccountRequest) String() string { +func (x *QueryMorseClaimableAccountRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryGetMorseClaimableAccountRequest) ProtoMessage() {} +func (*QueryMorseClaimableAccountRequest) ProtoMessage() {} -// Deprecated: Use QueryGetMorseClaimableAccountRequest.ProtoReflect.Descriptor instead. -func (*QueryGetMorseClaimableAccountRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryMorseClaimableAccountRequest.ProtoReflect.Descriptor instead. +func (*QueryMorseClaimableAccountRequest) Descriptor() ([]byte, []int) { return file_poktroll_migration_query_proto_rawDescGZIP(), []int{2} } -func (x *QueryGetMorseClaimableAccountRequest) GetAddress() string { +func (x *QueryMorseClaimableAccountRequest) GetAddress() string { if x != nil { return x.Address } return "" } -type QueryGetMorseClaimableAccountResponse struct { +type QueryMorseClaimableAccountResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2790,8 +2790,8 @@ type QueryGetMorseClaimableAccountResponse struct { MorseClaimableAccount *MorseClaimableAccount `protobuf:"bytes,1,opt,name=morseClaimableAccount,proto3" json:"morseClaimableAccount,omitempty"` } -func (x *QueryGetMorseClaimableAccountResponse) Reset() { - *x = QueryGetMorseClaimableAccountResponse{} +func (x *QueryMorseClaimableAccountResponse) Reset() { + *x = QueryMorseClaimableAccountResponse{} if protoimpl.UnsafeEnabled { mi := &file_poktroll_migration_query_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2799,18 +2799,18 @@ func (x *QueryGetMorseClaimableAccountResponse) Reset() { } } -func (x *QueryGetMorseClaimableAccountResponse) String() string { +func (x *QueryMorseClaimableAccountResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryGetMorseClaimableAccountResponse) ProtoMessage() {} +func (*QueryMorseClaimableAccountResponse) ProtoMessage() {} -// Deprecated: Use QueryGetMorseClaimableAccountResponse.ProtoReflect.Descriptor instead. -func (*QueryGetMorseClaimableAccountResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryMorseClaimableAccountResponse.ProtoReflect.Descriptor instead. +func (*QueryMorseClaimableAccountResponse) Descriptor() ([]byte, []int) { return file_poktroll_migration_query_proto_rawDescGZIP(), []int{3} } -func (x *QueryGetMorseClaimableAccountResponse) GetMorseClaimableAccount() *MorseClaimableAccount { +func (x *QueryMorseClaimableAccountResponse) GetMorseClaimableAccount() *MorseClaimableAccount { if x != nil { return x.MorseClaimableAccount } @@ -2919,89 +2919,89 @@ var file_poktroll_migration_query_proto_rawDesc = []byte{ 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x40, 0x0a, 0x24, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, - 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x8e, - 0x01, 0x0a, 0x25, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, - 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x15, 0x6d, 0x6f, 0x72, 0x73, - 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 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, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x15, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x43, - 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, - 0x6e, 0x0a, 0x24, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x4d, 0x6f, 0x72, 0x73, 0x65, - 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0xd7, 0x01, 0x0a, 0x25, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x4d, 0x6f, 0x72, 0x73, - 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x15, 0x6d, 0x6f, 0x72, - 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 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, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x15, 0x6d, 0x6f, 0x72, 0x73, 0x65, - 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xc3, 0x04, 0x0a, 0x05, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x8a, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 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, - 0x12, 0xd8, 0x01, 0x0a, 0x15, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, - 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x38, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, - 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, - 0x65, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x12, 0x42, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, - 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xd1, 0x01, 0x0a, 0x18, - 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x12, 0x38, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x3d, 0x0a, 0x21, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, + 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x8b, 0x01, 0x0a, 0x22, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, + 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x65, 0x0a, 0x15, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 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, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x15, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, + 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x6e, 0x0a, 0x24, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, + 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xd7, 0x01, 0x0a, 0x25, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, - 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, - 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, - 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, - 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x63, 0x6c, - 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, - 0xb6, 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, 0x0a, - 0x51, 0x75, 0x65, 0x72, 0x79, 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, + 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x15, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x29, 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, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x15, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, + 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x32, 0xbd, 0x04, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x8a, 0x01, + 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x29, 0x12, 0x27, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 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, 0x12, 0xd2, 0x01, 0x0a, 0x15, 0x4d, + 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x35, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, + 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x12, 0x42, 0x2f, 0x70, 0x6f, + 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, + 0x72, 0x73, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, + 0xd1, 0x01, 0x0a, 0x18, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, + 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x12, 0x38, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x41, 0x6c, 0x6c, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, + 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x70, 0x6f, 0x6b, 0x74, + 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x72, 0x73, + 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x42, 0xb6, 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, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 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 ( @@ -3020,8 +3020,8 @@ var file_poktroll_migration_query_proto_msgTypes = make([]protoimpl.MessageInfo, var file_poktroll_migration_query_proto_goTypes = []interface{}{ (*QueryParamsRequest)(nil), // 0: poktroll.migration.QueryParamsRequest (*QueryParamsResponse)(nil), // 1: poktroll.migration.QueryParamsResponse - (*QueryGetMorseClaimableAccountRequest)(nil), // 2: poktroll.migration.QueryGetMorseClaimableAccountRequest - (*QueryGetMorseClaimableAccountResponse)(nil), // 3: poktroll.migration.QueryGetMorseClaimableAccountResponse + (*QueryMorseClaimableAccountRequest)(nil), // 2: poktroll.migration.QueryMorseClaimableAccountRequest + (*QueryMorseClaimableAccountResponse)(nil), // 3: poktroll.migration.QueryMorseClaimableAccountResponse (*QueryAllMorseClaimableAccountRequest)(nil), // 4: poktroll.migration.QueryAllMorseClaimableAccountRequest (*QueryAllMorseClaimableAccountResponse)(nil), // 5: poktroll.migration.QueryAllMorseClaimableAccountResponse (*Params)(nil), // 6: poktroll.migration.Params @@ -3031,15 +3031,15 @@ var file_poktroll_migration_query_proto_goTypes = []interface{}{ } var file_poktroll_migration_query_proto_depIdxs = []int32{ 6, // 0: poktroll.migration.QueryParamsResponse.params:type_name -> poktroll.migration.Params - 7, // 1: poktroll.migration.QueryGetMorseClaimableAccountResponse.morseClaimableAccount:type_name -> poktroll.migration.MorseClaimableAccount + 7, // 1: poktroll.migration.QueryMorseClaimableAccountResponse.morseClaimableAccount:type_name -> poktroll.migration.MorseClaimableAccount 8, // 2: poktroll.migration.QueryAllMorseClaimableAccountRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest 7, // 3: poktroll.migration.QueryAllMorseClaimableAccountResponse.morseClaimableAccount:type_name -> poktroll.migration.MorseClaimableAccount 9, // 4: poktroll.migration.QueryAllMorseClaimableAccountResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse 0, // 5: poktroll.migration.Query.Params:input_type -> poktroll.migration.QueryParamsRequest - 2, // 6: poktroll.migration.Query.MorseClaimableAccount:input_type -> poktroll.migration.QueryGetMorseClaimableAccountRequest + 2, // 6: poktroll.migration.Query.MorseClaimableAccount:input_type -> poktroll.migration.QueryMorseClaimableAccountRequest 4, // 7: poktroll.migration.Query.MorseClaimableAccountAll:input_type -> poktroll.migration.QueryAllMorseClaimableAccountRequest 1, // 8: poktroll.migration.Query.Params:output_type -> poktroll.migration.QueryParamsResponse - 3, // 9: poktroll.migration.Query.MorseClaimableAccount:output_type -> poktroll.migration.QueryGetMorseClaimableAccountResponse + 3, // 9: poktroll.migration.Query.MorseClaimableAccount:output_type -> poktroll.migration.QueryMorseClaimableAccountResponse 5, // 10: poktroll.migration.Query.MorseClaimableAccountAll:output_type -> poktroll.migration.QueryAllMorseClaimableAccountResponse 8, // [8:11] is the sub-list for method output_type 5, // [5:8] is the sub-list for method input_type @@ -3081,7 +3081,7 @@ func file_poktroll_migration_query_proto_init() { } } file_poktroll_migration_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryGetMorseClaimableAccountRequest); i { + switch v := v.(*QueryMorseClaimableAccountRequest); i { case 0: return &v.state case 1: @@ -3093,7 +3093,7 @@ func file_poktroll_migration_query_proto_init() { } } file_poktroll_migration_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryGetMorseClaimableAccountResponse); i { + switch v := v.(*QueryMorseClaimableAccountResponse); i { case 0: return &v.state case 1: diff --git a/api/poktroll/migration/query_grpc.pb.go b/api/poktroll/migration/query_grpc.pb.go index 4c8927a9a..f94ccba6e 100644 --- a/api/poktroll/migration/query_grpc.pb.go +++ b/api/poktroll/migration/query_grpc.pb.go @@ -33,7 +33,7 @@ type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Queries a list of MorseClaimableAccount items. - MorseClaimableAccount(ctx context.Context, in *QueryGetMorseClaimableAccountRequest, opts ...grpc.CallOption) (*QueryGetMorseClaimableAccountResponse, error) + MorseClaimableAccount(ctx context.Context, in *QueryMorseClaimableAccountRequest, opts ...grpc.CallOption) (*QueryMorseClaimableAccountResponse, error) MorseClaimableAccountAll(ctx context.Context, in *QueryAllMorseClaimableAccountRequest, opts ...grpc.CallOption) (*QueryAllMorseClaimableAccountResponse, error) } @@ -55,9 +55,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) MorseClaimableAccount(ctx context.Context, in *QueryGetMorseClaimableAccountRequest, opts ...grpc.CallOption) (*QueryGetMorseClaimableAccountResponse, error) { +func (c *queryClient) MorseClaimableAccount(ctx context.Context, in *QueryMorseClaimableAccountRequest, opts ...grpc.CallOption) (*QueryMorseClaimableAccountResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryGetMorseClaimableAccountResponse) + out := new(QueryMorseClaimableAccountResponse) err := c.cc.Invoke(ctx, Query_MorseClaimableAccount_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -84,7 +84,7 @@ type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // Queries a list of MorseClaimableAccount items. - MorseClaimableAccount(context.Context, *QueryGetMorseClaimableAccountRequest) (*QueryGetMorseClaimableAccountResponse, error) + MorseClaimableAccount(context.Context, *QueryMorseClaimableAccountRequest) (*QueryMorseClaimableAccountResponse, error) MorseClaimableAccountAll(context.Context, *QueryAllMorseClaimableAccountRequest) (*QueryAllMorseClaimableAccountResponse, error) mustEmbedUnimplementedQueryServer() } @@ -96,7 +96,7 @@ type UnimplementedQueryServer struct { func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (UnimplementedQueryServer) MorseClaimableAccount(context.Context, *QueryGetMorseClaimableAccountRequest) (*QueryGetMorseClaimableAccountResponse, error) { +func (UnimplementedQueryServer) MorseClaimableAccount(context.Context, *QueryMorseClaimableAccountRequest) (*QueryMorseClaimableAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MorseClaimableAccount not implemented") } func (UnimplementedQueryServer) MorseClaimableAccountAll(context.Context, *QueryAllMorseClaimableAccountRequest) (*QueryAllMorseClaimableAccountResponse, error) { @@ -134,7 +134,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } func _Query_MorseClaimableAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetMorseClaimableAccountRequest) + in := new(QueryMorseClaimableAccountRequest) if err := dec(in); err != nil { return nil, err } @@ -146,7 +146,7 @@ func _Query_MorseClaimableAccount_Handler(srv interface{}, ctx context.Context, FullMethod: Query_MorseClaimableAccount_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).MorseClaimableAccount(ctx, req.(*QueryGetMorseClaimableAccountRequest)) + return srv.(QueryServer).MorseClaimableAccount(ctx, req.(*QueryMorseClaimableAccountRequest)) } return interceptor(ctx, in, info, handler) } diff --git a/proto/poktroll/migration/query.proto b/proto/poktroll/migration/query.proto index 3f4005692..11ceb1fdf 100644 --- a/proto/poktroll/migration/query.proto +++ b/proto/poktroll/migration/query.proto @@ -22,7 +22,7 @@ service Query { } // Queries a list of MorseClaimableAccount items. - rpc MorseClaimableAccount (QueryGetMorseClaimableAccountRequest) returns (QueryGetMorseClaimableAccountResponse) { + rpc MorseClaimableAccount (QueryMorseClaimableAccountRequest) returns (QueryMorseClaimableAccountResponse) { option (google.api.http).get = "/pokt-network/poktroll/migration/morse_claimable_account/{address}"; } @@ -41,11 +41,11 @@ message QueryParamsResponse { Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } -message QueryGetMorseClaimableAccountRequest { +message QueryMorseClaimableAccountRequest { string address = 1; } -message QueryGetMorseClaimableAccountResponse { +message QueryMorseClaimableAccountResponse { MorseClaimableAccount morseClaimableAccount = 1 [(gogoproto.nullable) = false]; } diff --git a/tests/integration/migration/morse_account_import_and_claim_test.go b/tests/integration/migration/morse_account_import_and_claim_test.go index 64daf7630..1b70cb97d 100644 --- a/tests/integration/migration/morse_account_import_and_claim_test.go +++ b/tests/integration/migration/morse_account_import_and_claim_test.go @@ -88,7 +88,7 @@ func TestMsgServer_CreateMorseAccountClaim(t *testing.T) { expectedMorseClaimableAccount.ClaimedAtHeight = app.GetSdkCtx().BlockHeight() - 1 morseAccountQuerier := migrationtypes.NewQueryClient(app.QueryHelper()) - morseClaimableAcctRes, err := morseAccountQuerier.MorseClaimableAccount(app.GetSdkCtx(), &migrationtypes.QueryGetMorseClaimableAccountRequest{ + morseClaimableAcctRes, err := morseAccountQuerier.MorseClaimableAccount(app.GetSdkCtx(), &migrationtypes.QueryMorseClaimableAccountRequest{ Address: morseSrcAddr, }) require.NoError(t, err) diff --git a/x/migration/keeper/query_morse_claimable_account.go b/x/migration/keeper/query_morse_claimable_account.go index 3049a0c96..898ea1308 100644 --- a/x/migration/keeper/query_morse_claimable_account.go +++ b/x/migration/keeper/query_morse_claimable_account.go @@ -46,8 +46,8 @@ func (k Keeper) MorseClaimableAccountAll( // MorseClaimableAccount returns a MorseClaimableAccount by its hex-encoded Morse address. func (k Keeper) MorseClaimableAccount( ctx context.Context, - req *types.QueryGetMorseClaimableAccountRequest, -) (*types.QueryGetMorseClaimableAccountResponse, error) { + req *types.QueryMorseClaimableAccountRequest, +) (*types.QueryMorseClaimableAccountResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -60,5 +60,5 @@ func (k Keeper) MorseClaimableAccount( return nil, status.Error(codes.NotFound, "not found") } - return &types.QueryGetMorseClaimableAccountResponse{MorseClaimableAccount: morseClaimableAccount}, nil + return &types.QueryMorseClaimableAccountResponse{MorseClaimableAccount: morseClaimableAccount}, nil } diff --git a/x/migration/keeper/query_morse_claimable_account_test.go b/x/migration/keeper/query_morse_claimable_account_test.go index 397191954..da4f87384 100644 --- a/x/migration/keeper/query_morse_claimable_account_test.go +++ b/x/migration/keeper/query_morse_claimable_account_test.go @@ -22,27 +22,27 @@ func TestMorseClaimableAccountQuerySingle(t *testing.T) { msgs := createNMorseClaimableAccount(keeper, ctx, 2) tests := []struct { desc string - request *types.QueryGetMorseClaimableAccountRequest - response *types.QueryGetMorseClaimableAccountResponse + request *types.QueryMorseClaimableAccountRequest + response *types.QueryMorseClaimableAccountResponse err error }{ { desc: "First", - request: &types.QueryGetMorseClaimableAccountRequest{ + request: &types.QueryMorseClaimableAccountRequest{ Address: msgs[0].MorseSrcAddress, }, - response: &types.QueryGetMorseClaimableAccountResponse{MorseClaimableAccount: msgs[0]}, + response: &types.QueryMorseClaimableAccountResponse{MorseClaimableAccount: msgs[0]}, }, { desc: "Second", - request: &types.QueryGetMorseClaimableAccountRequest{ + request: &types.QueryMorseClaimableAccountRequest{ Address: msgs[1].MorseSrcAddress, }, - response: &types.QueryGetMorseClaimableAccountResponse{MorseClaimableAccount: msgs[1]}, + response: &types.QueryMorseClaimableAccountResponse{MorseClaimableAccount: msgs[1]}, }, { desc: "KeyNotFound", - request: &types.QueryGetMorseClaimableAccountRequest{ + request: &types.QueryMorseClaimableAccountRequest{ Address: strconv.Itoa(100000), }, err: status.Error(codes.NotFound, "not found"), diff --git a/x/migration/types/query.pb.go b/x/migration/types/query.pb.go index 91c29ce42..b259c5001 100644 --- a/x/migration/types/query.pb.go +++ b/x/migration/types/query.pb.go @@ -106,20 +106,20 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } -type QueryGetMorseClaimableAccountRequest struct { +type QueryMorseClaimableAccountRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (m *QueryGetMorseClaimableAccountRequest) Reset() { *m = QueryGetMorseClaimableAccountRequest{} } -func (m *QueryGetMorseClaimableAccountRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetMorseClaimableAccountRequest) ProtoMessage() {} -func (*QueryGetMorseClaimableAccountRequest) Descriptor() ([]byte, []int) { +func (m *QueryMorseClaimableAccountRequest) Reset() { *m = QueryMorseClaimableAccountRequest{} } +func (m *QueryMorseClaimableAccountRequest) String() string { return proto.CompactTextString(m) } +func (*QueryMorseClaimableAccountRequest) ProtoMessage() {} +func (*QueryMorseClaimableAccountRequest) Descriptor() ([]byte, []int) { return fileDescriptor_524460f9291c42e8, []int{2} } -func (m *QueryGetMorseClaimableAccountRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryMorseClaimableAccountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetMorseClaimableAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryMorseClaimableAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -127,39 +127,39 @@ func (m *QueryGetMorseClaimableAccountRequest) XXX_Marshal(b []byte, determinist } return b[:n], nil } -func (m *QueryGetMorseClaimableAccountRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetMorseClaimableAccountRequest.Merge(m, src) +func (m *QueryMorseClaimableAccountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMorseClaimableAccountRequest.Merge(m, src) } -func (m *QueryGetMorseClaimableAccountRequest) XXX_Size() int { +func (m *QueryMorseClaimableAccountRequest) XXX_Size() int { return m.Size() } -func (m *QueryGetMorseClaimableAccountRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetMorseClaimableAccountRequest.DiscardUnknown(m) +func (m *QueryMorseClaimableAccountRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMorseClaimableAccountRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetMorseClaimableAccountRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryMorseClaimableAccountRequest proto.InternalMessageInfo -func (m *QueryGetMorseClaimableAccountRequest) GetAddress() string { +func (m *QueryMorseClaimableAccountRequest) GetAddress() string { if m != nil { return m.Address } return "" } -type QueryGetMorseClaimableAccountResponse struct { +type QueryMorseClaimableAccountResponse struct { MorseClaimableAccount MorseClaimableAccount `protobuf:"bytes,1,opt,name=morseClaimableAccount,proto3" json:"morseClaimableAccount"` } -func (m *QueryGetMorseClaimableAccountResponse) Reset() { *m = QueryGetMorseClaimableAccountResponse{} } -func (m *QueryGetMorseClaimableAccountResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetMorseClaimableAccountResponse) ProtoMessage() {} -func (*QueryGetMorseClaimableAccountResponse) Descriptor() ([]byte, []int) { +func (m *QueryMorseClaimableAccountResponse) Reset() { *m = QueryMorseClaimableAccountResponse{} } +func (m *QueryMorseClaimableAccountResponse) String() string { return proto.CompactTextString(m) } +func (*QueryMorseClaimableAccountResponse) ProtoMessage() {} +func (*QueryMorseClaimableAccountResponse) Descriptor() ([]byte, []int) { return fileDescriptor_524460f9291c42e8, []int{3} } -func (m *QueryGetMorseClaimableAccountResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryMorseClaimableAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryGetMorseClaimableAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryMorseClaimableAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -167,19 +167,19 @@ func (m *QueryGetMorseClaimableAccountResponse) XXX_Marshal(b []byte, determinis } return b[:n], nil } -func (m *QueryGetMorseClaimableAccountResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetMorseClaimableAccountResponse.Merge(m, src) +func (m *QueryMorseClaimableAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMorseClaimableAccountResponse.Merge(m, src) } -func (m *QueryGetMorseClaimableAccountResponse) XXX_Size() int { +func (m *QueryMorseClaimableAccountResponse) XXX_Size() int { return m.Size() } -func (m *QueryGetMorseClaimableAccountResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetMorseClaimableAccountResponse.DiscardUnknown(m) +func (m *QueryMorseClaimableAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMorseClaimableAccountResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryGetMorseClaimableAccountResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryMorseClaimableAccountResponse proto.InternalMessageInfo -func (m *QueryGetMorseClaimableAccountResponse) GetMorseClaimableAccount() MorseClaimableAccount { +func (m *QueryMorseClaimableAccountResponse) GetMorseClaimableAccount() MorseClaimableAccount { if m != nil { return m.MorseClaimableAccount } @@ -277,8 +277,8 @@ func (m *QueryAllMorseClaimableAccountResponse) GetPagination() *query.PageRespo func init() { proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.migration.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.migration.QueryParamsResponse") - proto.RegisterType((*QueryGetMorseClaimableAccountRequest)(nil), "poktroll.migration.QueryGetMorseClaimableAccountRequest") - proto.RegisterType((*QueryGetMorseClaimableAccountResponse)(nil), "poktroll.migration.QueryGetMorseClaimableAccountResponse") + proto.RegisterType((*QueryMorseClaimableAccountRequest)(nil), "poktroll.migration.QueryMorseClaimableAccountRequest") + proto.RegisterType((*QueryMorseClaimableAccountResponse)(nil), "poktroll.migration.QueryMorseClaimableAccountResponse") proto.RegisterType((*QueryAllMorseClaimableAccountRequest)(nil), "poktroll.migration.QueryAllMorseClaimableAccountRequest") proto.RegisterType((*QueryAllMorseClaimableAccountResponse)(nil), "poktroll.migration.QueryAllMorseClaimableAccountResponse") } @@ -286,42 +286,42 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/query.proto", fileDescriptor_524460f9291c42e8) } var fileDescriptor_524460f9291c42e8 = []byte{ - // 552 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4f, 0x6b, 0xd4, 0x40, - 0x14, 0xdf, 0xa9, 0xb5, 0xd2, 0xf1, 0xe4, 0xd8, 0xc2, 0xb2, 0x48, 0x2a, 0x41, 0x77, 0x6d, 0xc1, - 0x0c, 0x5d, 0x2f, 0x55, 0x10, 0xba, 0xab, 0x58, 0x10, 0x84, 0x35, 0x78, 0xf2, 0x52, 0x26, 0xe9, - 0x90, 0x86, 0x26, 0xf3, 0xd2, 0xcc, 0xac, 0x5a, 0xc4, 0x8b, 0x47, 0x0f, 0x22, 0xf8, 0x25, 0x3c, - 0xfa, 0x1d, 0xbc, 0xf4, 0x58, 0xf1, 0xe0, 0x9e, 0x44, 0x76, 0x05, 0xbf, 0x86, 0x64, 0x66, 0xa2, - 0x5b, 0x9a, 0xdd, 0x40, 0xf1, 0xb2, 0x64, 0x33, 0xef, 0xf7, 0xef, 0xbd, 0x37, 0xc1, 0x4e, 0x06, - 0x07, 0x2a, 0x87, 0x24, 0xa1, 0x69, 0x1c, 0xe5, 0x4c, 0xc5, 0x20, 0xe8, 0xe1, 0x90, 0xe7, 0x47, - 0x5e, 0x96, 0x83, 0x02, 0x42, 0xca, 0x73, 0xef, 0xef, 0x79, 0xeb, 0x0a, 0x4b, 0x63, 0x01, 0x54, - 0xff, 0x9a, 0xb2, 0xd6, 0x4a, 0x04, 0x11, 0xe8, 0x47, 0x5a, 0x3c, 0xd9, 0xb7, 0xd7, 0x22, 0x80, - 0x28, 0xe1, 0x94, 0x65, 0x31, 0x65, 0x42, 0x80, 0xd2, 0x78, 0x69, 0x4f, 0x37, 0x42, 0x90, 0x29, - 0x48, 0x1a, 0x30, 0xc9, 0x8d, 0x26, 0x7d, 0xb1, 0x19, 0x70, 0xc5, 0x36, 0x69, 0xc6, 0xa2, 0x58, - 0xe8, 0x62, 0x5b, 0xbb, 0x56, 0x61, 0x33, 0x63, 0x39, 0x4b, 0x4b, 0xb2, 0x76, 0x45, 0x41, 0x0a, - 0xb9, 0xe4, 0xbb, 0x20, 0xc2, 0x7d, 0x16, 0x5b, 0x22, 0x77, 0x05, 0x93, 0xa7, 0x85, 0xd4, 0x40, - 0x83, 0x7d, 0x7e, 0x38, 0xe4, 0x52, 0xb9, 0xcf, 0xf0, 0xd5, 0x53, 0x6f, 0x65, 0x06, 0x42, 0x72, - 0x72, 0x1f, 0x2f, 0x19, 0x91, 0x26, 0xba, 0x8e, 0x6e, 0x5d, 0xee, 0xb6, 0xbc, 0xb3, 0xdd, 0xf0, - 0x0c, 0xa6, 0xbf, 0x7c, 0xfc, 0x63, 0xad, 0xf1, 0xe9, 0xf7, 0xe7, 0x0d, 0xe4, 0x5b, 0x90, 0xbb, - 0x8d, 0x6f, 0x68, 0xd6, 0x1d, 0xae, 0x9e, 0x14, 0x56, 0x1e, 0x24, 0x2c, 0x4e, 0x59, 0x90, 0xf0, - 0x5e, 0x18, 0xc2, 0x50, 0x28, 0xab, 0x4e, 0x9a, 0xf8, 0x12, 0xdb, 0xdb, 0xcb, 0xb9, 0x34, 0x3a, - 0xcb, 0x7e, 0xf9, 0xd7, 0x7d, 0x8f, 0xf0, 0xcd, 0x1a, 0x0a, 0x6b, 0x95, 0xe3, 0xd5, 0xb4, 0xaa, - 0xc0, 0x3a, 0x5f, 0xaf, 0x72, 0x5e, 0xc9, 0xd8, 0x5f, 0x2c, 0x82, 0xf8, 0xd5, 0x6c, 0xae, 0xb0, - 0x91, 0x7a, 0x49, 0x32, 0x37, 0xd2, 0x23, 0x8c, 0xff, 0xcd, 0xd0, 0x7a, 0x68, 0x7b, 0x66, 0xe0, - 0x5e, 0x31, 0x70, 0xcf, 0x2c, 0x99, 0x1d, 0xb8, 0x37, 0x60, 0x11, 0xb7, 0x58, 0x7f, 0x0a, 0xe9, - 0x7e, 0x2f, 0x1b, 0x30, 0x5b, 0xb0, 0xbe, 0x01, 0x17, 0xfe, 0x5f, 0x03, 0xc8, 0xce, 0xa9, 0x60, - 0x0b, 0x3a, 0x58, 0xa7, 0x36, 0x98, 0xf1, 0x38, 0x9d, 0xac, 0xfb, 0x65, 0x11, 0x5f, 0xd4, 0xc9, - 0xc8, 0x3b, 0x84, 0x97, 0xcc, 0x12, 0x91, 0x76, 0x95, 0xcb, 0xb3, 0xfb, 0xda, 0xea, 0xd4, 0xd6, - 0x19, 0x45, 0x97, 0xbe, 0xfd, 0xf6, 0xeb, 0xe3, 0xc2, 0x3a, 0xe9, 0xd0, 0x02, 0x70, 0x5b, 0x70, - 0xf5, 0x12, 0xf2, 0x03, 0x3a, 0xf3, 0x36, 0x91, 0x11, 0xc2, 0xab, 0x95, 0x6d, 0x21, 0x5b, 0x33, - 0x35, 0x6b, 0xf6, 0xbb, 0x75, 0xf7, 0x1c, 0x48, 0xeb, 0xff, 0xb1, 0xf6, 0xff, 0x90, 0xf4, 0x6b, - 0xfd, 0x9b, 0xcb, 0x1e, 0x96, 0x44, 0xbb, 0xcc, 0x30, 0xd1, 0xd7, 0xf6, 0x2e, 0xbd, 0x21, 0x5f, - 0x11, 0x6e, 0x56, 0xaa, 0xf5, 0x92, 0x64, 0x4e, 0xba, 0x9a, 0x55, 0x9f, 0x93, 0xae, 0x6e, 0x67, - 0xdd, 0x6d, 0x9d, 0xee, 0x1e, 0xd9, 0x3a, 0x6f, 0xba, 0xfe, 0xe0, 0x78, 0xec, 0xa0, 0x93, 0xb1, - 0x83, 0x46, 0x63, 0x07, 0xfd, 0x1c, 0x3b, 0xe8, 0xc3, 0xc4, 0x69, 0x9c, 0x4c, 0x9c, 0xc6, 0x68, - 0xe2, 0x34, 0x9e, 0x77, 0xa3, 0x58, 0xed, 0x0f, 0x03, 0x2f, 0x84, 0x74, 0x86, 0xc2, 0xab, 0x29, - 0x0d, 0x75, 0x94, 0x71, 0x19, 0x2c, 0xe9, 0xef, 0xe4, 0x9d, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x91, 0x06, 0x9f, 0xe7, 0x19, 0x06, 0x00, 0x00, + // 554 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4f, 0x6b, 0x13, 0x41, + 0x14, 0xcf, 0xd4, 0x1a, 0xe9, 0x78, 0x72, 0x6c, 0x21, 0x2c, 0xb2, 0xd5, 0x45, 0x13, 0x5b, 0x70, + 0x87, 0x46, 0x94, 0x2a, 0x14, 0x4c, 0x14, 0x05, 0x41, 0x88, 0xc1, 0x93, 0x97, 0x32, 0xbb, 0x1d, + 0xb6, 0x4b, 0x77, 0xe7, 0x6d, 0x77, 0x26, 0x6a, 0x11, 0x2f, 0x1e, 0xf5, 0x22, 0xf8, 0x25, 0x3c, + 0xfa, 0x05, 0xbc, 0xf7, 0x58, 0xf5, 0x60, 0x4f, 0x22, 0x89, 0xe0, 0xd7, 0x90, 0x9d, 0x99, 0x68, + 0x4a, 0x37, 0x59, 0x2c, 0x5e, 0xc2, 0x66, 0xe7, 0xfd, 0xfe, 0xbd, 0xf7, 0x66, 0xb1, 0x9b, 0xc1, + 0x8e, 0xca, 0x21, 0x49, 0x68, 0x1a, 0x47, 0x39, 0x53, 0x31, 0x08, 0xba, 0x3b, 0xe0, 0xf9, 0x9e, + 0x9f, 0xe5, 0xa0, 0x80, 0x90, 0xf1, 0xb9, 0xff, 0xe7, 0xdc, 0x39, 0xc7, 0xd2, 0x58, 0x00, 0xd5, + 0xbf, 0xa6, 0xcc, 0x59, 0x8c, 0x20, 0x02, 0xfd, 0x48, 0x8b, 0x27, 0xfb, 0xf6, 0x42, 0x04, 0x10, + 0x25, 0x9c, 0xb2, 0x2c, 0xa6, 0x4c, 0x08, 0x50, 0x1a, 0x2f, 0xed, 0xe9, 0x6a, 0x08, 0x32, 0x05, + 0x49, 0x03, 0x26, 0xb9, 0xd1, 0xa4, 0xcf, 0xd6, 0x02, 0xae, 0xd8, 0x1a, 0xcd, 0x58, 0x14, 0x0b, + 0x5d, 0x6c, 0x6b, 0x97, 0x4b, 0x6c, 0x66, 0x2c, 0x67, 0xe9, 0x98, 0xac, 0x59, 0x52, 0x90, 0x42, + 0x2e, 0xf9, 0x26, 0x88, 0x70, 0x9b, 0xc5, 0x96, 0xc8, 0x5b, 0xc4, 0xe4, 0x71, 0x21, 0xd5, 0xd3, + 0xe0, 0x3e, 0xdf, 0x1d, 0x70, 0xa9, 0xbc, 0x27, 0xf8, 0xfc, 0x91, 0xb7, 0x32, 0x03, 0x21, 0x39, + 0xd9, 0xc0, 0x75, 0x23, 0xd2, 0x40, 0x17, 0xd1, 0xd5, 0xb3, 0x6d, 0xc7, 0x3f, 0xde, 0x0d, 0xdf, + 0x60, 0xba, 0x0b, 0xfb, 0xdf, 0x97, 0x6b, 0x1f, 0x7e, 0x7d, 0x5c, 0x45, 0x7d, 0x0b, 0xf2, 0x36, + 0xf0, 0x25, 0xcd, 0xfa, 0xa8, 0xf0, 0x71, 0x37, 0x61, 0x71, 0xca, 0x82, 0x84, 0x77, 0xc2, 0x10, + 0x06, 0x42, 0x59, 0x69, 0xd2, 0xc0, 0x67, 0xd8, 0xd6, 0x56, 0xce, 0xa5, 0x11, 0x59, 0xe8, 0x8f, + 0xff, 0x7a, 0x6f, 0x11, 0xf6, 0x66, 0xe1, 0xad, 0x49, 0x8e, 0x97, 0xd2, 0xb2, 0x02, 0xeb, 0x79, + 0xa5, 0xcc, 0x73, 0x29, 0x63, 0x77, 0xbe, 0x88, 0xd0, 0x2f, 0x67, 0xf3, 0x04, 0xbe, 0xac, 0xcd, + 0x74, 0x92, 0x64, 0x66, 0x9e, 0xfb, 0x18, 0xff, 0x9d, 0x9e, 0xf5, 0xd0, 0xf4, 0xcd, 0xa8, 0xfd, + 0x62, 0xd4, 0xbe, 0x59, 0x2f, 0x3b, 0x6a, 0xbf, 0xc7, 0x22, 0x6e, 0xb1, 0xfd, 0x09, 0xa4, 0xf7, + 0x0d, 0xe1, 0x2b, 0x15, 0x82, 0xd5, 0x0d, 0x38, 0xf5, 0xff, 0x1a, 0x40, 0x1e, 0x1c, 0x09, 0x36, + 0xa7, 0x83, 0xb5, 0x2a, 0x83, 0x19, 0x8f, 0x93, 0xc9, 0xda, 0x9f, 0xe6, 0xf1, 0x69, 0x9d, 0x8c, + 0xbc, 0x41, 0xb8, 0x6e, 0xd6, 0x87, 0x34, 0xcb, 0x5c, 0x1e, 0xdf, 0x54, 0xa7, 0x55, 0x59, 0x67, + 0x14, 0x3d, 0xfa, 0xfa, 0xeb, 0xcf, 0xf7, 0x73, 0x2b, 0xa4, 0x45, 0x0b, 0xc0, 0x35, 0xc1, 0xd5, + 0x73, 0xc8, 0x77, 0xe8, 0xd4, 0x7b, 0x44, 0xbe, 0x20, 0xbc, 0x54, 0xda, 0x16, 0x72, 0x63, 0xaa, + 0xe6, 0xac, 0x4d, 0x70, 0x6e, 0xfe, 0x2b, 0xcc, 0x3a, 0x7f, 0xa8, 0x9d, 0xdf, 0x23, 0xdd, 0x4a, + 0xe7, 0xe6, 0x82, 0x87, 0x63, 0xa2, 0x4d, 0x66, 0x98, 0xe8, 0x4b, 0x7b, 0x85, 0x5e, 0x91, 0xcf, + 0x08, 0x37, 0x4a, 0xd5, 0x3a, 0x49, 0x42, 0xd6, 0xa7, 0x1a, 0xac, 0x58, 0x72, 0xe7, 0xd6, 0x09, + 0x90, 0x36, 0xdd, 0x1d, 0x9d, 0xee, 0x36, 0x59, 0x3f, 0x69, 0xba, 0x6e, 0x6f, 0x7f, 0xe8, 0xa2, + 0x83, 0xa1, 0x8b, 0x0e, 0x87, 0x2e, 0xfa, 0x31, 0x74, 0xd1, 0xbb, 0x91, 0x5b, 0x3b, 0x18, 0xb9, + 0xb5, 0xc3, 0x91, 0x5b, 0x7b, 0xda, 0x8e, 0x62, 0xb5, 0x3d, 0x08, 0xfc, 0x10, 0xd2, 0x29, 0x0a, + 0x2f, 0x26, 0x34, 0xd4, 0x5e, 0xc6, 0x65, 0x50, 0xd7, 0xdf, 0xc6, 0xeb, 0xbf, 0x03, 0x00, 0x00, + 0xff, 0xff, 0x71, 0xcb, 0xeb, 0x93, 0x0d, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -339,7 +339,7 @@ type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Queries a list of MorseClaimableAccount items. - MorseClaimableAccount(ctx context.Context, in *QueryGetMorseClaimableAccountRequest, opts ...grpc.CallOption) (*QueryGetMorseClaimableAccountResponse, error) + MorseClaimableAccount(ctx context.Context, in *QueryMorseClaimableAccountRequest, opts ...grpc.CallOption) (*QueryMorseClaimableAccountResponse, error) MorseClaimableAccountAll(ctx context.Context, in *QueryAllMorseClaimableAccountRequest, opts ...grpc.CallOption) (*QueryAllMorseClaimableAccountResponse, error) } @@ -360,8 +360,8 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) MorseClaimableAccount(ctx context.Context, in *QueryGetMorseClaimableAccountRequest, opts ...grpc.CallOption) (*QueryGetMorseClaimableAccountResponse, error) { - out := new(QueryGetMorseClaimableAccountResponse) +func (c *queryClient) MorseClaimableAccount(ctx context.Context, in *QueryMorseClaimableAccountRequest, opts ...grpc.CallOption) (*QueryMorseClaimableAccountResponse, error) { + out := new(QueryMorseClaimableAccountResponse) err := c.cc.Invoke(ctx, "/poktroll.migration.Query/MorseClaimableAccount", in, out, opts...) if err != nil { return nil, err @@ -383,7 +383,7 @@ type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // Queries a list of MorseClaimableAccount items. - MorseClaimableAccount(context.Context, *QueryGetMorseClaimableAccountRequest) (*QueryGetMorseClaimableAccountResponse, error) + MorseClaimableAccount(context.Context, *QueryMorseClaimableAccountRequest) (*QueryMorseClaimableAccountResponse, error) MorseClaimableAccountAll(context.Context, *QueryAllMorseClaimableAccountRequest) (*QueryAllMorseClaimableAccountResponse, error) } @@ -394,7 +394,7 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (*UnimplementedQueryServer) MorseClaimableAccount(ctx context.Context, req *QueryGetMorseClaimableAccountRequest) (*QueryGetMorseClaimableAccountResponse, error) { +func (*UnimplementedQueryServer) MorseClaimableAccount(ctx context.Context, req *QueryMorseClaimableAccountRequest) (*QueryMorseClaimableAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MorseClaimableAccount not implemented") } func (*UnimplementedQueryServer) MorseClaimableAccountAll(ctx context.Context, req *QueryAllMorseClaimableAccountRequest) (*QueryAllMorseClaimableAccountResponse, error) { @@ -424,7 +424,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } func _Query_MorseClaimableAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetMorseClaimableAccountRequest) + in := new(QueryMorseClaimableAccountRequest) if err := dec(in); err != nil { return nil, err } @@ -436,7 +436,7 @@ func _Query_MorseClaimableAccount_Handler(srv interface{}, ctx context.Context, FullMethod: "/poktroll.migration.Query/MorseClaimableAccount", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).MorseClaimableAccount(ctx, req.(*QueryGetMorseClaimableAccountRequest)) + return srv.(QueryServer).MorseClaimableAccount(ctx, req.(*QueryMorseClaimableAccountRequest)) } return interceptor(ctx, in, info, handler) } @@ -537,7 +537,7 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryGetMorseClaimableAccountRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryMorseClaimableAccountRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -547,12 +547,12 @@ func (m *QueryGetMorseClaimableAccountRequest) Marshal() (dAtA []byte, err error return dAtA[:n], nil } -func (m *QueryGetMorseClaimableAccountRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryMorseClaimableAccountRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetMorseClaimableAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryMorseClaimableAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -567,7 +567,7 @@ func (m *QueryGetMorseClaimableAccountRequest) MarshalToSizedBuffer(dAtA []byte) return len(dAtA) - i, nil } -func (m *QueryGetMorseClaimableAccountResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryMorseClaimableAccountResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -577,12 +577,12 @@ func (m *QueryGetMorseClaimableAccountResponse) Marshal() (dAtA []byte, err erro return dAtA[:n], nil } -func (m *QueryGetMorseClaimableAccountResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryMorseClaimableAccountResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetMorseClaimableAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryMorseClaimableAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -715,7 +715,7 @@ func (m *QueryParamsResponse) Size() (n int) { return n } -func (m *QueryGetMorseClaimableAccountRequest) Size() (n int) { +func (m *QueryMorseClaimableAccountRequest) Size() (n int) { if m == nil { return 0 } @@ -728,7 +728,7 @@ func (m *QueryGetMorseClaimableAccountRequest) Size() (n int) { return n } -func (m *QueryGetMorseClaimableAccountResponse) Size() (n int) { +func (m *QueryMorseClaimableAccountResponse) Size() (n int) { if m == nil { return 0 } @@ -910,7 +910,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetMorseClaimableAccountRequest) Unmarshal(dAtA []byte) error { +func (m *QueryMorseClaimableAccountRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -933,10 +933,10 @@ func (m *QueryGetMorseClaimableAccountRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetMorseClaimableAccountRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMorseClaimableAccountRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetMorseClaimableAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMorseClaimableAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -992,7 +992,7 @@ func (m *QueryGetMorseClaimableAccountRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetMorseClaimableAccountResponse) Unmarshal(dAtA []byte) error { +func (m *QueryMorseClaimableAccountResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1015,10 +1015,10 @@ func (m *QueryGetMorseClaimableAccountResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetMorseClaimableAccountResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMorseClaimableAccountResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetMorseClaimableAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMorseClaimableAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/migration/types/query.pb.gw.go b/x/migration/types/query.pb.gw.go index d2223adbb..389e38b9e 100644 --- a/x/migration/types/query.pb.gw.go +++ b/x/migration/types/query.pb.gw.go @@ -52,7 +52,7 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } func request_Query_MorseClaimableAccount_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetMorseClaimableAccountRequest + var protoReq QueryMorseClaimableAccountRequest var metadata runtime.ServerMetadata var ( @@ -79,7 +79,7 @@ func request_Query_MorseClaimableAccount_0(ctx context.Context, marshaler runtim } func local_request_Query_MorseClaimableAccount_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetMorseClaimableAccountRequest + var protoReq QueryMorseClaimableAccountRequest var metadata runtime.ServerMetadata var ( From 10208dc68b15451ee1df12f82119463d32778b5b Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 18 Feb 2025 14:31:03 +0100 Subject: [PATCH 27/81] chore: add app/supplier keepers as migration module deps --- testutil/integration/app.go | 4 ++++ testutil/keeper/migration.go | 18 ++++++++++++++++++ testutil/keeper/tokenomics.go | 2 ++ x/migration/keeper/keeper.go | 23 ++++++++++++++--------- x/migration/module/module.go | 22 +++++++++++++++++----- x/migration/types/expected_keepers.go | 14 +++++++++++++- 6 files changed, 68 insertions(+), 15 deletions(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index c2ce36e89..5eadaf4f2 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -526,12 +526,16 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOptionFn) *Ap authority.String(), accountKeeper, bankKeeper, + applicationKeeper, + supplierKeeper, ) migrationModule := migration.NewAppModule( cdc, migrationKeeper, accountKeeper, bankKeeper, + applicationKeeper, + supplierKeeper, ) // Prepare the message & query routers diff --git a/testutil/keeper/migration.go b/testutil/keeper/migration.go index 363ac76e1..2ec0ede3b 100644 --- a/testutil/keeper/migration.go +++ b/testutil/keeper/migration.go @@ -61,6 +61,22 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { mockAccountKeeper := mocks.NewMockAccountKeeper(ctrl) + mockAppKeeper := mocks.NewMockApplicationKeeper(ctrl) + mockAppKeeper.EXPECT(). + GetApplication(gomock.Any(), gomock.Any()). + AnyTimes() + mockAppKeeper.EXPECT(). + SetApplication(gomock.Any(), gomock.Any()). + AnyTimes() + + mockSupplierKeeper := mocks.NewMockSupplierKeeper(ctrl) + mockSupplierKeeper.EXPECT(). + GetSupplier(gomock.Any(), gomock.Any()). + AnyTimes() + mockSupplierKeeper.EXPECT(). + SetSupplier(gomock.Any(), gomock.Any()). + AnyTimes() + k := keeper.NewKeeper( cdc, runtime.NewKVStoreService(storeKey), @@ -68,6 +84,8 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { authority.String(), mockAccountKeeper, mockBankKeeper, + mockAppKeeper, + mockSupplierKeeper, ) ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) diff --git a/testutil/keeper/tokenomics.go b/testutil/keeper/tokenomics.go index f3c70cc99..7483d2747 100644 --- a/testutil/keeper/tokenomics.go +++ b/testutil/keeper/tokenomics.go @@ -534,6 +534,8 @@ func NewTokenomicsModuleKeepers( authority.String(), accountKeeper, bankKeeper, + appKeeper, + supplierKeeper, ) require.NoError(t, migrationKeeper.SetParams(sdkCtx, migrationtypes.DefaultParams())) diff --git a/x/migration/keeper/keeper.go b/x/migration/keeper/keeper.go index b4019db3f..e695a04e9 100644 --- a/x/migration/keeper/keeper.go +++ b/x/migration/keeper/keeper.go @@ -21,8 +21,10 @@ type ( // should be the x/gov module account. authority string - accountKeeper types.AccountKeeper - bankKeeper types.BankKeeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper + appKeeper types.ApplicationKeeper + supplierKeeper types.SupplierKeeper } ) @@ -33,19 +35,22 @@ func NewKeeper( authority string, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, - + appKeeper types.ApplicationKeeper, + supplierKeeper types.SupplierKeeper, ) Keeper { if _, err := sdk.AccAddressFromBech32(authority); err != nil { panic(fmt.Sprintf("invalid authority address: %s", authority)) } return Keeper{ - cdc: cdc, - storeService: storeService, - authority: authority, - logger: logger, - accountKeeper: accountKeeper, - bankKeeper: bankKeeper, + cdc: cdc, + storeService: storeService, + authority: authority, + logger: logger, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + appKeeper: appKeeper, + supplierKeeper: supplierKeeper, } } diff --git a/x/migration/module/module.go b/x/migration/module/module.go index 53cb8fc7d..cfeb50b84 100644 --- a/x/migration/module/module.go +++ b/x/migration/module/module.go @@ -95,9 +95,11 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *r type AppModule struct { AppModuleBasic - keeper keeper.Keeper - accountKeeper types.AccountKeeper - bankKeeper types.BankKeeper + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper + appKeeper types.ApplicationKeeper + supplierKeeper types.SupplierKeeper } func NewAppModule( @@ -105,12 +107,16 @@ func NewAppModule( keeper keeper.Keeper, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, + appKeeper types.ApplicationKeeper, + supplierKeeper types.SupplierKeeper, ) AppModule { return AppModule{ AppModuleBasic: NewAppModuleBasic(cdc), keeper: keeper, accountKeeper: accountKeeper, bankKeeper: bankKeeper, + appKeeper: appKeeper, + supplierKeeper: supplierKeeper, } } @@ -180,8 +186,10 @@ type ModuleInputs struct { Config *modulev1.Module Logger log.Logger - AccountKeeper types.AccountKeeper - BankKeeper types.BankKeeper + AccountKeeper types.AccountKeeper + BankKeeper types.BankKeeper + ApplicationKeeper types.ApplicationKeeper + SupplierKeeper types.SupplierKeeper } type ModuleOutputs struct { @@ -204,12 +212,16 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { authority.String(), in.AccountKeeper, in.BankKeeper, + in.ApplicationKeeper, + in.SupplierKeeper, ) m := NewAppModule( in.Cdc, k, in.AccountKeeper, in.BankKeeper, + in.ApplicationKeeper, + in.SupplierKeeper, ) return ModuleOutputs{MigrationKeeper: k, Module: m} diff --git a/x/migration/types/expected_keepers.go b/x/migration/types/expected_keepers.go index 64aa3a3e3..e0cddb646 100644 --- a/x/migration/types/expected_keepers.go +++ b/x/migration/types/expected_keepers.go @@ -1,4 +1,4 @@ -//go:generate go run go.uber.org/mock/mockgen -destination ../../../testutil/migration/mocks/expected_keepers_mock.go -package mocks . AccountKeeper,BankKeeper +//go:generate go run go.uber.org/mock/mockgen -destination ../../../testutil/migration/mocks/expected_keepers_mock.go -package mocks . AccountKeeper,BankKeeper,ApplicationKeeper,SupplierKeeper package types @@ -6,6 +6,9 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" + + apptypes "github.com/pokt-network/poktroll/x/application/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) // AccountKeeper defines the expected interface for the Account module. @@ -22,6 +25,15 @@ type BankKeeper interface { // Methods imported from bank should be defined here } +type ApplicationKeeper interface { + GetApplication(ctx context.Context, appAddr string) (app apptypes.Application, found bool) + SetApplication(ctx context.Context, application apptypes.Application) +} +type SupplierKeeper interface { + GetSupplier(ctx context.Context, supplierOperatorAddr string) (supplier sharedtypes.Supplier, found bool) + SetSupplier(ctx context.Context, supplier sharedtypes.Supplier) +} + // ParamSubspace defines the expected Subspace interface for parameters. type ParamSubspace interface { Get(context.Context, []byte, interface{}) From 49ee23fbb3abee409b672c115c44fca6529c9adb Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 19 Feb 2025 09:25:11 +0100 Subject: [PATCH 28/81] chore: add gateway keeper dep --- testutil/integration/app.go | 1 + testutil/keeper/migration.go | 9 +++++++++ testutil/keeper/tokenomics.go | 1 + x/migration/keeper/keeper.go | 3 +++ x/migration/module/module.go | 2 ++ x/migration/types/expected_keepers.go | 8 +++++++- 6 files changed, 23 insertions(+), 1 deletion(-) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 5eadaf4f2..f0e89fc3f 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -526,6 +526,7 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOptionFn) *Ap authority.String(), accountKeeper, bankKeeper, + gatewayKeeper, applicationKeeper, supplierKeeper, ) diff --git a/testutil/keeper/migration.go b/testutil/keeper/migration.go index 2ec0ede3b..200a67c87 100644 --- a/testutil/keeper/migration.go +++ b/testutil/keeper/migration.go @@ -61,6 +61,14 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { mockAccountKeeper := mocks.NewMockAccountKeeper(ctrl) + mockGatewayKeeper := mocks.NewMockGatewayKeeper(ctrl) + mockGatewayKeeper.EXPECT(). + GetGateway(gomock.Any(), gomock.Any()). + AnyTimes() + mockGatewayKeeper.EXPECT(). + SetGateway(gomock.Any(), gomock.Any()). + AnyTimes() + mockAppKeeper := mocks.NewMockApplicationKeeper(ctrl) mockAppKeeper.EXPECT(). GetApplication(gomock.Any(), gomock.Any()). @@ -84,6 +92,7 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { authority.String(), mockAccountKeeper, mockBankKeeper, + mockGatewayKeeper, mockAppKeeper, mockSupplierKeeper, ) diff --git a/testutil/keeper/tokenomics.go b/testutil/keeper/tokenomics.go index 7483d2747..bf16a8776 100644 --- a/testutil/keeper/tokenomics.go +++ b/testutil/keeper/tokenomics.go @@ -534,6 +534,7 @@ func NewTokenomicsModuleKeepers( authority.String(), accountKeeper, bankKeeper, + gatewayKeeper, appKeeper, supplierKeeper, ) diff --git a/x/migration/keeper/keeper.go b/x/migration/keeper/keeper.go index e695a04e9..1d7f7004c 100644 --- a/x/migration/keeper/keeper.go +++ b/x/migration/keeper/keeper.go @@ -23,6 +23,7 @@ type ( accountKeeper types.AccountKeeper bankKeeper types.BankKeeper + gatewayKeeper types.GatewayKeeper appKeeper types.ApplicationKeeper supplierKeeper types.SupplierKeeper } @@ -35,6 +36,7 @@ func NewKeeper( authority string, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, + gatewayKeeper types.GatewayKeeper, appKeeper types.ApplicationKeeper, supplierKeeper types.SupplierKeeper, ) Keeper { @@ -49,6 +51,7 @@ func NewKeeper( logger: logger, accountKeeper: accountKeeper, bankKeeper: bankKeeper, + gatewayKeeper: gatewayKeeper, appKeeper: appKeeper, supplierKeeper: supplierKeeper, } diff --git a/x/migration/module/module.go b/x/migration/module/module.go index cfeb50b84..341e5e627 100644 --- a/x/migration/module/module.go +++ b/x/migration/module/module.go @@ -188,6 +188,7 @@ type ModuleInputs struct { AccountKeeper types.AccountKeeper BankKeeper types.BankKeeper + GatewayKeeper types.GatewayKeeper ApplicationKeeper types.ApplicationKeeper SupplierKeeper types.SupplierKeeper } @@ -212,6 +213,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { authority.String(), in.AccountKeeper, in.BankKeeper, + in.GatewayKeeper, in.ApplicationKeeper, in.SupplierKeeper, ) diff --git a/x/migration/types/expected_keepers.go b/x/migration/types/expected_keepers.go index e0cddb646..4846e8334 100644 --- a/x/migration/types/expected_keepers.go +++ b/x/migration/types/expected_keepers.go @@ -1,4 +1,4 @@ -//go:generate go run go.uber.org/mock/mockgen -destination ../../../testutil/migration/mocks/expected_keepers_mock.go -package mocks . AccountKeeper,BankKeeper,ApplicationKeeper,SupplierKeeper +//go:generate go run go.uber.org/mock/mockgen -destination ../../../testutil/migration/mocks/expected_keepers_mock.go -package mocks . AccountKeeper,BankKeeper,GatewayKeeper,ApplicationKeeper,SupplierKeeper package types @@ -8,6 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" apptypes "github.com/pokt-network/poktroll/x/application/types" + "github.com/pokt-network/poktroll/x/gateway/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -25,6 +26,11 @@ type BankKeeper interface { // Methods imported from bank should be defined here } +type GatewayKeeper interface { + GetGateway(ctx context.Context, address string) (gateway types.Gateway, found bool) + SetGateway(ctx context.Context, gateway types.Gateway) +} + type ApplicationKeeper interface { GetApplication(ctx context.Context, appAddr string) (app apptypes.Application, found bool) SetApplication(ctx context.Context, application apptypes.Application) From 952bf174b51f0518a8a0d530668e4615057b4324 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 19 Feb 2025 13:04:29 +0100 Subject: [PATCH 29/81] refactor: extract keeper methods from msgServer handler --- x/migration/keeper/morse_claimable_account.go | 51 ++++++++++++++----- .../keeper/msg_server_claim_morse_account.go | 25 ++++----- x/migration/types/morse_claimable_account.go | 7 +++ 3 files changed, 54 insertions(+), 29 deletions(-) create mode 100644 x/migration/types/morse_claimable_account.go diff --git a/x/migration/keeper/morse_claimable_account.go b/x/migration/keeper/morse_claimable_account.go index dd3e3e43a..c47ee5b1f 100644 --- a/x/migration/keeper/morse_claimable_account.go +++ b/x/migration/keeper/morse_claimable_account.go @@ -6,16 +6,17 @@ import ( "cosmossdk.io/store/prefix" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/runtime" + cosmostypes "github.com/cosmos/cosmos-sdk/types" - "github.com/pokt-network/poktroll/x/migration/types" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) // SetMorseClaimableAccount set a specific morseClaimableAccount in the store from its index -func (k Keeper) SetMorseClaimableAccount(ctx context.Context, morseClaimableAccount types.MorseClaimableAccount) { +func (k Keeper) SetMorseClaimableAccount(ctx context.Context, morseClaimableAccount migrationtypes.MorseClaimableAccount) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.MorseClaimableAccountKeyPrefix)) + store := prefix.NewStore(storeAdapter, migrationtypes.KeyPrefix(migrationtypes.MorseClaimableAccountKeyPrefix)) morseClaimableAccountBz := k.cdc.MustMarshal(&morseClaimableAccount) - store.Set(types.MorseClaimableAccountKey( + store.Set(migrationtypes.MorseClaimableAccountKey( morseClaimableAccount.MorseSrcAddress, ), morseClaimableAccountBz) } @@ -25,11 +26,11 @@ func (k Keeper) GetMorseClaimableAccount( ctx context.Context, address string, -) (morseClaimableAccount types.MorseClaimableAccount, found bool) { +) (morseClaimableAccount migrationtypes.MorseClaimableAccount, found bool) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.MorseClaimableAccountKeyPrefix)) + store := prefix.NewStore(storeAdapter, migrationtypes.KeyPrefix(migrationtypes.MorseClaimableAccountKeyPrefix)) - morseClaimableAccountBz := store.Get(types.MorseClaimableAccountKey( + morseClaimableAccountBz := store.Get(migrationtypes.MorseClaimableAccountKey( address, )) if morseClaimableAccountBz == nil { @@ -47,22 +48,22 @@ func (k Keeper) RemoveMorseClaimableAccount( ) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.MorseClaimableAccountKeyPrefix)) - store.Delete(types.MorseClaimableAccountKey( + store := prefix.NewStore(storeAdapter, migrationtypes.KeyPrefix(migrationtypes.MorseClaimableAccountKeyPrefix)) + store.Delete(migrationtypes.MorseClaimableAccountKey( address, )) } // GetAllMorseClaimableAccounts returns all morseClaimableAccount -func (k Keeper) GetAllMorseClaimableAccounts(ctx context.Context) (list []types.MorseClaimableAccount) { +func (k Keeper) GetAllMorseClaimableAccounts(ctx context.Context) (list []migrationtypes.MorseClaimableAccount) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.MorseClaimableAccountKeyPrefix)) + store := prefix.NewStore(storeAdapter, migrationtypes.KeyPrefix(migrationtypes.MorseClaimableAccountKeyPrefix)) iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var morseClaimableAccount types.MorseClaimableAccount + var morseClaimableAccount migrationtypes.MorseClaimableAccount k.cdc.MustUnmarshal(iterator.Value(), &morseClaimableAccount) list = append(list, morseClaimableAccount) } @@ -75,7 +76,7 @@ func (k Keeper) GetAllMorseClaimableAccounts(ctx context.Context) (list []types. // DEV_NOTE: It assumes that the MorseAccountState has already been validated. func (k Keeper) ImportFromMorseAccountState( ctx context.Context, - morseAccountState *types.MorseAccountState, + morseAccountState *migrationtypes.MorseAccountState, ) { for _, morseAccount := range morseAccountState.Accounts { // DEV_NOTE: Ensure all MorseClaimableAccounts are initially unclaimed. @@ -83,3 +84,27 @@ func (k Keeper) ImportFromMorseAccountState( k.SetMorseClaimableAccount(ctx, *morseAccount) } } + +// MintClaimedMorseTokens mints the given coinToMint to the given destAddress. +func (k Keeper) MintClaimedMorseTokens( + ctx context.Context, + destAddress cosmostypes.AccAddress, + coinToMint cosmostypes.Coin, +) error { + // Mint the sum of the account balance (coinToMint) and any actor stakes to the migration module account. + if err := k.bankKeeper.MintCoins( + ctx, + migrationtypes.ModuleName, + cosmostypes.NewCoins(coinToMint), + ); err != nil { + return err + } + + // Transfer the coinToMint to the shannonDestAddress account. + return k.bankKeeper.SendCoinsFromModuleToAccount( + ctx, + migrationtypes.ModuleName, + destAddress, + cosmostypes.NewCoins(coinToMint), + ) +} diff --git a/x/migration/keeper/msg_server_claim_morse_account.go b/x/migration/keeper/msg_server_claim_morse_account.go index 0035ed266..1bf758e71 100644 --- a/x/migration/keeper/msg_server_claim_morse_account.go +++ b/x/migration/keeper/msg_server_claim_morse_account.go @@ -4,7 +4,7 @@ import ( "context" cosmostypes "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" + cosmoserrors "github.com/cosmos/cosmos-sdk/types/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -24,7 +24,7 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms if err != nil { return nil, status.Error( codes.InvalidArgument, - errors.ErrInvalidAddress.Wrapf( + cosmoserrors.ErrInvalidAddress.Wrapf( "failed to parse shannon destination address (%s): %s", msg.ShannonDestAddress, err, ).Error(), @@ -47,8 +47,7 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms } // Ensure that the given MorseClaimableAccount has not already been claimed. - if morseClaimableAccount.ClaimedAtHeight > 0 || - morseClaimableAccount.ShannonDestAddress != "" { + if morseClaimableAccount.IsClaimed() { return nil, status.Error( codes.FailedPrecondition, migrationtypes.ErrMorseAccountClaim.Wrapf( @@ -60,8 +59,11 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms ) } - // Update the MorseClaimableAccount + // Set ShannonDestAddress & ClaimedAtHeight (claim). + morseClaimableAccount.ShannonDestAddress = shannonAccAddr.String() morseClaimableAccount.ClaimedAtHeight = sdkCtx.BlockHeight() + + // Update the MorseClaimableAccount. k.SetMorseClaimableAccount( sdkCtx, morseClaimableAccount, @@ -73,17 +75,8 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms Add(morseClaimableAccount.ApplicationStake). Add(morseClaimableAccount.SupplierStake) - // Mint the sum of the account balance (totalTokens) and any actor stakes to the migration module account. - if err = k.bankKeeper.MintCoins(ctx, migrationtypes.ModuleName, cosmostypes.NewCoins(totalTokens)); err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - // Transfer the totalTokens to the shannonDestAddress account. - if err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, - migrationtypes.ModuleName, - shannonAccAddr, - cosmostypes.NewCoins(totalTokens), - ); err != nil { + // Mint the totalTokens to the shannonDestAddress account balance. + if err = k.MintClaimedMorseTokens(ctx, shannonAccAddr, totalTokens); err != nil { return nil, status.Error(codes.Internal, err.Error()) } diff --git a/x/migration/types/morse_claimable_account.go b/x/migration/types/morse_claimable_account.go new file mode 100644 index 000000000..39fc1af01 --- /dev/null +++ b/x/migration/types/morse_claimable_account.go @@ -0,0 +1,7 @@ +package types + +// IsClaimed returns true if the MorseClaimableAccount has been claimed; +// i.e. ShannonDestAddress is not empty OR the ClaimedAtHeight is greater than 0. +func (m *MorseClaimableAccount) IsClaimed() bool { + return m.ShannonDestAddress != "" || m.ClaimedAtHeight > 0 +} From b49e9ad2da6d85536f05d3a48f1aa89890b608c4 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 19 Feb 2025 13:04:47 +0100 Subject: [PATCH 30/81] test: refactor testutil --- .../morse_account_import_and_claim_test.go | 1 + testutil/keeper/migration.go | 77 +++++++++++++------ .../msg_server_claim_morse_acount_test.go | 1 + 3 files changed, 56 insertions(+), 23 deletions(-) diff --git a/tests/integration/migration/morse_account_import_and_claim_test.go b/tests/integration/migration/morse_account_import_and_claim_test.go index 64daf7630..77b4cbeb2 100644 --- a/tests/integration/migration/morse_account_import_and_claim_test.go +++ b/tests/integration/migration/morse_account_import_and_claim_test.go @@ -85,6 +85,7 @@ func TestMsgServer_CreateMorseAccountClaim(t *testing.T) { // Assert that the MorseClaimableAccount was updated on-chain. expectedMorseClaimableAccount := *accountState.Accounts[0] + expectedMorseClaimableAccount.ShannonDestAddress = shannonDestAddr expectedMorseClaimableAccount.ClaimedAtHeight = app.GetSdkCtx().BlockHeight() - 1 morseAccountQuerier := migrationtypes.NewQueryClient(app.QueryHelper()) diff --git a/testutil/keeper/migration.go b/testutil/keeper/migration.go index 363ac76e1..400bcedf3 100644 --- a/testutil/keeper/migration.go +++ b/testutil/keeper/migration.go @@ -21,11 +21,26 @@ import ( "github.com/pokt-network/poktroll/testutil/migration/mocks" "github.com/pokt-network/poktroll/x/migration/keeper" - "github.com/pokt-network/poktroll/x/migration/types" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) -func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { - storeKey := storetypes.NewKVStoreKey(types.StoreKey) +// MigrationKeeperConfig is a configuration struct for the MigrationKeeper testutil. +type MigrationKeeperConfig struct { + bankKeeper migrationtypes.BankKeeper +} + +// MigrationKeeperOptionFn is a function which receives and potentially modifies +// the MigrationKeeperConfig during construction of the MigrationKeeper testutil. +type MigrationKeeperOptionFn func(cfg *MigrationKeeperConfig) + +// MigrationKeeper returns a new migration module keeper with mocked dependencies +// (i.e. gateway, app, & supplier keepers). Mocked dependencies are configurable +// via the MigrationKeeperOptionFns. +func MigrationKeeper( + t testing.TB, + opts ...MigrationKeeperOptionFn, +) (keeper.Keeper, sdk.Context) { + storeKey := storetypes.NewKVStoreKey(migrationtypes.StoreKey) db := dbm.NewMemDB() stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) @@ -37,6 +52,40 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { authority := authtypes.NewModuleAddress(govtypes.ModuleName) ctrl := gomock.NewController(t) + mockAccountKeeper := mocks.NewMockAccountKeeper(ctrl) + + cfg := defaultConfigWithMocks(ctrl) + for _, opt := range opts { + opt(cfg) + } + + k := keeper.NewKeeper( + cdc, + runtime.NewKVStoreService(storeKey), + log.NewNopLogger(), + authority.String(), + mockAccountKeeper, + cfg.bankKeeper, + ) + + ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) + + // Initialize params + if err := k.SetParams(ctx, migrationtypes.DefaultParams()); err != nil { + panic(err) + } + + return k, ctx +} + +// WithBankKeeper assigns the given BankKeeper to the MigrationKeeperConfig. +func WithBankKeeper(bankKeeper migrationtypes.BankKeeper) MigrationKeeperOptionFn { + return func(cfg *MigrationKeeperConfig) { + cfg.bankKeeper = bankKeeper + } +} + +func defaultConfigWithMocks(ctrl *gomock.Controller) *MigrationKeeperConfig { mockBankKeeper := mocks.NewMockBankKeeper(ctrl) mockBankKeeper.EXPECT(). SpendableCoins(gomock.Any(), gomock.Any()). @@ -50,32 +99,14 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { return sdk.Coins{} }, ).AnyTimes() - mockBankKeeper.EXPECT(). MintCoins(gomock.Any(), gomock.Any(), gomock.Any()). AnyTimes() - mockBankKeeper.EXPECT(). SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). AnyTimes() - mockAccountKeeper := mocks.NewMockAccountKeeper(ctrl) - - k := keeper.NewKeeper( - cdc, - runtime.NewKVStoreService(storeKey), - log.NewNopLogger(), - authority.String(), - mockAccountKeeper, - mockBankKeeper, - ) - - ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) - - // Initialize params - if err := k.SetParams(ctx, types.DefaultParams()); err != nil { - panic(err) + return &MigrationKeeperConfig{ + bankKeeper: mockBankKeeper, } - - return k, ctx } diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go index 736d12544..edb204823 100644 --- a/x/migration/keeper/msg_server_claim_morse_acount_test.go +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -68,6 +68,7 @@ func TestMsgServer_ClaimMorseAccount_Success(t *testing.T) { // Assert that the persisted MorseClaimableAccount is updated. expectedMorseAccount := morseAccount + expectedMorseAccount.ShannonDestAddress = msgClaim.GetShannonDestAddress() expectedMorseAccount.ClaimedAtHeight = ctx.BlockHeight() foundMorseAccount, found := k.GetMorseClaimableAccount(ctx, msgClaim.MorseSrcAddress) require.True(t, found) From f08fd003a482a125435cd59d652c3df250082a4b Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 19 Feb 2025 13:08:04 +0100 Subject: [PATCH 31/81] test: refactor testutil --- testutil/keeper/migration.go | 110 ++++++++++++++++++++++++++--------- 1 file changed, 84 insertions(+), 26 deletions(-) diff --git a/testutil/keeper/migration.go b/testutil/keeper/migration.go index 200a67c87..67d72000c 100644 --- a/testutil/keeper/migration.go +++ b/testutil/keeper/migration.go @@ -21,11 +21,29 @@ import ( "github.com/pokt-network/poktroll/testutil/migration/mocks" "github.com/pokt-network/poktroll/x/migration/keeper" - "github.com/pokt-network/poktroll/x/migration/types" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) -func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { - storeKey := storetypes.NewKVStoreKey(types.StoreKey) +// MigrationKeeperConfig is a configuration struct for the MigrationKeeper testutil. +type MigrationKeeperConfig struct { + bankKeeper migrationtypes.BankKeeper + gatewayKeeper migrationtypes.GatewayKeeper + appKeeper migrationtypes.ApplicationKeeper + supplierKeeper migrationtypes.SupplierKeeper +} + +// MigrationKeeperOptionFn is a function which receives and potentially modifies +// the MigrationKeeperConfig during construction of the MigrationKeeper testutil. +type MigrationKeeperOptionFn func(cfg *MigrationKeeperConfig) + +// MigrationKeeper returns a new migration module keeper with mocked dependencies +// (i.e. gateway, app, & supplier keepers). Mocked dependencies are configurable +// via the MigrationKeeperOptionFns. +func MigrationKeeper( + t testing.TB, + opts ...MigrationKeeperOptionFn, +) (keeper.Keeper, sdk.Context) { + storeKey := storetypes.NewKVStoreKey(migrationtypes.StoreKey) db := dbm.NewMemDB() stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) @@ -37,6 +55,64 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { authority := authtypes.NewModuleAddress(govtypes.ModuleName) ctrl := gomock.NewController(t) + mockAccountKeeper := mocks.NewMockAccountKeeper(ctrl) + + cfg := defaultConfigWithMocks(ctrl) + for _, opt := range opts { + opt(cfg) + } + + k := keeper.NewKeeper( + cdc, + runtime.NewKVStoreService(storeKey), + log.NewNopLogger(), + authority.String(), + mockAccountKeeper, + cfg.bankKeeper, + cfg.gatewayKeeper, + cfg.appKeeper, + cfg.supplierKeeper, + ) + + ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) + + // Initialize params + if err := k.SetParams(ctx, migrationtypes.DefaultParams()); err != nil { + panic(err) + } + + return k, ctx +} + +// WithBankKeeper assigns the given BankKeeper to the MigrationKeeperConfig. +func WithBankKeeper(bankKeeper migrationtypes.BankKeeper) MigrationKeeperOptionFn { + return func(cfg *MigrationKeeperConfig) { + cfg.bankKeeper = bankKeeper + } +} + +// WithGatewayKeeper assigns the given GatewayKeeper to the MigrationKeeperConfig. +func WithGatewayKeeper(gatewayKeeper migrationtypes.GatewayKeeper) MigrationKeeperOptionFn { + return func(cfg *MigrationKeeperConfig) { + cfg.gatewayKeeper = gatewayKeeper + } +} + +// WithApplicationKeeper assigns the given ApplicationKeeper to the MigrationKeeperConfig. +func WithApplicationKeeper(appKeeper migrationtypes.ApplicationKeeper) MigrationKeeperOptionFn { + return func(cfg *MigrationKeeperConfig) { + cfg.appKeeper = appKeeper + } +} + +// WithSupplierKeeper assigns the given SupplierKeeper to the MigrationKeeperConfig. +func WithSupplierKeeper(supplierKeeper migrationtypes.SupplierKeeper) MigrationKeeperOptionFn { + return func(cfg *MigrationKeeperConfig) { + cfg.supplierKeeper = supplierKeeper + } +} + +func defaultConfigWithMocks(ctrl *gomock.Controller) *MigrationKeeperConfig { mockBankKeeper := mocks.NewMockBankKeeper(ctrl) mockBankKeeper.EXPECT(). SpendableCoins(gomock.Any(), gomock.Any()). @@ -50,17 +126,13 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { return sdk.Coins{} }, ).AnyTimes() - mockBankKeeper.EXPECT(). MintCoins(gomock.Any(), gomock.Any(), gomock.Any()). AnyTimes() - mockBankKeeper.EXPECT(). SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). AnyTimes() - mockAccountKeeper := mocks.NewMockAccountKeeper(ctrl) - mockGatewayKeeper := mocks.NewMockGatewayKeeper(ctrl) mockGatewayKeeper.EXPECT(). GetGateway(gomock.Any(), gomock.Any()). @@ -85,24 +157,10 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { SetSupplier(gomock.Any(), gomock.Any()). AnyTimes() - k := keeper.NewKeeper( - cdc, - runtime.NewKVStoreService(storeKey), - log.NewNopLogger(), - authority.String(), - mockAccountKeeper, - mockBankKeeper, - mockGatewayKeeper, - mockAppKeeper, - mockSupplierKeeper, - ) - - ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) - - // Initialize params - if err := k.SetParams(ctx, types.DefaultParams()); err != nil { - panic(err) + return &MigrationKeeperConfig{ + bankKeeper: mockBankKeeper, + gatewayKeeper: mockGatewayKeeper, + appKeeper: mockAppKeeper, + supplierKeeper: mockSupplierKeeper, } - - return k, ctx } From 3b7f77f3267063b093b4ac06b299b56f817b7e6a Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 18 Feb 2025 12:38:17 +0100 Subject: [PATCH 32/81] scaffold: message claim_morse_application --module migration --signer shannon_dest_address morse_src_address morse_signature stake:coin service_config --response morse_src_address --response claimed_balance:coin --response service_id --response claimed_application_stake:coin --response claimed_at_height:int --- api/poktroll/migration/event.pulsar.go | 1117 +++++++++-- api/poktroll/migration/tx.pulsar.go | 1657 ++++++++++++++++- api/poktroll/migration/tx_grpc.pb.go | 38 + proto/poktroll/migration/tx.proto | 45 +- .../msg_server_claim_morse_application.go | 17 + x/migration/module/autocli.go | 6 + x/migration/module/simulation.go | 23 + .../simulation/claim_morse_application.go | 28 + x/migration/types/codec.go | 3 + .../types/message_claim_morse_application.go | 27 + .../message_claim_morse_application_test.go | 40 + x/migration/types/tx.pb.go | 910 ++++++++- 12 files changed, 3680 insertions(+), 231 deletions(-) create mode 100644 x/migration/keeper/msg_server_claim_morse_application.go create mode 100644 x/migration/simulation/claim_morse_application.go create mode 100644 x/migration/types/message_claim_morse_application.go create mode 100644 x/migration/types/message_claim_morse_application_test.go diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index ec5f9587d..ad7fa0219 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -3,11 +3,11 @@ package migration import ( v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - _ "github.com/pokt-network/poktroll/api/poktroll/shared" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" + _ "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -1145,141 +1145,977 @@ func (x *fastReflection_EventMorseAccountClaimed) ProtoMethods() *protoiface.Met } } -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: poktroll/migration/event.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +var ( + md_EventMorseApplicationClaimed protoreflect.MessageDescriptor + fd_EventMorseApplicationClaimed_claimed_at_height protoreflect.FieldDescriptor + fd_EventMorseApplicationClaimed_claimed_balance protoreflect.FieldDescriptor + fd_EventMorseApplicationClaimed_shannon_dest_address protoreflect.FieldDescriptor + fd_EventMorseApplicationClaimed_morse_src_address protoreflect.FieldDescriptor + fd_EventMorseApplicationClaimed_claimedApplicationStake protoreflect.FieldDescriptor + fd_EventMorseApplicationClaimed_serviceId protoreflect.FieldDescriptor ) -// EventImportMorseClaimableAccounts is emitted when the MorseClaimableAccounts are created on-chain. -type EventImportMorseClaimableAccounts struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +func init() { + file_poktroll_migration_event_proto_init() + md_EventMorseApplicationClaimed = File_poktroll_migration_event_proto.Messages().ByName("EventMorseApplicationClaimed") + fd_EventMorseApplicationClaimed_claimed_at_height = md_EventMorseApplicationClaimed.Fields().ByName("claimed_at_height") + fd_EventMorseApplicationClaimed_claimed_balance = md_EventMorseApplicationClaimed.Fields().ByName("claimed_balance") + fd_EventMorseApplicationClaimed_shannon_dest_address = md_EventMorseApplicationClaimed.Fields().ByName("shannon_dest_address") + fd_EventMorseApplicationClaimed_morse_src_address = md_EventMorseApplicationClaimed.Fields().ByName("morse_src_address") + fd_EventMorseApplicationClaimed_claimedApplicationStake = md_EventMorseApplicationClaimed.Fields().ByName("claimedApplicationStake") + fd_EventMorseApplicationClaimed_serviceId = md_EventMorseApplicationClaimed.Fields().ByName("serviceId") +} - // The height (on Shannon) at which the MorseAccountState was created on-chain. - CreatedAtHeight int64 `protobuf:"varint,1,opt,name=created_at_height,json=createdAtHeight,proto3" json:"created_at_height,omitempty"` - // The sha256 has of the MorseAccountState. - MorseAccountStateHash []byte `protobuf:"bytes,2,opt,name=morse_account_state_hash,json=morseAccountStateHash,proto3" json:"morse_account_state_hash,omitempty"` - // The number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. - // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. - NumAccounts uint64 `protobuf:"varint,3,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts,omitempty"` +var _ protoreflect.Message = (*fastReflection_EventMorseApplicationClaimed)(nil) + +type fastReflection_EventMorseApplicationClaimed EventMorseApplicationClaimed + +func (x *EventMorseApplicationClaimed) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventMorseApplicationClaimed)(x) } -func (x *EventImportMorseClaimableAccounts) Reset() { - *x = EventImportMorseClaimableAccounts{} - if protoimpl.UnsafeEnabled { - mi := &file_poktroll_migration_event_proto_msgTypes[0] +func (x *EventMorseApplicationClaimed) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_event_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } + return mi.MessageOf(x) } -func (x *EventImportMorseClaimableAccounts) String() string { - return protoimpl.X.MessageStringOf(x) -} +var _fastReflection_EventMorseApplicationClaimed_messageType fastReflection_EventMorseApplicationClaimed_messageType +var _ protoreflect.MessageType = fastReflection_EventMorseApplicationClaimed_messageType{} -func (*EventImportMorseClaimableAccounts) ProtoMessage() {} +type fastReflection_EventMorseApplicationClaimed_messageType struct{} -// Deprecated: Use EventImportMorseClaimableAccounts.ProtoReflect.Descriptor instead. -func (*EventImportMorseClaimableAccounts) Descriptor() ([]byte, []int) { - return file_poktroll_migration_event_proto_rawDescGZIP(), []int{0} +func (x fastReflection_EventMorseApplicationClaimed_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventMorseApplicationClaimed)(nil) } - -func (x *EventImportMorseClaimableAccounts) GetCreatedAtHeight() int64 { - if x != nil { - return x.CreatedAtHeight - } - return 0 +func (x fastReflection_EventMorseApplicationClaimed_messageType) New() protoreflect.Message { + return new(fastReflection_EventMorseApplicationClaimed) +} +func (x fastReflection_EventMorseApplicationClaimed_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventMorseApplicationClaimed } -func (x *EventImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { - if x != nil { - return x.MorseAccountStateHash - } - return nil +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventMorseApplicationClaimed) Descriptor() protoreflect.MessageDescriptor { + return md_EventMorseApplicationClaimed } -func (x *EventImportMorseClaimableAccounts) GetNumAccounts() uint64 { - if x != nil { - return x.NumAccounts - } - return 0 +// 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_EventMorseApplicationClaimed) Type() protoreflect.MessageType { + return _fastReflection_EventMorseApplicationClaimed_messageType } -// EventMorseAccountClaimed is emitted when a MorseAccount is claimed on-chain. -type EventMorseAccountClaimed struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventMorseApplicationClaimed) New() protoreflect.Message { + return new(fastReflection_EventMorseApplicationClaimed) +} - // The height (on Shannon) at which the claim was executed (i.e. claimed). - ClaimedAtHeight int64 `protobuf:"varint,1,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` - // The balance which was claimed. - ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance,omitempty"` - // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. - ShannonDestAddress string `protobuf:"bytes,3,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address,omitempty"` - // The hex-encoded address of the Morse account whose balance will be claimed. - MorseSrcAddress string `protobuf:"bytes,4,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventMorseApplicationClaimed) Interface() protoreflect.ProtoMessage { + return (*EventMorseApplicationClaimed)(x) } -func (x *EventMorseAccountClaimed) Reset() { - *x = EventMorseAccountClaimed{} - if protoimpl.UnsafeEnabled { - mi := &file_poktroll_migration_event_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +// 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_EventMorseApplicationClaimed) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ClaimedAtHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.ClaimedAtHeight) + if !f(fd_EventMorseApplicationClaimed_claimed_at_height, value) { + return + } + } + if x.ClaimedBalance != nil { + value := protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) + if !f(fd_EventMorseApplicationClaimed_claimed_balance, value) { + return + } + } + if x.ShannonDestAddress != "" { + value := protoreflect.ValueOfString(x.ShannonDestAddress) + if !f(fd_EventMorseApplicationClaimed_shannon_dest_address, value) { + return + } + } + if x.MorseSrcAddress != "" { + value := protoreflect.ValueOfString(x.MorseSrcAddress) + if !f(fd_EventMorseApplicationClaimed_morse_src_address, value) { + return + } + } + if x.ClaimedApplicationStake != nil { + value := protoreflect.ValueOfMessage(x.ClaimedApplicationStake.ProtoReflect()) + if !f(fd_EventMorseApplicationClaimed_claimedApplicationStake, value) { + return + } + } + if x.ServiceId != "" { + value := protoreflect.ValueOfString(x.ServiceId) + if !f(fd_EventMorseApplicationClaimed_serviceId, value) { + return + } } } -func (x *EventMorseAccountClaimed) String() string { - return protoimpl.X.MessageStringOf(x) +// 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_EventMorseApplicationClaimed) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.EventMorseApplicationClaimed.claimed_at_height": + return x.ClaimedAtHeight != int64(0) + case "poktroll.migration.EventMorseApplicationClaimed.claimed_balance": + return x.ClaimedBalance != nil + case "poktroll.migration.EventMorseApplicationClaimed.shannon_dest_address": + return x.ShannonDestAddress != "" + case "poktroll.migration.EventMorseApplicationClaimed.morse_src_address": + return x.MorseSrcAddress != "" + case "poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake": + return x.ClaimedApplicationStake != nil + case "poktroll.migration.EventMorseApplicationClaimed.serviceId": + return x.ServiceId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseApplicationClaimed")) + } + panic(fmt.Errorf("message poktroll.migration.EventMorseApplicationClaimed does not contain field %s", fd.FullName())) + } } -func (*EventMorseAccountClaimed) ProtoMessage() {} - -// Deprecated: Use EventMorseAccountClaimed.ProtoReflect.Descriptor instead. -func (*EventMorseAccountClaimed) Descriptor() ([]byte, []int) { - return file_poktroll_migration_event_proto_rawDescGZIP(), []int{1} +// 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_EventMorseApplicationClaimed) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.EventMorseApplicationClaimed.claimed_at_height": + x.ClaimedAtHeight = int64(0) + case "poktroll.migration.EventMorseApplicationClaimed.claimed_balance": + x.ClaimedBalance = nil + case "poktroll.migration.EventMorseApplicationClaimed.shannon_dest_address": + x.ShannonDestAddress = "" + case "poktroll.migration.EventMorseApplicationClaimed.morse_src_address": + x.MorseSrcAddress = "" + case "poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake": + x.ClaimedApplicationStake = nil + case "poktroll.migration.EventMorseApplicationClaimed.serviceId": + x.ServiceId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseApplicationClaimed")) + } + panic(fmt.Errorf("message poktroll.migration.EventMorseApplicationClaimed does not contain field %s", fd.FullName())) + } } -func (x *EventMorseAccountClaimed) GetClaimedAtHeight() int64 { - if x != nil { - return x.ClaimedAtHeight +// 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_EventMorseApplicationClaimed) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.EventMorseApplicationClaimed.claimed_at_height": + value := x.ClaimedAtHeight + return protoreflect.ValueOfInt64(value) + case "poktroll.migration.EventMorseApplicationClaimed.claimed_balance": + value := x.ClaimedBalance + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.EventMorseApplicationClaimed.shannon_dest_address": + value := x.ShannonDestAddress + return protoreflect.ValueOfString(value) + case "poktroll.migration.EventMorseApplicationClaimed.morse_src_address": + value := x.MorseSrcAddress + return protoreflect.ValueOfString(value) + case "poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake": + value := x.ClaimedApplicationStake + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.EventMorseApplicationClaimed.serviceId": + value := x.ServiceId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseApplicationClaimed")) + } + panic(fmt.Errorf("message poktroll.migration.EventMorseApplicationClaimed does not contain field %s", descriptor.FullName())) } - return 0 } -func (x *EventMorseAccountClaimed) GetClaimedBalance() *v1beta1.Coin { - if x != nil { - return x.ClaimedBalance +// 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_EventMorseApplicationClaimed) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.EventMorseApplicationClaimed.claimed_at_height": + x.ClaimedAtHeight = value.Int() + case "poktroll.migration.EventMorseApplicationClaimed.claimed_balance": + x.ClaimedBalance = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.migration.EventMorseApplicationClaimed.shannon_dest_address": + x.ShannonDestAddress = value.Interface().(string) + case "poktroll.migration.EventMorseApplicationClaimed.morse_src_address": + x.MorseSrcAddress = value.Interface().(string) + case "poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake": + x.ClaimedApplicationStake = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.migration.EventMorseApplicationClaimed.serviceId": + x.ServiceId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseApplicationClaimed")) + } + panic(fmt.Errorf("message poktroll.migration.EventMorseApplicationClaimed does not contain field %s", fd.FullName())) } - return nil } -func (x *EventMorseAccountClaimed) GetShannonDestAddress() string { - if x != nil { - return x.ShannonDestAddress +// 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_EventMorseApplicationClaimed) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.EventMorseApplicationClaimed.claimed_balance": + if x.ClaimedBalance == nil { + x.ClaimedBalance = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) + case "poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake": + if x.ClaimedApplicationStake == nil { + x.ClaimedApplicationStake = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedApplicationStake.ProtoReflect()) + case "poktroll.migration.EventMorseApplicationClaimed.claimed_at_height": + panic(fmt.Errorf("field claimed_at_height of message poktroll.migration.EventMorseApplicationClaimed is not mutable")) + case "poktroll.migration.EventMorseApplicationClaimed.shannon_dest_address": + panic(fmt.Errorf("field shannon_dest_address of message poktroll.migration.EventMorseApplicationClaimed is not mutable")) + case "poktroll.migration.EventMorseApplicationClaimed.morse_src_address": + panic(fmt.Errorf("field morse_src_address of message poktroll.migration.EventMorseApplicationClaimed is not mutable")) + case "poktroll.migration.EventMorseApplicationClaimed.serviceId": + panic(fmt.Errorf("field serviceId of message poktroll.migration.EventMorseApplicationClaimed is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseApplicationClaimed")) + } + panic(fmt.Errorf("message poktroll.migration.EventMorseApplicationClaimed does not contain field %s", fd.FullName())) } - return "" } -func (x *EventMorseAccountClaimed) GetMorseSrcAddress() string { - if x != nil { - return x.MorseSrcAddress +// 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_EventMorseApplicationClaimed) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.EventMorseApplicationClaimed.claimed_at_height": + return protoreflect.ValueOfInt64(int64(0)) + case "poktroll.migration.EventMorseApplicationClaimed.claimed_balance": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.EventMorseApplicationClaimed.shannon_dest_address": + return protoreflect.ValueOfString("") + case "poktroll.migration.EventMorseApplicationClaimed.morse_src_address": + return protoreflect.ValueOfString("") + case "poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.EventMorseApplicationClaimed.serviceId": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseApplicationClaimed")) + } + panic(fmt.Errorf("message poktroll.migration.EventMorseApplicationClaimed does not contain field %s", fd.FullName())) } - return "" } -var File_poktroll_migration_event_proto protoreflect.FileDescriptor - +// 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_EventMorseApplicationClaimed) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.EventMorseApplicationClaimed", 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_EventMorseApplicationClaimed) 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_EventMorseApplicationClaimed) 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_EventMorseApplicationClaimed) 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_EventMorseApplicationClaimed) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventMorseApplicationClaimed) + 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.ClaimedAtHeight != 0 { + n += 1 + runtime.Sov(uint64(x.ClaimedAtHeight)) + } + if x.ClaimedBalance != nil { + l = options.Size(x.ClaimedBalance) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ShannonDestAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MorseSrcAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ClaimedApplicationStake != nil { + l = options.Size(x.ClaimedApplicationStake) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ServiceId) + 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().(*EventMorseApplicationClaimed) + 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.ServiceId) > 0 { + i -= len(x.ServiceId) + copy(dAtA[i:], x.ServiceId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceId))) + i-- + dAtA[i] = 0x32 + } + if x.ClaimedApplicationStake != nil { + encoded, err := options.Marshal(x.ClaimedApplicationStake) + 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] = 0x2a + } + if len(x.MorseSrcAddress) > 0 { + i -= len(x.MorseSrcAddress) + copy(dAtA[i:], x.MorseSrcAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseSrcAddress))) + i-- + dAtA[i] = 0x22 + } + if len(x.ShannonDestAddress) > 0 { + i -= len(x.ShannonDestAddress) + copy(dAtA[i:], x.ShannonDestAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ShannonDestAddress))) + i-- + dAtA[i] = 0x1a + } + if x.ClaimedBalance != nil { + encoded, err := options.Marshal(x.ClaimedBalance) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.ClaimedAtHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimedAtHeight)) + i-- + dAtA[i] = 0x8 + } + 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().(*EventMorseApplicationClaimed) + 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: EventMorseApplicationClaimed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventMorseApplicationClaimed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) + } + x.ClaimedAtHeight = 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.ClaimedAtHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedBalance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ClaimedBalance == nil { + x.ClaimedBalance = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedBalance); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ShannonDestAddress", 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.ShannonDestAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MorseSrcAddress", 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.MorseSrcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedApplicationStake", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ClaimedApplicationStake == nil { + x.ClaimedApplicationStake = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedApplicationStake); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceId", 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.ServiceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: poktroll/migration/event.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EventImportMorseClaimableAccounts is emitted when the MorseClaimableAccounts are created on-chain. +type EventImportMorseClaimableAccounts struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The height (on Shannon) at which the MorseAccountState was created on-chain. + CreatedAtHeight int64 `protobuf:"varint,1,opt,name=created_at_height,json=createdAtHeight,proto3" json:"created_at_height,omitempty"` + // The sha256 has of the MorseAccountState. + MorseAccountStateHash []byte `protobuf:"bytes,2,opt,name=morse_account_state_hash,json=morseAccountStateHash,proto3" json:"morse_account_state_hash,omitempty"` + // The number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. + // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. + NumAccounts uint64 `protobuf:"varint,3,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts,omitempty"` +} + +func (x *EventImportMorseClaimableAccounts) Reset() { + *x = EventImportMorseClaimableAccounts{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_event_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventImportMorseClaimableAccounts) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventImportMorseClaimableAccounts) ProtoMessage() {} + +// Deprecated: Use EventImportMorseClaimableAccounts.ProtoReflect.Descriptor instead. +func (*EventImportMorseClaimableAccounts) Descriptor() ([]byte, []int) { + return file_poktroll_migration_event_proto_rawDescGZIP(), []int{0} +} + +func (x *EventImportMorseClaimableAccounts) GetCreatedAtHeight() int64 { + if x != nil { + return x.CreatedAtHeight + } + return 0 +} + +func (x *EventImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { + if x != nil { + return x.MorseAccountStateHash + } + return nil +} + +func (x *EventImportMorseClaimableAccounts) GetNumAccounts() uint64 { + if x != nil { + return x.NumAccounts + } + return 0 +} + +// EventMorseAccountClaimed is emitted when a MorseAccount is claimed on-chain. +type EventMorseAccountClaimed struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The height (on Shannon) at which the claim was executed (i.e. claimed). + ClaimedAtHeight int64 `protobuf:"varint,1,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` + // The balance which was claimed. + ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance,omitempty"` + // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. + ShannonDestAddress string `protobuf:"bytes,3,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address,omitempty"` + // The hex-encoded address of the Morse account whose balance will be claimed. + MorseSrcAddress string `protobuf:"bytes,4,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` +} + +func (x *EventMorseAccountClaimed) Reset() { + *x = EventMorseAccountClaimed{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_event_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventMorseAccountClaimed) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventMorseAccountClaimed) ProtoMessage() {} + +// Deprecated: Use EventMorseAccountClaimed.ProtoReflect.Descriptor instead. +func (*EventMorseAccountClaimed) Descriptor() ([]byte, []int) { + return file_poktroll_migration_event_proto_rawDescGZIP(), []int{1} +} + +func (x *EventMorseAccountClaimed) GetClaimedAtHeight() int64 { + if x != nil { + return x.ClaimedAtHeight + } + return 0 +} + +func (x *EventMorseAccountClaimed) GetClaimedBalance() *v1beta1.Coin { + if x != nil { + return x.ClaimedBalance + } + return nil +} + +func (x *EventMorseAccountClaimed) GetShannonDestAddress() string { + if x != nil { + return x.ShannonDestAddress + } + return "" +} + +func (x *EventMorseAccountClaimed) GetMorseSrcAddress() string { + if x != nil { + return x.MorseSrcAddress + } + return "" +} + +// EventMorseApplicationClaimed is emitted when a MorseAccount is claimed on-chain as a staked application. +type EventMorseApplicationClaimed struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The height (on Shannon) at which the claim was executed (i.e. claimed). + ClaimedAtHeight int64 `protobuf:"varint,1,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` + // The balance which was claimed. + ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance,omitempty"` + // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. + ShannonDestAddress string `protobuf:"bytes,3,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address,omitempty"` + // The hex-encoded address of the Morse account whose balance will be claimed. + MorseSrcAddress string `protobuf:"bytes,4,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` + // TODO_IN_THIS_COMMIT: comments... + ClaimedApplicationStake *v1beta1.Coin `protobuf:"bytes,5,opt,name=claimedApplicationStake,proto3" json:"claimedApplicationStake,omitempty"` + // TODO_IN_THIS_COMMIT: comments... + ServiceId string `protobuf:"bytes,6,opt,name=serviceId,proto3" json:"serviceId,omitempty"` +} + +func (x *EventMorseApplicationClaimed) Reset() { + *x = EventMorseApplicationClaimed{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_event_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventMorseApplicationClaimed) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventMorseApplicationClaimed) ProtoMessage() {} + +// Deprecated: Use EventMorseApplicationClaimed.ProtoReflect.Descriptor instead. +func (*EventMorseApplicationClaimed) Descriptor() ([]byte, []int) { + return file_poktroll_migration_event_proto_rawDescGZIP(), []int{2} +} + +func (x *EventMorseApplicationClaimed) GetClaimedAtHeight() int64 { + if x != nil { + return x.ClaimedAtHeight + } + return 0 +} + +func (x *EventMorseApplicationClaimed) GetClaimedBalance() *v1beta1.Coin { + if x != nil { + return x.ClaimedBalance + } + return nil +} + +func (x *EventMorseApplicationClaimed) GetShannonDestAddress() string { + if x != nil { + return x.ShannonDestAddress + } + return "" +} + +func (x *EventMorseApplicationClaimed) GetMorseSrcAddress() string { + if x != nil { + return x.MorseSrcAddress + } + return "" +} + +func (x *EventMorseApplicationClaimed) GetClaimedApplicationStake() *v1beta1.Coin { + if x != nil { + return x.ClaimedApplicationStake + } + return nil +} + +func (x *EventMorseApplicationClaimed) GetServiceId() string { + if x != nil { + return x.ServiceId + } + return "" +} + +var File_poktroll_migration_event_proto protoreflect.FileDescriptor + var file_poktroll_migration_event_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, @@ -1331,19 +2167,49 @@ var file_poktroll_migration_event_proto_rawDesc = []byte{ 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0xb6, 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, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 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, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xde, 0x03, 0x0a, 0x1c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, + 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x12, 0x41, 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, + 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x5b, 0x0a, 0x0f, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x17, 0xc8, + 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, + 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xea, 0xde, 0x1f, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, + 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, + 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6d, 0x6f, + 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, + 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, + 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x59, 0x0a, + 0x17, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x17, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x42, 0xb6, 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, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 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 ( @@ -1358,19 +2224,22 @@ func file_poktroll_migration_event_proto_rawDescGZIP() []byte { return file_poktroll_migration_event_proto_rawDescData } -var file_poktroll_migration_event_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_poktroll_migration_event_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_poktroll_migration_event_proto_goTypes = []interface{}{ (*EventImportMorseClaimableAccounts)(nil), // 0: poktroll.migration.EventImportMorseClaimableAccounts (*EventMorseAccountClaimed)(nil), // 1: poktroll.migration.EventMorseAccountClaimed - (*v1beta1.Coin)(nil), // 2: cosmos.base.v1beta1.Coin + (*EventMorseApplicationClaimed)(nil), // 2: poktroll.migration.EventMorseApplicationClaimed + (*v1beta1.Coin)(nil), // 3: cosmos.base.v1beta1.Coin } var file_poktroll_migration_event_proto_depIdxs = []int32{ - 2, // 0: poktroll.migration.EventMorseAccountClaimed.claimed_balance:type_name -> cosmos.base.v1beta1.Coin - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] 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 + 3, // 0: poktroll.migration.EventMorseAccountClaimed.claimed_balance:type_name -> cosmos.base.v1beta1.Coin + 3, // 1: poktroll.migration.EventMorseApplicationClaimed.claimed_balance:type_name -> cosmos.base.v1beta1.Coin + 3, // 2: poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake:type_name -> cosmos.base.v1beta1.Coin + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_poktroll_migration_event_proto_init() } @@ -1404,6 +2273,18 @@ func file_poktroll_migration_event_proto_init() { return nil } } + file_poktroll_migration_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventMorseApplicationClaimed); 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{ @@ -1411,7 +2292,7 @@ func file_poktroll_migration_event_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_migration_event_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index 1c7229bf2..e60a6185e 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -3002,6 +3002,1387 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) ProtoMethods() *protoiface } } +var ( + md_MsgClaimMorseApplication protoreflect.MessageDescriptor + fd_MsgClaimMorseApplication_shannonDestAddress protoreflect.FieldDescriptor + fd_MsgClaimMorseApplication_morseSrcAddress protoreflect.FieldDescriptor + fd_MsgClaimMorseApplication_morseSignature protoreflect.FieldDescriptor + fd_MsgClaimMorseApplication_stake protoreflect.FieldDescriptor + fd_MsgClaimMorseApplication_serviceConfig protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_tx_proto_init() + md_MsgClaimMorseApplication = File_poktroll_migration_tx_proto.Messages().ByName("MsgClaimMorseApplication") + fd_MsgClaimMorseApplication_shannonDestAddress = md_MsgClaimMorseApplication.Fields().ByName("shannonDestAddress") + fd_MsgClaimMorseApplication_morseSrcAddress = md_MsgClaimMorseApplication.Fields().ByName("morseSrcAddress") + fd_MsgClaimMorseApplication_morseSignature = md_MsgClaimMorseApplication.Fields().ByName("morseSignature") + fd_MsgClaimMorseApplication_stake = md_MsgClaimMorseApplication.Fields().ByName("stake") + fd_MsgClaimMorseApplication_serviceConfig = md_MsgClaimMorseApplication.Fields().ByName("serviceConfig") +} + +var _ protoreflect.Message = (*fastReflection_MsgClaimMorseApplication)(nil) + +type fastReflection_MsgClaimMorseApplication MsgClaimMorseApplication + +func (x *MsgClaimMorseApplication) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClaimMorseApplication)(x) +} + +func (x *MsgClaimMorseApplication) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_tx_proto_msgTypes[6] + 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_MsgClaimMorseApplication_messageType fastReflection_MsgClaimMorseApplication_messageType +var _ protoreflect.MessageType = fastReflection_MsgClaimMorseApplication_messageType{} + +type fastReflection_MsgClaimMorseApplication_messageType struct{} + +func (x fastReflection_MsgClaimMorseApplication_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClaimMorseApplication)(nil) +} +func (x fastReflection_MsgClaimMorseApplication_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClaimMorseApplication) +} +func (x fastReflection_MsgClaimMorseApplication_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimMorseApplication +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClaimMorseApplication) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimMorseApplication +} + +// 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_MsgClaimMorseApplication) Type() protoreflect.MessageType { + return _fastReflection_MsgClaimMorseApplication_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClaimMorseApplication) New() protoreflect.Message { + return new(fastReflection_MsgClaimMorseApplication) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClaimMorseApplication) Interface() protoreflect.ProtoMessage { + return (*MsgClaimMorseApplication)(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_MsgClaimMorseApplication) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ShannonDestAddress != "" { + value := protoreflect.ValueOfString(x.ShannonDestAddress) + if !f(fd_MsgClaimMorseApplication_shannonDestAddress, value) { + return + } + } + if x.MorseSrcAddress != "" { + value := protoreflect.ValueOfString(x.MorseSrcAddress) + if !f(fd_MsgClaimMorseApplication_morseSrcAddress, value) { + return + } + } + if x.MorseSignature != "" { + value := protoreflect.ValueOfString(x.MorseSignature) + if !f(fd_MsgClaimMorseApplication_morseSignature, value) { + return + } + } + if x.Stake != nil { + value := protoreflect.ValueOfMessage(x.Stake.ProtoReflect()) + if !f(fd_MsgClaimMorseApplication_stake, value) { + return + } + } + if x.ServiceConfig != "" { + value := protoreflect.ValueOfString(x.ServiceConfig) + if !f(fd_MsgClaimMorseApplication_serviceConfig, 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_MsgClaimMorseApplication) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseApplication.shannonDestAddress": + return x.ShannonDestAddress != "" + case "poktroll.migration.MsgClaimMorseApplication.morseSrcAddress": + return x.MorseSrcAddress != "" + case "poktroll.migration.MsgClaimMorseApplication.morseSignature": + return x.MorseSignature != "" + case "poktroll.migration.MsgClaimMorseApplication.stake": + return x.Stake != nil + case "poktroll.migration.MsgClaimMorseApplication.serviceConfig": + return x.ServiceConfig != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseApplication 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_MsgClaimMorseApplication) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseApplication.shannonDestAddress": + x.ShannonDestAddress = "" + case "poktroll.migration.MsgClaimMorseApplication.morseSrcAddress": + x.MorseSrcAddress = "" + case "poktroll.migration.MsgClaimMorseApplication.morseSignature": + x.MorseSignature = "" + case "poktroll.migration.MsgClaimMorseApplication.stake": + x.Stake = nil + case "poktroll.migration.MsgClaimMorseApplication.serviceConfig": + x.ServiceConfig = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseApplication 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_MsgClaimMorseApplication) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MsgClaimMorseApplication.shannonDestAddress": + value := x.ShannonDestAddress + return protoreflect.ValueOfString(value) + case "poktroll.migration.MsgClaimMorseApplication.morseSrcAddress": + value := x.MorseSrcAddress + return protoreflect.ValueOfString(value) + case "poktroll.migration.MsgClaimMorseApplication.morseSignature": + value := x.MorseSignature + return protoreflect.ValueOfString(value) + case "poktroll.migration.MsgClaimMorseApplication.stake": + value := x.Stake + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.MsgClaimMorseApplication.serviceConfig": + value := x.ServiceConfig + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseApplication 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_MsgClaimMorseApplication) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseApplication.shannonDestAddress": + x.ShannonDestAddress = value.Interface().(string) + case "poktroll.migration.MsgClaimMorseApplication.morseSrcAddress": + x.MorseSrcAddress = value.Interface().(string) + case "poktroll.migration.MsgClaimMorseApplication.morseSignature": + x.MorseSignature = value.Interface().(string) + case "poktroll.migration.MsgClaimMorseApplication.stake": + x.Stake = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.migration.MsgClaimMorseApplication.serviceConfig": + x.ServiceConfig = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseApplication 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_MsgClaimMorseApplication) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseApplication.stake": + if x.Stake == nil { + x.Stake = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Stake.ProtoReflect()) + case "poktroll.migration.MsgClaimMorseApplication.shannonDestAddress": + panic(fmt.Errorf("field shannonDestAddress of message poktroll.migration.MsgClaimMorseApplication is not mutable")) + case "poktroll.migration.MsgClaimMorseApplication.morseSrcAddress": + panic(fmt.Errorf("field morseSrcAddress of message poktroll.migration.MsgClaimMorseApplication is not mutable")) + case "poktroll.migration.MsgClaimMorseApplication.morseSignature": + panic(fmt.Errorf("field morseSignature of message poktroll.migration.MsgClaimMorseApplication is not mutable")) + case "poktroll.migration.MsgClaimMorseApplication.serviceConfig": + panic(fmt.Errorf("field serviceConfig of message poktroll.migration.MsgClaimMorseApplication is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseApplication 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_MsgClaimMorseApplication) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseApplication.shannonDestAddress": + return protoreflect.ValueOfString("") + case "poktroll.migration.MsgClaimMorseApplication.morseSrcAddress": + return protoreflect.ValueOfString("") + case "poktroll.migration.MsgClaimMorseApplication.morseSignature": + return protoreflect.ValueOfString("") + case "poktroll.migration.MsgClaimMorseApplication.stake": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.MsgClaimMorseApplication.serviceConfig": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseApplication 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_MsgClaimMorseApplication) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MsgClaimMorseApplication", 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_MsgClaimMorseApplication) 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_MsgClaimMorseApplication) 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_MsgClaimMorseApplication) 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_MsgClaimMorseApplication) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClaimMorseApplication) + 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.ShannonDestAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MorseSrcAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.MorseSignature) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Stake != nil { + l = options.Size(x.Stake) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ServiceConfig) + 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().(*MsgClaimMorseApplication) + 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.ServiceConfig) > 0 { + i -= len(x.ServiceConfig) + copy(dAtA[i:], x.ServiceConfig) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceConfig))) + i-- + dAtA[i] = 0x2a + } + if x.Stake != nil { + encoded, err := options.Marshal(x.Stake) + 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] = 0x22 + } + if len(x.MorseSignature) > 0 { + i -= len(x.MorseSignature) + copy(dAtA[i:], x.MorseSignature) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseSignature))) + i-- + dAtA[i] = 0x1a + } + if len(x.MorseSrcAddress) > 0 { + i -= len(x.MorseSrcAddress) + copy(dAtA[i:], x.MorseSrcAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseSrcAddress))) + i-- + dAtA[i] = 0x12 + } + if len(x.ShannonDestAddress) > 0 { + i -= len(x.ShannonDestAddress) + copy(dAtA[i:], x.ShannonDestAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ShannonDestAddress))) + 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().(*MsgClaimMorseApplication) + 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: MsgClaimMorseApplication: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimMorseApplication: 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 ShannonDestAddress", 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.ShannonDestAddress = 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 MorseSrcAddress", 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.MorseSrcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MorseSignature", 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.MorseSignature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Stake == nil { + x.Stake = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Stake); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceConfig", 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.ServiceConfig = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgClaimMorseApplicationResponse protoreflect.MessageDescriptor + fd_MsgClaimMorseApplicationResponse_morseSrcAddress protoreflect.FieldDescriptor + fd_MsgClaimMorseApplicationResponse_claimedBalance protoreflect.FieldDescriptor + fd_MsgClaimMorseApplicationResponse_serviceId protoreflect.FieldDescriptor + fd_MsgClaimMorseApplicationResponse_claimedApplicationStake protoreflect.FieldDescriptor + fd_MsgClaimMorseApplicationResponse_claimedAtHeight protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_tx_proto_init() + md_MsgClaimMorseApplicationResponse = File_poktroll_migration_tx_proto.Messages().ByName("MsgClaimMorseApplicationResponse") + fd_MsgClaimMorseApplicationResponse_morseSrcAddress = md_MsgClaimMorseApplicationResponse.Fields().ByName("morseSrcAddress") + fd_MsgClaimMorseApplicationResponse_claimedBalance = md_MsgClaimMorseApplicationResponse.Fields().ByName("claimedBalance") + fd_MsgClaimMorseApplicationResponse_serviceId = md_MsgClaimMorseApplicationResponse.Fields().ByName("serviceId") + fd_MsgClaimMorseApplicationResponse_claimedApplicationStake = md_MsgClaimMorseApplicationResponse.Fields().ByName("claimedApplicationStake") + fd_MsgClaimMorseApplicationResponse_claimedAtHeight = md_MsgClaimMorseApplicationResponse.Fields().ByName("claimedAtHeight") +} + +var _ protoreflect.Message = (*fastReflection_MsgClaimMorseApplicationResponse)(nil) + +type fastReflection_MsgClaimMorseApplicationResponse MsgClaimMorseApplicationResponse + +func (x *MsgClaimMorseApplicationResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClaimMorseApplicationResponse)(x) +} + +func (x *MsgClaimMorseApplicationResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_tx_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgClaimMorseApplicationResponse_messageType fastReflection_MsgClaimMorseApplicationResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgClaimMorseApplicationResponse_messageType{} + +type fastReflection_MsgClaimMorseApplicationResponse_messageType struct{} + +func (x fastReflection_MsgClaimMorseApplicationResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClaimMorseApplicationResponse)(nil) +} +func (x fastReflection_MsgClaimMorseApplicationResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClaimMorseApplicationResponse) +} +func (x fastReflection_MsgClaimMorseApplicationResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimMorseApplicationResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClaimMorseApplicationResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimMorseApplicationResponse +} + +// 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_MsgClaimMorseApplicationResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgClaimMorseApplicationResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClaimMorseApplicationResponse) New() protoreflect.Message { + return new(fastReflection_MsgClaimMorseApplicationResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClaimMorseApplicationResponse) Interface() protoreflect.ProtoMessage { + return (*MsgClaimMorseApplicationResponse)(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_MsgClaimMorseApplicationResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.MorseSrcAddress != "" { + value := protoreflect.ValueOfString(x.MorseSrcAddress) + if !f(fd_MsgClaimMorseApplicationResponse_morseSrcAddress, value) { + return + } + } + if x.ClaimedBalance != nil { + value := protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) + if !f(fd_MsgClaimMorseApplicationResponse_claimedBalance, value) { + return + } + } + if x.ServiceId != "" { + value := protoreflect.ValueOfString(x.ServiceId) + if !f(fd_MsgClaimMorseApplicationResponse_serviceId, value) { + return + } + } + if x.ClaimedApplicationStake != nil { + value := protoreflect.ValueOfMessage(x.ClaimedApplicationStake.ProtoReflect()) + if !f(fd_MsgClaimMorseApplicationResponse_claimedApplicationStake, value) { + return + } + } + if x.ClaimedAtHeight != int32(0) { + value := protoreflect.ValueOfInt32(x.ClaimedAtHeight) + if !f(fd_MsgClaimMorseApplicationResponse_claimedAtHeight, 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_MsgClaimMorseApplicationResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseApplicationResponse.morseSrcAddress": + return x.MorseSrcAddress != "" + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedBalance": + return x.ClaimedBalance != nil + case "poktroll.migration.MsgClaimMorseApplicationResponse.serviceId": + return x.ServiceId != "" + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedApplicationStake": + return x.ClaimedApplicationStake != nil + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedAtHeight": + return x.ClaimedAtHeight != int32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplicationResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseApplicationResponse 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_MsgClaimMorseApplicationResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseApplicationResponse.morseSrcAddress": + x.MorseSrcAddress = "" + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedBalance": + x.ClaimedBalance = nil + case "poktroll.migration.MsgClaimMorseApplicationResponse.serviceId": + x.ServiceId = "" + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedApplicationStake": + x.ClaimedApplicationStake = nil + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedAtHeight": + x.ClaimedAtHeight = int32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplicationResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseApplicationResponse 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_MsgClaimMorseApplicationResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MsgClaimMorseApplicationResponse.morseSrcAddress": + value := x.MorseSrcAddress + return protoreflect.ValueOfString(value) + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedBalance": + value := x.ClaimedBalance + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.MsgClaimMorseApplicationResponse.serviceId": + value := x.ServiceId + return protoreflect.ValueOfString(value) + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedApplicationStake": + value := x.ClaimedApplicationStake + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedAtHeight": + value := x.ClaimedAtHeight + return protoreflect.ValueOfInt32(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplicationResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseApplicationResponse 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_MsgClaimMorseApplicationResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseApplicationResponse.morseSrcAddress": + x.MorseSrcAddress = value.Interface().(string) + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedBalance": + x.ClaimedBalance = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.migration.MsgClaimMorseApplicationResponse.serviceId": + x.ServiceId = value.Interface().(string) + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedApplicationStake": + x.ClaimedApplicationStake = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedAtHeight": + x.ClaimedAtHeight = int32(value.Int()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplicationResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseApplicationResponse 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_MsgClaimMorseApplicationResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedBalance": + if x.ClaimedBalance == nil { + x.ClaimedBalance = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedApplicationStake": + if x.ClaimedApplicationStake == nil { + x.ClaimedApplicationStake = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedApplicationStake.ProtoReflect()) + case "poktroll.migration.MsgClaimMorseApplicationResponse.morseSrcAddress": + panic(fmt.Errorf("field morseSrcAddress of message poktroll.migration.MsgClaimMorseApplicationResponse is not mutable")) + case "poktroll.migration.MsgClaimMorseApplicationResponse.serviceId": + panic(fmt.Errorf("field serviceId of message poktroll.migration.MsgClaimMorseApplicationResponse is not mutable")) + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedAtHeight": + panic(fmt.Errorf("field claimedAtHeight of message poktroll.migration.MsgClaimMorseApplicationResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplicationResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseApplicationResponse 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_MsgClaimMorseApplicationResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgClaimMorseApplicationResponse.morseSrcAddress": + return protoreflect.ValueOfString("") + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedBalance": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.MsgClaimMorseApplicationResponse.serviceId": + return protoreflect.ValueOfString("") + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedApplicationStake": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedAtHeight": + return protoreflect.ValueOfInt32(int32(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplicationResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgClaimMorseApplicationResponse 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_MsgClaimMorseApplicationResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MsgClaimMorseApplicationResponse", 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_MsgClaimMorseApplicationResponse) 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_MsgClaimMorseApplicationResponse) 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_MsgClaimMorseApplicationResponse) 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_MsgClaimMorseApplicationResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClaimMorseApplicationResponse) + 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.MorseSrcAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ClaimedBalance != nil { + l = options.Size(x.ClaimedBalance) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ServiceId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ClaimedApplicationStake != nil { + l = options.Size(x.ClaimedApplicationStake) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ClaimedAtHeight != 0 { + n += 1 + runtime.Sov(uint64(x.ClaimedAtHeight)) + } + 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().(*MsgClaimMorseApplicationResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.ClaimedAtHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimedAtHeight)) + i-- + dAtA[i] = 0x28 + } + if x.ClaimedApplicationStake != nil { + encoded, err := options.Marshal(x.ClaimedApplicationStake) + 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] = 0x22 + } + if len(x.ServiceId) > 0 { + i -= len(x.ServiceId) + copy(dAtA[i:], x.ServiceId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceId))) + i-- + dAtA[i] = 0x1a + } + if x.ClaimedBalance != nil { + encoded, err := options.Marshal(x.ClaimedBalance) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.MorseSrcAddress) > 0 { + i -= len(x.MorseSrcAddress) + copy(dAtA[i:], x.MorseSrcAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseSrcAddress))) + 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().(*MsgClaimMorseApplicationResponse) + 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: MsgClaimMorseApplicationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimMorseApplicationResponse: 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 MorseSrcAddress", 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.MorseSrcAddress = 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 ClaimedBalance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ClaimedBalance == nil { + x.ClaimedBalance = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedBalance); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceId", 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.ServiceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedApplicationStake", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ClaimedApplicationStake == nil { + x.ClaimedApplicationStake = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedApplicationStake); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) + } + x.ClaimedAtHeight = 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.ClaimedAtHeight |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + 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 @@ -3311,6 +4692,140 @@ func (x *MsgClaimMorseAccountResponse) GetClaimedAtHeight() int64 { return 0 } +type MsgClaimMorseApplication struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannonDestAddress,proto3" json:"shannonDestAddress,omitempty"` + MorseSrcAddress string `protobuf:"bytes,2,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` + MorseSignature string `protobuf:"bytes,3,opt,name=morseSignature,proto3" json:"morseSignature,omitempty"` + Stake *v1beta1.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake,omitempty"` + ServiceConfig string `protobuf:"bytes,5,opt,name=serviceConfig,proto3" json:"serviceConfig,omitempty"` +} + +func (x *MsgClaimMorseApplication) Reset() { + *x = MsgClaimMorseApplication{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClaimMorseApplication) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClaimMorseApplication) ProtoMessage() {} + +// Deprecated: Use MsgClaimMorseApplication.ProtoReflect.Descriptor instead. +func (*MsgClaimMorseApplication) Descriptor() ([]byte, []int) { + return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgClaimMorseApplication) GetShannonDestAddress() string { + if x != nil { + return x.ShannonDestAddress + } + return "" +} + +func (x *MsgClaimMorseApplication) GetMorseSrcAddress() string { + if x != nil { + return x.MorseSrcAddress + } + return "" +} + +func (x *MsgClaimMorseApplication) GetMorseSignature() string { + if x != nil { + return x.MorseSignature + } + return "" +} + +func (x *MsgClaimMorseApplication) GetStake() *v1beta1.Coin { + if x != nil { + return x.Stake + } + return nil +} + +func (x *MsgClaimMorseApplication) GetServiceConfig() string { + if x != nil { + return x.ServiceConfig + } + return "" +} + +type MsgClaimMorseApplicationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MorseSrcAddress string `protobuf:"bytes,1,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` + ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimedBalance,proto3" json:"claimedBalance,omitempty"` + ServiceId string `protobuf:"bytes,3,opt,name=serviceId,proto3" json:"serviceId,omitempty"` + ClaimedApplicationStake *v1beta1.Coin `protobuf:"bytes,4,opt,name=claimedApplicationStake,proto3" json:"claimedApplicationStake,omitempty"` + ClaimedAtHeight int32 `protobuf:"varint,5,opt,name=claimedAtHeight,proto3" json:"claimedAtHeight,omitempty"` +} + +func (x *MsgClaimMorseApplicationResponse) Reset() { + *x = MsgClaimMorseApplicationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClaimMorseApplicationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClaimMorseApplicationResponse) ProtoMessage() {} + +// Deprecated: Use MsgClaimMorseApplicationResponse.ProtoReflect.Descriptor instead. +func (*MsgClaimMorseApplicationResponse) Descriptor() ([]byte, []int) { + return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{7} +} + +func (x *MsgClaimMorseApplicationResponse) GetMorseSrcAddress() string { + if x != nil { + return x.MorseSrcAddress + } + return "" +} + +func (x *MsgClaimMorseApplicationResponse) GetClaimedBalance() *v1beta1.Coin { + if x != nil { + return x.ClaimedBalance + } + return nil +} + +func (x *MsgClaimMorseApplicationResponse) GetServiceId() string { + if x != nil { + return x.ServiceId + } + return "" +} + +func (x *MsgClaimMorseApplicationResponse) GetClaimedApplicationStake() *v1beta1.Coin { + if x != nil { + return x.ClaimedApplicationStake + } + return nil +} + +func (x *MsgClaimMorseApplicationResponse) GetClaimedAtHeight() int32 { + if x != nil { + return x.ClaimedAtHeight + } + return 0 +} + var File_poktroll_migration_tx_proto protoreflect.FileDescriptor var file_poktroll_migration_tx_proto_rawDesc = []byte{ @@ -3404,7 +4919,44 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x32, 0xf2, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x55, + 0x67, 0x68, 0x74, 0x22, 0x92, 0x02, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x2e, 0x0a, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x68, + 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x28, 0x0a, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, + 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x6d, 0x6f, + 0x72, 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3a, + 0x17, 0x82, 0xe7, 0xb0, 0x2a, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, + 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xb8, 0x02, 0x0a, 0x20, 0x4d, 0x73, 0x67, + 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, + 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x47, 0x0a, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x59, + 0x0a, 0x17, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x17, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x32, 0xef, 0x03, 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, @@ -3427,19 +4979,27 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x30, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 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, + 0x65, 0x12, 0x7b, 0x0a, 0x15, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x34, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, + 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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 ( @@ -3454,7 +5014,7 @@ 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, 6) +var file_poktroll_migration_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_poktroll_migration_tx_proto_goTypes = []interface{}{ (*MsgUpdateParams)(nil), // 0: poktroll.migration.MsgUpdateParams (*MsgUpdateParamsResponse)(nil), // 1: poktroll.migration.MsgUpdateParamsResponse @@ -3462,25 +5022,32 @@ var file_poktroll_migration_tx_proto_goTypes = []interface{}{ (*MsgImportMorseClaimableAccountsResponse)(nil), // 3: poktroll.migration.MsgImportMorseClaimableAccountsResponse (*MsgClaimMorseAccount)(nil), // 4: poktroll.migration.MsgClaimMorseAccount (*MsgClaimMorseAccountResponse)(nil), // 5: poktroll.migration.MsgClaimMorseAccountResponse - (*Params)(nil), // 6: poktroll.migration.Params - (*MorseAccountState)(nil), // 7: poktroll.migration.MorseAccountState - (*v1beta1.Coin)(nil), // 8: cosmos.base.v1beta1.Coin + (*MsgClaimMorseApplication)(nil), // 6: poktroll.migration.MsgClaimMorseApplication + (*MsgClaimMorseApplicationResponse)(nil), // 7: poktroll.migration.MsgClaimMorseApplicationResponse + (*Params)(nil), // 8: poktroll.migration.Params + (*MorseAccountState)(nil), // 9: poktroll.migration.MorseAccountState + (*v1beta1.Coin)(nil), // 10: cosmos.base.v1beta1.Coin } var file_poktroll_migration_tx_proto_depIdxs = []int32{ - 6, // 0: poktroll.migration.MsgUpdateParams.params:type_name -> poktroll.migration.Params - 7, // 1: poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state:type_name -> poktroll.migration.MorseAccountState - 8, // 2: poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance:type_name -> cosmos.base.v1beta1.Coin - 0, // 3: poktroll.migration.Msg.UpdateParams:input_type -> poktroll.migration.MsgUpdateParams - 2, // 4: poktroll.migration.Msg.ImportMorseClaimableAccounts:input_type -> poktroll.migration.MsgImportMorseClaimableAccounts - 4, // 5: poktroll.migration.Msg.ClaimMorseAccount:input_type -> poktroll.migration.MsgClaimMorseAccount - 1, // 6: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.MsgUpdateParamsResponse - 3, // 7: poktroll.migration.Msg.ImportMorseClaimableAccounts:output_type -> poktroll.migration.MsgImportMorseClaimableAccountsResponse - 5, // 8: poktroll.migration.Msg.ClaimMorseAccount:output_type -> poktroll.migration.MsgClaimMorseAccountResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 8, // 0: poktroll.migration.MsgUpdateParams.params:type_name -> poktroll.migration.Params + 9, // 1: poktroll.migration.MsgImportMorseClaimableAccounts.morse_account_state:type_name -> poktroll.migration.MorseAccountState + 10, // 2: poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance:type_name -> cosmos.base.v1beta1.Coin + 10, // 3: poktroll.migration.MsgClaimMorseApplication.stake:type_name -> cosmos.base.v1beta1.Coin + 10, // 4: poktroll.migration.MsgClaimMorseApplicationResponse.claimedBalance:type_name -> cosmos.base.v1beta1.Coin + 10, // 5: poktroll.migration.MsgClaimMorseApplicationResponse.claimedApplicationStake:type_name -> cosmos.base.v1beta1.Coin + 0, // 6: poktroll.migration.Msg.UpdateParams:input_type -> poktroll.migration.MsgUpdateParams + 2, // 7: poktroll.migration.Msg.ImportMorseClaimableAccounts:input_type -> poktroll.migration.MsgImportMorseClaimableAccounts + 4, // 8: poktroll.migration.Msg.ClaimMorseAccount:input_type -> poktroll.migration.MsgClaimMorseAccount + 6, // 9: poktroll.migration.Msg.ClaimMorseApplication:input_type -> poktroll.migration.MsgClaimMorseApplication + 1, // 10: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.MsgUpdateParamsResponse + 3, // 11: poktroll.migration.Msg.ImportMorseClaimableAccounts:output_type -> poktroll.migration.MsgImportMorseClaimableAccountsResponse + 5, // 12: poktroll.migration.Msg.ClaimMorseAccount:output_type -> poktroll.migration.MsgClaimMorseAccountResponse + 7, // 13: poktroll.migration.Msg.ClaimMorseApplication:output_type -> poktroll.migration.MsgClaimMorseApplicationResponse + 10, // [10:14] is the sub-list for method output_type + 6, // [6:10] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_poktroll_migration_tx_proto_init() } @@ -3563,6 +5130,30 @@ func file_poktroll_migration_tx_proto_init() { return nil } } + file_poktroll_migration_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClaimMorseApplication); 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[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClaimMorseApplicationResponse); 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{ @@ -3570,7 +5161,7 @@ func file_poktroll_migration_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_migration_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/api/poktroll/migration/tx_grpc.pb.go b/api/poktroll/migration/tx_grpc.pb.go index cd76ece4e..3c7944925 100644 --- a/api/poktroll/migration/tx_grpc.pb.go +++ b/api/poktroll/migration/tx_grpc.pb.go @@ -22,6 +22,7 @@ const ( Msg_UpdateParams_FullMethodName = "/poktroll.migration.Msg/UpdateParams" Msg_ImportMorseClaimableAccounts_FullMethodName = "/poktroll.migration.Msg/ImportMorseClaimableAccounts" Msg_ClaimMorseAccount_FullMethodName = "/poktroll.migration.Msg/ClaimMorseAccount" + Msg_ClaimMorseApplication_FullMethodName = "/poktroll.migration.Msg/ClaimMorseApplication" ) // MsgClient is the client API for Msg service. @@ -35,6 +36,7 @@ type MsgClient interface { UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) ImportMorseClaimableAccounts(ctx context.Context, in *MsgImportMorseClaimableAccounts, opts ...grpc.CallOption) (*MsgImportMorseClaimableAccountsResponse, error) ClaimMorseAccount(ctx context.Context, in *MsgClaimMorseAccount, opts ...grpc.CallOption) (*MsgClaimMorseAccountResponse, error) + ClaimMorseApplication(ctx context.Context, in *MsgClaimMorseApplication, opts ...grpc.CallOption) (*MsgClaimMorseApplicationResponse, error) } type msgClient struct { @@ -75,6 +77,16 @@ func (c *msgClient) ClaimMorseAccount(ctx context.Context, in *MsgClaimMorseAcco return out, nil } +func (c *msgClient) ClaimMorseApplication(ctx context.Context, in *MsgClaimMorseApplication, opts ...grpc.CallOption) (*MsgClaimMorseApplicationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgClaimMorseApplicationResponse) + err := c.cc.Invoke(ctx, Msg_ClaimMorseApplication_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 @@ -86,6 +98,7 @@ type MsgServer interface { UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) ImportMorseClaimableAccounts(context.Context, *MsgImportMorseClaimableAccounts) (*MsgImportMorseClaimableAccountsResponse, error) ClaimMorseAccount(context.Context, *MsgClaimMorseAccount) (*MsgClaimMorseAccountResponse, error) + ClaimMorseApplication(context.Context, *MsgClaimMorseApplication) (*MsgClaimMorseApplicationResponse, error) mustEmbedUnimplementedMsgServer() } @@ -102,6 +115,9 @@ func (UnimplementedMsgServer) ImportMorseClaimableAccounts(context.Context, *Msg func (UnimplementedMsgServer) ClaimMorseAccount(context.Context, *MsgClaimMorseAccount) (*MsgClaimMorseAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ClaimMorseAccount not implemented") } +func (UnimplementedMsgServer) ClaimMorseApplication(context.Context, *MsgClaimMorseApplication) (*MsgClaimMorseApplicationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClaimMorseApplication not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -169,6 +185,24 @@ func _Msg_ClaimMorseAccount_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Msg_ClaimMorseApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClaimMorseApplication) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ClaimMorseApplication(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_ClaimMorseApplication_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ClaimMorseApplication(ctx, req.(*MsgClaimMorseApplication)) + } + 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) @@ -188,6 +222,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "ClaimMorseAccount", Handler: _Msg_ClaimMorseAccount_Handler, }, + { + MethodName: "ClaimMorseApplication", + Handler: _Msg_ClaimMorseApplication_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/migration/tx.proto", diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 59f35d985..faa7452be 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -16,23 +16,24 @@ 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 ImportMorseClaimableAccounts (MsgImportMorseClaimableAccounts) returns (MsgImportMorseClaimableAccountsResponse); rpc ClaimMorseAccount (MsgClaimMorseAccount ) returns (MsgClaimMorseAccountResponse ); + rpc ClaimMorseApplication (MsgClaimMorseApplication ) returns (MsgClaimMorseApplicationResponse ); } // MsgUpdateParams is the Msg/UpdateParams request type. message 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]; } @@ -44,13 +45,13 @@ message MsgUpdateParamsResponse {} // MsgImportMorseClaimableAccounts is used to create the on-chain MorseClaimableAccounts ONLY ONCE (per network / re-genesis). message MsgImportMorseClaimableAccounts { option (cosmos.msg.v1.signer) = "authority"; - + // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - + // the account state derived from the Morse state export and the `poktrolld migrate collect-morse-accounts` command. MorseAccountState morse_account_state = 2 [(gogoproto.jsontag) = "morse_account_state", (gogoproto.nullable) = false]; - + // expected sha256 hash of the morse_account_state. If this hash does not match the on-chain // computation, the transaction will fail. Social consensus regarding the correctness of // morse_account_state should have been achieved off-chain and can be verified on-chain by @@ -66,10 +67,10 @@ message MsgImportMorseClaimableAccounts { // of the given Shannon account (who MUST also be the signer of this message). // Authz grant(s) MAY be used to delegate the authority to create a claim on behalf of another Shannon account. message MsgImportMorseClaimableAccountsResponse { - + // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. bytes state_hash = 1 [(gogoproto.jsontag) = "state_hash"]; - + // Number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. uint64 num_accounts = 2 [(gogoproto.jsontag) = "num_accounts"]; @@ -80,25 +81,43 @@ message MsgImportMorseClaimableAccountsResponse { // by the MsgClaimMorseAccount message, when it is claimed (also a one-time event, per claimable account). message MsgClaimMorseAccount { option (cosmos.msg.v1.signer) = "shannon_dest_address"; - + // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. string shannon_dest_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "shannon_dest_address"]; - + // The hex-encoded address of the Morse account whose balance will be claimed. string morse_src_address = 2 [(gogoproto.jsontag) = "morse_src_address"]; - + // The hex-encoded signature, by the Morse account, of this message (where this field is nil). string morse_signature = 3 [(gogoproto.jsontag) = "morse_signature"]; } message MsgClaimMorseAccountResponse { + // The hex-encoded address of the Morse account whose balance will be claimed. string morse_src_address = 1 [(gogoproto.jsontag) = "morse_src_address"]; - + // The balance which was claimed. cosmos.base.v1beta1.Coin claimed_balance = 2 [(gogoproto.jsontag) = "claimed_balance", (gogoproto.nullable) = false]; - + // The height (on Shannon) at which the claim was created. int64 claimed_at_height = 3; } +message MsgClaimMorseApplication { + option (cosmos.msg.v1.signer) = "shannonDestAddress"; + string shannonDestAddress = 1; + string morseSrcAddress = 2; + string morseSignature = 3; + cosmos.base.v1beta1.Coin stake = 4 [(gogoproto.nullable) = false]; + string serviceConfig = 5; +} + +message MsgClaimMorseApplicationResponse { + string morseSrcAddress = 1; + cosmos.base.v1beta1.Coin claimedBalance = 2 [(gogoproto.nullable) = false]; + string serviceId = 3; + cosmos.base.v1beta1.Coin claimedApplicationStake = 4 [(gogoproto.nullable) = false]; + int32 claimedAtHeight = 5; +} + diff --git a/x/migration/keeper/msg_server_claim_morse_application.go b/x/migration/keeper/msg_server_claim_morse_application.go new file mode 100644 index 000000000..215e152ce --- /dev/null +++ b/x/migration/keeper/msg_server_claim_morse_application.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + +) + +func (k msgServer) ClaimMorseApplication(goCtx context.Context, msg *types.MsgClaimMorseApplication) (*types.MsgClaimMorseApplicationResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgClaimMorseApplicationResponse{}, nil +} diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index 306b7c52f..0e1d72f9c 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -59,6 +59,12 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Skip: true, // skipped because autoCLI cannot handle signing // TODO_UPNEXT(@bryanchriswhite#1034): Add morse account claiming CLI. }, + { + RpcMethod: "ClaimMorseApplication", + Use: "claim-morse-application [morse-src-address] [morse-signature] [stake] [service-config]", + Short: "Send a claim_morse_application tx", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morseSrcAddress"}, {ProtoField: "morseSignature"}, {ProtoField: "stake"}, {ProtoField: "serviceConfig"}}, + }, // this line is used by ignite scaffolding # autocli/tx }, }, diff --git a/x/migration/module/simulation.go b/x/migration/module/simulation.go index 47596f99f..64ce5c980 100644 --- a/x/migration/module/simulation.go +++ b/x/migration/module/simulation.go @@ -31,6 +31,10 @@ const ( // TODO: Determine the simulation weight value defaultWeightMsgClaimMorseAccount int = 100 + opWeightMsgClaimMorseApplication = "op_weight_msg_claim_morse_application" + // TODO: Determine the simulation weight value + defaultWeightMsgClaimMorseApplication int = 100 + // this line is used by starport scaffolding # simapp/module/const ) @@ -76,6 +80,17 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp migrationsimulation.SimulateMsgClaimMorseAccount(am.accountKeeper, am.bankKeeper, am.keeper), )) + var weightMsgClaimMorseApplication int + simState.AppParams.GetOrGenerate(opWeightMsgClaimMorseApplication, &weightMsgClaimMorseApplication, nil, + func(_ *rand.Rand) { + weightMsgClaimMorseApplication = defaultWeightMsgClaimMorseApplication + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgClaimMorseApplication, + migrationsimulation.SimulateMsgClaimMorseApplication(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations @@ -100,6 +115,14 @@ func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.Wei return nil }, ), + simulation.NewWeightedProposalMsg( + opWeightMsgClaimMorseApplication, + defaultWeightMsgClaimMorseApplication, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + migrationsimulation.SimulateMsgClaimMorseApplication(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, + ), // this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/migration/simulation/claim_morse_application.go b/x/migration/simulation/claim_morse_application.go new file mode 100644 index 000000000..000d32560 --- /dev/null +++ b/x/migration/simulation/claim_morse_application.go @@ -0,0 +1,28 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + " +) + +func SimulateMsgClaimMorseApplication( + 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.MsgClaimMorseApplication{ + ShannonDestAddress: simAccount.Address.String(), + } + + // TODO: Handling the ClaimMorseApplication simulation + + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "ClaimMorseApplication simulation not implemented"), nil, nil + } +} diff --git a/x/migration/types/codec.go b/x/migration/types/codec.go index 7c2642ad2..f9a5aab5f 100644 --- a/x/migration/types/codec.go +++ b/x/migration/types/codec.go @@ -14,6 +14,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgClaimMorseAccount{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgClaimMorseApplication{}, + ) // this line is used by starport scaffolding # 3 registry.RegisterImplementations((*sdk.Msg)(nil), diff --git a/x/migration/types/message_claim_morse_application.go b/x/migration/types/message_claim_morse_application.go new file mode 100644 index 000000000..50f36d6c2 --- /dev/null +++ b/x/migration/types/message_claim_morse_application.go @@ -0,0 +1,27 @@ +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 = &MsgClaimMorseApplication{} + +func NewMsgClaimMorseApplication(shannonDestAddress string, morseSrcAddress string, morseSignature string, stake sdk.Coin, serviceConfig string) *MsgClaimMorseApplication { + return &MsgClaimMorseApplication{ + ShannonDestAddress: shannonDestAddress, + MorseSrcAddress: morseSrcAddress, + MorseSignature: morseSignature, + Stake: stake, + ServiceConfig: serviceConfig, + } +} + +func (msg *MsgClaimMorseApplication) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.ShannonDestAddress) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid shannonDestAddress address (%s)", err) + } + return nil +} diff --git a/x/migration/types/message_claim_morse_application_test.go b/x/migration/types/message_claim_morse_application_test.go new file mode 100644 index 000000000..208e813a3 --- /dev/null +++ b/x/migration/types/message_claim_morse_application_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/pokt-network/poktroll/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgClaimMorseApplication_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgClaimMorseApplication + err error + }{ + { + name: "invalid address", + msg: MsgClaimMorseApplication{ + ShannonDestAddress: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgClaimMorseApplication{ + ShannonDestAddress: 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) + }) + } +} diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 38857d9d2..34b98d7bd 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -361,6 +361,150 @@ func (m *MsgClaimMorseAccountResponse) GetClaimedAtHeight() int64 { return 0 } +type MsgClaimMorseApplication struct { + ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannonDestAddress,proto3" json:"shannonDestAddress,omitempty"` + MorseSrcAddress string `protobuf:"bytes,2,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` + MorseSignature string `protobuf:"bytes,3,opt,name=morseSignature,proto3" json:"morseSignature,omitempty"` + Stake types.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake"` + ServiceConfig string `protobuf:"bytes,5,opt,name=serviceConfig,proto3" json:"serviceConfig,omitempty"` +} + +func (m *MsgClaimMorseApplication) Reset() { *m = MsgClaimMorseApplication{} } +func (m *MsgClaimMorseApplication) String() string { return proto.CompactTextString(m) } +func (*MsgClaimMorseApplication) ProtoMessage() {} +func (*MsgClaimMorseApplication) Descriptor() ([]byte, []int) { + return fileDescriptor_21658240592266b6, []int{6} +} +func (m *MsgClaimMorseApplication) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimMorseApplication) 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 *MsgClaimMorseApplication) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimMorseApplication.Merge(m, src) +} +func (m *MsgClaimMorseApplication) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimMorseApplication) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimMorseApplication.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimMorseApplication proto.InternalMessageInfo + +func (m *MsgClaimMorseApplication) GetShannonDestAddress() string { + if m != nil { + return m.ShannonDestAddress + } + return "" +} + +func (m *MsgClaimMorseApplication) GetMorseSrcAddress() string { + if m != nil { + return m.MorseSrcAddress + } + return "" +} + +func (m *MsgClaimMorseApplication) GetMorseSignature() string { + if m != nil { + return m.MorseSignature + } + return "" +} + +func (m *MsgClaimMorseApplication) GetStake() types.Coin { + if m != nil { + return m.Stake + } + return types.Coin{} +} + +func (m *MsgClaimMorseApplication) GetServiceConfig() string { + if m != nil { + return m.ServiceConfig + } + return "" +} + +type MsgClaimMorseApplicationResponse struct { + MorseSrcAddress string `protobuf:"bytes,1,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` + ClaimedBalance types.Coin `protobuf:"bytes,2,opt,name=claimedBalance,proto3" json:"claimedBalance"` + ServiceId string `protobuf:"bytes,3,opt,name=serviceId,proto3" json:"serviceId,omitempty"` + ClaimedApplicationStake types.Coin `protobuf:"bytes,4,opt,name=claimedApplicationStake,proto3" json:"claimedApplicationStake"` + ClaimedAtHeight int32 `protobuf:"varint,5,opt,name=claimedAtHeight,proto3" json:"claimedAtHeight,omitempty"` +} + +func (m *MsgClaimMorseApplicationResponse) Reset() { *m = MsgClaimMorseApplicationResponse{} } +func (m *MsgClaimMorseApplicationResponse) String() string { return proto.CompactTextString(m) } +func (*MsgClaimMorseApplicationResponse) ProtoMessage() {} +func (*MsgClaimMorseApplicationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_21658240592266b6, []int{7} +} +func (m *MsgClaimMorseApplicationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimMorseApplicationResponse) 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 *MsgClaimMorseApplicationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimMorseApplicationResponse.Merge(m, src) +} +func (m *MsgClaimMorseApplicationResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimMorseApplicationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimMorseApplicationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimMorseApplicationResponse proto.InternalMessageInfo + +func (m *MsgClaimMorseApplicationResponse) GetMorseSrcAddress() string { + if m != nil { + return m.MorseSrcAddress + } + return "" +} + +func (m *MsgClaimMorseApplicationResponse) GetClaimedBalance() types.Coin { + if m != nil { + return m.ClaimedBalance + } + return types.Coin{} +} + +func (m *MsgClaimMorseApplicationResponse) GetServiceId() string { + if m != nil { + return m.ServiceId + } + return "" +} + +func (m *MsgClaimMorseApplicationResponse) GetClaimedApplicationStake() types.Coin { + if m != nil { + return m.ClaimedApplicationStake + } + return types.Coin{} +} + +func (m *MsgClaimMorseApplicationResponse) GetClaimedAtHeight() int32 { + if m != nil { + return m.ClaimedAtHeight + } + return 0 +} + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.migration.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.migration.MsgUpdateParamsResponse") @@ -368,61 +512,73 @@ func init() { proto.RegisterType((*MsgImportMorseClaimableAccountsResponse)(nil), "poktroll.migration.MsgImportMorseClaimableAccountsResponse") proto.RegisterType((*MsgClaimMorseAccount)(nil), "poktroll.migration.MsgClaimMorseAccount") proto.RegisterType((*MsgClaimMorseAccountResponse)(nil), "poktroll.migration.MsgClaimMorseAccountResponse") + proto.RegisterType((*MsgClaimMorseApplication)(nil), "poktroll.migration.MsgClaimMorseApplication") + proto.RegisterType((*MsgClaimMorseApplicationResponse)(nil), "poktroll.migration.MsgClaimMorseApplicationResponse") } func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 772 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x4f, 0x4f, 0xdb, 0x48, - 0x14, 0x8f, 0xc3, 0x2e, 0x52, 0x06, 0x94, 0x6c, 0x4c, 0x10, 0x49, 0x40, 0x36, 0xca, 0xfe, 0x8b, - 0xb2, 0xc2, 0xe6, 0x8f, 0xb4, 0x2b, 0xb1, 0xbb, 0x87, 0x98, 0x1e, 0xe8, 0x21, 0x12, 0x32, 0xe2, - 0xd2, 0x1e, 0xdc, 0x89, 0x33, 0xb2, 0x2d, 0xe2, 0x99, 0xc8, 0x33, 0xa1, 0x70, 0xab, 0x7a, 0xac, - 0x54, 0x89, 0x53, 0x3f, 0x43, 0x8f, 0x1c, 0xf8, 0x02, 0xbd, 0x71, 0x44, 0x3d, 0x71, 0xb2, 0xaa, - 0x70, 0x40, 0xf2, 0xb1, 0x9f, 0xa0, 0xb2, 0x3d, 0x0e, 0xf9, 0xe3, 0x50, 0xca, 0x25, 0xf1, 0xbc, - 0xf7, 0x7b, 0xef, 0xfd, 0xde, 0xef, 0x8d, 0x9f, 0xc1, 0x6a, 0x8f, 0x1c, 0x33, 0x8f, 0x74, 0xbb, - 0xaa, 0xeb, 0x58, 0x1e, 0x64, 0x0e, 0xc1, 0x2a, 0x3b, 0x55, 0x7a, 0x1e, 0x61, 0x44, 0x14, 0x13, - 0xa7, 0x32, 0x74, 0x56, 0x8b, 0xd0, 0x75, 0x30, 0x51, 0xa3, 0xdf, 0x18, 0x56, 0x5d, 0x31, 0x09, - 0x75, 0x09, 0x55, 0x5d, 0x6a, 0xa9, 0x27, 0x5b, 0xe1, 0x1f, 0x77, 0x54, 0x62, 0x87, 0x11, 0x9d, - 0xd4, 0xf8, 0xc0, 0x5d, 0x25, 0x8b, 0x58, 0x24, 0xb6, 0x87, 0x4f, 0xdc, 0xfa, 0x47, 0x0a, 0x1b, - 0x97, 0x78, 0x14, 0x19, 0x04, 0x9b, 0x36, 0x74, 0x30, 0xc7, 0xc9, 0x29, 0xb8, 0x1e, 0xf4, 0xa0, - 0x9b, 0xa4, 0x97, 0x38, 0xa5, 0x36, 0xa4, 0x48, 0x3d, 0xd9, 0x6a, 0x23, 0x06, 0xb7, 0x54, 0x93, - 0x24, 0x09, 0x6a, 0x9f, 0x04, 0x50, 0x68, 0x51, 0xeb, 0xa8, 0xd7, 0x81, 0x0c, 0x1d, 0x44, 0x91, - 0xe2, 0xdf, 0x20, 0x07, 0xfb, 0xcc, 0x26, 0x9e, 0xc3, 0xce, 0xca, 0xc2, 0xba, 0x50, 0xcf, 0x69, - 0xe5, 0xcf, 0x97, 0x1b, 0x25, 0xce, 0xbb, 0xd9, 0xe9, 0x78, 0x88, 0xd2, 0x43, 0xe6, 0x39, 0xd8, - 0xd2, 0xef, 0xa1, 0xe2, 0xff, 0x60, 0x3e, 0xae, 0x5d, 0xce, 0xae, 0x0b, 0xf5, 0x85, 0xed, 0xaa, - 0x32, 0x2d, 0x9b, 0x12, 0xd7, 0xd0, 0x72, 0x57, 0xbe, 0x9c, 0xf9, 0x78, 0x77, 0xd1, 0x10, 0x74, - 0x1e, 0xb4, 0xfb, 0xcf, 0xdb, 0xbb, 0x8b, 0xc6, 0x7d, 0xba, 0x77, 0x77, 0x17, 0x8d, 0xdf, 0x86, - 0xed, 0x9d, 0x8e, 0x34, 0x38, 0xc1, 0xb7, 0x56, 0x01, 0x2b, 0x13, 0x26, 0x1d, 0xd1, 0x1e, 0xc1, - 0x14, 0xd5, 0x2e, 0xb3, 0x40, 0x6e, 0x51, 0xeb, 0xb9, 0xdb, 0x23, 0x1e, 0x6b, 0x85, 0x02, 0xee, - 0x75, 0xa1, 0xe3, 0xc2, 0x76, 0x17, 0x35, 0x4d, 0x93, 0xf4, 0x31, 0x7b, 0x7a, 0xbb, 0x1e, 0x58, - 0x8a, 0x47, 0x02, 0xe3, 0x4c, 0x06, 0x65, 0x90, 0x21, 0xde, 0xfb, 0xef, 0x69, 0xbd, 0x47, 0x04, - 0x78, 0xdd, 0xc3, 0x10, 0xac, 0xad, 0x86, 0x32, 0x04, 0xbe, 0x9c, 0x96, 0x49, 0x2f, 0xba, 0x93, - 0x78, 0xf1, 0x08, 0x94, 0x53, 0x90, 0x86, 0x0d, 0xa9, 0x5d, 0x9e, 0x5b, 0x17, 0xea, 0x8b, 0xda, - 0x5a, 0xe0, 0xcb, 0x33, 0x31, 0xfa, 0xf2, 0x54, 0xca, 0x7d, 0x48, 0xed, 0xdd, 0xfc, 0xb8, 0xf4, - 0xb5, 0xf7, 0x02, 0xf8, 0xf3, 0x3b, 0xb2, 0x25, 0x12, 0x8b, 0x1b, 0x00, 0x8c, 0x90, 0x10, 0x22, - 0x12, 0xf9, 0xc0, 0x97, 0x47, 0xac, 0x7a, 0x8e, 0x26, 0xa5, 0xc4, 0x1d, 0xb0, 0x88, 0xfb, 0x6e, - 0xc2, 0x2d, 0xbe, 0x2a, 0x3f, 0x69, 0xbf, 0x04, 0xbe, 0x3c, 0x66, 0xd7, 0x17, 0x70, 0xdf, 0x4d, - 0x6a, 0xd5, 0x3e, 0x64, 0x41, 0xa9, 0x45, 0xad, 0x88, 0xc4, 0xa8, 0x88, 0x62, 0x1b, 0x94, 0xa8, - 0x0d, 0x31, 0x26, 0xd8, 0xe8, 0x20, 0xca, 0x0c, 0x18, 0x0f, 0x8b, 0x8f, 0x71, 0x33, 0xf0, 0xe5, - 0x54, 0xff, 0xcc, 0xf1, 0x8a, 0x1c, 0xfd, 0x0c, 0x51, 0xc6, 0x3d, 0x62, 0x13, 0xc4, 0x83, 0x30, - 0xa8, 0x67, 0x0e, 0x0b, 0x64, 0xa3, 0x02, 0xcb, 0x81, 0x2f, 0x4f, 0x3b, 0xf5, 0x42, 0x64, 0x3a, - 0xf4, 0xcc, 0x24, 0xc5, 0x7f, 0xa0, 0xc0, 0x51, 0x8e, 0x85, 0x21, 0xeb, 0x7b, 0x28, 0x9a, 0x56, - 0x4e, 0x5b, 0x0a, 0x7c, 0x79, 0xd2, 0xa5, 0xe7, 0xe3, 0xf0, 0xe4, 0xbc, 0x5b, 0x09, 0xa7, 0x93, - 0xda, 0x47, 0x2d, 0x10, 0xc0, 0x5a, 0x9a, 0x30, 0xc3, 0xe9, 0xa4, 0x92, 0x17, 0x7e, 0x88, 0xfc, - 0x4b, 0x50, 0x30, 0xc3, 0xfc, 0xa8, 0x63, 0xb4, 0x61, 0x17, 0x62, 0x33, 0xb9, 0xe3, 0x15, 0x85, - 0x6b, 0x18, 0x2e, 0x17, 0x85, 0x2f, 0x17, 0x65, 0x8f, 0x38, 0x58, 0x5b, 0xe1, 0xf7, 0x7a, 0x32, - 0x52, 0xcf, 0x73, 0x83, 0x16, 0x9f, 0xc5, 0x06, 0x28, 0x26, 0x10, 0xc8, 0x0c, 0x1b, 0x39, 0x96, - 0xcd, 0x22, 0x6d, 0xe6, 0xf4, 0x24, 0xb6, 0xc9, 0xf6, 0x23, 0xf3, 0xf6, 0xd7, 0x2c, 0x98, 0x6b, - 0x51, 0x4b, 0x7c, 0x05, 0x16, 0xc7, 0xf6, 0xd5, 0xaf, 0xa9, 0xef, 0xda, 0xf8, 0x46, 0xa8, 0xfe, - 0xf5, 0x08, 0xd0, 0x50, 0xb5, 0x73, 0x01, 0xac, 0x3d, 0xb8, 0x33, 0x76, 0x66, 0x64, 0x7b, 0x28, - 0xa8, 0xfa, 0xef, 0x13, 0x82, 0x86, 0x94, 0x08, 0x28, 0x4e, 0x5f, 0xff, 0xfa, 0x8c, 0x8c, 0x53, - 0xc8, 0xea, 0xe6, 0x63, 0x91, 0x49, 0xc1, 0xea, 0xcf, 0x6f, 0xc2, 0xed, 0xac, 0x1d, 0x5c, 0x0d, - 0x24, 0xe1, 0x7a, 0x20, 0x09, 0x37, 0x03, 0x49, 0xf8, 0x32, 0x90, 0x84, 0xf3, 0x5b, 0x29, 0x73, - 0x7d, 0x2b, 0x65, 0x6e, 0x6e, 0xa5, 0xcc, 0x8b, 0x6d, 0xcb, 0x61, 0x76, 0xbf, 0xad, 0x98, 0xc4, - 0x55, 0xc3, 0x02, 0x1b, 0x18, 0xb1, 0xd7, 0xc4, 0x3b, 0x56, 0x53, 0x17, 0x37, 0x3b, 0xeb, 0x21, - 0xda, 0x9e, 0x8f, 0xbe, 0x3c, 0x3b, 0xdf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x17, 0x88, 0x75, - 0x72, 0x07, 0x00, 0x00, + // 936 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x3d, 0x6f, 0xdb, 0x46, + 0x18, 0x36, 0x65, 0x3b, 0x80, 0xde, 0xb8, 0x76, 0xcd, 0xd8, 0x90, 0xac, 0x18, 0xa2, 0xa1, 0xa6, + 0xa9, 0xe0, 0xd6, 0x64, 0x6c, 0xf7, 0x03, 0x70, 0xdb, 0xc1, 0x74, 0x81, 0x26, 0x83, 0x80, 0x80, + 0x46, 0x86, 0xb6, 0x03, 0x7b, 0xa2, 0xae, 0x24, 0x61, 0xf1, 0x8e, 0xe0, 0x9d, 0xdc, 0x04, 0x5d, + 0x8a, 0x8e, 0x05, 0x0a, 0x04, 0x1d, 0xfa, 0x1b, 0x3a, 0x7a, 0xc8, 0xd0, 0xb5, 0x5b, 0xc6, 0xa0, + 0x53, 0x26, 0xa1, 0xb0, 0x07, 0x03, 0x5a, 0xfa, 0x17, 0x0a, 0xf2, 0x8e, 0x92, 0x45, 0x9d, 0xa2, + 0xd8, 0x8b, 0x2d, 0xbe, 0xef, 0xf3, 0x7e, 0x3c, 0xcf, 0x73, 0xfc, 0x80, 0xbb, 0x31, 0x3d, 0xe1, + 0x09, 0xed, 0x76, 0xad, 0x28, 0xf4, 0x13, 0xc4, 0x43, 0x4a, 0x2c, 0xfe, 0xd4, 0x8c, 0x13, 0xca, + 0xa9, 0xae, 0xe7, 0x49, 0x73, 0x98, 0xac, 0xad, 0xa2, 0x28, 0x24, 0xd4, 0xca, 0xfe, 0x0a, 0x58, + 0xad, 0xe2, 0x51, 0x16, 0x51, 0x66, 0x45, 0xcc, 0xb7, 0x4e, 0x77, 0xd3, 0x7f, 0x32, 0xb1, 0x21, + 0x12, 0x6e, 0x76, 0x65, 0x89, 0x0b, 0x99, 0x5a, 0xf3, 0xa9, 0x4f, 0x45, 0x3c, 0xfd, 0x25, 0xa3, + 0xf7, 0x15, 0xdb, 0x44, 0x34, 0x61, 0xd8, 0xa5, 0xc4, 0x0b, 0x50, 0x48, 0x24, 0xce, 0x50, 0xe0, + 0x62, 0x94, 0xa0, 0x28, 0x6f, 0x5f, 0x97, 0x2b, 0xb5, 0x11, 0xc3, 0xd6, 0xe9, 0x6e, 0x1b, 0x73, + 0xb4, 0x6b, 0x79, 0x34, 0x6f, 0xd0, 0xf8, 0x5b, 0x83, 0x95, 0x16, 0xf3, 0x9f, 0xc4, 0x1d, 0xc4, + 0xf1, 0xe3, 0xac, 0x52, 0xff, 0x14, 0xca, 0xa8, 0xc7, 0x03, 0x9a, 0x84, 0xfc, 0x59, 0x55, 0xdb, + 0xd2, 0x9a, 0x65, 0xbb, 0xfa, 0xcf, 0x8b, 0x9d, 0x35, 0xb9, 0xf7, 0x61, 0xa7, 0x93, 0x60, 0xc6, + 0x8e, 0x79, 0x12, 0x12, 0xdf, 0x19, 0x41, 0xf5, 0x2f, 0xe1, 0x96, 0x98, 0x5d, 0x2d, 0x6d, 0x69, + 0xcd, 0xdb, 0x7b, 0x35, 0x73, 0x52, 0x36, 0x53, 0xcc, 0xb0, 0xcb, 0x2f, 0xfb, 0xc6, 0xdc, 0x9f, + 0x97, 0x67, 0xdb, 0x9a, 0x23, 0x8b, 0x0e, 0x3e, 0xfb, 0xe5, 0xf2, 0x6c, 0x7b, 0xd4, 0xee, 0xd7, + 0xcb, 0xb3, 0xed, 0x7b, 0x43, 0x7a, 0x4f, 0xaf, 0x10, 0x2c, 0xec, 0xdb, 0xd8, 0x80, 0x4a, 0x21, + 0xe4, 0x60, 0x16, 0x53, 0xc2, 0x70, 0xe3, 0x45, 0x09, 0x8c, 0x16, 0xf3, 0x1f, 0x45, 0x31, 0x4d, + 0x78, 0x2b, 0x15, 0xf0, 0xa8, 0x8b, 0xc2, 0x08, 0xb5, 0xbb, 0xf8, 0xd0, 0xf3, 0x68, 0x8f, 0xf0, + 0x9b, 0xd3, 0x4d, 0xe0, 0x8e, 0xb0, 0x04, 0x89, 0x4e, 0x2e, 0xe3, 0x88, 0x63, 0xc9, 0xfd, 0x7d, + 0x15, 0xf7, 0x6c, 0x01, 0x39, 0xf7, 0x38, 0x05, 0xdb, 0x77, 0x53, 0x19, 0x06, 0x7d, 0x43, 0xd5, + 0xc9, 0x59, 0x8d, 0x8a, 0x78, 0xfd, 0x09, 0x54, 0x15, 0x48, 0x37, 0x40, 0x2c, 0xa8, 0xce, 0x6f, + 0x69, 0xcd, 0x25, 0x7b, 0x73, 0xd0, 0x37, 0xa6, 0x62, 0x9c, 0xf5, 0x89, 0x96, 0x0f, 0x11, 0x0b, + 0x0e, 0x96, 0xc7, 0xa5, 0x6f, 0xfc, 0xa6, 0xc1, 0x07, 0x33, 0x64, 0xcb, 0x25, 0xd6, 0x77, 0x00, + 0xae, 0x2c, 0xa1, 0x65, 0x4b, 0x2c, 0x0f, 0xfa, 0xc6, 0x95, 0xa8, 0x53, 0x66, 0xf9, 0x28, 0x7d, + 0x1f, 0x96, 0x48, 0x2f, 0xca, 0x77, 0x13, 0x47, 0x65, 0xc1, 0x7e, 0x77, 0xd0, 0x37, 0xc6, 0xe2, + 0xce, 0x6d, 0xd2, 0x8b, 0xf2, 0x59, 0x8d, 0x3f, 0x4a, 0xb0, 0xd6, 0x62, 0x7e, 0xb6, 0xc4, 0x55, + 0x11, 0xf5, 0x36, 0xac, 0xb1, 0x00, 0x11, 0x42, 0x89, 0xdb, 0xc1, 0x8c, 0xbb, 0x48, 0x98, 0x25, + 0x6d, 0x7c, 0x30, 0xe8, 0x1b, 0xca, 0xfc, 0x54, 0x7b, 0x75, 0x89, 0xfe, 0x0a, 0x33, 0x2e, 0x33, + 0xfa, 0x21, 0x08, 0x23, 0x5c, 0x96, 0x78, 0xc3, 0x01, 0xa5, 0x6c, 0xc0, 0xfa, 0xa0, 0x6f, 0x4c, + 0x26, 0x9d, 0x95, 0x2c, 0x74, 0x9c, 0x78, 0x79, 0x8b, 0x2f, 0x60, 0x45, 0xa2, 0x42, 0x9f, 0x20, + 0xde, 0x4b, 0x70, 0xe6, 0x56, 0xd9, 0xbe, 0x33, 0xe8, 0x1b, 0xc5, 0x94, 0xb3, 0x2c, 0xca, 0xf3, + 0xeb, 0x83, 0x8d, 0xd4, 0x1d, 0x25, 0x8f, 0xc6, 0x40, 0x83, 0x4d, 0x95, 0x30, 0x43, 0x77, 0x94, + 0xcb, 0x6b, 0xd7, 0x5a, 0xfe, 0x3b, 0x58, 0xf1, 0xd2, 0xfe, 0xb8, 0xe3, 0xb6, 0x51, 0x17, 0x11, + 0x2f, 0x3f, 0xe3, 0x1b, 0xa6, 0xd4, 0x30, 0x7d, 0xb8, 0x98, 0xf2, 0xe1, 0x62, 0x1e, 0xd1, 0x90, + 0xd8, 0x15, 0x79, 0xae, 0x8b, 0x95, 0xce, 0xb2, 0x0c, 0xd8, 0xe2, 0x5a, 0xdf, 0x86, 0xd5, 0x1c, + 0x82, 0xb8, 0x1b, 0xe0, 0xd0, 0x0f, 0x78, 0xa6, 0xcd, 0xbc, 0x93, 0xd7, 0x1e, 0xf2, 0x87, 0x59, + 0xb8, 0xf1, 0x7b, 0x09, 0xaa, 0xe3, 0x64, 0xe3, 0xb8, 0x1b, 0x7a, 0xd9, 0xbd, 0xa5, 0x9b, 0xa0, + 0xf0, 0x4e, 0x30, 0x55, 0xba, 0xda, 0x84, 0x22, 0x51, 0xe1, 0xe9, 0x24, 0xff, 0xfb, 0x50, 0x30, + 0x44, 0x78, 0x57, 0xb4, 0x49, 0xff, 0x04, 0x16, 0x19, 0x47, 0x27, 0xb8, 0xba, 0x30, 0x4b, 0x9d, + 0x85, 0x54, 0x1d, 0x47, 0xa0, 0xf5, 0x7b, 0xf0, 0x0e, 0xc3, 0xc9, 0x69, 0xe8, 0xe1, 0x23, 0x4a, + 0x7e, 0x08, 0xfd, 0xea, 0x62, 0xd6, 0x7d, 0x3c, 0x78, 0x50, 0x49, 0xcf, 0x80, 0x82, 0x47, 0xe3, + 0xaf, 0x12, 0x6c, 0x4d, 0x13, 0x65, 0x78, 0x0a, 0x14, 0x64, 0x35, 0x35, 0xd9, 0xaf, 0xa1, 0xe0, + 0xd0, 0x6c, 0xaf, 0x05, 0x9b, 0xa2, 0xb1, 0x9b, 0x50, 0x96, 0x0c, 0x1e, 0x75, 0xa4, 0x60, 0xa3, + 0x80, 0xfe, 0x0d, 0x54, 0x72, 0x77, 0x47, 0xeb, 0x1e, 0x5f, 0x47, 0xbd, 0x69, 0xf5, 0x29, 0xd7, + 0xc2, 0xc1, 0xc9, 0x14, 0x5d, 0x9c, 0x38, 0x4f, 0x7b, 0xff, 0xcd, 0xc3, 0x7c, 0x8b, 0xf9, 0xfa, + 0xf7, 0xb0, 0x34, 0xf6, 0xfe, 0x7b, 0x4f, 0xf9, 0xec, 0x1e, 0x7f, 0xc3, 0xd4, 0x3e, 0x7c, 0x0b, + 0xd0, 0x50, 0xff, 0xe7, 0x1a, 0x6c, 0xbe, 0xf1, 0x1d, 0xb4, 0x3f, 0xa5, 0xdb, 0x9b, 0x8a, 0x6a, + 0x9f, 0xdf, 0xa0, 0x68, 0xb8, 0x12, 0x85, 0xd5, 0xc9, 0xc7, 0x69, 0x73, 0x4a, 0xc7, 0x09, 0x64, + 0xed, 0xc1, 0xdb, 0x22, 0x87, 0x03, 0x7f, 0x82, 0x75, 0xf5, 0x9d, 0xfb, 0xd1, 0xec, 0x56, 0x23, + 0x74, 0xed, 0xe3, 0xeb, 0xa0, 0xf3, 0xe1, 0xb5, 0xc5, 0x9f, 0xd3, 0x4f, 0x0d, 0xfb, 0xf1, 0xcb, + 0xf3, 0xba, 0xf6, 0xea, 0xbc, 0xae, 0xbd, 0x3e, 0xaf, 0x6b, 0xff, 0x9e, 0xd7, 0xb5, 0xe7, 0x17, + 0xf5, 0xb9, 0x57, 0x17, 0xf5, 0xb9, 0xd7, 0x17, 0xf5, 0xb9, 0x6f, 0xf7, 0xfc, 0x90, 0x07, 0xbd, + 0xb6, 0xe9, 0xd1, 0xc8, 0x4a, 0x87, 0xec, 0x10, 0xcc, 0x7f, 0xa4, 0xc9, 0x89, 0xa5, 0xfc, 0x0a, + 0xe1, 0xcf, 0x62, 0xcc, 0xda, 0xb7, 0xb2, 0xcf, 0xa8, 0xfd, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, + 0xde, 0xeb, 0xbd, 0x12, 0x3f, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -442,6 +598,7 @@ type MsgClient interface { UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) ImportMorseClaimableAccounts(ctx context.Context, in *MsgImportMorseClaimableAccounts, opts ...grpc.CallOption) (*MsgImportMorseClaimableAccountsResponse, error) ClaimMorseAccount(ctx context.Context, in *MsgClaimMorseAccount, opts ...grpc.CallOption) (*MsgClaimMorseAccountResponse, error) + ClaimMorseApplication(ctx context.Context, in *MsgClaimMorseApplication, opts ...grpc.CallOption) (*MsgClaimMorseApplicationResponse, error) } type msgClient struct { @@ -479,6 +636,15 @@ func (c *msgClient) ClaimMorseAccount(ctx context.Context, in *MsgClaimMorseAcco return out, nil } +func (c *msgClient) ClaimMorseApplication(ctx context.Context, in *MsgClaimMorseApplication, opts ...grpc.CallOption) (*MsgClaimMorseApplicationResponse, error) { + out := new(MsgClaimMorseApplicationResponse) + err := c.cc.Invoke(ctx, "/poktroll.migration.Msg/ClaimMorseApplication", 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 @@ -486,6 +652,7 @@ type MsgServer interface { UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) ImportMorseClaimableAccounts(context.Context, *MsgImportMorseClaimableAccounts) (*MsgImportMorseClaimableAccountsResponse, error) ClaimMorseAccount(context.Context, *MsgClaimMorseAccount) (*MsgClaimMorseAccountResponse, error) + ClaimMorseApplication(context.Context, *MsgClaimMorseApplication) (*MsgClaimMorseApplicationResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -501,6 +668,9 @@ func (*UnimplementedMsgServer) ImportMorseClaimableAccounts(ctx context.Context, func (*UnimplementedMsgServer) ClaimMorseAccount(ctx context.Context, req *MsgClaimMorseAccount) (*MsgClaimMorseAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ClaimMorseAccount not implemented") } +func (*UnimplementedMsgServer) ClaimMorseApplication(ctx context.Context, req *MsgClaimMorseApplication) (*MsgClaimMorseApplicationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClaimMorseApplication not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -560,6 +730,24 @@ func _Msg_ClaimMorseAccount_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Msg_ClaimMorseApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClaimMorseApplication) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ClaimMorseApplication(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.migration.Msg/ClaimMorseApplication", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ClaimMorseApplication(ctx, req.(*MsgClaimMorseApplication)) + } + return interceptor(ctx, in, info, handler) +} + var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "poktroll.migration.Msg", @@ -577,6 +765,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "ClaimMorseAccount", Handler: _Msg_ClaimMorseAccount_Handler, }, + { + MethodName: "ClaimMorseApplication", + Handler: _Msg_ClaimMorseApplication_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/migration/tx.proto", @@ -816,6 +1008,129 @@ func (m *MsgClaimMorseAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *MsgClaimMorseApplication) 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 *MsgClaimMorseApplication) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimMorseApplication) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ServiceConfig) > 0 { + i -= len(m.ServiceConfig) + copy(dAtA[i:], m.ServiceConfig) + i = encodeVarintTx(dAtA, i, uint64(len(m.ServiceConfig))) + i-- + dAtA[i] = 0x2a + } + { + size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.MorseSignature) > 0 { + i -= len(m.MorseSignature) + copy(dAtA[i:], m.MorseSignature) + i = encodeVarintTx(dAtA, i, uint64(len(m.MorseSignature))) + i-- + dAtA[i] = 0x1a + } + if len(m.MorseSrcAddress) > 0 { + i -= len(m.MorseSrcAddress) + copy(dAtA[i:], m.MorseSrcAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.MorseSrcAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.ShannonDestAddress) > 0 { + i -= len(m.ShannonDestAddress) + copy(dAtA[i:], m.ShannonDestAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.ShannonDestAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgClaimMorseApplicationResponse) 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 *MsgClaimMorseApplicationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimMorseApplicationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ClaimedAtHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ClaimedAtHeight)) + i-- + dAtA[i] = 0x28 + } + { + size, err := m.ClaimedApplicationStake.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.ServiceId) > 0 { + i -= len(m.ServiceId) + copy(dAtA[i:], m.ServiceId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ServiceId))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.ClaimedBalance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.MorseSrcAddress) > 0 { + i -= len(m.MorseSrcAddress) + copy(dAtA[i:], m.MorseSrcAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.MorseSrcAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -925,24 +1240,75 @@ func (m *MsgClaimMorseAccountResponse) Size() (n int) { return n } -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func (m *MsgClaimMorseApplication) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ShannonDestAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MorseSrcAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MorseSignature) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Stake.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.ServiceConfig) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n } -func (m *MsgUpdateParams) 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 + +func (m *MsgClaimMorseApplicationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MorseSrcAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ClaimedBalance.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.ServiceId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ClaimedApplicationStake.Size() + n += 1 + l + sovTx(uint64(l)) + if m.ClaimedAtHeight != 0 { + n += 1 + sovTx(uint64(m.ClaimedAtHeight)) + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) 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++ @@ -1628,6 +1994,416 @@ func (m *MsgClaimMorseAccountResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgClaimMorseApplication) 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: MsgClaimMorseApplication: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimMorseApplication: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShannonDestAddress", 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.ShannonDestAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MorseSrcAddress", 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.MorseSrcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MorseSignature", 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.MorseSignature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceConfig", 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.ServiceConfig = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgClaimMorseApplicationResponse) 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: MsgClaimMorseApplicationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimMorseApplicationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MorseSrcAddress", 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.MorseSrcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedBalance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ClaimedBalance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", 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.ServiceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedApplicationStake", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ClaimedApplicationStake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) + } + m.ClaimedAtHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClaimedAtHeight |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 60389394336c2f8e0181151614f8d4e9813826c9 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 18 Feb 2025 12:43:24 +0100 Subject: [PATCH 33/81] fix: errors --- x/migration/keeper/msg_server_claim_morse_application.go | 7 ++++--- x/migration/simulation/claim_morse_application.go | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/x/migration/keeper/msg_server_claim_morse_application.go b/x/migration/keeper/msg_server_claim_morse_application.go index 215e152ce..95ee8a92e 100644 --- a/x/migration/keeper/msg_server_claim_morse_application.go +++ b/x/migration/keeper/msg_server_claim_morse_application.go @@ -4,14 +4,15 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - + + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) -func (k msgServer) ClaimMorseApplication(goCtx context.Context, msg *types.MsgClaimMorseApplication) (*types.MsgClaimMorseApplicationResponse, error) { +func (k msgServer) ClaimMorseApplication(goCtx context.Context, msg *migrationtypes.MsgClaimMorseApplication) (*migrationtypes.MsgClaimMorseApplicationResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // TODO: Handling the message _ = ctx - return &types.MsgClaimMorseApplicationResponse{}, nil + return &migrationtypes.MsgClaimMorseApplicationResponse{}, nil } diff --git a/x/migration/simulation/claim_morse_application.go b/x/migration/simulation/claim_morse_application.go index 000d32560..d1835561f 100644 --- a/x/migration/simulation/claim_morse_application.go +++ b/x/migration/simulation/claim_morse_application.go @@ -6,7 +6,9 @@ import ( "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 SimulateMsgClaimMorseApplication( From 3411b2978c63c30db847eef37490b81ac8dabe5d Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 19 Feb 2025 14:54:20 +0100 Subject: [PATCH 34/81] refactor: base integration suite bank client --- .../application/application_transfer_test.go | 48 ++++++++----------- testutil/integration/suites/application.go | 4 +- testutil/integration/suites/base.go | 13 ++++- testutil/integration/suites/base_test.go | 16 ++----- testutil/integration/suites/interface.go | 4 +- 5 files changed, 40 insertions(+), 45 deletions(-) diff --git a/tests/integration/application/application_transfer_test.go b/tests/integration/application/application_transfer_test.go index ad0b49cd7..5eebc0056 100644 --- a/tests/integration/application/application_transfer_test.go +++ b/tests/integration/application/application_transfer_test.go @@ -4,7 +4,6 @@ import ( "testing" cosmostypes "github.com/cosmos/cosmos-sdk/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -81,7 +80,7 @@ func (s *appTransferTestSuite) SetupTest() { }) // Assert the onchain state shows the application 3 as NOT staked. - _, queryErr := s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app3) + _, queryErr := s.GetAppQueryClient(s.T()).GetApplication(s.SdkCtx(), s.app3) require.ErrorContains(s.T(), queryErr, "application not found") require.ErrorContains(s.T(), queryErr, s.app3) } @@ -110,7 +109,7 @@ func (s *appTransferTestSuite) TestSingleSourceToNonexistentDestinationSucceeds( require.EqualValues(s.T(), expectedPendingTransfer, pendingTransfer) // Query and assert application pending transfer field updated in the store. - foundApp1, err := s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app1) + foundApp1, err := s.GetAppQueryClient(s.T()).GetApplication(s.SdkCtx(), s.app1) require.NoError(s.T(), err) require.EqualValues(s.T(), expectedPendingTransfer, foundApp1.GetPendingTransfer()) @@ -129,7 +128,7 @@ func (s *appTransferTestSuite) TestSingleSourceToNonexistentDestinationSucceeds( s.GetApp().NextBlocks(s.T(), int(blocksUntilTransferEndHeight)-1) // Assert that app1 is in transfer period. - foundApp1, err = s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app1) + foundApp1, err = s.GetAppQueryClient(s.T()).GetApplication(s.SdkCtx(), s.app1) require.NoError(s.T(), err) require.Equal(s.T(), s.app1, foundApp1.GetAddress()) @@ -139,7 +138,7 @@ func (s *appTransferTestSuite) TestSingleSourceToNonexistentDestinationSucceeds( s.GetApp().NextBlock(s.T()) // Query for and assert that the destination application was created. - foundApp3, err := s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app3) + foundApp3, err := s.GetAppQueryClient(s.T()).GetApplication(s.SdkCtx(), s.app3) require.NoError(s.T(), err) // Assert that the destination application was created with the correct state. @@ -164,21 +163,18 @@ func (s *appTransferTestSuite) TestSingleSourceToNonexistentDestinationSucceeds( s.shouldObserveTransferEndEvent(&foundApp3, s.app1) // Assert that app1 is unstaked. - _, err = s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app1) + _, err = s.GetAppQueryClient(s.T()).GetApplication(s.SdkCtx(), s.app1) require.ErrorContains(s.T(), err, "application not found") require.ErrorContains(s.T(), err, s.app1) // Assert that app1's bank balance has not changed. - balanceRes, err := s.GetBankQueryClient().Balance(s.SdkCtx(), &banktypes.QueryBalanceRequest{ - Address: s.app1, - Denom: volatile.DenomuPOKT, - }) + balance, err := s.GetBankQueryClient(s.T()).GetBalance(s.SdkCtx(), s.app1) require.NoError(s.T(), err) - require.NotNil(s.T(), balanceRes) + require.NotNil(s.T(), balance) require.EqualValues(s.T(), cosmostypes.NewInt64Coin(volatile.DenomuPOKT, appFundAmount-stakeAmount), - *balanceRes.GetBalance(), + *balance, ) } @@ -228,7 +224,7 @@ func (s *appTransferTestSuite) TestMultipleSourceToSameNonexistentDestinationMer require.EqualValues(s.T(), expectedPendingTransfer, pendingTransfer) // Query and assert application pending transfer field updated in the store. - foundSrcApp, srcAppErr := s.GetAppQueryClient().GetApplication(s.SdkCtx(), expectedSrcBech32) + foundSrcApp, srcAppErr := s.GetAppQueryClient(s.T()).GetApplication(s.SdkCtx(), expectedSrcBech32) require.NoError(s.T(), srcAppErr) require.EqualValues(s.T(), expectedPendingTransfer, foundSrcApp.GetPendingTransfer()) @@ -257,7 +253,7 @@ func (s *appTransferTestSuite) TestMultipleSourceToSameNonexistentDestinationMer s.GetApp().NextBlocks(s.T(), int(blocksUntilTransferEndHeight)-1) // Assert that app1 is in transfer period. - foundApp1, err := s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app1) + foundApp1, err := s.GetAppQueryClient(s.T()).GetApplication(s.SdkCtx(), s.app1) require.NoError(s.T(), err) require.Equal(s.T(), s.app1, foundApp1.GetAddress()) @@ -267,7 +263,7 @@ func (s *appTransferTestSuite) TestMultipleSourceToSameNonexistentDestinationMer s.GetApp().NextBlock(s.T()) // Assert that app3 is staked with the sum amount: app1 + app2. - foundApp3, err := s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app3) + foundApp3, err := s.GetAppQueryClient(s.T()).GetApplication(s.SdkCtx(), s.app3) require.NoError(s.T(), err) require.Equal(s.T(), s.app3, foundApp3.GetAddress()) @@ -308,30 +304,26 @@ func (s *appTransferTestSuite) TestMultipleSourceToSameNonexistentDestinationMer require.Equal(s.T(), len(expectedApp3ServiceIds), len(foundApp3.GetServiceConfigs())) // Assert that app1 is unstaked. - foundApp1, err = s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app1) + foundApp1, err = s.GetAppQueryClient(s.T()).GetApplication(s.SdkCtx(), s.app1) require.ErrorContains(s.T(), err, "application not found") require.ErrorContains(s.T(), err, s.app1) // Assert that app2 is unstaked. - _, err = s.GetAppQueryClient().GetApplication(s.SdkCtx(), s.app2) + _, err = s.GetAppQueryClient(s.T()).GetApplication(s.SdkCtx(), s.app2) require.ErrorContains(s.T(), err, "application not found") require.ErrorContains(s.T(), err, s.app2) // Assert that app1's bank balance has not changed - balRes, err := s.GetBankQueryClient().Balance(s.SdkCtx(), &banktypes.QueryBalanceRequest{ - Address: s.app1, - Denom: volatile.DenomuPOKT, - }) require.NoError(s.T(), err) - require.Equal(s.T(), appFundAmount-stakeAmount, balRes.GetBalance().Amount.Int64()) + + balance, err := s.GetBankQueryClient(s.T()).GetBalance(s.SdkCtx(), s.app1) + require.NoError(s.T(), err) + require.Equal(s.T(), appFundAmount-stakeAmount, balance.Amount.Int64()) // Assert that app2's bank balance has not changed - balRes, err = s.GetBankQueryClient().Balance(s.SdkCtx(), &banktypes.QueryBalanceRequest{ - Address: s.app2, - Denom: volatile.DenomuPOKT, - }) + balance, err = s.GetBankQueryClient(s.T()).GetBalance(s.SdkCtx(), s.app2) require.NoError(s.T(), err) - require.Equal(s.T(), appFundAmount-stakeAmount, balRes.GetBalance().Amount.Int64()) + require.Equal(s.T(), appFundAmount-stakeAmount, balance.Amount.Int64()) } // TODO_TEST: @@ -391,7 +383,7 @@ func (s *appTransferTestSuite) setupStakeApps(appBech32ToServiceIdsMap map[strin require.Equal(s.T(), stakeAmount, stakeAppRes.GetApplication().GetStake().Amount.Int64()) // Assert the onchain state shows the application as staked. - foundApp, queryErr := s.GetAppQueryClient().GetApplication(s.SdkCtx(), appBech32) + foundApp, queryErr := s.GetAppQueryClient(s.T()).GetApplication(s.SdkCtx(), appBech32) require.NoError(s.T(), queryErr) require.Equal(s.T(), appBech32, foundApp.GetAddress()) require.Equal(s.T(), stakeAmount, foundApp.GetStake().Amount.Int64()) diff --git a/testutil/integration/suites/application.go b/testutil/integration/suites/application.go index 86b22fccf..a54b2a756 100644 --- a/testutil/integration/suites/application.go +++ b/testutil/integration/suites/application.go @@ -24,10 +24,10 @@ type ApplicationModuleSuite struct { // GetAppQueryClient constructs and returns a query client for the application // module of the integration app. -func (s *ApplicationModuleSuite) GetAppQueryClient() client.ApplicationQueryClient { +func (s *ApplicationModuleSuite) GetAppQueryClient(t *testing.T) client.ApplicationQueryClient { deps := depinject.Supply(s.GetApp().QueryHelper()) appQueryClient, err := query.NewApplicationQuerier(deps) - require.NoError(s.T(), err) + require.NoError(t, err) return appQueryClient } diff --git a/testutil/integration/suites/base.go b/testutil/integration/suites/base.go index 491cae620..1a2adb5f6 100644 --- a/testutil/integration/suites/base.go +++ b/testutil/integration/suites/base.go @@ -6,6 +6,7 @@ import ( "testing" "cosmossdk.io/core/appmodule" + "cosmossdk.io/depinject" "github.com/cosmos/cosmos-sdk/codec" cosmostypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -14,6 +15,8 @@ import ( "github.com/stretchr/testify/suite" "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/pkg/client" + "github.com/pokt-network/poktroll/pkg/client/query" "github.com/pokt-network/poktroll/pkg/polylog" _ "github.com/pokt-network/poktroll/pkg/polylog/polyzero" "github.com/pokt-network/poktroll/testutil/integration" @@ -97,8 +100,14 @@ func (s *BaseIntegrationSuite) FundAddress( // GetBankQueryClient constructs and returns a query client for the bank module // of the integration app. -func (s *BaseIntegrationSuite) GetBankQueryClient() banktypes.QueryClient { - return banktypes.NewQueryClient(s.GetApp().QueryHelper()) +func (s *BaseIntegrationSuite) GetBankQueryClient(t *testing.T) client.BankQueryClient { + t.Helper() + + deps := depinject.Supply(s.GetApp().QueryHelper()) + bankqueryClient, err := query.NewBankQuerier(deps) + require.NoError(t, err) + + return bankqueryClient } // FilterEvents returns the events from the event manager which match the given diff --git a/testutil/integration/suites/base_test.go b/testutil/integration/suites/base_test.go index 6952668ba..a4694797f 100644 --- a/testutil/integration/suites/base_test.go +++ b/testutil/integration/suites/base_test.go @@ -93,24 +93,18 @@ func (s *baseIntegrationSuiteTestSuite) TestFundAddressAndGetBankQueryClient() { require.NoError(s.T(), err) // Assert that the balance is zero before funding. - bankQueryClient := s.GetBankQueryClient() - balRes, err := bankQueryClient.Balance(s.SdkCtx(), &banktypes.QueryBalanceRequest{ - Address: fundAddr.String(), - Denom: volatile.DenomuPOKT, - }) + bankClient := s.GetBankQueryClient(s.T()) + balance, err := bankClient.GetBalance(s.SdkCtx(), fundAddr.String()) require.NoError(s.T(), err) - require.Equal(s.T(), int64(0), balRes.GetBalance().Amount.Int64()) + require.Equal(s.T(), int64(0), balance.Amount.Int64()) // Fund the address. s.FundAddress(s.T(), fundAddr, fundAmount) // Assert that the balance amount is equal to fundAmount. - balRes, err = bankQueryClient.Balance(s.SdkCtx(), &banktypes.QueryBalanceRequest{ - Address: fundAddr.String(), - Denom: volatile.DenomuPOKT, - }) + balance, err = bankClient.GetBalance(s.SdkCtx(), fundAddr.String()) require.NoError(s.T(), err) - require.Equal(s.T(), fundAmount, balRes.GetBalance().Amount.Int64()) + require.Equal(s.T(), fundAmount, balance.Amount.Int64()) } func (s *baseIntegrationSuiteTestSuite) TestFilterLatestEventsWithNewMsgEventMatchFn() { diff --git a/testutil/integration/suites/interface.go b/testutil/integration/suites/interface.go index d88246a90..0d4321d8f 100644 --- a/testutil/integration/suites/interface.go +++ b/testutil/integration/suites/interface.go @@ -4,8 +4,8 @@ import ( "testing" cosmostypes "github.com/cosmos/cosmos-sdk/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/pokt-network/poktroll/pkg/client" "github.com/pokt-network/poktroll/testutil/integration" ) @@ -31,7 +31,7 @@ type IntegrationSuite interface { FundAddress(t *testing.T, addr cosmostypes.AccAddress, amtUpokt int64) // GetBankQueryClient constructs and returns a query client for the bank module // of the integration app. - GetBankQueryClient() banktypes.QueryClient + GetBankQueryClient(t *testing.T) client.BankQueryClient // FilterEvents returns the events from the event manager which match the given // matchFn. Events are returned in reverse order, i.e. the most recent event is From 7128b8398983d98cdb205ea22bc238bbc3a4db8a Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 19 Feb 2025 14:54:44 +0100 Subject: [PATCH 35/81] test: refactor integration test to a suite --- .../morse_account_import_and_claim_test.go | 123 ++++++++---------- testutil/integration/suites/migration.go | 104 +++++++++++++++ 2 files changed, 159 insertions(+), 68 deletions(-) create mode 100644 testutil/integration/suites/migration.go diff --git a/tests/integration/migration/morse_account_import_and_claim_test.go b/tests/integration/migration/morse_account_import_and_claim_test.go index 77b4cbeb2..627617744 100644 --- a/tests/integration/migration/morse_account_import_and_claim_test.go +++ b/tests/integration/migration/morse_account_import_and_claim_test.go @@ -3,106 +3,93 @@ package migration import ( "testing" - "cosmossdk.io/depinject" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" "github.com/pokt-network/poktroll/app/volatile" - "github.com/pokt-network/poktroll/pkg/client/query" - "github.com/pokt-network/poktroll/testutil/integration" + "github.com/pokt-network/poktroll/testutil/integration/suites" "github.com/pokt-network/poktroll/testutil/sample" - "github.com/pokt-network/poktroll/testutil/testmigration" migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) -func TestMsgServer_CreateMorseAccountClaim(t *testing.T) { - app := integration.NewCompleteIntegrationApp(t) +type MigrationModuleTestSuite struct { + suites.MigrationModuleSuite - // Generate Morse claimable accounts. - numAccounts := 10 - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts) + // TODO_IN_THIS_COMMIT: godoc... + numAccounts int +} + +func (s *MigrationModuleTestSuite) SetupTest() { + // Initialize a new integration app for the suite. + s.NewApp(s.T()) - msgImport, err := migrationtypes.NewMsgImportMorseClaimableAccounts( - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - *accountState, - ) - require.NoError(t, err) + s.numAccounts = 10 - // Import Morse claimable accounts. - resAny, err := app.RunMsg(t, msgImport) - require.NoError(t, err) + // Assign the app to nested suites. + s.AppSuite.SetApp(s.GetApp()) +} - msgImportRes, ok := resAny.(*migrationtypes.MsgImportMorseClaimableAccountsResponse) - require.True(t, ok) +func TestMigrationModuleSuite(t *testing.T) { + suite.Run(t, &MigrationModuleTestSuite{}) +} - morseAccountStateHash, err := accountState.GetHash() - require.NoError(t, err) +// TODO_IN_THIS_COMMIT: godoc... +func (s *MigrationModuleTestSuite) TestImportMorseClaimableAccounts() { + s.GenerateMorseAccountState(s.T(), s.numAccounts) + msgImportRes := s.ImportMorseClaimableAccounts(s.T()) + morseAccountStateHash, err := s.GetAccountState(s.T()).GetHash() + require.NoError(s.T(), err) expectedMsgImportRes := &migrationtypes.MsgImportMorseClaimableAccountsResponse{ StateHash: morseAccountStateHash, - NumAccounts: uint64(numAccounts), + NumAccounts: uint64(s.numAccounts), } - require.Equal(t, expectedMsgImportRes, msgImportRes) + require.Equal(s.T(), expectedMsgImportRes, msgImportRes) +} - deps := depinject.Supply(app.QueryHelper()) - bankClient, err := query.NewBankQuerier(deps) - require.NoError(t, err) +// TODO_IN_THIS_COMMIT: godoc... +func (s *MigrationModuleTestSuite) TestClaimMorseAccount() { + s.GenerateMorseAccountState(s.T(), s.numAccounts) + s.ImportMorseClaimableAccounts(s.T()) - // Assert that the shannonDestAddr account initially has a zero balance. shannonDestAddr := sample.AccAddress() - shannonDestBalance, err := bankClient.GetBalance(app.GetSdkCtx(), shannonDestAddr) - require.NoError(t, err) - require.Equal(t, int64(0), shannonDestBalance.Amount.Int64()) - - morsePrivateKey := testmigration.NewMorsePrivateKey(t, 1) - morseSrcAddr := morsePrivateKey.PubKey().Address().String() - require.Equal(t, morseSrcAddr, accountState.Accounts[0].MorseSrcAddress) - - morseClaimMsg, err := migrationtypes.NewMsgClaimMorseAccount( - shannonDestAddr, - morseSrcAddr, - morsePrivateKey, - ) - require.NoError(t, err) - - // Claim a Morse claimable account. - resAny, err = app.RunMsg(t, morseClaimMsg) - require.NoError(t, err) - - expectedBalance := sdk.NewInt64Coin(volatile.DenomuPOKT, 1110111) + + bankClient := s.GetBankQueryClient(s.T()) + shannonDestBalance, err := bankClient.GetBalance(s.SdkCtx(), shannonDestAddr) + require.NoError(s.T(), err) + require.Equal(s.T(), int64(0), shannonDestBalance.Amount.Int64()) + + morseSrcAddr, claimAccountRes := s.ClaimMorseAccount(s.T(), 1, shannonDestAddr) + + expectedMorseClaimableAccount := s.GetAccountState(s.T()).Accounts[0] + expectedBalance := expectedMorseClaimableAccount.GetUnstakedBalance(). + Add(expectedMorseClaimableAccount.GetApplicationStake()). + Add(expectedMorseClaimableAccount.GetSupplierStake()) + expectedClaimAccountRes := &migrationtypes.MsgClaimMorseAccountResponse{ MorseSrcAddress: morseSrcAddr, ClaimedBalance: expectedBalance, - ClaimedAtHeight: app.GetSdkCtx().BlockHeight() - 1, + ClaimedAtHeight: s.SdkCtx().BlockHeight() - 1, } - - claimAccountRes, ok := resAny.(*migrationtypes.MsgClaimMorseAccountResponse) - require.True(t, ok) - require.Equal(t, expectedClaimAccountRes, claimAccountRes) + require.Equal(s.T(), expectedClaimAccountRes, claimAccountRes) // Assert that the MorseClaimableAccount was updated on-chain. - expectedMorseClaimableAccount := *accountState.Accounts[0] expectedMorseClaimableAccount.ShannonDestAddress = shannonDestAddr - expectedMorseClaimableAccount.ClaimedAtHeight = app.GetSdkCtx().BlockHeight() - 1 - - morseAccountQuerier := migrationtypes.NewQueryClient(app.QueryHelper()) - morseClaimableAcctRes, err := morseAccountQuerier.MorseClaimableAccount(app.GetSdkCtx(), &migrationtypes.QueryGetMorseClaimableAccountRequest{ - Address: morseSrcAddr, - }) - require.NoError(t, err) - require.Equal(t, expectedMorseClaimableAccount, morseClaimableAcctRes.MorseClaimableAccount) + expectedMorseClaimableAccount.ClaimedAtHeight = s.SdkCtx().BlockHeight() - 1 + morseClaimableAccount := s.QueryMorseClaimableAccount(s.T(), morseSrcAddr) + require.Equal(s.T(), expectedMorseClaimableAccount, morseClaimableAccount) // Assert that the shannonDestAddr account balance has been updated. - shannonDestBalance, err = bankClient.GetBalance(app.GetSdkCtx(), shannonDestAddr) - require.NoError(t, err) - require.Equal(t, expectedBalance, *shannonDestBalance) + shannonDestBalance, err = bankClient.GetBalance(s.GetApp().GetSdkCtx(), shannonDestAddr) + require.NoError(s.T(), err) + require.Equal(s.T(), expectedBalance, *shannonDestBalance) // Assert that the migration module account balance returns to zero. migrationModuleAddress := authtypes.NewModuleAddress(migrationtypes.ModuleName).String() - migrationModuleBalance, err := bankClient.GetBalance(app.GetSdkCtx(), migrationModuleAddress) - require.NoError(t, err) - require.Equal(t, sdk.NewCoin(volatile.DenomuPOKT, math.ZeroInt()), *migrationModuleBalance) + migrationModuleBalance, err := bankClient.GetBalance(s.SdkCtx(), migrationModuleAddress) + require.NoError(s.T(), err) + require.Equal(s.T(), sdk.NewCoin(volatile.DenomuPOKT, math.ZeroInt()), *migrationModuleBalance) } diff --git a/testutil/integration/suites/migration.go b/testutil/integration/suites/migration.go new file mode 100644 index 000000000..0e8a78e33 --- /dev/null +++ b/testutil/integration/suites/migration.go @@ -0,0 +1,104 @@ +package suites + +import ( + "testing" + + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/testutil/testmigration" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" +) + +var _ IntegrationSuite = (*MigrationModuleSuite)(nil) + +// TODO_IN_THIS_COMMIT: godoc... +type MigrationModuleSuite struct { + BaseIntegrationSuite + // TODO_IN_THIS_COMMIT: godoc... set in #GenerateMorseAccountState(), used in #ImportMorseClaimableAccounts(). + accountState *migrationtypes.MorseAccountState + // TODO_IN_THIS_COMMIT: godoc... set in #GenerateMorseAccountState(), used in #ImportMorseClaimableAccounts(). + numAccounts int + + // TODO_UPNEXT(@bryanchriswhite, #1043): Add ApplicationModuleSuite to the suite. + // AppSuite ApplicationModuleSuite +} + +// TODO_IN_THIS_COMMIT: godoc... +func (s *MigrationModuleSuite) GenerateMorseAccountState(t *testing.T, numAccounts int) { + s.numAccounts = numAccounts + _, s.accountState = testmigration.NewMorseStateExportAndAccountState(t, s.numAccounts) +} + +// TODO_IN_THIS_COMMIT: godoc... +func (s *MigrationModuleSuite) GetAccountState(t *testing.T) *migrationtypes.MorseAccountState { + require.NotNil(t, s.accountState) + return s.accountState +} + +// TODO_IN_THIS_COMMIT: godoc... +func (s *MigrationModuleSuite) ImportMorseClaimableAccounts(t *testing.T) *migrationtypes.MsgImportMorseClaimableAccountsResponse { + msgImport, err := migrationtypes.NewMsgImportMorseClaimableAccounts( + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + *s.accountState, + ) + require.NoError(t, err) + + // Import Morse claimable accounts. + resAny, err := s.GetApp().RunMsg(t, msgImport) + require.NoError(t, err) + + msgImportRes, ok := resAny.(*migrationtypes.MsgImportMorseClaimableAccountsResponse) + require.True(t, ok) + + return msgImportRes +} + +// TODO_IN_THIS_COMMIT: godoc... NOTE: morseAccountIdx is 1-based... +func (s *MigrationModuleSuite) ClaimMorseAccount( + t *testing.T, + morseAccountIdx uint64, + shannonDestAddr string, +) (morseSrcAddr string, _ *migrationtypes.MsgClaimMorseAccountResponse) { + t.Helper() + + morsePrivateKey := testmigration.NewMorsePrivateKey(t, morseAccountIdx) + morseSrcAddr = morsePrivateKey.PubKey().Address().String() + require.Equal(t, morseSrcAddr, s.accountState.Accounts[0].MorseSrcAddress) + + morseClaimMsg, err := migrationtypes.NewMsgClaimMorseAccount( + shannonDestAddr, + morseSrcAddr, + morsePrivateKey, + ) + require.NoError(t, err) + + // Claim a Morse claimable account. + resAny, err := s.GetApp().RunMsg(t, morseClaimMsg) + require.NoError(t, err) + + claimAccountRes, ok := resAny.(*migrationtypes.MsgClaimMorseAccountResponse) + require.True(t, ok) + + return morseSrcAddr, claimAccountRes +} + +// TODO_IN_THIS_COMMIT: godoc... +func (s *MigrationModuleSuite) QueryMorseClaimableAccount( + t *testing.T, + morseSrcAddr string, +) *migrationtypes.MorseClaimableAccount { + t.Helper() + + morseAccountQuerier := migrationtypes.NewQueryClient(s.GetApp().QueryHelper()) + morseClaimableAcctRes, err := morseAccountQuerier.MorseClaimableAccount( + s.SdkCtx(), + &migrationtypes.QueryMorseClaimableAccountRequest{ + Address: morseSrcAddr, + }, + ) + require.NoError(t, err) + + return &morseClaimableAcctRes.MorseClaimableAccount +} From c4fed01a1e86efc4adb06da20d86bca07da11626 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 19 Feb 2025 15:10:04 +0100 Subject: [PATCH 36/81] chore: self-review improvements --- .../application/application_transfer_test.go | 2 - .../morse_account_import_and_claim_test.go | 23 ++++++---- testutil/integration/suites/migration.go | 43 +++++++++++-------- 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/tests/integration/application/application_transfer_test.go b/tests/integration/application/application_transfer_test.go index 5eebc0056..493993ae8 100644 --- a/tests/integration/application/application_transfer_test.go +++ b/tests/integration/application/application_transfer_test.go @@ -314,8 +314,6 @@ func (s *appTransferTestSuite) TestMultipleSourceToSameNonexistentDestinationMer require.ErrorContains(s.T(), err, s.app2) // Assert that app1's bank balance has not changed - require.NoError(s.T(), err) - balance, err := s.GetBankQueryClient(s.T()).GetBalance(s.SdkCtx(), s.app1) require.NoError(s.T(), err) require.Equal(s.T(), appFundAmount-stakeAmount, balance.Amount.Int64()) diff --git a/tests/integration/migration/morse_account_import_and_claim_test.go b/tests/integration/migration/morse_account_import_and_claim_test.go index 627617744..d10578d9c 100644 --- a/tests/integration/migration/morse_account_import_and_claim_test.go +++ b/tests/integration/migration/morse_account_import_and_claim_test.go @@ -18,41 +18,46 @@ import ( type MigrationModuleTestSuite struct { suites.MigrationModuleSuite - // TODO_IN_THIS_COMMIT: godoc... - numAccounts int + // numMorseClaimableAccounts is the number of morse claimable accounts to + // generate when calling #GenerateMorseAccountState. + numMorseClaimableAccounts int } func (s *MigrationModuleTestSuite) SetupTest() { // Initialize a new integration app for the suite. s.NewApp(s.T()) - s.numAccounts = 10 + s.numMorseClaimableAccounts = 10 // Assign the app to nested suites. - s.AppSuite.SetApp(s.GetApp()) + // TODO_UPNEXT(@bryanchriswhite, #1043): Initialize the app module suite. + // s.AppSuite.SetApp(s.GetApp()) } func TestMigrationModuleSuite(t *testing.T) { suite.Run(t, &MigrationModuleTestSuite{}) } -// TODO_IN_THIS_COMMIT: godoc... +// TestImportMorseClaimableAccounts tests claiming of morse claimable accounts. +// It only claims account balances and does not test staking any actors as a result of claiming. func (s *MigrationModuleTestSuite) TestImportMorseClaimableAccounts() { - s.GenerateMorseAccountState(s.T(), s.numAccounts) + s.GenerateMorseAccountState(s.T(), s.numMorseClaimableAccounts) msgImportRes := s.ImportMorseClaimableAccounts(s.T()) morseAccountStateHash, err := s.GetAccountState(s.T()).GetHash() require.NoError(s.T(), err) expectedMsgImportRes := &migrationtypes.MsgImportMorseClaimableAccountsResponse{ StateHash: morseAccountStateHash, - NumAccounts: uint64(s.numAccounts), + NumAccounts: uint64(s.numMorseClaimableAccounts), } require.Equal(s.T(), expectedMsgImportRes, msgImportRes) } -// TODO_IN_THIS_COMMIT: godoc... +// TestClaimMorseAccount tests claiming of a MorseClaimableAccounts. +// It only exercises claiming of account balances and does not exercise +// the staking any actors as a result of claiming. func (s *MigrationModuleTestSuite) TestClaimMorseAccount() { - s.GenerateMorseAccountState(s.T(), s.numAccounts) + s.GenerateMorseAccountState(s.T(), s.numMorseClaimableAccounts) s.ImportMorseClaimableAccounts(s.T()) shannonDestAddr := sample.AccAddress() diff --git a/testutil/integration/suites/migration.go b/testutil/integration/suites/migration.go index 0e8a78e33..5b8bff766 100644 --- a/testutil/integration/suites/migration.go +++ b/testutil/integration/suites/migration.go @@ -13,31 +13,34 @@ import ( var _ IntegrationSuite = (*MigrationModuleSuite)(nil) -// TODO_IN_THIS_COMMIT: godoc... +// MigrationModuleSuite is a test suite which abstracts common migration module +// functionality. It is intended to be embedded in dependent integration test suites. type MigrationModuleSuite struct { BaseIntegrationSuite - // TODO_IN_THIS_COMMIT: godoc... set in #GenerateMorseAccountState(), used in #ImportMorseClaimableAccounts(). - accountState *migrationtypes.MorseAccountState - // TODO_IN_THIS_COMMIT: godoc... set in #GenerateMorseAccountState(), used in #ImportMorseClaimableAccounts(). - numAccounts int - // TODO_UPNEXT(@bryanchriswhite, #1043): Add ApplicationModuleSuite to the suite. // AppSuite ApplicationModuleSuite + + // accountState is the generated MorseAccountState to be imported into the migration module. + accountState *migrationtypes.MorseAccountState + // numMorseClaimableAccounts is the number of morse claimable accounts to generate when calling #GenerateMorseAccountState. + numMorseClaimableAccounts int } -// TODO_IN_THIS_COMMIT: godoc... +// GenerateMorseAccountState generates a MorseAccountState with the given number of MorseClaimableAccounts. +// It updates the suite's #numMorseClaimableAccounts and #accountState fields. func (s *MigrationModuleSuite) GenerateMorseAccountState(t *testing.T, numAccounts int) { - s.numAccounts = numAccounts - _, s.accountState = testmigration.NewMorseStateExportAndAccountState(t, s.numAccounts) + s.numMorseClaimableAccounts = numAccounts + _, s.accountState = testmigration.NewMorseStateExportAndAccountState(t, s.numMorseClaimableAccounts) } -// TODO_IN_THIS_COMMIT: godoc... +// GetAccountState returns the suite's #accountState field. func (s *MigrationModuleSuite) GetAccountState(t *testing.T) *migrationtypes.MorseAccountState { require.NotNil(t, s.accountState) return s.accountState } -// TODO_IN_THIS_COMMIT: godoc... +// ImportMorseClaimableAccounts imports the MorseClaimableAccounts from the suite's +// #accountState field by running a MsgImportMorseClaimableAccounts message. func (s *MigrationModuleSuite) ImportMorseClaimableAccounts(t *testing.T) *migrationtypes.MsgImportMorseClaimableAccountsResponse { msgImport, err := migrationtypes.NewMsgImportMorseClaimableAccounts( authtypes.NewModuleAddress(govtypes.ModuleName).String(), @@ -55,21 +58,23 @@ func (s *MigrationModuleSuite) ImportMorseClaimableAccounts(t *testing.T) *migra return msgImportRes } -// TODO_IN_THIS_COMMIT: godoc... NOTE: morseAccountIdx is 1-based... +// ClaimMorseAccount claims the given MorseClaimableAccount by running a MsgClaimMorseAccount message. +// It returns the expected Morse source address and the MsgClaimMorseAccountResponse. +// DEV_NOTE: morseAccountIdx is 1-based. func (s *MigrationModuleSuite) ClaimMorseAccount( t *testing.T, morseAccountIdx uint64, shannonDestAddr string, -) (morseSrcAddr string, _ *migrationtypes.MsgClaimMorseAccountResponse) { +) (expectedMorseSrcAddr string, _ *migrationtypes.MsgClaimMorseAccountResponse) { t.Helper() morsePrivateKey := testmigration.NewMorsePrivateKey(t, morseAccountIdx) - morseSrcAddr = morsePrivateKey.PubKey().Address().String() - require.Equal(t, morseSrcAddr, s.accountState.Accounts[0].MorseSrcAddress) + expectedMorseSrcAddr = morsePrivateKey.PubKey().Address().String() + require.Equal(t, expectedMorseSrcAddr, s.accountState.Accounts[0].MorseSrcAddress) morseClaimMsg, err := migrationtypes.NewMsgClaimMorseAccount( shannonDestAddr, - morseSrcAddr, + expectedMorseSrcAddr, morsePrivateKey, ) require.NoError(t, err) @@ -81,10 +86,10 @@ func (s *MigrationModuleSuite) ClaimMorseAccount( claimAccountRes, ok := resAny.(*migrationtypes.MsgClaimMorseAccountResponse) require.True(t, ok) - return morseSrcAddr, claimAccountRes + return expectedMorseSrcAddr, claimAccountRes } -// TODO_IN_THIS_COMMIT: godoc... +// QueryMorseClaimableAccount queries the migration module for the given morseSrcAddr. func (s *MigrationModuleSuite) QueryMorseClaimableAccount( t *testing.T, morseSrcAddr string, @@ -94,7 +99,7 @@ func (s *MigrationModuleSuite) QueryMorseClaimableAccount( morseAccountQuerier := migrationtypes.NewQueryClient(s.GetApp().QueryHelper()) morseClaimableAcctRes, err := morseAccountQuerier.MorseClaimableAccount( s.SdkCtx(), - &migrationtypes.QueryMorseClaimableAccountRequest{ + &migrationtypes.QueryGetMorseClaimableAccountRequest{ Address: morseSrcAddr, }, ) From 285ef338461b536aabc0e4f04a4a13afb81daa2b Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 19 Feb 2025 15:19:50 +0100 Subject: [PATCH 37/81] fix: post-merge --- testutil/integration/suites/migration.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testutil/integration/suites/migration.go b/testutil/integration/suites/migration.go index 5b8bff766..b78c32801 100644 --- a/testutil/integration/suites/migration.go +++ b/testutil/integration/suites/migration.go @@ -99,7 +99,7 @@ func (s *MigrationModuleSuite) QueryMorseClaimableAccount( morseAccountQuerier := migrationtypes.NewQueryClient(s.GetApp().QueryHelper()) morseClaimableAcctRes, err := morseAccountQuerier.MorseClaimableAccount( s.SdkCtx(), - &migrationtypes.QueryGetMorseClaimableAccountRequest{ + &migrationtypes.QueryMorseClaimableAccountRequest{ Address: morseSrcAddr, }, ) From 1ffb73ba04ff23784039c6bfa6f8f8c2cdf891d1 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 20 Feb 2025 12:50:40 +0100 Subject: [PATCH 38/81] chore: review feedback improvements Co-authored-by: Daniel Olshansky --- api/poktroll/migration/event.pulsar.go | 7 +- .../migration/morse_onchain.pulsar.go | 107 +++++++++--------- api/poktroll/migration/tx.pulsar.go | 24 ++-- proto/poktroll/migration/event.proto | 6 +- proto/poktroll/migration/morse_onchain.proto | 8 +- proto/poktroll/migration/tx.proto | 23 ++-- testutil/testmigration/fixtures.go | 4 +- x/migration/keeper/morse_claimable_account.go | 1 - ..._server_import_morse_claimable_accounts.go | 2 + ...er_import_morse_claimable_accounts_test.go | 2 +- x/migration/types/errors.go | 2 +- x/migration/types/event.pb.go | 6 +- x/migration/types/morse_onchain.pb.go | 76 +++++++------ x/migration/types/tx.pb.go | 23 ++-- 14 files changed, 159 insertions(+), 132 deletions(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index e6ca4fc52..61726e93e 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -8,6 +8,7 @@ import ( runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "github.com/pokt-network/poktroll/api/poktroll/shared" + prot protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -555,10 +556,10 @@ type EventImportMorseClaimableAccounts struct { // The height (on Shannon) at which the MorseAccountState was created on-chain. CreatedAtHeight int64 `protobuf:"varint,1,opt,name=created_at_height,json=createdAtHeight,proto3" json:"created_at_height,omitempty"` - // The sha256 has of the MorseAccountState. + // The on-chain computed sha256 hash of the entire MorseAccountState containing the MorseClaimableAccounts which were imported. MorseAccountStateHash []byte `protobuf:"bytes,2,opt,name=morse_account_state_hash,json=morseAccountStateHash,proto3" json:"morse_account_state_hash,omitempty"` - // The number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. - // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. + // Number of claimable accounts (EOAs) collected from Morse state export + // NOTE: Account balances include consolidated application and supplier actor stakes NumAccounts uint64 `protobuf:"varint,3,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts,omitempty"` } diff --git a/api/poktroll/migration/morse_onchain.pulsar.go b/api/poktroll/migration/morse_onchain.pulsar.go index 79e595792..7e7aba6f2 100644 --- a/api/poktroll/migration/morse_onchain.pulsar.go +++ b/api/poktroll/migration/morse_onchain.pulsar.go @@ -1398,12 +1398,15 @@ func (x *MorseAccountState) GetAccounts() []*MorseClaimableAccount { // MorseClaimableAccount is the onchain (persisted) representation of a Morse // account which is claimable as part of the Morse -> Shannon migration. // They are intended to be created during MorseAccountState import (see: MsgImportMorseClaimableAccount). +// It is created ONLY ONCE and NEVER deleted (per morse_src_address per network / re-genesis). +// It is updated ONLY ONCE, when it is claimed (per morse_src_address per network / re-genesis). type MorseClaimableAccount struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. + // This field is intended to remain empty until the account has been claimed. ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address,omitempty"` // The hex-encoded address of the Morse account whose balance will be claimed. MorseSrcAddress string `protobuf:"bytes,2,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` @@ -1422,6 +1425,7 @@ type MorseClaimableAccount struct { // The staked tokens associated with an application actor which corresponds to this account address. ApplicationStake *v1beta1.Coin `protobuf:"bytes,7,opt,name=application_stake,json=applicationStake,proto3" json:"application_stake,omitempty"` // The Shannon height at which the account was claimed. + // This field is intended to remain empty until the account has been claimed. ClaimedAtHeight int64 `protobuf:"varint,8,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` } @@ -1513,59 +1517,60 @@ var file_poktroll_migration_morse_onchain_proto_rawDesc = []byte{ 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, - 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0xf7, 0x04, 0x0a, 0x15, 0x4d, + 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0xff, 0x04, 0x0a, 0x15, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x62, 0x0a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x66, 0x0a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x30, 0xea, 0xde, 0x1f, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, - 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, - 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6d, 0x6f, 0x72, 0x73, - 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, - 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, - 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3b, 0x0a, 0x0a, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x1c, 0xfa, 0xde, 0x1f, 0x18, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x65, 0x64, 0x32, 0x35, - 0x35, 0x31, 0x39, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x5e, 0x0a, 0x10, 0x75, 0x6e, 0x73, 0x74, - 0x61, 0x6b, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x18, 0xc8, - 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x10, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x5f, - 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, - 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x0e, 0x73, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x16, 0xc8, 0xde, 0x1f, - 0x00, 0xea, 0xde, 0x1f, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x73, 0x74, - 0x61, 0x6b, 0x65, 0x52, 0x0d, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x74, 0x61, - 0x6b, 0x65, 0x12, 0x61, 0x0a, 0x11, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x19, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, - 0x1f, 0x11, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, - 0x61, 0x6b, 0x65, 0x52, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x5d, 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, - 0x42, 0x31, 0xea, 0xde, 0x1f, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, - 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0xf2, 0xde, 0x1f, 0x18, 0x79, 0x61, 0x6d, 0x6c, 0x3a, - 0x22, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x22, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x42, 0xbd, 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, 0x11, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x4f, 0x6e, 0x63, 0x68, 0x61, 0x69, - 0x6e, 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, + 0x28, 0x09, 0x42, 0x34, 0xc8, 0xde, 0x1f, 0x01, 0xea, 0xde, 0x1f, 0x14, 0x73, 0x68, 0x61, 0x6e, + 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 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, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, + 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x11, + 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, + 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, + 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x3b, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x1c, 0xfa, 0xde, 0x1f, 0x18, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, + 0x65, 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x5e, 0x0a, 0x10, + 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x18, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x10, 0x75, 0x6e, 0x73, 0x74, 0x61, + 0x6b, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x75, 0x6e, 0x73, + 0x74, 0x61, 0x6b, 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x0e, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, + 0x16, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x0d, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x61, 0x0a, 0x11, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x19, 0xc8, 0xde, + 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x11, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x52, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x61, 0x0a, 0x11, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x03, 0x42, 0x35, 0xc8, 0xde, 0x1f, 0x01, 0xea, 0xde, 0x1f, 0x11, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0xf2, + 0xde, 0x1f, 0x18, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x52, 0x0f, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0xbd, 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, 0x11, 0x4d, 0x6f, 0x72, + 0x73, 0x65, 0x4f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 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/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index 303317e2b..233b1fba7 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -1993,7 +1993,7 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{1} } -// MsgImportMorseClaimableAccounts is used to create the on-chain MorseClaimableAccounts ONLY ONCE (per network / re-genesis). +// MsgImportMorseClaimableAccounts is used to create the on-chain MorseClaimableAccounts ONLY AND EXACTLY ONCE (per network / re-genesis). type MsgImportMorseClaimableAccounts struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2003,13 +2003,17 @@ type MsgImportMorseClaimableAccounts struct { Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // the account state derived from the Morse state export and the `poktrolld migrate collect-morse-accounts` command. MorseAccountState *MorseAccountState `protobuf:"bytes,2,opt,name=morse_account_state,json=morseAccountState,proto3" json:"morse_account_state,omitempty"` - // expected sha256 hash of the morse_account_state. If this hash does not match the on-chain - // computation, the transaction will fail. Social consensus regarding the correctness of - // morse_account_state should have been achieved off-chain and can be verified on-chain by - // comparing this hash with that of a locally derived Morse state export: - // E.g., `poktrolld migrate collect-morse-accounts $<(pocket util export-genesis-for-reset)`. - // See: `pocket util export-genesis-for-migration --help` & `poktrolld migrate collect-morse-accounts --help` - // for more details. + // Validates the morse_account_state sha256 hash: + // - Transaction fails if hash doesn't match on-chain computation + // - Off-chain social consensus should be reached off-chain before verification + // + // Verification can be done by comparing with locally derived Morse state like so: + // + // $ poktrolld migrate collect-morse-accounts $<(pocket util export-genesis-for-reset) + // + // Additional documentation: + // - pocket util export-genesis-for-migration --help + // - poktrolld migrate collect-morse-accounts --help MorseAccountStateHash []byte `protobuf:"bytes,3,opt,name=morse_account_state_hash,json=morseAccountStateHash,proto3" json:"morse_account_state_hash,omitempty"` } @@ -2061,8 +2065,8 @@ type MsgImportMorseClaimableAccountsResponse struct { // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. StateHash []byte `protobuf:"bytes,1,opt,name=state_hash,json=stateHash,proto3" json:"state_hash,omitempty"` - // Number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. - // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. + // Number of claimable accounts (EOAs) collected from Morse state export. + // NOTE: Account balances include consolidated application and supplier actor stakes. NumAccounts uint64 `protobuf:"varint,2,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts,omitempty"` } diff --git a/proto/poktroll/migration/event.proto b/proto/poktroll/migration/event.proto index 60b013d65..57bf39e5f 100644 --- a/proto/poktroll/migration/event.proto +++ b/proto/poktroll/migration/event.proto @@ -16,10 +16,10 @@ message EventImportMorseClaimableAccounts { // The height (on Shannon) at which the MorseAccountState was created on-chain. int64 created_at_height = 1 [(gogoproto.jsontag) = "created_at_height"]; - // The sha256 has of the MorseAccountState. + // The on-chain computed sha256 hash of the entire MorseAccountState containing the MorseClaimableAccounts which were imported. bytes morse_account_state_hash = 2 [(gogoproto.jsontag) = "morse_account_state_hash"]; - // The number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. - // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. + // Number of claimable accounts (EOAs) collected from Morse state export + // NOTE: Account balances include consolidated application and supplier actor stakes uint64 num_accounts = 3 [(gogoproto.jsontag) = "num_accounts"]; } diff --git a/proto/poktroll/migration/morse_onchain.proto b/proto/poktroll/migration/morse_onchain.proto index 9b3700d63..e9cc36bea 100644 --- a/proto/poktroll/migration/morse_onchain.proto +++ b/proto/poktroll/migration/morse_onchain.proto @@ -19,9 +19,12 @@ message MorseAccountState { // MorseClaimableAccount is the onchain (persisted) representation of a Morse // account which is claimable as part of the Morse -> Shannon migration. // They are intended to be created during MorseAccountState import (see: MsgImportMorseClaimableAccount). +// It is created ONLY ONCE and NEVER deleted (per morse_src_address per network / re-genesis). +// It is updated ONLY ONCE, when it is claimed (per morse_src_address per network / re-genesis). message MorseClaimableAccount { // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. - string shannon_dest_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "shannon_dest_address"]; + // This field is intended to remain empty until the account has been claimed. + string shannon_dest_address = 1 [(gogoproto.nullable) = true, (cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "shannon_dest_address"]; // The hex-encoded address of the Morse account whose balance will be claimed. string morse_src_address = 2 [(gogoproto.jsontag) = "morse_src_address"]; @@ -45,6 +48,7 @@ message MorseClaimableAccount { cosmos.base.v1beta1.Coin application_stake = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "application_stake"]; // The Shannon height at which the account was claimed. - int64 claimed_at_height = 8 [(gogoproto.jsontag) = "claimed_at_height", (gogoproto.moretags) = "yaml:\"claimed_at_height\""]; + // This field is intended to remain empty until the account has been claimed. + int64 claimed_at_height = 8 [(gogoproto.nullable) = true, (gogoproto.jsontag) = "claimed_at_height", (gogoproto.moretags) = "yaml:\"claimed_at_height\""]; } diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index c1b81ab35..5eb92e91a 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -39,7 +39,7 @@ message MsgUpdateParams { // MsgUpdateParams message. message MsgUpdateParamsResponse {} -// MsgImportMorseClaimableAccounts is used to create the on-chain MorseClaimableAccounts ONLY ONCE (per network / re-genesis). +// MsgImportMorseClaimableAccounts is used to create the on-chain MorseClaimableAccounts ONLY AND EXACTLY ONCE (per network / re-genesis). message MsgImportMorseClaimableAccounts { option (cosmos.msg.v1.signer) = "authority"; @@ -49,20 +49,23 @@ message MsgImportMorseClaimableAccounts { // the account state derived from the Morse state export and the `poktrolld migrate collect-morse-accounts` command. MorseAccountState morse_account_state = 2 [(gogoproto.jsontag) = "morse_account_state", (gogoproto.nullable) = false]; - // expected sha256 hash of the morse_account_state. If this hash does not match the on-chain - // computation, the transaction will fail. Social consensus regarding the correctness of - // morse_account_state should have been achieved off-chain and can be verified on-chain by - // comparing this hash with that of a locally derived Morse state export: - // E.g., `poktrolld migrate collect-morse-accounts $<(pocket util export-genesis-for-reset)`. - // See: `pocket util export-genesis-for-migration --help` & `poktrolld migrate collect-morse-accounts --help` - // for more details. + // Validates the morse_account_state sha256 hash: + // - Transaction fails if hash doesn't match on-chain computation + // - Off-chain social consensus should be reached off-chain before verification + // + // Verification can be done by comparing with locally derived Morse state like so: + // $ poktrolld migrate collect-morse-accounts $<(pocket util export-genesis-for-reset) + // + // Additional documentation: + // - pocket util export-genesis-for-migration --help + // - poktrolld migrate collect-morse-accounts --help bytes morse_account_state_hash = 3 [(gogoproto.jsontag) = "morse_account_state_hash"]; } message MsgImportMorseClaimableAccountsResponse { // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. bytes state_hash = 1 [(gogoproto.jsontag) = "state_hash"]; - // Number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. - // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. + // Number of claimable accounts (EOAs) collected from Morse state export. + // NOTE: Account balances include consolidated application and supplier actor stakes. uint64 num_accounts = 2 [(gogoproto.jsontag) = "num_accounts"]; } diff --git a/testutil/testmigration/fixtures.go b/testutil/testmigration/fixtures.go index b77a34a1f..14b1a3754 100644 --- a/testutil/testmigration/fixtures.go +++ b/testutil/testmigration/fixtures.go @@ -21,7 +21,7 @@ import ( // It is used to generate the MorseAccountState. // - Its corresponding MorseAccountState. // This is the JSON output of `poktrolld migrate collect-morse-accounts`. -// It is used to persist the canonical Morse migration state from on Shannon. +// It is used to persist the canonical Morse migration state (snapshot) from on Shannon. // // The states are populated with: // - Random account addresses @@ -106,6 +106,8 @@ func NewMorseStateExportAndAccountState( ) // Add a supplier. + // In Morse, a node (aka a Service) is a Shannon supplier. + // In Morse, Validators are, by default, the top 1000 staked nodes. morseStateExport.AppState.Pos.Validators = append( morseStateExport.AppState.Pos.Validators, &migrationtypes.MorseValidator{ diff --git a/x/migration/keeper/morse_claimable_account.go b/x/migration/keeper/morse_claimable_account.go index 5cdf1cc51..fea87fd40 100644 --- a/x/migration/keeper/morse_claimable_account.go +++ b/x/migration/keeper/morse_claimable_account.go @@ -71,7 +71,6 @@ func (k Keeper) GetAllMorseClaimableAccounts(ctx context.Context) (list []types. } // ImportFromMorseAccountState imports the MorseClaimableAccounts from the given MorseAccountState. -// It returns the state hash of the imported MorseAccountState. func (k Keeper) ImportFromMorseAccountState( ctx context.Context, morseAccountState *types.MorseAccountState, diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts.go index dcc093b2f..fe308c0e0 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts.go @@ -26,6 +26,8 @@ func (k msgServer) ImportMorseClaimableAccounts(ctx context.Context, msg *migrat } // Check if MorseClaimableAccounts have already been imported. + // TODO_MAINNET(@bryanchriswhite): Use the MultiStore more directly to more + // efficiently test for the existence of ANY MorseClaimableAccounts. if morseClaimableAccounts := k.GetAllMorseClaimableAccounts(sdkCtx); len(morseClaimableAccounts) > 0 { err := migrationtypes.ErrMorseAccountState.Wrap("Morse claimable accounts already imported") logger.Info(err.Error()) diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go index f0b3c7800..1efc5a50a 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go @@ -55,7 +55,7 @@ func TestMsgServer_ImportMorseClaimableAccounts_Success(t *testing.T) { // Assert that the MorseAccountState was created and matches expectations. morseClaimableAccounts = k.GetAllMorseClaimableAccounts(ctx) - require.Greater(t, len(morseClaimableAccounts), 0) + require.Equal(t, len(morseClaimableAccounts), numAccounts) require.NoError(t, err) // Assert that the EventCreateMorseAccountState event was emitted. diff --git a/x/migration/types/errors.go b/x/migration/types/errors.go index d49cef446..e2b41cd6f 100644 --- a/x/migration/types/errors.go +++ b/x/migration/types/errors.go @@ -8,7 +8,7 @@ import ( // x/migration module sentinel errors var ( - ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected x/gov module account as the only signer for migration state import messages") ErrMorseAccountState = sdkerrors.Register(ModuleName, 1101, "morse account state is invalid") ErrUnauthorized = sdkerrors.Register(ModuleName, 1102, "unauthorized") ) diff --git a/x/migration/types/event.pb.go b/x/migration/types/event.pb.go index 9ccab2666..9163b58b0 100644 --- a/x/migration/types/event.pb.go +++ b/x/migration/types/event.pb.go @@ -30,10 +30,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type EventImportMorseClaimableAccounts struct { // The height (on Shannon) at which the MorseAccountState was created on-chain. CreatedAtHeight int64 `protobuf:"varint,1,opt,name=created_at_height,json=createdAtHeight,proto3" json:"created_at_height"` - // The sha256 has of the MorseAccountState. + // The on-chain computed sha256 hash of the entire MorseAccountState containing the MorseClaimableAccounts which were imported. MorseAccountStateHash []byte `protobuf:"bytes,2,opt,name=morse_account_state_hash,json=morseAccountStateHash,proto3" json:"morse_account_state_hash"` - // The number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. - // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. + // Number of claimable accounts (EOAs) collected from Morse state export + // NOTE: Account balances include consolidated application and supplier actor stakes NumAccounts uint64 `protobuf:"varint,3,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts"` } diff --git a/x/migration/types/morse_onchain.pb.go b/x/migration/types/morse_onchain.pb.go index eafa84e5c..6ef03dab2 100644 --- a/x/migration/types/morse_onchain.pb.go +++ b/x/migration/types/morse_onchain.pb.go @@ -72,8 +72,11 @@ func (m *MorseAccountState) GetAccounts() []*MorseClaimableAccount { // MorseClaimableAccount is the onchain (persisted) representation of a Morse // account which is claimable as part of the Morse -> Shannon migration. // They are intended to be created during MorseAccountState import (see: MsgImportMorseClaimableAccount). +// It is created ONLY ONCE and NEVER deleted (per morse_src_address per network / re-genesis). +// It is updated ONLY ONCE, when it is claimed (per morse_src_address per network / re-genesis). type MorseClaimableAccount struct { // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. + // This field is intended to remain empty until the account has been claimed. ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address"` // The hex-encoded address of the Morse account whose balance will be claimed. MorseSrcAddress string `protobuf:"bytes,2,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address"` @@ -92,6 +95,7 @@ type MorseClaimableAccount struct { // The staked tokens associated with an application actor which corresponds to this account address. ApplicationStake types.Coin `protobuf:"bytes,7,opt,name=application_stake,json=applicationStake,proto3" json:"application_stake"` // The Shannon height at which the account was claimed. + // This field is intended to remain empty until the account has been claimed. ClaimedAtHeight int64 `protobuf:"varint,8,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height" yaml:"claimed_at_height"` } @@ -183,42 +187,42 @@ func init() { } var fileDescriptor_e74ea76a959fdb61 = []byte{ - // 549 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x3f, 0x6f, 0xd3, 0x40, - 0x14, 0x8f, 0xdb, 0x52, 0xda, 0x2b, 0x90, 0xc6, 0x4a, 0x91, 0x13, 0x21, 0x3b, 0xca, 0x80, 0xc2, - 0x50, 0x9b, 0x04, 0x75, 0x00, 0xa6, 0xb8, 0x0c, 0x48, 0x08, 0xa9, 0x72, 0x16, 0x84, 0x04, 0xd6, - 0xf9, 0x7c, 0x38, 0xa7, 0xd8, 0x77, 0xd6, 0xdd, 0x05, 0x88, 0xf8, 0x12, 0x7c, 0x18, 0x3e, 0x44, - 0xc7, 0x8a, 0xa9, 0x93, 0x85, 0x92, 0x2d, 0x63, 0x17, 0x24, 0x26, 0x64, 0x9f, 0x1d, 0x55, 0x75, - 0xa5, 0x6e, 0xf7, 0x7e, 0xff, 0x9e, 0x7d, 0xf7, 0x1e, 0x78, 0x9a, 0xb2, 0x99, 0xe4, 0x2c, 0x8e, - 0x9d, 0x84, 0x44, 0x1c, 0x4a, 0xc2, 0xa8, 0x93, 0x30, 0x2e, 0xb0, 0xcf, 0x28, 0x9a, 0x42, 0x42, - 0xed, 0x94, 0x33, 0xc9, 0x74, 0xbd, 0xd2, 0xd9, 0x1b, 0x5d, 0xb7, 0x83, 0x98, 0x48, 0x98, 0xf0, - 0x0b, 0x85, 0xa3, 0x0a, 0x25, 0xef, 0x9a, 0xaa, 0x72, 0x02, 0x28, 0xb0, 0xf3, 0x75, 0x18, 0x60, - 0x09, 0x87, 0x0e, 0x62, 0x55, 0x5c, 0xb7, 0x1d, 0xb1, 0x88, 0x29, 0x5f, 0x7e, 0x52, 0x68, 0xff, - 0x07, 0x68, 0xbd, 0xcf, 0x7b, 0x8f, 0x11, 0x62, 0x73, 0x2a, 0x27, 0x12, 0x4a, 0xac, 0x7f, 0x01, - 0x7b, 0x50, 0xd5, 0xc2, 0xd8, 0xea, 0x6d, 0x0f, 0x0e, 0x46, 0xcf, 0xec, 0xfa, 0xc7, 0xd8, 0x85, - 0xf1, 0x34, 0x86, 0x24, 0x81, 0x41, 0x5c, 0x25, 0xb8, 0xd6, 0x3a, 0xb3, 0x36, 0xf6, 0xab, 0xcc, - 0x6a, 0x2e, 0x60, 0x12, 0xbf, 0xea, 0x57, 0x48, 0xdf, 0xdb, 0x90, 0xfd, 0xbf, 0x3b, 0xe0, 0xe8, - 0xd6, 0x10, 0x3d, 0x00, 0x6d, 0x31, 0x85, 0x94, 0x32, 0xea, 0x87, 0x58, 0x48, 0x1f, 0x86, 0x21, - 0xc7, 0x42, 0x18, 0x5a, 0x4f, 0x1b, 0xec, 0xbb, 0xcf, 0xd7, 0x99, 0x75, 0x2b, 0xff, 0xfb, 0xd7, - 0x71, 0xbb, 0xbc, 0x94, 0xb1, 0x42, 0x26, 0x92, 0x13, 0x1a, 0x79, 0x7a, 0xa9, 0x7e, 0x83, 0x85, - 0x2c, 0x19, 0x7d, 0x0c, 0x5a, 0xea, 0xda, 0x05, 0x47, 0x9b, 0x06, 0x5b, 0x45, 0x83, 0xa3, 0x75, - 0x66, 0xd5, 0x49, 0xaf, 0x59, 0x40, 0x13, 0x8e, 0xaa, 0x88, 0xd7, 0x00, 0xa4, 0xf3, 0x20, 0x26, - 0xc8, 0x9f, 0xe1, 0x85, 0xb1, 0xd3, 0xd3, 0x06, 0x0f, 0xdc, 0x27, 0xff, 0x32, 0xcb, 0x40, 0x7c, - 0x91, 0x4a, 0xe6, 0xe0, 0x70, 0x74, 0x72, 0x32, 0x7c, 0x69, 0x9f, 0x15, 0xa2, 0x77, 0x78, 0xe1, - 0xed, 0xa7, 0xd5, 0x51, 0xff, 0x0c, 0x0e, 0xe7, 0x54, 0x48, 0x38, 0xc3, 0xa1, 0x1f, 0xc0, 0x18, - 0x52, 0x84, 0x8d, 0x7b, 0x3d, 0x6d, 0x70, 0x30, 0xea, 0xd8, 0xe5, 0x4f, 0xe4, 0x6f, 0x69, 0x97, - 0x6f, 0x69, 0x9f, 0x32, 0x42, 0x5d, 0xe3, 0x3c, 0xb3, 0x1a, 0xeb, 0xcc, 0xaa, 0x59, 0xbd, 0x66, - 0x85, 0xb8, 0x0a, 0xd0, 0x3f, 0x80, 0x47, 0x62, 0x9e, 0xa6, 0x31, 0xc1, 0xdc, 0x2f, 0x18, 0x63, - 0xf7, 0xae, 0xf4, 0xc7, 0x65, 0xfa, 0x0d, 0xa3, 0xf7, 0xb0, 0xaa, 0x27, 0x79, 0xa9, 0x43, 0xd0, - 0x82, 0x79, 0x8d, 0x8a, 0x39, 0x28, 0xc3, 0xef, 0xdf, 0x15, 0xde, 0x29, 0xc3, 0xeb, 0x5e, 0xef, - 0xf0, 0x1a, 0xa4, 0x5a, 0x7c, 0x02, 0x2d, 0x94, 0x0f, 0x05, 0x0e, 0x7d, 0x28, 0xfd, 0x29, 0x26, - 0xd1, 0x54, 0x1a, 0x7b, 0x3d, 0x6d, 0xb0, 0xed, 0x0e, 0xf3, 0x8c, 0x1a, 0x79, 0x95, 0x59, 0x86, - 0x9a, 0xb4, 0x1a, 0xd5, 0xf7, 0x9a, 0x25, 0x36, 0x96, 0x6f, 0x0b, 0xc4, 0x3d, 0x3b, 0x5f, 0x9a, - 0xda, 0xc5, 0xd2, 0xd4, 0x2e, 0x97, 0xa6, 0xf6, 0x67, 0x69, 0x6a, 0x3f, 0x57, 0x66, 0xe3, 0x62, - 0x65, 0x36, 0x2e, 0x57, 0x66, 0xe3, 0xe3, 0x28, 0x22, 0x72, 0x3a, 0x0f, 0x6c, 0xc4, 0x12, 0x27, - 0x9f, 0xfb, 0x63, 0x8a, 0xe5, 0x37, 0xc6, 0x67, 0xce, 0x66, 0x73, 0xbf, 0x5f, 0xdb, 0x5d, 0xb9, - 0x48, 0xb1, 0x08, 0x76, 0x8b, 0x7d, 0x7a, 0xf1, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x39, 0xb7, 0x2d, - 0x34, 0xde, 0x03, 0x00, 0x00, + // 552 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x31, 0x6f, 0xd3, 0x40, + 0x18, 0x8d, 0xdb, 0x52, 0xda, 0x2b, 0x90, 0xc6, 0x4a, 0x91, 0x13, 0x21, 0x3b, 0xca, 0x80, 0xc2, + 0x50, 0x5b, 0x09, 0x64, 0x00, 0xa6, 0xb8, 0x0c, 0x48, 0x08, 0xa9, 0x72, 0x16, 0xc4, 0x80, 0x75, + 0x3e, 0x5f, 0x1d, 0x2b, 0xf6, 0x9d, 0x75, 0x77, 0x01, 0x22, 0xfe, 0x04, 0x3f, 0x86, 0x1f, 0x91, + 0xb1, 0x62, 0xea, 0x64, 0xa1, 0x64, 0xcb, 0xd8, 0x91, 0x05, 0x64, 0xfb, 0x6c, 0x55, 0x75, 0xa5, + 0x6e, 0xf7, 0xde, 0xf7, 0xde, 0xfb, 0xec, 0xbb, 0xef, 0x03, 0xcf, 0x13, 0x3a, 0x17, 0x8c, 0x46, + 0x91, 0x15, 0x87, 0x01, 0x83, 0x22, 0xa4, 0xc4, 0x8a, 0x29, 0xe3, 0xd8, 0xa5, 0x04, 0xcd, 0x60, + 0x48, 0xcc, 0x84, 0x51, 0x41, 0x55, 0xb5, 0xd4, 0x99, 0x95, 0xae, 0xdb, 0x41, 0x94, 0xc7, 0x94, + 0xbb, 0xb9, 0xc2, 0x2a, 0x40, 0x21, 0xef, 0xea, 0x05, 0xb2, 0x3c, 0xc8, 0xb1, 0xf5, 0x75, 0xe8, + 0x61, 0x01, 0x87, 0x16, 0xa2, 0x65, 0x5c, 0xb7, 0x1d, 0xd0, 0x80, 0x16, 0xbe, 0xec, 0x54, 0xb0, + 0xfd, 0x1f, 0xa0, 0xf5, 0x31, 0xeb, 0x3d, 0x41, 0x88, 0x2e, 0x88, 0x98, 0x0a, 0x28, 0xb0, 0x7a, + 0x01, 0x0e, 0x60, 0x81, 0xb9, 0xb6, 0xd3, 0xdb, 0x1d, 0x1c, 0x8d, 0x5e, 0x98, 0xf5, 0x8f, 0x31, + 0x73, 0xe3, 0x59, 0x04, 0xc3, 0x18, 0x7a, 0x51, 0x99, 0x60, 0x1b, 0xdb, 0xd4, 0xa8, 0xec, 0xd7, + 0xa9, 0xd1, 0x5c, 0xc2, 0x38, 0x7a, 0xd3, 0x2f, 0x99, 0xbe, 0x53, 0x15, 0xfb, 0xff, 0xf6, 0xc0, + 0xc9, 0x9d, 0x21, 0xea, 0x05, 0x68, 0xf3, 0x19, 0x24, 0x84, 0x12, 0xd7, 0xc7, 0x5c, 0xb8, 0xd0, + 0xf7, 0x19, 0xe6, 0x5c, 0x53, 0x7a, 0xca, 0xe0, 0xd0, 0x7e, 0xb5, 0x4a, 0x0d, 0x65, 0x9b, 0x1a, + 0x77, 0x6a, 0x7e, 0xff, 0x3a, 0x6d, 0xcb, 0x8b, 0x99, 0x14, 0xcc, 0x54, 0xb0, 0x90, 0x04, 0x8e, + 0x2a, 0xd5, 0xef, 0x30, 0x17, 0xb2, 0xa2, 0x4e, 0x40, 0xab, 0xb8, 0x7a, 0xce, 0x50, 0xd5, 0x64, + 0x27, 0x6f, 0x72, 0xb2, 0x4d, 0x8d, 0x7a, 0xd1, 0x69, 0xe6, 0xd4, 0x94, 0xa1, 0x32, 0xe2, 0x2d, + 0x00, 0xc9, 0xc2, 0x8b, 0x42, 0xe4, 0xce, 0xf1, 0x52, 0xdb, 0xeb, 0x29, 0x83, 0x47, 0xf6, 0xb3, + 0xbf, 0xa9, 0xa1, 0x21, 0xb6, 0x4c, 0x04, 0xb5, 0xb0, 0x3f, 0x1a, 0x8f, 0x87, 0xaf, 0xcd, 0xf3, + 0x5c, 0xf4, 0x01, 0x2f, 0x9d, 0xc3, 0xa4, 0x3c, 0xaa, 0x5f, 0xc0, 0xf1, 0x82, 0x70, 0x01, 0xe7, + 0xd8, 0x77, 0x3d, 0x18, 0x41, 0x82, 0xb0, 0xf6, 0xa0, 0xa7, 0x0c, 0x8e, 0x46, 0x1d, 0x53, 0xfe, + 0x44, 0xf6, 0x9e, 0xa6, 0x7c, 0x4f, 0xf3, 0x8c, 0x86, 0xc4, 0xd6, 0x56, 0xa9, 0xd1, 0xd8, 0xa6, + 0x46, 0xcd, 0xea, 0x34, 0x4b, 0xc6, 0x2e, 0x08, 0xf5, 0x13, 0x78, 0xc2, 0x17, 0x49, 0x12, 0x85, + 0x98, 0xb9, 0x79, 0x45, 0xdb, 0xbf, 0x2f, 0xfd, 0xa9, 0x4c, 0xbf, 0x65, 0x74, 0x1e, 0x97, 0x78, + 0x9a, 0x41, 0x15, 0x82, 0x16, 0xcc, 0x30, 0xca, 0x67, 0x41, 0x86, 0x3f, 0xbc, 0x2f, 0xbc, 0x23, + 0xc3, 0xeb, 0x5e, 0xe7, 0xf8, 0x06, 0x55, 0xb5, 0x40, 0xd9, 0x60, 0x60, 0xdf, 0x85, 0xc2, 0x9d, + 0xe1, 0x30, 0x98, 0x09, 0xed, 0xa0, 0xa7, 0x0c, 0x76, 0xed, 0xb1, 0x9c, 0x80, 0xba, 0xe0, 0x3a, + 0x35, 0xb4, 0x62, 0xe2, 0x6a, 0xa5, 0xbe, 0xd3, 0x94, 0xdc, 0x44, 0xbc, 0xcf, 0x19, 0xfb, 0x7c, + 0xb5, 0xd6, 0x95, 0xcb, 0xb5, 0xae, 0x5c, 0xad, 0x75, 0xe5, 0xcf, 0x5a, 0x57, 0x7e, 0x6e, 0xf4, + 0xc6, 0xe5, 0x46, 0x6f, 0x5c, 0x6d, 0xf4, 0xc6, 0xe7, 0x51, 0x10, 0x8a, 0xd9, 0xc2, 0x33, 0x11, + 0x8d, 0xad, 0x6c, 0xfe, 0x4f, 0x09, 0x16, 0xdf, 0x28, 0x9b, 0x5b, 0xd5, 0x06, 0x7f, 0xbf, 0xb1, + 0xc3, 0x62, 0x99, 0x60, 0xee, 0xed, 0xe7, 0x7b, 0xf5, 0xf2, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x9e, 0x69, 0xe7, 0xf5, 0xe6, 0x03, 0x00, 0x00, } func (m *MorseAccountState) Marshal() (dAtA []byte, err error) { diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 825cf2158..7164d9d45 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -116,19 +116,22 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo -// MsgImportMorseClaimableAccounts is used to create the on-chain MorseClaimableAccounts ONLY ONCE (per network / re-genesis). +// MsgImportMorseClaimableAccounts is used to create the on-chain MorseClaimableAccounts ONLY AND EXACTLY ONCE (per network / re-genesis). type MsgImportMorseClaimableAccounts 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"` // the account state derived from the Morse state export and the `poktrolld migrate collect-morse-accounts` command. MorseAccountState MorseAccountState `protobuf:"bytes,2,opt,name=morse_account_state,json=morseAccountState,proto3" json:"morse_account_state"` - // expected sha256 hash of the morse_account_state. If this hash does not match the on-chain - // computation, the transaction will fail. Social consensus regarding the correctness of - // morse_account_state should have been achieved off-chain and can be verified on-chain by - // comparing this hash with that of a locally derived Morse state export: - // E.g., `poktrolld migrate collect-morse-accounts $<(pocket util export-genesis-for-reset)`. - // See: `pocket util export-genesis-for-migration --help` & `poktrolld migrate collect-morse-accounts --help` - // for more details. + // Validates the morse_account_state sha256 hash: + // - Transaction fails if hash doesn't match on-chain computation + // - Off-chain social consensus should be reached off-chain before verification + // + // Verification can be done by comparing with locally derived Morse state like so: + // $ poktrolld migrate collect-morse-accounts $<(pocket util export-genesis-for-reset) + // + // Additional documentation: + // - pocket util export-genesis-for-migration --help + // - poktrolld migrate collect-morse-accounts --help MorseAccountStateHash []byte `protobuf:"bytes,3,opt,name=morse_account_state_hash,json=morseAccountStateHash,proto3" json:"morse_account_state_hash"` } @@ -185,8 +188,8 @@ func (m *MsgImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { type MsgImportMorseClaimableAccountsResponse struct { // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. StateHash []byte `protobuf:"bytes,1,opt,name=state_hash,json=stateHash,proto3" json:"state_hash"` - // Number of accounts (EOAs) which were collected from the Morse state export, which may be claimed. - // NOTE: Application and supplier actor stakes are consolidated into their corresponding account balances. + // Number of claimable accounts (EOAs) collected from Morse state export. + // NOTE: Account balances include consolidated application and supplier actor stakes. NumAccounts uint64 `protobuf:"varint,2,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts"` } From bbfd600b7abecda5debbe46a57a8b7bbe9871e41 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 20 Feb 2025 12:51:29 +0100 Subject: [PATCH 39/81] fix: typo --- api/poktroll/migration/event.pulsar.go | 1 - 1 file changed, 1 deletion(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index 61726e93e..ebb2a4f76 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -8,7 +8,6 @@ import ( runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "github.com/pokt-network/poktroll/api/poktroll/shared" - prot protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" From c4b037522daf4b4bd906e3c8da3b2b90e85b15ff Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 20 Feb 2025 14:39:55 +0100 Subject: [PATCH 40/81] chore: review feedback improvements Co-authored-by: red-0ne --- .../morse_account_import_and_claim_test.go | 2 +- .../keeper/msg_server_claim_morse_account.go | 27 ++++----- .../msg_server_claim_morse_acount_test.go | 5 +- .../types/message_claim_morse_account.go | 55 +++++++++++++++++-- .../types/message_claim_morse_account_test.go | 55 +++++++++++++++---- 5 files changed, 111 insertions(+), 33 deletions(-) diff --git a/tests/integration/migration/morse_account_import_and_claim_test.go b/tests/integration/migration/morse_account_import_and_claim_test.go index d10578d9c..a62a90292 100644 --- a/tests/integration/migration/morse_account_import_and_claim_test.go +++ b/tests/integration/migration/morse_account_import_and_claim_test.go @@ -65,7 +65,7 @@ func (s *MigrationModuleTestSuite) TestClaimMorseAccount() { bankClient := s.GetBankQueryClient(s.T()) shannonDestBalance, err := bankClient.GetBalance(s.SdkCtx(), shannonDestAddr) require.NoError(s.T(), err) - require.Equal(s.T(), int64(0), shannonDestBalance.Amount.Int64()) + require.True(s.T(), shannonDestBalance.IsZero()) morseSrcAddr, claimAccountRes := s.ClaimMorseAccount(s.T(), 1, shannonDestAddr) diff --git a/x/migration/keeper/msg_server_claim_morse_account.go b/x/migration/keeper/msg_server_claim_morse_account.go index 1bf758e71..27c60bef7 100644 --- a/x/migration/keeper/msg_server_claim_morse_account.go +++ b/x/migration/keeper/msg_server_claim_morse_account.go @@ -3,8 +3,8 @@ package keeper import ( "context" + "github.com/cometbft/cometbft/crypto/ed25519" cosmostypes "github.com/cosmos/cosmos-sdk/types" - cosmoserrors "github.com/cosmos/cosmos-sdk/types/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -18,18 +18,9 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms return nil, status.Error(codes.InvalidArgument, err.Error()) } - shannonAccAddr, err := cosmostypes.AccAddressFromBech32(msg.ShannonDestAddress) - // DEV_NOTE: This SHOULD NEVER happen as the shannonDestAddress is validated - // in MsgClaimMorseAccount#ValidateBasic(). - if err != nil { - return nil, status.Error( - codes.InvalidArgument, - cosmoserrors.ErrInvalidAddress.Wrapf( - "failed to parse shannon destination address (%s): %s", - msg.ShannonDestAddress, err, - ).Error(), - ) - } + // DEV_NOTE: It is safe to use MustAccAddressFromBech32 here because the + // shannonDestAddress is validated in MsgClaimMorseAccount#ValidateBasic(). + shannonAccAddr := cosmostypes.MustAccAddressFromBech32(msg.ShannonDestAddress) // Ensure that a MorseClaimableAccount exists for the given morseSrcAddress. morseClaimableAccount, isFound := k.GetMorseClaimableAccount( @@ -59,6 +50,12 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms ) } + // Validate the Morse signature. + publicKey := ed25519.PubKey(morseClaimableAccount.GetPublicKey()) + if err := msg.ValidateMorseSignature(publicKey); err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + // Set ShannonDestAddress & ClaimedAtHeight (claim). morseClaimableAccount.ShannonDestAddress = shannonAccAddr.String() morseClaimableAccount.ClaimedAtHeight = sdkCtx.BlockHeight() @@ -76,7 +73,7 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms Add(morseClaimableAccount.SupplierStake) // Mint the totalTokens to the shannonDestAddress account balance. - if err = k.MintClaimedMorseTokens(ctx, shannonAccAddr, totalTokens); err != nil { + if err := k.MintClaimedMorseTokens(ctx, shannonAccAddr, totalTokens); err != nil { return nil, status.Error(codes.Internal, err.Error()) } @@ -87,7 +84,7 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms MorseSrcAddress: msg.MorseSrcAddress, ClaimedBalance: totalTokens, } - if err = sdkCtx.EventManager().EmitTypedEvent(&event); err != nil { + if err := sdkCtx.EventManager().EmitTypedEvent(&event); err != nil { return nil, status.Error( codes.Internal, migrationtypes.ErrMorseAccountClaim.Wrapf( diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go index edb204823..d0a01baef 100644 --- a/x/migration/keeper/msg_server_claim_morse_acount_test.go +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -42,7 +42,7 @@ func TestMsgServer_ClaimMorseAccount_Success(t *testing.T) { // Claim each MorseClaimableAccount. for morseAccountIdx, morseAccount := range accountState.Accounts { // Generate the corresponding morse private key using the account slice index as a seed. - morsePrivKey := testmigration.NewMorsePrivateKey(t, uint64(morseAccountIdx)) + morsePrivKey := testmigration.NewMorsePrivateKey(t, uint64(morseAccountIdx+1)) // Claim the MorseClaimableAccount. msgClaim, err := migrationtypes.NewMsgClaimMorseAccount( @@ -52,6 +52,9 @@ func TestMsgServer_ClaimMorseAccount_Success(t *testing.T) { ) require.NoError(t, err) + err = msgClaim.SignMorseSignature(morsePrivKey) + require.NoError(t, err) + msgClaimRes, err := srv.ClaimMorseAccount(ctx, msgClaim) require.NoError(t, err) diff --git a/x/migration/types/message_claim_morse_account.go b/x/migration/types/message_claim_morse_account.go index cc486a9e0..88039fe73 100644 --- a/x/migration/types/message_claim_morse_account.go +++ b/x/migration/types/message_claim_morse_account.go @@ -4,7 +4,7 @@ import ( "encoding/hex" errorsmod "cosmossdk.io/errors" - cometcrypto "github.com/cometbft/cometbft/crypto/ed25519" + cometcrypto "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/gogoproto/proto" @@ -37,10 +37,6 @@ func NewMsgClaimMorseAccount( } func (msg *MsgClaimMorseAccount) ValidateBasic() error { - if len(msg.MorseSignature) == 0 { - return ErrMorseAccountClaim.Wrap("morseSignature is empty") - } - if len(msg.MorseSrcAddress) != MorseAddressHexLengthBytes { return ErrMorseAccountClaim.Wrapf("invalid morseSrcAddress length (%d)", len(msg.MorseSrcAddress)) } @@ -50,3 +46,52 @@ func (msg *MsgClaimMorseAccount) ValidateBasic() error { } return nil } + +// SignMorseSignature signs the given MsgClaimMorseAccount with the given Morse private key. +func (msg *MsgClaimMorseAccount) SignMorseSignature(morsePrivKey cometcrypto.PrivKey) error { + signingMsgBz, err := msg.getSigningBytes() + if err != nil { + return err + } + + signatureBz, err := morsePrivKey.Sign(signingMsgBz) + if err != nil { + return err + } + + msg.MorseSignature = hex.EncodeToString(signatureBz) + return nil +} + +// ValidateMorseSignature validates the signature of the given MsgClaimMorseAccount +// matches the given Morse public key. +func (msg *MsgClaimMorseAccount) ValidateMorseSignature(morsePublicKey cometcrypto.PubKey) error { + // Validate the morse signature. + morseSignature, err := hex.DecodeString(msg.MorseSignature) + if err != nil { + return err + } + + signingMsgBz, err := msg.getSigningBytes() + if err != nil { + return err + } + + // Validate the morse signature. + if !morsePublicKey.VerifySignature(signingMsgBz, morseSignature) { + return ErrMorseAccountClaim.Wrapf("morseSignature is invalid") + } + + return nil +} + +// getSigningBytes returns the canonical byte representation of the MsgClaimMorseAccount +// which is used for signing and/or signature validation. +func (msg *MsgClaimMorseAccount) getSigningBytes() ([]byte, error) { + // Copy msg and clear the morse signature field (ONLY on the copy) to prevent + // it from being included in the signature validation. + signingMsg := *msg + signingMsg.MorseSignature = "" + + return proto.Marshal(&signingMsg) +} diff --git a/x/migration/types/message_claim_morse_account_test.go b/x/migration/types/message_claim_morse_account_test.go index a16d52cbe..fe3dd2f52 100644 --- a/x/migration/types/message_claim_morse_account_test.go +++ b/x/migration/types/message_claim_morse_account_test.go @@ -1,39 +1,42 @@ -package types +package types_test import ( + "encoding/hex" "testing" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" "github.com/pokt-network/poktroll/testutil/sample" + "github.com/pokt-network/poktroll/testutil/testmigration" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { tests := []struct { - name string - msg MsgClaimMorseAccount + desc string + msg migrationtypes.MsgClaimMorseAccount err error }{ { - name: "invalid ShannonDestAddress", - msg: MsgClaimMorseAccount{ + desc: "invalid ShannonDestAddress", + msg: migrationtypes.MsgClaimMorseAccount{ ShannonDestAddress: "invalid_address", MorseSrcAddress: sample.MorseAddressHex(), MorseSignature: "mock_signature", }, err: sdkerrors.ErrInvalidAddress, }, { - name: "invalid MorseSrcAddress", - msg: MsgClaimMorseAccount{ + desc: "invalid MorseSrcAddress", + msg: migrationtypes.MsgClaimMorseAccount{ ShannonDestAddress: sample.AccAddress(), MorseSrcAddress: "invalid_address", MorseSignature: "mock_signature", }, - err: ErrMorseAccountClaim, + err: migrationtypes.ErrMorseAccountClaim, }, { - name: "valid claim message", - msg: MsgClaimMorseAccount{ + desc: "valid claim message", + msg: migrationtypes.MsgClaimMorseAccount{ ShannonDestAddress: sample.AccAddress(), MorseSrcAddress: sample.MorseAddressHex(), MorseSignature: "mock_signature", @@ -41,7 +44,7 @@ func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { }, } for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { + t.Run(tt.desc, func(t *testing.T) { err := tt.msg.ValidateBasic() if tt.err != nil { require.ErrorIs(t, err, tt.err) @@ -51,3 +54,33 @@ func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { }) } } + +func TestMsgClaimMorseAccount_ValidateMorseSignature(t *testing.T) { + morsePrivKey := testmigration.NewMorsePrivateKey(t, 0) + morsePublicKey := morsePrivKey.PubKey() + + t.Run("invalid Morse signature", func(t *testing.T) { + msg := migrationtypes.MsgClaimMorseAccount{ + ShannonDestAddress: sample.AccAddress(), + MorseSrcAddress: sample.MorseAddressHex(), + MorseSignature: hex.EncodeToString([]byte("invalid_signature")), + } + + expectedErr := migrationtypes.ErrMorseAccountClaim.Wrapf("morseSignature is invalid") + err := msg.ValidateMorseSignature(morsePublicKey) + require.EqualError(t, err, expectedErr.Error()) + }) + + t.Run("valid Morse signature", func(t *testing.T) { + msg := migrationtypes.MsgClaimMorseAccount{ + ShannonDestAddress: sample.AccAddress(), + MorseSrcAddress: sample.MorseAddressHex(), + // MorseSignature: (intenionally omitted; set in #SignMorseSignature) + } + err := msg.SignMorseSignature(morsePrivKey) + require.NoError(t, err) + + err = msg.ValidateMorseSignature(morsePublicKey) + require.NoError(t, err) + }) +} From 5a17194bc9134a30b2c744b8809860dfc9e96b90 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 20 Feb 2025 15:00:45 +0100 Subject: [PATCH 41/81] fix: test --- x/migration/keeper/msg_server_claim_morse_acount_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go index d0a01baef..07b0d511b 100644 --- a/x/migration/keeper/msg_server_claim_morse_acount_test.go +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -129,7 +129,7 @@ func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { expectedErr := status.Error( codes.InvalidArgument, migrationtypes.ErrMorseAccountClaim.Wrapf( - "morseSignature is empty", + "morseSignature is invalid", ).Error(), ) From 52d865ff5189e31d1f35b96a0ce990831d22503a Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 21 Feb 2025 11:46:26 +0100 Subject: [PATCH 42/81] chore: chore: review feedback improvements Co-authored-by: Daniel Olshansky --- ..._server_import_morse_claimable_accounts.go | 6 ++++- x/migration/types/errors.go | 1 - ...message_import_morse_claimable_accounts.go | 27 ++++++++++++++----- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts.go index fe308c0e0..0a7ba5c77 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts.go @@ -10,12 +10,16 @@ import ( migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) +// ImportMorseClaimableAccounts persists all MorseClaimableAccounts in the given +// MorseAccountState to the KVStore. +// This operation MAY ONLY be performed EXACTLY ONCE (per network/re-genesis), +// and ONLY by an authorized account (i.e. PNF). func (k msgServer) ImportMorseClaimableAccounts(ctx context.Context, msg *migrationtypes.MsgImportMorseClaimableAccounts) (*migrationtypes.MsgImportMorseClaimableAccountsResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) logger := sdkCtx.Logger().With("method", "CreateMorseAccountState") if msg.GetAuthority() != k.GetAuthority() { - err := migrationtypes.ErrUnauthorized.Wrapf("invalid authority address (%s)", msg.GetAuthority()) + err := migrationtypes.ErrInvalidSigner.Wrapf("invalid authority address (%s)", msg.GetAuthority()) return nil, status.Error(codes.PermissionDenied, err.Error()) } diff --git a/x/migration/types/errors.go b/x/migration/types/errors.go index e2b41cd6f..6e826ae89 100644 --- a/x/migration/types/errors.go +++ b/x/migration/types/errors.go @@ -10,5 +10,4 @@ import ( var ( ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected x/gov module account as the only signer for migration state import messages") ErrMorseAccountState = sdkerrors.Register(ModuleName, 1101, "morse account state is invalid") - ErrUnauthorized = sdkerrors.Register(ModuleName, 1102, "unauthorized") ) diff --git a/x/migration/types/message_import_morse_claimable_accounts.go b/x/migration/types/message_import_morse_claimable_accounts.go index cba065608..283bdf4b4 100644 --- a/x/migration/types/message_import_morse_claimable_accounts.go +++ b/x/migration/types/message_import_morse_claimable_accounts.go @@ -2,6 +2,7 @@ package types import ( "bytes" + "crypto/sha256" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -9,6 +10,8 @@ import ( var _ sdk.Msg = (*MsgImportMorseClaimableAccounts)(nil) +// NewMsgImportMorseClaimableAccounts constructs a MsgImportMorseClaimableAccounts +// from the given authority and morseAccountState. func NewMsgImportMorseClaimableAccounts( authority string, morseAccountState MorseAccountState, @@ -25,27 +28,37 @@ func NewMsgImportMorseClaimableAccounts( }, nil } +// ValidateBasic ensures that: +// - The authority address is valid (i.e. well-formed). +// - The MorseAccountStateHash field hash matches computed hash of the MorseAccountState field. func (msg *MsgImportMorseClaimableAccounts) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { return sdkerrors.ErrInvalidAddress.Wrapf("invalid authority address (%s)", err) } - actualHash, err := msg.MorseAccountState.GetHash() + // Compute the hash (right now) of the MorseAccountState field. + computedHash, err := msg.MorseAccountState.GetHash() if err != nil { return err } - expectedHash := msg.GetMorseAccountStateHash() - if len(expectedHash) == 0 { + // givenHash is computed off-chain and included as part of MsgImportMorseClaimableAccounts; + // the rationale being, that this consensus of the correctness of this hash will have been + // established off-chain. It is included here to simplify the validation of the MorseAccountState + // itself, as a ground-truth to which an on-chain computation of the hash can be compared (below). + givenHash := msg.GetMorseAccountStateHash() + + // Validate the given hash (i.e. the MorseAccountStateHash field) length. + if len(givenHash) == sha256.Size { return ErrMorseAccountState.Wrapf("expected hash is empty") } - if !bytes.Equal(actualHash, expectedHash) { + // Validate the given hash matches the computed hash. + if !bytes.Equal(computedHash, givenHash) { return ErrMorseAccountState.Wrapf( - "Morse account state hash (%x) doesn't match expected: (%x)", - actualHash, expectedHash, + "computed MorseAccountState hash (%s) doesn't match the given MorseAccountStateHash (%s)", + computedHash, givenHash, ) } - return nil } From 4a14f00da3f4db2586a468e154e933c10ec9e071 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 21 Feb 2025 11:55:27 +0100 Subject: [PATCH 43/81] fix: typo & test --- ...erver_import_morse_claimable_accounts_test.go | 16 ++++------------ .../message_import_morse_claimable_accounts.go | 4 ++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go index 1efc5a50a..dc8c8ee25 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go @@ -75,19 +75,11 @@ func TestMsgServer_ImportMorseClaimableAccounts_ErrorAlreadySet(t *testing.T) { k, ctx := keepertest.MigrationKeeper(t) srv := keeper.NewMsgServerImpl(k) - // Assert that the MorseAccountState is not set initially. - morseClaimableAccounts := k.GetAllMorseClaimableAccounts(ctx) - require.Equal(t, 0, len(morseClaimableAccounts)) - - numAccounts := 10 - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts) - k.ImportFromMorseAccountState(ctx, accountState) - - // Assert that the MorseAccountState have been set. - morseClaimableAccounts = k.GetAllMorseClaimableAccounts(ctx) - require.Equal(t, 10, len(morseClaimableAccounts)) + // Set at least one MorseAccountState initially. + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, 1) + k.SetMorseClaimableAccount(ctx, *accountState.Accounts[0]) - // Assert that the MorseAccountState can ONLY be set once. + // Assert that the MsgImportMorseClaimableAccounts fails. msgImportMorseClaimableAccounts, err := migrationtypes.NewMsgImportMorseClaimableAccounts( authtypes.NewModuleAddress(govtypes.ModuleName).String(), *accountState, diff --git a/x/migration/types/message_import_morse_claimable_accounts.go b/x/migration/types/message_import_morse_claimable_accounts.go index 283bdf4b4..3e64f9328 100644 --- a/x/migration/types/message_import_morse_claimable_accounts.go +++ b/x/migration/types/message_import_morse_claimable_accounts.go @@ -49,8 +49,8 @@ func (msg *MsgImportMorseClaimableAccounts) ValidateBasic() error { givenHash := msg.GetMorseAccountStateHash() // Validate the given hash (i.e. the MorseAccountStateHash field) length. - if len(givenHash) == sha256.Size { - return ErrMorseAccountState.Wrapf("expected hash is empty") + if len(givenHash) != sha256.Size { + return ErrMorseAccountState.Wrapf("invalid MorseAccountStateHash size") } // Validate the given hash matches the computed hash. From a4ef4334d2bdcd38f80624b0751c90128d843317 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 24 Feb 2025 09:59:44 +0100 Subject: [PATCH 44/81] chore: review feedback improvements --- testutil/testmigration/fixtures.go | 4 ++++ x/migration/module/autocli.go | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/testutil/testmigration/fixtures.go b/testutil/testmigration/fixtures.go index 14b1a3754..d4fe56254 100644 --- a/testutil/testmigration/fixtures.go +++ b/testutil/testmigration/fixtures.go @@ -15,6 +15,10 @@ import ( migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) +// TODO_CONSIDERATION/TODO_IMPROVE: Generate more "realistic" fixtures. +// I.e.: Non-actor accounts, applications, and suppliers. +// See: https://github.com/pokt-network/poktroll/pull/1072#discussion_r1961769422 + // NewMorseStateExportAndAccountStateBytes returns: // - A serialized MorseStateExport. // This is the JSON output of `pocket util export-genesis-for-reset`. diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index 38485e870..904bbb908 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -48,7 +48,8 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Use: "import-morse-claimable-accounts [morse-account-state]", Short: "Send a import_morse_claimable_accounts tx", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morseAccountState"}}, - Skip: true, // skipped because authority gated + // TODO_UPNEXT(@bryanchriswhite, #1034): Implement CLI logic. + Skip: true, // skipped because authority gated }, // this line is used by ignite scaffolding # autocli/tx }, From 5e13640a9d88f538694e9f27cb82eec3382ba340 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 24 Feb 2025 11:32:25 +0100 Subject: [PATCH 45/81] chore: review feedback improvements Co-authored-by: red-0ne Co-authored-by: Daniel Olshansky --- api/poktroll/migration/event.pulsar.go | 1 + api/poktroll/migration/tx.pulsar.go | 22 +++++++++++++++------- proto/poktroll/migration/tx.proto | 22 +++++++++++++++------- x/migration/module/autocli.go | 2 +- x/migration/types/tx.pb.go | 22 +++++++++++++++------- 5 files changed, 47 insertions(+), 22 deletions(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index e6ca4fc52..f9296d2fe 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -8,6 +8,7 @@ import ( runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "github.com/pokt-network/poktroll/api/poktroll/shared" + prot protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index 1c7229bf2..88c07e1c4 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -3150,10 +3150,13 @@ func (x *MsgImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { return nil } -// MsgImportMorseClaimableAccountsResponse is used to execute a claim (one-time minting of tokens on Shannon), -// of the balance of the given Morse account, according to the on-chain MorseClaimableAccounts, to the balance -// of the given Shannon account (who MUST also be the signer of this message). -// Authz grant(s) MAY be used to delegate the authority to create a claim on behalf of another Shannon account. +// MsgImportMorseClaimableAccountsResponse handles the state management that enables +// one-time token minting on Shannon for a Morse account's balance based on the on-chain MorseClaimableAccounts configuration. +// +// Key points: +// - The Shannon account specified must be the message signer +// - Claims are executed against the balance shown in MorseClaimableAccounts +// - Authz grants can delegate claim creation authority to other Shannon accounts type MsgImportMorseClaimableAccountsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3200,9 +3203,11 @@ func (x *MsgImportMorseClaimableAccountsResponse) GetNumAccounts() uint64 { return 0 } -// MsgClaimMorseAccount is an on-chain, persisted data structure which represents the state of a claimable account. -// It is initially created by the (one-time) MsgImportMorseClaimableAccounts message, and is subsequently updated -// by the MsgClaimMorseAccount message, when it is claimed (also a one-time event, per claimable account). +// MsgClaimMorseAccount represents the state of a claimable account persisted on-chain. +// +// Lifecycle: +// - Created once via MsgImportMorseClaimableAccounts +// - Updated once via MsgClaimMorseAccount during claim execution type MsgClaimMorseAccount struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3211,8 +3216,10 @@ type MsgClaimMorseAccount struct { // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address,omitempty"` // The hex-encoded address of the Morse account whose balance will be claimed. + // E.g.: 00f9900606fa3d5c9179fc0c8513078a53a2073e MorseSrcAddress string `protobuf:"bytes,2,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` // The hex-encoded signature, by the Morse account, of this message (where this field is nil). + // I.e.: morse_signature = private_key.sign(marshal(MsgClaimMorseAccount{morse_signature: nil, ...})) MorseSignature string `protobuf:"bytes,3,opt,name=morse_signature,json=morseSignature,proto3" json:"morse_signature,omitempty"` } @@ -3263,6 +3270,7 @@ type MsgClaimMorseAccountResponse struct { unknownFields protoimpl.UnknownFields // The hex-encoded address of the Morse account whose balance will be claimed. + // E.g.: 00f9900606fa3d5c9179fc0c8513078a53a2073e MorseSrcAddress string `protobuf:"bytes,1,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` // The balance which was claimed. ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance,omitempty"` diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 59f35d985..d2feb6940 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -61,10 +61,13 @@ message MsgImportMorseClaimableAccounts { bytes morse_account_state_hash = 3 [(gogoproto.jsontag) = "morse_account_state_hash"]; } -// MsgImportMorseClaimableAccountsResponse is used to execute a claim (one-time minting of tokens on Shannon), -// of the balance of the given Morse account, according to the on-chain MorseClaimableAccounts, to the balance -// of the given Shannon account (who MUST also be the signer of this message). -// Authz grant(s) MAY be used to delegate the authority to create a claim on behalf of another Shannon account. +// MsgImportMorseClaimableAccountsResponse handles the state management that enables +// one-time token minting on Shannon for a Morse account's balance based on the on-chain MorseClaimableAccounts configuration. +// +// Key points: +// - The Shannon account specified must be the message signer +// - Claims are executed against the balance shown in MorseClaimableAccounts +// - Authz grants can delegate claim creation authority to other Shannon accounts message MsgImportMorseClaimableAccountsResponse { // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. @@ -75,9 +78,11 @@ message MsgImportMorseClaimableAccountsResponse { uint64 num_accounts = 2 [(gogoproto.jsontag) = "num_accounts"]; } -// MsgClaimMorseAccount is an on-chain, persisted data structure which represents the state of a claimable account. -// It is initially created by the (one-time) MsgImportMorseClaimableAccounts message, and is subsequently updated -// by the MsgClaimMorseAccount message, when it is claimed (also a one-time event, per claimable account). +// MsgClaimMorseAccount represents the state of a claimable account persisted on-chain. +// +// Lifecycle: +// - Created once via MsgImportMorseClaimableAccounts +// - Updated once via MsgClaimMorseAccount during claim execution message MsgClaimMorseAccount { option (cosmos.msg.v1.signer) = "shannon_dest_address"; @@ -85,14 +90,17 @@ message MsgClaimMorseAccount { string shannon_dest_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "shannon_dest_address"]; // The hex-encoded address of the Morse account whose balance will be claimed. + // E.g.: 00f9900606fa3d5c9179fc0c8513078a53a2073e string morse_src_address = 2 [(gogoproto.jsontag) = "morse_src_address"]; // The hex-encoded signature, by the Morse account, of this message (where this field is nil). + // I.e.: morse_signature = private_key.sign(marshal(MsgClaimMorseAccount{morse_signature: nil, ...})) string morse_signature = 3 [(gogoproto.jsontag) = "morse_signature"]; } message MsgClaimMorseAccountResponse { // The hex-encoded address of the Morse account whose balance will be claimed. + // E.g.: 00f9900606fa3d5c9179fc0c8513078a53a2073e string morse_src_address = 1 [(gogoproto.jsontag) = "morse_src_address"]; // The balance which was claimed. diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index 306b7c52f..dfb98de97 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -57,7 +57,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Long: "Claim the account balance of the given Morse account address, by signing the message with the private key of the Morse account.", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morse_src_address"}, {ProtoField: "morse_signature"}}, Skip: true, // skipped because autoCLI cannot handle signing - // TODO_UPNEXT(@bryanchriswhite#1034): Add morse account claiming CLI. + // TODO_UPNEXT(@bryanchriswhite, #1034): Add morse account claiming CLI, incl. examples (see x/supplier/module/autocli.go). }, // this line is used by ignite scaffolding # autocli/tx }, diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 38857d9d2..9e1328542 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -183,10 +183,13 @@ func (m *MsgImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { return nil } -// MsgImportMorseClaimableAccountsResponse is used to execute a claim (one-time minting of tokens on Shannon), -// of the balance of the given Morse account, according to the on-chain MorseClaimableAccounts, to the balance -// of the given Shannon account (who MUST also be the signer of this message). -// Authz grant(s) MAY be used to delegate the authority to create a claim on behalf of another Shannon account. +// MsgImportMorseClaimableAccountsResponse handles the state management that enables +// one-time token minting on Shannon for a Morse account's balance based on the on-chain MorseClaimableAccounts configuration. +// +// Key points: +// - The Shannon account specified must be the message signer +// - Claims are executed against the balance shown in MorseClaimableAccounts +// - Authz grants can delegate claim creation authority to other Shannon accounts type MsgImportMorseClaimableAccountsResponse struct { // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. StateHash []byte `protobuf:"bytes,1,opt,name=state_hash,json=stateHash,proto3" json:"state_hash"` @@ -240,15 +243,19 @@ func (m *MsgImportMorseClaimableAccountsResponse) GetNumAccounts() uint64 { return 0 } -// MsgClaimMorseAccount is an on-chain, persisted data structure which represents the state of a claimable account. -// It is initially created by the (one-time) MsgImportMorseClaimableAccounts message, and is subsequently updated -// by the MsgClaimMorseAccount message, when it is claimed (also a one-time event, per claimable account). +// MsgClaimMorseAccount represents the state of a claimable account persisted on-chain. +// +// Lifecycle: +// - Created once via MsgImportMorseClaimableAccounts +// - Updated once via MsgClaimMorseAccount during claim execution type MsgClaimMorseAccount struct { // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address"` // The hex-encoded address of the Morse account whose balance will be claimed. + // E.g.: 00f9900606fa3d5c9179fc0c8513078a53a2073e MorseSrcAddress string `protobuf:"bytes,2,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address"` // The hex-encoded signature, by the Morse account, of this message (where this field is nil). + // I.e.: morse_signature = private_key.sign(marshal(MsgClaimMorseAccount{morse_signature: nil, ...})) MorseSignature string `protobuf:"bytes,3,opt,name=morse_signature,json=morseSignature,proto3" json:"morse_signature"` } @@ -304,6 +311,7 @@ func (m *MsgClaimMorseAccount) GetMorseSignature() string { type MsgClaimMorseAccountResponse struct { // The hex-encoded address of the Morse account whose balance will be claimed. + // E.g.: 00f9900606fa3d5c9179fc0c8513078a53a2073e MorseSrcAddress string `protobuf:"bytes,1,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address"` // The balance which was claimed. ClaimedBalance types.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance"` From 958bdac3e8e08ccb73df618a51e5c388ddfdcb56 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 24 Feb 2025 11:57:15 +0100 Subject: [PATCH 46/81] fix: imports --- api/poktroll/migration/event.pulsar.go | 1 - 1 file changed, 1 deletion(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index 61726e93e..ebb2a4f76 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -8,7 +8,6 @@ import ( runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "github.com/pokt-network/poktroll/api/poktroll/shared" - prot protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" From 7ca2cfe9164f89b37dcfeaf421f3ac499c984514 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 24 Feb 2025 12:33:36 +0100 Subject: [PATCH 47/81] fix: typo --- .../keeper/msg_server_import_morse_claimable_accounts_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go index 39fd22f27..e2ab7e96e 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go @@ -80,8 +80,8 @@ func TestMsgServer_ImportMorseClaimableAccounts_ErrorAlreadySet(t *testing.T) { k.SetMorseClaimableAccount(ctx, *accountState.Accounts[0]) // Set up the MsgImportMorseClaimableAccounts to fail. - morseClaimableAccounts = k.GetAllMorseClaimableAccounts(ctx) - require.Equal(t, numAccounts, len(morseClaimableAccounts)) + morseClaimableAccounts := k.GetAllMorseClaimableAccounts(ctx) + require.Equal(t, 1, len(morseClaimableAccounts)) for _, morseClaimableAccount := range morseClaimableAccounts { require.Equal(t, int64(0), morseClaimableAccount.ClaimedAtHeight) require.Equal(t, "", morseClaimableAccount.ShannonDestAddress) From c3e467130a6f14ab44e525df85da40fb443461e0 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 24 Feb 2025 15:32:34 +0100 Subject: [PATCH 48/81] fix: linter error --- x/migration/types/errors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/migration/types/errors.go b/x/migration/types/errors.go index f93d577d1..255ff25d2 100644 --- a/x/migration/types/errors.go +++ b/x/migration/types/errors.go @@ -8,7 +8,7 @@ import ( // x/migration module sentinel errors var ( - ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected x/gov module account as the only signer for migration state import messages") + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected x/gov module account as the only signer for migration state import messages") ErrMorseAccountsImport = sdkerrors.Register(ModuleName, 1101, "unable to import morse claimable accounts") ErrMorseAccountClaim = sdkerrors.Register(ModuleName, 1102, "unable to claim morse account") ) From d61192b3ae99c28e077d6b155d90adf1710dec6e Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 24 Feb 2025 16:38:38 +0100 Subject: [PATCH 49/81] chore: review feedback improvements --- api/poktroll/migration/tx.pulsar.go | 2 ++ proto/poktroll/migration/tx.proto | 2 ++ x/migration/types/tx.pb.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index 233b1fba7..cb22af755 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -2058,6 +2058,8 @@ func (x *MsgImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { return nil } +// MsgImportMorseClaimableAccountsResponse is returned from MsgImportMorseClaimableAccounts. +// It indicates the canonical hash of the imported MorseAccountState, and the number of claimable accounts which were imported. type MsgImportMorseClaimableAccountsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 5eb92e91a..3130f22f4 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -62,6 +62,8 @@ message MsgImportMorseClaimableAccounts { bytes morse_account_state_hash = 3 [(gogoproto.jsontag) = "morse_account_state_hash"]; } +// MsgImportMorseClaimableAccountsResponse is returned from MsgImportMorseClaimableAccounts. +// It indicates the canonical hash of the imported MorseAccountState, and the number of claimable accounts which were imported. message MsgImportMorseClaimableAccountsResponse { // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. bytes state_hash = 1 [(gogoproto.jsontag) = "state_hash"]; diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 7164d9d45..50d338e05 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -185,6 +185,8 @@ func (m *MsgImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { return nil } +// MsgImportMorseClaimableAccountsResponse is returned from MsgImportMorseClaimableAccounts. +// It indicates the canonical hash of the imported MorseAccountState, and the number of claimable accounts which were imported. type MsgImportMorseClaimableAccountsResponse struct { // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. StateHash []byte `protobuf:"bytes,1,opt,name=state_hash,json=stateHash,proto3" json:"state_hash"` From e11777aa1f3d23aaa0805130097b97e08369c1cf Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 24 Feb 2025 16:45:03 +0100 Subject: [PATCH 50/81] chore: review feedback improvements --- api/poktroll/migration/tx.pulsar.go | 22 +++++++++++----------- proto/poktroll/migration/tx.proto | 13 +++++++++---- x/migration/types/tx.pb.go | 22 +++++++++++----------- 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index e5dcbbe9d..3b9857f3b 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -3154,13 +3154,8 @@ func (x *MsgImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { return nil } -// MsgImportMorseClaimableAccountsResponse handles the state management that enables -// one-time token minting on Shannon for a Morse account's balance based on the on-chain MorseClaimableAccounts configuration. -// -// Key points: -// - The Shannon account specified must be the message signer -// - Claims are executed against the balance shown in MorseClaimableAccounts -// - Authz grants can delegate claim creation authority to other Shannon accounts +// MsgImportMorseClaimableAccountsResponse is returned from MsgImportMorseClaimableAccounts. +// It indicates the canonical hash of the imported MorseAccountState, and the number of claimable accounts which were imported. type MsgImportMorseClaimableAccountsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3207,11 +3202,13 @@ func (x *MsgImportMorseClaimableAccountsResponse) GetNumAccounts() uint64 { return 0 } -// MsgClaimMorseAccount represents the state of a claimable account persisted on-chain. +// MsgClaimMorseAccount is used to execute a claim (one-time minting of tokens on Shannon), +// of the balance of the given Morse account, according to the on-chain MorseClaimableAccounts, +// to the balance of the given Shannon account. // -// Lifecycle: -// - Created once via MsgImportMorseClaimableAccounts -// - Updated once via MsgClaimMorseAccount during claim execution +// NOTE: +// - The Shannon account specified must be the message signer +// - Authz grants MAY be used to delegate claiming authority to other Shannon accounts type MsgClaimMorseAccount struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3268,6 +3265,9 @@ func (x *MsgClaimMorseAccount) GetMorseSignature() string { return "" } +// MsgClaimMorseAccountResponse is returned from MsgClaimMorseAccount. +// It indicates the morse_src_address of the account which was claimed, the total +// balance claimed, and the height at which the claim was committed. type MsgClaimMorseAccountResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 49a7dfa8d..ab16bf00b 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -75,11 +75,13 @@ message MsgImportMorseClaimableAccountsResponse { uint64 num_accounts = 2 [(gogoproto.jsontag) = "num_accounts"]; } -// MsgClaimMorseAccount represents the state of a claimable account persisted on-chain. +// MsgClaimMorseAccount is used to execute a claim (one-time minting of tokens on Shannon), +// of the balance of the given Morse account, according to the on-chain MorseClaimableAccounts, +// to the balance of the given Shannon account. // -// Lifecycle: -// - Created once via MsgImportMorseClaimableAccounts -// - Updated once via MsgClaimMorseAccount during claim execution +// NOTE: +// - The Shannon account specified must be the message signer +// - Authz grants MAY be used to delegate claiming authority to other Shannon accounts message MsgClaimMorseAccount { option (cosmos.msg.v1.signer) = "shannon_dest_address"; @@ -95,6 +97,9 @@ message MsgClaimMorseAccount { string morse_signature = 3 [(gogoproto.jsontag) = "morse_signature"]; } +// MsgClaimMorseAccountResponse is returned from MsgClaimMorseAccount. +// It indicates the morse_src_address of the account which was claimed, the total +// balance claimed, and the height at which the claim was committed. message MsgClaimMorseAccountResponse { // The hex-encoded address of the Morse account whose balance will be claimed. // E.g.: 00f9900606fa3d5c9179fc0c8513078a53a2073e diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 05ab0a21d..2c3cc00d5 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -186,13 +186,8 @@ func (m *MsgImportMorseClaimableAccounts) GetMorseAccountStateHash() []byte { return nil } -// MsgImportMorseClaimableAccountsResponse handles the state management that enables -// one-time token minting on Shannon for a Morse account's balance based on the on-chain MorseClaimableAccounts configuration. -// -// Key points: -// - The Shannon account specified must be the message signer -// - Claims are executed against the balance shown in MorseClaimableAccounts -// - Authz grants can delegate claim creation authority to other Shannon accounts +// MsgImportMorseClaimableAccountsResponse is returned from MsgImportMorseClaimableAccounts. +// It indicates the canonical hash of the imported MorseAccountState, and the number of claimable accounts which were imported. type MsgImportMorseClaimableAccountsResponse struct { // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. StateHash []byte `protobuf:"bytes,1,opt,name=state_hash,json=stateHash,proto3" json:"state_hash"` @@ -246,11 +241,13 @@ func (m *MsgImportMorseClaimableAccountsResponse) GetNumAccounts() uint64 { return 0 } -// MsgClaimMorseAccount represents the state of a claimable account persisted on-chain. +// MsgClaimMorseAccount is used to execute a claim (one-time minting of tokens on Shannon), +// of the balance of the given Morse account, according to the on-chain MorseClaimableAccounts, +// to the balance of the given Shannon account. // -// Lifecycle: -// - Created once via MsgImportMorseClaimableAccounts -// - Updated once via MsgClaimMorseAccount during claim execution +// NOTE: +// - The Shannon account specified must be the message signer +// - Authz grants MAY be used to delegate claiming authority to other Shannon accounts type MsgClaimMorseAccount struct { // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address"` @@ -312,6 +309,9 @@ func (m *MsgClaimMorseAccount) GetMorseSignature() string { return "" } +// MsgClaimMorseAccountResponse is returned from MsgClaimMorseAccount. +// It indicates the morse_src_address of the account which was claimed, the total +// balance claimed, and the height at which the claim was committed. type MsgClaimMorseAccountResponse struct { // The hex-encoded address of the Morse account whose balance will be claimed. // E.g.: 00f9900606fa3d5c9179fc0c8513078a53a2073e From 6fba262e9747fdb260b944f0020f07c0526fe9e4 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 24 Feb 2025 16:51:34 +0100 Subject: [PATCH 51/81] chore: regenerate protobufs --- api/poktroll/migration/event.pulsar.go | 925 +------------------------ 1 file changed, 22 insertions(+), 903 deletions(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index 8a6d508f9..e10fdfe25 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -1145,760 +1145,6 @@ func (x *fastReflection_EventMorseAccountClaimed) ProtoMethods() *protoiface.Met } } -var ( - md_EventMorseApplicationClaimed protoreflect.MessageDescriptor - fd_EventMorseApplicationClaimed_claimed_at_height protoreflect.FieldDescriptor - fd_EventMorseApplicationClaimed_claimed_balance protoreflect.FieldDescriptor - fd_EventMorseApplicationClaimed_shannon_dest_address protoreflect.FieldDescriptor - fd_EventMorseApplicationClaimed_morse_src_address protoreflect.FieldDescriptor - fd_EventMorseApplicationClaimed_claimedApplicationStake protoreflect.FieldDescriptor - fd_EventMorseApplicationClaimed_serviceId protoreflect.FieldDescriptor -) - -func init() { - file_poktroll_migration_event_proto_init() - md_EventMorseApplicationClaimed = File_poktroll_migration_event_proto.Messages().ByName("EventMorseApplicationClaimed") - fd_EventMorseApplicationClaimed_claimed_at_height = md_EventMorseApplicationClaimed.Fields().ByName("claimed_at_height") - fd_EventMorseApplicationClaimed_claimed_balance = md_EventMorseApplicationClaimed.Fields().ByName("claimed_balance") - fd_EventMorseApplicationClaimed_shannon_dest_address = md_EventMorseApplicationClaimed.Fields().ByName("shannon_dest_address") - fd_EventMorseApplicationClaimed_morse_src_address = md_EventMorseApplicationClaimed.Fields().ByName("morse_src_address") - fd_EventMorseApplicationClaimed_claimedApplicationStake = md_EventMorseApplicationClaimed.Fields().ByName("claimedApplicationStake") - fd_EventMorseApplicationClaimed_serviceId = md_EventMorseApplicationClaimed.Fields().ByName("serviceId") -} - -var _ protoreflect.Message = (*fastReflection_EventMorseApplicationClaimed)(nil) - -type fastReflection_EventMorseApplicationClaimed EventMorseApplicationClaimed - -func (x *EventMorseApplicationClaimed) ProtoReflect() protoreflect.Message { - return (*fastReflection_EventMorseApplicationClaimed)(x) -} - -func (x *EventMorseApplicationClaimed) slowProtoReflect() protoreflect.Message { - mi := &file_poktroll_migration_event_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_EventMorseApplicationClaimed_messageType fastReflection_EventMorseApplicationClaimed_messageType -var _ protoreflect.MessageType = fastReflection_EventMorseApplicationClaimed_messageType{} - -type fastReflection_EventMorseApplicationClaimed_messageType struct{} - -func (x fastReflection_EventMorseApplicationClaimed_messageType) Zero() protoreflect.Message { - return (*fastReflection_EventMorseApplicationClaimed)(nil) -} -func (x fastReflection_EventMorseApplicationClaimed_messageType) New() protoreflect.Message { - return new(fastReflection_EventMorseApplicationClaimed) -} -func (x fastReflection_EventMorseApplicationClaimed_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_EventMorseApplicationClaimed -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_EventMorseApplicationClaimed) Descriptor() protoreflect.MessageDescriptor { - return md_EventMorseApplicationClaimed -} - -// 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_EventMorseApplicationClaimed) Type() protoreflect.MessageType { - return _fastReflection_EventMorseApplicationClaimed_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_EventMorseApplicationClaimed) New() protoreflect.Message { - return new(fastReflection_EventMorseApplicationClaimed) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_EventMorseApplicationClaimed) Interface() protoreflect.ProtoMessage { - return (*EventMorseApplicationClaimed)(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_EventMorseApplicationClaimed) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.ClaimedAtHeight != int64(0) { - value := protoreflect.ValueOfInt64(x.ClaimedAtHeight) - if !f(fd_EventMorseApplicationClaimed_claimed_at_height, value) { - return - } - } - if x.ClaimedBalance != nil { - value := protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) - if !f(fd_EventMorseApplicationClaimed_claimed_balance, value) { - return - } - } - if x.ShannonDestAddress != "" { - value := protoreflect.ValueOfString(x.ShannonDestAddress) - if !f(fd_EventMorseApplicationClaimed_shannon_dest_address, value) { - return - } - } - if x.MorseSrcAddress != "" { - value := protoreflect.ValueOfString(x.MorseSrcAddress) - if !f(fd_EventMorseApplicationClaimed_morse_src_address, value) { - return - } - } - if x.ClaimedApplicationStake != nil { - value := protoreflect.ValueOfMessage(x.ClaimedApplicationStake.ProtoReflect()) - if !f(fd_EventMorseApplicationClaimed_claimedApplicationStake, value) { - return - } - } - if x.ServiceId != "" { - value := protoreflect.ValueOfString(x.ServiceId) - if !f(fd_EventMorseApplicationClaimed_serviceId, 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_EventMorseApplicationClaimed) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "poktroll.migration.EventMorseApplicationClaimed.claimed_at_height": - return x.ClaimedAtHeight != int64(0) - case "poktroll.migration.EventMorseApplicationClaimed.claimed_balance": - return x.ClaimedBalance != nil - case "poktroll.migration.EventMorseApplicationClaimed.shannon_dest_address": - return x.ShannonDestAddress != "" - case "poktroll.migration.EventMorseApplicationClaimed.morse_src_address": - return x.MorseSrcAddress != "" - case "poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake": - return x.ClaimedApplicationStake != nil - case "poktroll.migration.EventMorseApplicationClaimed.serviceId": - return x.ServiceId != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseApplicationClaimed")) - } - panic(fmt.Errorf("message poktroll.migration.EventMorseApplicationClaimed 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_EventMorseApplicationClaimed) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "poktroll.migration.EventMorseApplicationClaimed.claimed_at_height": - x.ClaimedAtHeight = int64(0) - case "poktroll.migration.EventMorseApplicationClaimed.claimed_balance": - x.ClaimedBalance = nil - case "poktroll.migration.EventMorseApplicationClaimed.shannon_dest_address": - x.ShannonDestAddress = "" - case "poktroll.migration.EventMorseApplicationClaimed.morse_src_address": - x.MorseSrcAddress = "" - case "poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake": - x.ClaimedApplicationStake = nil - case "poktroll.migration.EventMorseApplicationClaimed.serviceId": - x.ServiceId = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseApplicationClaimed")) - } - panic(fmt.Errorf("message poktroll.migration.EventMorseApplicationClaimed 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_EventMorseApplicationClaimed) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "poktroll.migration.EventMorseApplicationClaimed.claimed_at_height": - value := x.ClaimedAtHeight - return protoreflect.ValueOfInt64(value) - case "poktroll.migration.EventMorseApplicationClaimed.claimed_balance": - value := x.ClaimedBalance - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "poktroll.migration.EventMorseApplicationClaimed.shannon_dest_address": - value := x.ShannonDestAddress - return protoreflect.ValueOfString(value) - case "poktroll.migration.EventMorseApplicationClaimed.morse_src_address": - value := x.MorseSrcAddress - return protoreflect.ValueOfString(value) - case "poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake": - value := x.ClaimedApplicationStake - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "poktroll.migration.EventMorseApplicationClaimed.serviceId": - value := x.ServiceId - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseApplicationClaimed")) - } - panic(fmt.Errorf("message poktroll.migration.EventMorseApplicationClaimed 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_EventMorseApplicationClaimed) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "poktroll.migration.EventMorseApplicationClaimed.claimed_at_height": - x.ClaimedAtHeight = value.Int() - case "poktroll.migration.EventMorseApplicationClaimed.claimed_balance": - x.ClaimedBalance = value.Message().Interface().(*v1beta1.Coin) - case "poktroll.migration.EventMorseApplicationClaimed.shannon_dest_address": - x.ShannonDestAddress = value.Interface().(string) - case "poktroll.migration.EventMorseApplicationClaimed.morse_src_address": - x.MorseSrcAddress = value.Interface().(string) - case "poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake": - x.ClaimedApplicationStake = value.Message().Interface().(*v1beta1.Coin) - case "poktroll.migration.EventMorseApplicationClaimed.serviceId": - x.ServiceId = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseApplicationClaimed")) - } - panic(fmt.Errorf("message poktroll.migration.EventMorseApplicationClaimed 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_EventMorseApplicationClaimed) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.migration.EventMorseApplicationClaimed.claimed_balance": - if x.ClaimedBalance == nil { - x.ClaimedBalance = new(v1beta1.Coin) - } - return protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) - case "poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake": - if x.ClaimedApplicationStake == nil { - x.ClaimedApplicationStake = new(v1beta1.Coin) - } - return protoreflect.ValueOfMessage(x.ClaimedApplicationStake.ProtoReflect()) - case "poktroll.migration.EventMorseApplicationClaimed.claimed_at_height": - panic(fmt.Errorf("field claimed_at_height of message poktroll.migration.EventMorseApplicationClaimed is not mutable")) - case "poktroll.migration.EventMorseApplicationClaimed.shannon_dest_address": - panic(fmt.Errorf("field shannon_dest_address of message poktroll.migration.EventMorseApplicationClaimed is not mutable")) - case "poktroll.migration.EventMorseApplicationClaimed.morse_src_address": - panic(fmt.Errorf("field morse_src_address of message poktroll.migration.EventMorseApplicationClaimed is not mutable")) - case "poktroll.migration.EventMorseApplicationClaimed.serviceId": - panic(fmt.Errorf("field serviceId of message poktroll.migration.EventMorseApplicationClaimed is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseApplicationClaimed")) - } - panic(fmt.Errorf("message poktroll.migration.EventMorseApplicationClaimed 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_EventMorseApplicationClaimed) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.migration.EventMorseApplicationClaimed.claimed_at_height": - return protoreflect.ValueOfInt64(int64(0)) - case "poktroll.migration.EventMorseApplicationClaimed.claimed_balance": - m := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "poktroll.migration.EventMorseApplicationClaimed.shannon_dest_address": - return protoreflect.ValueOfString("") - case "poktroll.migration.EventMorseApplicationClaimed.morse_src_address": - return protoreflect.ValueOfString("") - case "poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake": - m := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "poktroll.migration.EventMorseApplicationClaimed.serviceId": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.EventMorseApplicationClaimed")) - } - panic(fmt.Errorf("message poktroll.migration.EventMorseApplicationClaimed 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_EventMorseApplicationClaimed) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.EventMorseApplicationClaimed", 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_EventMorseApplicationClaimed) 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_EventMorseApplicationClaimed) 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_EventMorseApplicationClaimed) 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_EventMorseApplicationClaimed) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*EventMorseApplicationClaimed) - 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.ClaimedAtHeight != 0 { - n += 1 + runtime.Sov(uint64(x.ClaimedAtHeight)) - } - if x.ClaimedBalance != nil { - l = options.Size(x.ClaimedBalance) - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.ShannonDestAddress) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.MorseSrcAddress) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.ClaimedApplicationStake != nil { - l = options.Size(x.ClaimedApplicationStake) - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.ServiceId) - 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().(*EventMorseApplicationClaimed) - 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.ServiceId) > 0 { - i -= len(x.ServiceId) - copy(dAtA[i:], x.ServiceId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceId))) - i-- - dAtA[i] = 0x32 - } - if x.ClaimedApplicationStake != nil { - encoded, err := options.Marshal(x.ClaimedApplicationStake) - 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] = 0x2a - } - if len(x.MorseSrcAddress) > 0 { - i -= len(x.MorseSrcAddress) - copy(dAtA[i:], x.MorseSrcAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MorseSrcAddress))) - i-- - dAtA[i] = 0x22 - } - if len(x.ShannonDestAddress) > 0 { - i -= len(x.ShannonDestAddress) - copy(dAtA[i:], x.ShannonDestAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ShannonDestAddress))) - i-- - dAtA[i] = 0x1a - } - if x.ClaimedBalance != nil { - encoded, err := options.Marshal(x.ClaimedBalance) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if x.ClaimedAtHeight != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimedAtHeight)) - i-- - dAtA[i] = 0x8 - } - 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().(*EventMorseApplicationClaimed) - 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: EventMorseApplicationClaimed: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventMorseApplicationClaimed: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) - } - x.ClaimedAtHeight = 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.ClaimedAtHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedBalance", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.ClaimedBalance == nil { - x.ClaimedBalance = &v1beta1.Coin{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedBalance); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ShannonDestAddress", 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.ShannonDestAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MorseSrcAddress", 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.MorseSrcAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedApplicationStake", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.ClaimedApplicationStake == nil { - x.ClaimedApplicationStake = &v1beta1.Coin{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedApplicationStake); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceId", 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.ServiceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -2032,88 +1278,6 @@ func (x *EventMorseAccountClaimed) GetMorseSrcAddress() string { return "" } -// EventMorseApplicationClaimed is emitted when a MorseAccount is claimed on-chain as a staked application. -type EventMorseApplicationClaimed struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The height (on Shannon) at which the claim was executed (i.e. claimed). - ClaimedAtHeight int64 `protobuf:"varint,1,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` - // The balance which was claimed. - ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance,omitempty"` - // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. - ShannonDestAddress string `protobuf:"bytes,3,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address,omitempty"` - // The hex-encoded address of the Morse account whose balance will be claimed. - MorseSrcAddress string `protobuf:"bytes,4,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` - // TODO_IN_THIS_COMMIT: comments... - ClaimedApplicationStake *v1beta1.Coin `protobuf:"bytes,5,opt,name=claimedApplicationStake,proto3" json:"claimedApplicationStake,omitempty"` - // TODO_IN_THIS_COMMIT: comments... - ServiceId string `protobuf:"bytes,6,opt,name=serviceId,proto3" json:"serviceId,omitempty"` -} - -func (x *EventMorseApplicationClaimed) Reset() { - *x = EventMorseApplicationClaimed{} - if protoimpl.UnsafeEnabled { - mi := &file_poktroll_migration_event_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EventMorseApplicationClaimed) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EventMorseApplicationClaimed) ProtoMessage() {} - -// Deprecated: Use EventMorseApplicationClaimed.ProtoReflect.Descriptor instead. -func (*EventMorseApplicationClaimed) Descriptor() ([]byte, []int) { - return file_poktroll_migration_event_proto_rawDescGZIP(), []int{2} -} - -func (x *EventMorseApplicationClaimed) GetClaimedAtHeight() int64 { - if x != nil { - return x.ClaimedAtHeight - } - return 0 -} - -func (x *EventMorseApplicationClaimed) GetClaimedBalance() *v1beta1.Coin { - if x != nil { - return x.ClaimedBalance - } - return nil -} - -func (x *EventMorseApplicationClaimed) GetShannonDestAddress() string { - if x != nil { - return x.ShannonDestAddress - } - return "" -} - -func (x *EventMorseApplicationClaimed) GetMorseSrcAddress() string { - if x != nil { - return x.MorseSrcAddress - } - return "" -} - -func (x *EventMorseApplicationClaimed) GetClaimedApplicationStake() *v1beta1.Coin { - if x != nil { - return x.ClaimedApplicationStake - } - return nil -} - -func (x *EventMorseApplicationClaimed) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - var File_poktroll_migration_event_proto protoreflect.FileDescriptor var file_poktroll_migration_event_proto_rawDesc = []byte{ @@ -2167,49 +1331,19 @@ var file_poktroll_migration_event_proto_rawDesc = []byte{ 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xde, 0x03, 0x0a, 0x1c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, - 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, - 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x12, 0x41, 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, - 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, - 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x5b, 0x0a, 0x0f, 0x63, 0x6c, 0x61, - 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x17, 0xc8, - 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, - 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xea, 0xde, 0x1f, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, - 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, - 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6d, 0x6f, - 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, - 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, - 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x59, 0x0a, - 0x17, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, - 0x17, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x42, 0xb6, 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, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 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, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0xb6, 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, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 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 ( @@ -2224,22 +1358,19 @@ func file_poktroll_migration_event_proto_rawDescGZIP() []byte { return file_poktroll_migration_event_proto_rawDescData } -var file_poktroll_migration_event_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_poktroll_migration_event_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_poktroll_migration_event_proto_goTypes = []interface{}{ (*EventImportMorseClaimableAccounts)(nil), // 0: poktroll.migration.EventImportMorseClaimableAccounts (*EventMorseAccountClaimed)(nil), // 1: poktroll.migration.EventMorseAccountClaimed - (*EventMorseApplicationClaimed)(nil), // 2: poktroll.migration.EventMorseApplicationClaimed - (*v1beta1.Coin)(nil), // 3: cosmos.base.v1beta1.Coin + (*v1beta1.Coin)(nil), // 2: cosmos.base.v1beta1.Coin } var file_poktroll_migration_event_proto_depIdxs = []int32{ - 3, // 0: poktroll.migration.EventMorseAccountClaimed.claimed_balance:type_name -> cosmos.base.v1beta1.Coin - 3, // 1: poktroll.migration.EventMorseApplicationClaimed.claimed_balance:type_name -> cosmos.base.v1beta1.Coin - 3, // 2: poktroll.migration.EventMorseApplicationClaimed.claimedApplicationStake:type_name -> cosmos.base.v1beta1.Coin - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 2, // 0: poktroll.migration.EventMorseAccountClaimed.claimed_balance:type_name -> cosmos.base.v1beta1.Coin + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] 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 } func init() { file_poktroll_migration_event_proto_init() } @@ -2273,18 +1404,6 @@ func file_poktroll_migration_event_proto_init() { return nil } } - file_poktroll_migration_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EventMorseApplicationClaimed); 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{ @@ -2292,7 +1411,7 @@ func file_poktroll_migration_event_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_migration_event_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, From b0744b6629f3fcb5ec6acd142f5b81c21ec1f4e6 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 24 Feb 2025 17:06:32 +0100 Subject: [PATCH 52/81] chore: review feedback improvements Co-authored-by: red-0ne --- proto/poktroll/migration/tx.proto | 4 ++++ testutil/integration/suites/base.go | 4 ++-- x/migration/module/autocli.go | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 914e4de77..694df7778 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -114,6 +114,10 @@ message MsgClaimMorseAccountResponse { int64 claimed_at_height = 3; } +// TODO_UPNEXT(@bryanchriswhite, #1034): +// - Refactor to consistent naming convention +// - Add comments describing the purpose of each message/field + message MsgClaimMorseApplication { option (cosmos.msg.v1.signer) = "shannonDestAddress"; string shannonDestAddress = 1; diff --git a/testutil/integration/suites/base.go b/testutil/integration/suites/base.go index 1a2adb5f6..14e68c09a 100644 --- a/testutil/integration/suites/base.go +++ b/testutil/integration/suites/base.go @@ -104,10 +104,10 @@ func (s *BaseIntegrationSuite) GetBankQueryClient(t *testing.T) client.BankQuery t.Helper() deps := depinject.Supply(s.GetApp().QueryHelper()) - bankqueryClient, err := query.NewBankQuerier(deps) + bankQueryClient, err := query.NewBankQuerier(deps) require.NoError(t, err) - return bankqueryClient + return bankQueryClient } // FilterEvents returns the events from the event manager which match the given diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index b6ce762e1..dd01dda47 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -65,6 +65,8 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Use: "claim-morse-application [morse-src-address] [morse-signature] [stake] [service-config]", Short: "Send a claim_morse_application tx", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morseSrcAddress"}, {ProtoField: "morseSignature"}, {ProtoField: "stake"}, {ProtoField: "serviceConfig"}}, + Skip: true, // skipped because autoCLI cannot handle signing + // TODO_UPNEXT(@bryanchriswhite, #1034): Add morse application claiming CLI, incl. examples (see x/supplier/module/autocli.go). }, // this line is used by ignite scaffolding # autocli/tx }, From c847898ebc163343c1c1222d4828ffbb6c18d9f7 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 25 Feb 2025 11:36:24 +0100 Subject: [PATCH 53/81] test: stub out E2E migration.feature --- e2e/tests/init_test.go | 5 +- e2e/tests/migration_error.feature | 4 + e2e/tests/migration_steps_test.go | 133 ++++++++++++++++++++++++++++ e2e/tests/migration_success.feature | 102 +++++++++++++++++++++ makefiles/tests.mk | 4 + 5 files changed, 247 insertions(+), 1 deletion(-) create mode 100644 e2e/tests/migration_error.feature create mode 100644 e2e/tests/migration_steps_test.go create mode 100644 e2e/tests/migration_success.feature diff --git a/e2e/tests/init_test.go b/e2e/tests/init_test.go index 0e8976cdd..ee6147759 100644 --- a/e2e/tests/init_test.go +++ b/e2e/tests/init_test.go @@ -157,7 +157,10 @@ func (s *suite) Before() { // TestFeatures runs the e2e tests specified in any .features files in this directory // * This test suite assumes that a LocalNet is running func TestFeatures(t *testing.T) { - gocuke.NewRunner(t, &suite{}).Path(flagFeaturesPath).Run() + gocuke.NewRunner(t, &suite{}).Path(flagFeaturesPath). + // Ignore test elements (e.g. Features, Scenarios, etc.) + // with the @manual tag (e.g. migration.feature). + Tags("not @manual").Run() } // TODO_TECHDEBT: rename `pocketd` to `poktrolld`. diff --git a/e2e/tests/migration_error.feature b/e2e/tests/migration_error.feature new file mode 100644 index 000000000..aa287c015 --- /dev/null +++ b/e2e/tests/migration_error.feature @@ -0,0 +1,4 @@ +@manual +Feature: Morse Migration Errors + + # TODO_UPNEXT(@bryanchriswhite, #1034): Enumerate and implement error scenarios. \ No newline at end of file diff --git a/e2e/tests/migration_steps_test.go b/e2e/tests/migration_steps_test.go new file mode 100644 index 000000000..a6e520dcf --- /dev/null +++ b/e2e/tests/migration_steps_test.go @@ -0,0 +1,133 @@ +//go:build e2e && manual + +package e2e + +import ( + "testing" + + "github.com/regen-network/gocuke" +) + +type migrationSuite struct { + gocuke.TestingT +} + +type actorTypeEnum = string + +const ( + actorTypeApp actorTypeEnum = "app" + actorTypeSupplier actorTypeEnum = "supplier" + actorTypeGateway actorTypeEnum = "gateway" +) + +// TestMigrationFeatures runs the migration.feature file ONLY. +// NOTE: This test has the e2e and manual build constraints because it is an E2E +// test which depends on a large Morse node snapshot being available locally. +// See: https://pocket-snapshot.liquify.com/#/pruned/ +// +// To run this test use: make test_e2e_migration +// OR +// go test -v ./e2e/tests/migration_steps_test.go -tags=e2e,manual +func TestMigrationFeatures(t *testing.T) { + gocuke.NewRunner(t, &migrationSuite{}).Path("migration_*.feature").Run() +} + +func (s *migrationSuite) ALocalMorseNodePersistedStateExists() { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) NoMorseclaimableaccountsExist() { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheShannonDestinationAccountIsStakedAsAn(actorType actorTypeEnum) { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheShannonStakeEqualsTheOfTheMorseclaimableaccount(actorType actorTypeEnum, totalTokensStakePct float64) { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheShannonStakeIncreasedByTheOfTheMorseclaimableaccount(actorType actorTypeEnum, totalTokensStakePct float64) { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheMorsePrivateKeyIsUsedToClaimAMorseclaimableaccountAsAnWithoutSpecifyingTheStakeAmount(actorType actorTypeEnum) { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheMorsePrivateKeyIsUsedToClaimAMorseclaimableaccountAsAnWithAStakeEqualTo(a string, b string) { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheAuthorityExecutesWithWrittenTo(commandStr, stdioStream, outputFile string) { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) AMorsestateexportIsWrittenTo(morseStateExportFile string) { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) AnUnclaimedMorseclaimableaccountWithAKnownPrivateKeyExists() { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) AShannonDestinationKeyExistsInTheLocalKeyring() { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheShannonDestinationAccountBalanceIsIncreasedByTheSumOfAllMorseclaimableaccountTokens() { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheShannonDestinationAccountBalanceIsIncreasedByTheSumOfAndOfTheMorseclaimableaccount(balanceSummandField1, balanceSummandField2 string) { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheShannonServiceConfigIsUpdatedIfApplicable(actorType actorTypeEnum) { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheAuthorityExecutes(commandStr string) { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) AMorseaccountstateIsWrittenTo(morseAccountStateFile string) { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheMorseaccountstateInIsValid(morseAccountStateFile string) { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheShannonDestinationAccountUpoktBalanceIsNonzero() { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) ThePrivateKeyIsUsedToClaimAMorseclaimableaccountAsANonactorAccount() { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) ThePrivateKeyIsUsedToClaimAMorseclaimableaccountAsAnWithAStakeEqualTo(actorType actorTypeEnum, totalTokensStakePct float64) { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheShannonDestinationAccountBalanceIsIncreasedByTheRemainingTokensOfTheMorseclaimableaccount() { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheMorseclaimableaccountsArePersistedOnchain() { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheShannonDestinationAccountDoesNotExistOnchain() { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheMorsePrivateKeyIsUsedToClaimAMorseclaimableaccountAsANonactorAccount() { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} + +func (s *migrationSuite) TheShannonDestinationAccountExistsOnchain() { + s.Skip("TODO_UPNEXT(@bryanchriswhite, #1034): Implement.") +} diff --git a/e2e/tests/migration_success.feature b/e2e/tests/migration_success.feature new file mode 100644 index 000000000..7905f6504 --- /dev/null +++ b/e2e/tests/migration_success.feature @@ -0,0 +1,102 @@ +@manual +Feature: Morse Migration Success + + Scenario: Authority generates and imports MorseAccountState + # TODO_UPNEXT(@bryanchriswhite, #1034): Print a link to the latest liquify snapshot if no local state exists. + Given a local Morse node persisted state exists + When the authority executes "pocket util export-genesis-for-reset" with "stdout" written to "morse_state_export.json" + Then a MorseStateExport is written to "morse_state_export.json" + + When the authority executes "poktrolld migrate collect-morse-accounts morse_state_export.json morse_account_state.json" + Then a MorseAccountState is written to "morse_account_state.json" + + Given no MorseClaimableAccounts exist + And the MorseAccountState in "morse_account_state.json" is valid + When the authority executes "make import-morse-claimable-accounts morse_account_state.json" + Then the MorseClaimableAccounts are persisted onchain + + Rule: Non-actor account claims MAY reference existing Shannon accounts + Background: + # TODO_INCOMPLETE: A "real" Morse snapshot IS NOT sufficient for exercising + # claming because it will not include any accounts with known or derivable + # private keys. + Given an unclaimed MorseClaimableAccount with a known private key exists + And a Shannon destination key exists in the local keyring + + Scenario: Morse account-holder claims as an new non-actor account + And the Shannon destination account does not exist onchain + When the Morse private key is used to claim a MorseClaimableAccount as a non-actor account + Then the Shannon destination account balance is increased by the sum of all MorseClaimableAccount tokens + + Scenario: Morse account-holder claims as an existing non-actor account + And the Shannon destination account exists onchain + And the Shannon destination account upokt balance is non-zero + When the Morse private key is used to claim a MorseClaimableAccount as a non-actor account + Then the Shannon destination account balance is increased by the sum of all MorseClaimableAccount tokens + + Rule: Actor re-stake claims use the Morse stake amount by default + Background: + # TODO_INCOMPLETE: A "real" Morse snapshot IS NOT sufficient for exercising + # claming because it will not include any accounts with known or derivable + # private keys. + Given an unclaimed MorseClaimableAccount with a known private key exists + And a Shannon destination key exists in the local keyring + + Scenario Outline: + And the Shannon destination account is staked as an "" + When the Morse private key is used to claim a MorseClaimableAccount as an "" without specifying the stake amount + Then the Shannon destination account balance is increased by the sum of "" and "" of the MorseClaimableAccount + Then the Shannon destination account is staked as an "" + And the Shannon "" stake increased by the "" of the MorseClaimableAccount + And the Shannon "" service config is updated, if applicable + + Examples: + | actor | balance_summand_1 | balance_summand_2 | stake_amount_field | + | application | unstaked_balance | supplier_stake | application_stake | + | supplier | unstaked_balance | service_rev_share | supplier_stake | + # TODO_TEST: No default gateway stake amount - should fail. + # | gateway | unstaked_balance | NA | NA + + Rule: Actor re-stake claims MAY use custom stake amounts + Background: + # TODO_INCOMPLETE: A "real" Morse snapshot IS NOT sufficient for exercising + # claming because it will not include any accounts with known or derivable + # private keys. + Given an unclaimed MorseClaimableAccount with a known private key exists + And a Shannon destination key exists in the local keyring + + Scenario Outline: + And the Shannon destination account is staked as an "" + When the Morse private key is used to claim a MorseClaimableAccount as an "" with a stake equal to ""% of the total tokens of the MorseClaimableAccount + Then the Shannon destination account balance is increased by the remaining tokens of the MorseClaimableAccount + Then the Shannon destination account is staked as an "" + And the Shannon "" stake equals the "" of the MorseClaimableAccount + + Examples: + | actor | total_tokens_stake_pct | + | application | 0.75 | + | supplier | 0.75 | + | gateway | 0.75 | + + Rule: Actor re-stake claims MAY reference existing Shannon actors + Background: + # TODO_INCOMPLETE: A "real" Morse snapshot IS NOT sufficient for exercising + # claming because it will not include any accounts with known or derivable + # private keys. + Given an unclaimed MorseClaimableAccount with a known private key exists + And a Shannon destination key exists in the local keyring + + Scenario Outline: + And the Shannon destination account is staked as an "" + When the Morse private key is used to claim a MorseClaimableAccount as an "" without specifying the stake amount + Then the Shannon destination account balance is increased by the sum of "" and "" of the MorseClaimableAccount + Then the Shannon destination account is staked as an "" + And the Shannon "" stake increased by the "" of the MorseClaimableAccount + And the Shannon "" service config is updated, if applicable + + Examples: + | actor | balance_summand_1 | balance_summand_2 | stake_amount_field | + | application | unstaked_balance | supplier_stake | application_stake | + | supplier | unstaked_balance | service_rev_share | supplier_stake | + # TODO_TEST: Existing gateway scenario; doesn't fit in this scenario outline. + # | gateway | unstaked_balance | NA | NA diff --git a/makefiles/tests.mk b/makefiles/tests.mk index b1962c845..9b664869b 100644 --- a/makefiles/tests.mk +++ b/makefiles/tests.mk @@ -44,6 +44,10 @@ test_e2e_tokenomics: test_e2e_env ## Run only the E2E suite that exercises the s test_e2e_params: test_e2e_env ## Run only the E2E suite that exercises parameter updates for all modules go test -v ./e2e/tests/... -tags=e2e,test --features-path=update_params.feature +.PHONY: test_e2e_migration +test_e2e_migration: test_e2e_env ## Run only the E2E suite that exercises the migration module + go test -v ./e2e/tests/migration_steps_test.go -tags=e2e,manual + .PHONY: test_load_relays_stress_custom test_load_relays_stress_custom: ## Run the stress test for E2E relays using custom manifest. "loadtest_manifest_example.yaml" manifest is used by default. Set `LOAD_TEST_CUSTOM_MANIFEST` environment variable to use the different manifest. go test -v -count=1 ./load-testing/tests/... \ From 8e2ca9bf3424baa207c50bf384325e318ea27b05 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 25 Feb 2025 11:56:27 +0100 Subject: [PATCH 54/81] chore: review feedback improvements Co-authored-by: Daniel Olshansky --- api/poktroll/migration/event.pulsar.go | 2 +- go.mod | 2 +- proto/poktroll/migration/event.proto | 2 +- x/migration/types/event.pb.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index ebb2a4f76..a6a04d37a 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -555,7 +555,7 @@ type EventImportMorseClaimableAccounts struct { // The height (on Shannon) at which the MorseAccountState was created on-chain. CreatedAtHeight int64 `protobuf:"varint,1,opt,name=created_at_height,json=createdAtHeight,proto3" json:"created_at_height,omitempty"` - // The on-chain computed sha256 hash of the entire MorseAccountState containing the MorseClaimableAccounts which were imported. + // The onchain computed sha256 hash of the entire MorseAccountState containing the MorseClaimableAccounts which were imported. MorseAccountStateHash []byte `protobuf:"bytes,2,opt,name=morse_account_state_hash,json=morseAccountStateHash,proto3" json:"morse_account_state_hash,omitempty"` // Number of claimable accounts (EOAs) collected from Morse state export // NOTE: Account balances include consolidated application and supplier actor stakes diff --git a/go.mod b/go.mod index e1d71296e..be56ae670 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/cosmos/ibc-go/v8 v8.2.0 github.com/go-kit/kit v0.13.0 github.com/gogo/status v1.1.0 - github.com/golang/mock v1.6.0 + github.com/golang/mock v1.6.0 // indirect github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.1 github.com/gorilla/websocket v1.5.3 diff --git a/proto/poktroll/migration/event.proto b/proto/poktroll/migration/event.proto index 57bf39e5f..d429bd3e5 100644 --- a/proto/poktroll/migration/event.proto +++ b/proto/poktroll/migration/event.proto @@ -16,7 +16,7 @@ message EventImportMorseClaimableAccounts { // The height (on Shannon) at which the MorseAccountState was created on-chain. int64 created_at_height = 1 [(gogoproto.jsontag) = "created_at_height"]; - // The on-chain computed sha256 hash of the entire MorseAccountState containing the MorseClaimableAccounts which were imported. + // The onchain computed sha256 hash of the entire MorseAccountState containing the MorseClaimableAccounts which were imported. bytes morse_account_state_hash = 2 [(gogoproto.jsontag) = "morse_account_state_hash"]; // Number of claimable accounts (EOAs) collected from Morse state export diff --git a/x/migration/types/event.pb.go b/x/migration/types/event.pb.go index 9163b58b0..18982958d 100644 --- a/x/migration/types/event.pb.go +++ b/x/migration/types/event.pb.go @@ -30,7 +30,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type EventImportMorseClaimableAccounts struct { // The height (on Shannon) at which the MorseAccountState was created on-chain. CreatedAtHeight int64 `protobuf:"varint,1,opt,name=created_at_height,json=createdAtHeight,proto3" json:"created_at_height"` - // The on-chain computed sha256 hash of the entire MorseAccountState containing the MorseClaimableAccounts which were imported. + // The onchain computed sha256 hash of the entire MorseAccountState containing the MorseClaimableAccounts which were imported. MorseAccountStateHash []byte `protobuf:"bytes,2,opt,name=morse_account_state_hash,json=morseAccountStateHash,proto3" json:"morse_account_state_hash"` // Number of claimable accounts (EOAs) collected from Morse state export // NOTE: Account balances include consolidated application and supplier actor stakes From 11fcb0317e11d8efe01923e73a2cf90b251fefe4 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 25 Feb 2025 12:11:27 +0100 Subject: [PATCH 55/81] chore: self-review improvements --- .../morse_account_import_and_claim_test.go | 23 +++++++++++++++---- testutil/integration/suites/migration.go | 21 ++++++++++++++++- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/tests/integration/migration/morse_account_import_and_claim_test.go b/tests/integration/migration/morse_account_import_and_claim_test.go index a62a90292..dd418019c 100644 --- a/tests/integration/migration/morse_account_import_and_claim_test.go +++ b/tests/integration/migration/morse_account_import_and_claim_test.go @@ -38,12 +38,12 @@ func TestMigrationModuleSuite(t *testing.T) { suite.Run(t, &MigrationModuleTestSuite{}) } -// TestImportMorseClaimableAccounts tests claiming of morse claimable accounts. -// It only claims account balances and does not test staking any actors as a result of claiming. +// TestImportMorseClaimableAccounts exercises importing and persistence of morse claimable accounts. func (s *MigrationModuleTestSuite) TestImportMorseClaimableAccounts() { s.GenerateMorseAccountState(s.T(), s.numMorseClaimableAccounts) msgImportRes := s.ImportMorseClaimableAccounts(s.T()) - morseAccountStateHash, err := s.GetAccountState(s.T()).GetHash() + morseAccountState := s.GetAccountState(s.T()) + morseAccountStateHash, err := morseAccountState.GetHash() require.NoError(s.T(), err) expectedMsgImportRes := &migrationtypes.MsgImportMorseClaimableAccountsResponse{ @@ -51,9 +51,24 @@ func (s *MigrationModuleTestSuite) TestImportMorseClaimableAccounts() { NumAccounts: uint64(s.numMorseClaimableAccounts), } require.Equal(s.T(), expectedMsgImportRes, msgImportRes) + + foundMorseClaimableAccounts := s.QueryAllMorseClaimableAccounts(s.T()) + require.Equal(s.T(), s.numMorseClaimableAccounts, len(foundMorseClaimableAccounts)) + + for _, expectedMorseClaimableAccount := range morseAccountState.Accounts { + isFound := false + for _, foundMorseClaimableAccount := range foundMorseClaimableAccounts { + if foundMorseClaimableAccount.GetMorseSrcAddress() == expectedMorseClaimableAccount.GetMorseSrcAddress() { + require.Equal(s.T(), *expectedMorseClaimableAccount, foundMorseClaimableAccount) + isFound = true + break + } + } + require.True(s.T(), isFound) + } } -// TestClaimMorseAccount tests claiming of a MorseClaimableAccounts. +// TestClaimMorseAccount exercises claiming of MorseClaimableAccounts. // It only exercises claiming of account balances and does not exercise // the staking any actors as a result of claiming. func (s *MigrationModuleTestSuite) TestClaimMorseAccount() { diff --git a/testutil/integration/suites/migration.go b/testutil/integration/suites/migration.go index 5b8bff766..95a3b117e 100644 --- a/testutil/integration/suites/migration.go +++ b/testutil/integration/suites/migration.go @@ -89,6 +89,11 @@ func (s *MigrationModuleSuite) ClaimMorseAccount( return expectedMorseSrcAddr, claimAccountRes } +// MorseClaimableAccountQuerier returns a migration module query client for morse claimable accounts. +func (s *MigrationModuleSuite) MorseClaimableAccountQuerier() migrationtypes.QueryClient { + return migrationtypes.NewQueryClient(s.GetApp().QueryHelper()) +} + // QueryMorseClaimableAccount queries the migration module for the given morseSrcAddr. func (s *MigrationModuleSuite) QueryMorseClaimableAccount( t *testing.T, @@ -96,7 +101,7 @@ func (s *MigrationModuleSuite) QueryMorseClaimableAccount( ) *migrationtypes.MorseClaimableAccount { t.Helper() - morseAccountQuerier := migrationtypes.NewQueryClient(s.GetApp().QueryHelper()) + morseAccountQuerier := s.MorseClaimableAccountQuerier() morseClaimableAcctRes, err := morseAccountQuerier.MorseClaimableAccount( s.SdkCtx(), &migrationtypes.QueryGetMorseClaimableAccountRequest{ @@ -107,3 +112,17 @@ func (s *MigrationModuleSuite) QueryMorseClaimableAccount( return &morseClaimableAcctRes.MorseClaimableAccount } + +// QueryAllMorseClaimableAccounts queries the migration module for all morse claimable accounts. +func (s *MigrationModuleSuite) QueryAllMorseClaimableAccounts(t *testing.T) []migrationtypes.MorseClaimableAccount { + t.Helper() + + morseAccountQuerier := s.MorseClaimableAccountQuerier() + morseClaimableAcctRes, err := morseAccountQuerier.MorseClaimableAccountAll( + s.SdkCtx(), + &migrationtypes.QueryAllMorseClaimableAccountRequest{}, + ) + require.NoError(t, err) + + return morseClaimableAcctRes.MorseClaimableAccount +} From 1d5a4966b441820378519a62f7f042b1b6f869b9 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 25 Feb 2025 12:32:19 +0100 Subject: [PATCH 56/81] chore: review feedback improvements Co-authored-by: red-0ne --- x/migration/keeper/morse_claimable_account.go | 2 +- .../types/message_claim_morse_account.go | 8 ++++++-- .../types/message_claim_morse_account_test.go | 18 +++++++++++++++--- x/migration/types/types.go | 7 +++++-- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/x/migration/keeper/morse_claimable_account.go b/x/migration/keeper/morse_claimable_account.go index 44dc0f12d..e40a83f5f 100644 --- a/x/migration/keeper/morse_claimable_account.go +++ b/x/migration/keeper/morse_claimable_account.go @@ -90,7 +90,7 @@ func (k Keeper) MintClaimedMorseTokens( destAddress cosmostypes.AccAddress, coinToMint cosmostypes.Coin, ) error { - // Mint the sum of the account balance (coinToMint) and any actor stakes to the migration module account. + // Mint coinToMint to the migration module account. if err := k.bankKeeper.MintCoins( ctx, migrationtypes.ModuleName, diff --git a/x/migration/types/message_claim_morse_account.go b/x/migration/types/message_claim_morse_account.go index 88039fe73..49dc9183b 100644 --- a/x/migration/types/message_claim_morse_account.go +++ b/x/migration/types/message_claim_morse_account.go @@ -38,11 +38,15 @@ func NewMsgClaimMorseAccount( func (msg *MsgClaimMorseAccount) ValidateBasic() error { if len(msg.MorseSrcAddress) != MorseAddressHexLengthBytes { - return ErrMorseAccountClaim.Wrapf("invalid morseSrcAddress length (%d)", len(msg.MorseSrcAddress)) + return ErrMorseAccountClaim.Wrapf("invalid morseSrcAddress length (%d): %s", len(msg.MorseSrcAddress), msg.MorseSrcAddress) + } + + if len(msg.MorseSignature) != MorseSignatureHexLengthBytes { + return ErrMorseAccountClaim.Wrapf("invalid morseSignature length (%d): %s", len(msg.MorseSignature), msg.MorseSignature) } if _, err := sdk.AccAddressFromBech32(msg.ShannonDestAddress); err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid shannonDestAddress address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid shannonDestAddress address (%s): %s", msg.ShannonDestAddress, err) } return nil } diff --git a/x/migration/types/message_claim_morse_account_test.go b/x/migration/types/message_claim_morse_account_test.go index fe3dd2f52..9313c1b23 100644 --- a/x/migration/types/message_claim_morse_account_test.go +++ b/x/migration/types/message_claim_morse_account_test.go @@ -12,7 +12,11 @@ import ( migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) +const mockMorseSignature = "6c0d3b25a3e53eb6739f00ac66fc70168dfbb6dfe306a50f48a5f9d732b23068be3840a7127e1d849b4b2c54f5d34c2db36c2d6da46263cc72270f8f5dfdec5f" + func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { + require.Len(t, mockMorseSignature, migrationtypes.MorseSignatureHexLengthBytes) + tests := []struct { desc string msg migrationtypes.MsgClaimMorseAccount @@ -23,7 +27,7 @@ func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { msg: migrationtypes.MsgClaimMorseAccount{ ShannonDestAddress: "invalid_address", MorseSrcAddress: sample.MorseAddressHex(), - MorseSignature: "mock_signature", + MorseSignature: mockMorseSignature, }, err: sdkerrors.ErrInvalidAddress, }, { @@ -31,7 +35,15 @@ func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { msg: migrationtypes.MsgClaimMorseAccount{ ShannonDestAddress: sample.AccAddress(), MorseSrcAddress: "invalid_address", - MorseSignature: "mock_signature", + MorseSignature: mockMorseSignature, + }, + err: migrationtypes.ErrMorseAccountClaim, + }, { + desc: "invalid empty MorseSignature", + msg: migrationtypes.MsgClaimMorseAccount{ + ShannonDestAddress: sample.AccAddress(), + MorseSrcAddress: "invalid_address", + MorseSignature: "", }, err: migrationtypes.ErrMorseAccountClaim, }, { @@ -39,7 +51,7 @@ func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { msg: migrationtypes.MsgClaimMorseAccount{ ShannonDestAddress: sample.AccAddress(), MorseSrcAddress: sample.MorseAddressHex(), - MorseSignature: "mock_signature", + MorseSignature: mockMorseSignature, }, }, } diff --git a/x/migration/types/types.go b/x/migration/types/types.go index 00efae8db..492b41162 100644 --- a/x/migration/types/types.go +++ b/x/migration/types/types.go @@ -1,6 +1,9 @@ package types const ( - MorseAddressLengthBytes = 20 - MorseAddressHexLengthBytes = MorseAddressLengthBytes * 2 + MorseAddressLengthBytes = 20 + MorseSignatureLengthBytes = 64 + + MorseAddressHexLengthBytes = MorseAddressLengthBytes * 2 + MorseSignatureHexLengthBytes = MorseSignatureLengthBytes * 2 ) From bb8f36742cd519d426f73d6ff5f34386a1ff6a7c Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 25 Feb 2025 15:59:10 +0100 Subject: [PATCH 57/81] fix: test --- x/migration/keeper/msg_server_claim_morse_acount_test.go | 2 +- x/migration/types/message_claim_morse_account.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go index 07b0d511b..ce0c5c80e 100644 --- a/x/migration/keeper/msg_server_claim_morse_acount_test.go +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -129,7 +129,7 @@ func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { expectedErr := status.Error( codes.InvalidArgument, migrationtypes.ErrMorseAccountClaim.Wrapf( - "morseSignature is invalid", + "invalid morseSignature length (0): %q", "", ).Error(), ) diff --git a/x/migration/types/message_claim_morse_account.go b/x/migration/types/message_claim_morse_account.go index 49dc9183b..7887ba466 100644 --- a/x/migration/types/message_claim_morse_account.go +++ b/x/migration/types/message_claim_morse_account.go @@ -38,11 +38,11 @@ func NewMsgClaimMorseAccount( func (msg *MsgClaimMorseAccount) ValidateBasic() error { if len(msg.MorseSrcAddress) != MorseAddressHexLengthBytes { - return ErrMorseAccountClaim.Wrapf("invalid morseSrcAddress length (%d): %s", len(msg.MorseSrcAddress), msg.MorseSrcAddress) + return ErrMorseAccountClaim.Wrapf("invalid morseSrcAddress length (%d): %q", len(msg.MorseSrcAddress), msg.MorseSrcAddress) } if len(msg.MorseSignature) != MorseSignatureHexLengthBytes { - return ErrMorseAccountClaim.Wrapf("invalid morseSignature length (%d): %s", len(msg.MorseSignature), msg.MorseSignature) + return ErrMorseAccountClaim.Wrapf("invalid morseSignature length (%d): %q", len(msg.MorseSignature), msg.MorseSignature) } if _, err := sdk.AccAddressFromBech32(msg.ShannonDestAddress); err != nil { From 0d6c6c7138fa40618f10c37229982c6e4b3c477b Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 26 Feb 2025 08:31:13 +0100 Subject: [PATCH 58/81] chore: update comments --- e2e/tests/migration_success.feature | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/e2e/tests/migration_success.feature b/e2e/tests/migration_success.feature index 7905f6504..0fd84b4cc 100644 --- a/e2e/tests/migration_success.feature +++ b/e2e/tests/migration_success.feature @@ -17,9 +17,8 @@ Feature: Morse Migration Success Rule: Non-actor account claims MAY reference existing Shannon accounts Background: - # TODO_INCOMPLETE: A "real" Morse snapshot IS NOT sufficient for exercising - # claming because it will not include any accounts with known or derivable - # private keys. + # TODO_INCOMPLETE: Ensure the liquify Morse snapshot includes known Morse + # private keys such that valid claim signatures can be generated for testing. Given an unclaimed MorseClaimableAccount with a known private key exists And a Shannon destination key exists in the local keyring @@ -36,9 +35,8 @@ Feature: Morse Migration Success Rule: Actor re-stake claims use the Morse stake amount by default Background: - # TODO_INCOMPLETE: A "real" Morse snapshot IS NOT sufficient for exercising - # claming because it will not include any accounts with known or derivable - # private keys. + # TODO_INCOMPLETE: Ensure the liquify Morse snapshot includes known Morse + # private keys such that valid claim signatures can be generated for testing. Given an unclaimed MorseClaimableAccount with a known private key exists And a Shannon destination key exists in the local keyring @@ -59,9 +57,8 @@ Feature: Morse Migration Success Rule: Actor re-stake claims MAY use custom stake amounts Background: - # TODO_INCOMPLETE: A "real" Morse snapshot IS NOT sufficient for exercising - # claming because it will not include any accounts with known or derivable - # private keys. + # TODO_INCOMPLETE: Ensure the liquify Morse snapshot includes known Morse + # private keys such that valid claim signatures can be generated for testing. Given an unclaimed MorseClaimableAccount with a known private key exists And a Shannon destination key exists in the local keyring @@ -80,9 +77,8 @@ Feature: Morse Migration Success Rule: Actor re-stake claims MAY reference existing Shannon actors Background: - # TODO_INCOMPLETE: A "real" Morse snapshot IS NOT sufficient for exercising - # claming because it will not include any accounts with known or derivable - # private keys. + # TODO_INCOMPLETE: Ensure the liquify Morse snapshot includes known Morse + # private keys such that valid claim signatures can be generated for testing. Given an unclaimed MorseClaimableAccount with a known private key exists And a Shannon destination key exists in the local keyring From 320e6e4af40e067dd8b50ae7679167f134f938a6 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 26 Feb 2025 10:59:49 +0100 Subject: [PATCH 59/81] refactor: extract application staking logic to keeper methods --- .../keeper/msg_server_stake_application.go | 44 +++++++++++++++---- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/x/application/keeper/msg_server_stake_application.go b/x/application/keeper/msg_server_stake_application.go index f2d758610..c7ef9e765 100644 --- a/x/application/keeper/msg_server_stake_application.go +++ b/x/application/keeper/msg_server_stake_application.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + cosmoslog "cosmossdk.io/log" sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -21,16 +22,44 @@ func (k msgServer) StakeApplication(ctx context.Context, msg *types.MsgStakeAppl ) logger := k.Logger().With("method", "StakeApplication") + foundApp, err := k.Keeper.StakeApplication(ctx, logger, msg) + if err != nil { + // DEV_NOTE: StakeApplication SHOULD ALWAYS return a gRPC status error. + return nil, err + } + + isSuccessful = true + + return &types.MsgStakeApplicationResponse{ + Application: foundApp, + }, nil +} + +// StakeApplication stakes (or updates) the application according to the given msg by applying the following logic: +// - the msg is validated +// - if the application is not found, it is created (in memory) according to the valid msg +// - if the application is found and is not unbonding, it is updated (in memory) according to the msg +// - if the application is found and is unbonding, it is updated (in memory; and no longer unbonding) +// - additional stake validation (e.g. min stake, etc.) +// - the positive difference between the msg stake and any current stake is transferred +// from the staking application's account, to the application module's accounts. +// - the (new or updated) application is persisted. +// - an EventApplicationUnbondingCanceled event is emitted if the application was unbonding. +// - an EventApplicationStaked event is emitted. +func (k Keeper) StakeApplication( + ctx context.Context, + logger cosmoslog.Logger, + msg *types.MsgStakeApplication, +) (_ *types.Application, err error) { logger.Info(fmt.Sprintf("About to stake application with msg: %v", msg)) - if err := msg.ValidateBasic(); err != nil { + if err = msg.ValidateBasic(); err != nil { logger.Error(fmt.Sprintf("invalid MsgStakeApplication: %v", err)) return nil, status.Error(codes.InvalidArgument, err.Error()) } // Check if the application already exists or not var ( - err error coinsToEscrow sdk.Coin wasAppUnbonding bool ) @@ -103,6 +132,7 @@ func (k msgServer) StakeApplication(ctx context.Context, msg *types.MsgStakeAppl k.SetApplication(ctx, foundApp) logger.Info(fmt.Sprintf("Successfully updated application stake for app: %+v", foundApp)) + // Collect events for emission. events := make([]sdk.Msg, 0) // If application unbonding was canceled, emit the corresponding event. @@ -128,14 +158,10 @@ func (k msgServer) StakeApplication(ctx context.Context, msg *types.MsgStakeAppl return nil, status.Error(codes.Internal, err.Error()) } - isSuccessful = true - - return &types.MsgStakeApplicationResponse{ - Application: &foundApp, - }, nil + return &foundApp, nil } -func (k msgServer) createApplication( +func (k Keeper) createApplication( _ context.Context, msg *types.MsgStakeApplication, ) types.Application { @@ -148,7 +174,7 @@ func (k msgServer) createApplication( } } -func (k msgServer) updateApplication( +func (k Keeper) updateApplication( _ context.Context, app *types.Application, msg *types.MsgStakeApplication, From 88521b68ff62c19563ec5d371aaa9d14b5c6728f Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 26 Feb 2025 11:21:30 +0100 Subject: [PATCH 60/81] Empty commit From 6c4d8679a1e4200b7a852f51a405ad69a8dce42d Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 26 Feb 2025 12:43:04 +0100 Subject: [PATCH 61/81] chore: remove inaccurate comment --- api/poktroll/migration/tx.pulsar.go | 1 - proto/poktroll/migration/tx.proto | 1 - x/migration/types/tx.pb.go | 1 - 3 files changed, 3 deletions(-) diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index cb22af755..9e183789c 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -2068,7 +2068,6 @@ type MsgImportMorseClaimableAccountsResponse struct { // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. StateHash []byte `protobuf:"bytes,1,opt,name=state_hash,json=stateHash,proto3" json:"state_hash,omitempty"` // Number of claimable accounts (EOAs) collected from Morse state export. - // NOTE: Account balances include consolidated application and supplier actor stakes. NumAccounts uint64 `protobuf:"varint,2,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts,omitempty"` } diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 3130f22f4..91e9bd1a2 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -68,6 +68,5 @@ message MsgImportMorseClaimableAccountsResponse { // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. bytes state_hash = 1 [(gogoproto.jsontag) = "state_hash"]; // Number of claimable accounts (EOAs) collected from Morse state export. - // NOTE: Account balances include consolidated application and supplier actor stakes. 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 50d338e05..8029de6a7 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -191,7 +191,6 @@ type MsgImportMorseClaimableAccountsResponse struct { // On-chain computed sha256 hash of the morse_account_state provided in the corresponding MsgCreateMorseAccountState. StateHash []byte `protobuf:"bytes,1,opt,name=state_hash,json=stateHash,proto3" json:"state_hash"` // Number of claimable accounts (EOAs) collected from Morse state export. - // NOTE: Account balances include consolidated application and supplier actor stakes. NumAccounts uint64 `protobuf:"varint,2,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts"` } From d2a7faafc8779e3393bf24d05a5e9c6b55259653 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 26 Feb 2025 13:11:12 +0100 Subject: [PATCH 62/81] moveme: feat/morse_claim_account --- x/migration/types/message_claim_morse_account.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/x/migration/types/message_claim_morse_account.go b/x/migration/types/message_claim_morse_account.go index 7887ba466..e759a1247 100644 --- a/x/migration/types/message_claim_morse_account.go +++ b/x/migration/types/message_claim_morse_account.go @@ -21,18 +21,13 @@ func NewMsgClaimMorseAccount( ShannonDestAddress: shannonDestAddress, MorseSrcAddress: morseSrcAddress, } - msgBz, err := proto.Marshal(msg) - if err != nil { - return nil, err - } - morseSignature, err := morsePrivateKey.Sign(msgBz) - if err != nil { - return nil, err + if morsePrivateKey != nil { + if err := msg.SignMorseSignature(morsePrivateKey); err != nil { + return nil, err + } } - msg.MorseSignature = hex.EncodeToString(morseSignature) - return msg, nil } From 5d47f383be1c2d46420a4560a79c87448668cb60 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 26 Feb 2025 17:34:08 +0100 Subject: [PATCH 63/81] chore: review feedback improvements Co-authored-by: Daniel Olshansky --- e2e/tests/migration_steps_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/e2e/tests/migration_steps_test.go b/e2e/tests/migration_steps_test.go index a6e520dcf..cfcb238da 100644 --- a/e2e/tests/migration_steps_test.go +++ b/e2e/tests/migration_steps_test.go @@ -25,9 +25,10 @@ const ( // test which depends on a large Morse node snapshot being available locally. // See: https://pocket-snapshot.liquify.com/#/pruned/ // -// To run this test use: make test_e2e_migration +// To run this test use: +// $ make test_e2e_migration // OR -// go test -v ./e2e/tests/migration_steps_test.go -tags=e2e,manual +// $ go test -v ./e2e/tests/migration_steps_test.go -tags=e2e,manual func TestMigrationFeatures(t *testing.T) { gocuke.NewRunner(t, &migrationSuite{}).Path("migration_*.feature").Run() } From 3cc8442c72b24ba3072668db52ca14f8d77dee5f Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 27 Feb 2025 09:18:51 +0100 Subject: [PATCH 64/81] fix: linter error --- x/migration/types/message_claim_morse_account.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/migration/types/message_claim_morse_account.go b/x/migration/types/message_claim_morse_account.go index 585857d19..2236cb0d6 100644 --- a/x/migration/types/message_claim_morse_account.go +++ b/x/migration/types/message_claim_morse_account.go @@ -6,7 +6,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -var _ sdk.Msg = &MsgClaimMorseAccount{} +var _ sdk.Msg = (*MsgClaimMorseAccount)(nil) func NewMsgClaimMorseAccount(shannonDestAddress string, morseSrcAddress string, morseSignature string) *MsgClaimMorseAccount { return &MsgClaimMorseAccount{ From 9b013836a5cad2144a28572d7926f6324d579a26 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 27 Feb 2025 09:36:09 +0100 Subject: [PATCH 65/81] Empty commit From 9098a11b048f8f97eba6598975e85645b67517cf Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 27 Feb 2025 11:05:37 +0100 Subject: [PATCH 66/81] chore: review feedback improvements Co-authored-by: red-0ne --- api/poktroll/migration/tx.pulsar.go | 36 +++++++------ proto/poktroll/migration/tx.proto | 2 +- .../msg_server_claim_morse_acount_test.go | 4 +- .../types/message_claim_morse_account.go | 29 +++------- .../types/message_claim_morse_account_test.go | 22 +++++--- x/migration/types/tx.pb.go | 54 ++++++++++--------- x/migration/types/types.go | 3 +- 7 files changed, 75 insertions(+), 75 deletions(-) diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index b032cdde9..d974ee54a 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -1999,8 +1999,8 @@ func (x *fastReflection_MsgClaimMorseAccount) Range(f func(protoreflect.FieldDes return } } - if x.MorseSignature != "" { - value := protoreflect.ValueOfString(x.MorseSignature) + if len(x.MorseSignature) != 0 { + value := protoreflect.ValueOfBytes(x.MorseSignature) if !f(fd_MsgClaimMorseAccount_morse_signature, value) { return } @@ -2025,7 +2025,7 @@ func (x *fastReflection_MsgClaimMorseAccount) Has(fd protoreflect.FieldDescripto case "poktroll.migration.MsgClaimMorseAccount.morse_src_address": return x.MorseSrcAddress != "" case "poktroll.migration.MsgClaimMorseAccount.morse_signature": - return x.MorseSignature != "" + return len(x.MorseSignature) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccount")) @@ -2047,7 +2047,7 @@ func (x *fastReflection_MsgClaimMorseAccount) Clear(fd protoreflect.FieldDescrip case "poktroll.migration.MsgClaimMorseAccount.morse_src_address": x.MorseSrcAddress = "" case "poktroll.migration.MsgClaimMorseAccount.morse_signature": - x.MorseSignature = "" + x.MorseSignature = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccount")) @@ -2072,7 +2072,7 @@ func (x *fastReflection_MsgClaimMorseAccount) Get(descriptor protoreflect.FieldD return protoreflect.ValueOfString(value) case "poktroll.migration.MsgClaimMorseAccount.morse_signature": value := x.MorseSignature - return protoreflect.ValueOfString(value) + return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccount")) @@ -2098,7 +2098,7 @@ func (x *fastReflection_MsgClaimMorseAccount) Set(fd protoreflect.FieldDescripto case "poktroll.migration.MsgClaimMorseAccount.morse_src_address": x.MorseSrcAddress = value.Interface().(string) case "poktroll.migration.MsgClaimMorseAccount.morse_signature": - x.MorseSignature = value.Interface().(string) + x.MorseSignature = value.Bytes() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccount")) @@ -2143,7 +2143,7 @@ func (x *fastReflection_MsgClaimMorseAccount) NewField(fd protoreflect.FieldDesc case "poktroll.migration.MsgClaimMorseAccount.morse_src_address": return protoreflect.ValueOfString("") case "poktroll.migration.MsgClaimMorseAccount.morse_signature": - return protoreflect.ValueOfString("") + return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccount")) @@ -2392,7 +2392,7 @@ func (x *fastReflection_MsgClaimMorseAccount) ProtoMethods() *protoiface.Methods if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MorseSignature", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2402,23 +2402,25 @@ func (x *fastReflection_MsgClaimMorseAccount) ProtoMethods() *protoiface.Methods } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.MorseSignature = string(dAtA[iNdEx:postIndex]) + x.MorseSignature = append(x.MorseSignature[:0], dAtA[iNdEx:postIndex]...) + if x.MorseSignature == nil { + x.MorseSignature = []byte{} + } iNdEx = postIndex default: iNdEx = preIndex @@ -3220,7 +3222,7 @@ type MsgClaimMorseAccount struct { MorseSrcAddress string `protobuf:"bytes,2,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` // The hex-encoded signature, by the Morse account, of this message (where this field is nil). // I.e.: morse_signature = private_key.sign(marshal(MsgClaimMorseAccount{morse_signature: nil, ...})) - MorseSignature string `protobuf:"bytes,3,opt,name=morse_signature,json=morseSignature,proto3" json:"morse_signature,omitempty"` + MorseSignature []byte `protobuf:"bytes,3,opt,name=morse_signature,json=morseSignature,proto3" json:"morse_signature,omitempty"` } func (x *MsgClaimMorseAccount) Reset() { @@ -3257,11 +3259,11 @@ func (x *MsgClaimMorseAccount) GetMorseSrcAddress() string { return "" } -func (x *MsgClaimMorseAccount) GetMorseSignature() string { +func (x *MsgClaimMorseAccount) GetMorseSignature() []byte { if x != nil { return x.MorseSignature } - return "" + return nil } // MsgClaimMorseAccountResponse is returned from MsgClaimMorseAccount. @@ -3396,7 +3398,7 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3c, 0x0a, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xea, 0xde, 0x1f, 0x0f, 0x6d, 0x6f, 0x72, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x13, 0xea, 0xde, 0x1f, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0e, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x19, 0x82, 0xe7, 0xb0, 0x2a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 65a59fe34..331bbff30 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -93,7 +93,7 @@ message MsgClaimMorseAccount { // The hex-encoded signature, by the Morse account, of this message (where this field is nil). // I.e.: morse_signature = private_key.sign(marshal(MsgClaimMorseAccount{morse_signature: nil, ...})) - string morse_signature = 3 [(gogoproto.jsontag) = "morse_signature"]; + bytes morse_signature = 3 [(gogoproto.jsontag) = "morse_signature"]; } // MsgClaimMorseAccountResponse is returned from MsgClaimMorseAccount. diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go index ce0c5c80e..74ad4b17d 100644 --- a/x/migration/keeper/msg_server_claim_morse_acount_test.go +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -52,7 +52,7 @@ func TestMsgServer_ClaimMorseAccount_Success(t *testing.T) { ) require.NoError(t, err) - err = msgClaim.SignMorseSignature(morsePrivKey) + err = msgClaim.SignMsgClaimMorseAccount(morsePrivKey) require.NoError(t, err) msgClaimRes, err := srv.ClaimMorseAccount(ctx, msgClaim) @@ -124,7 +124,7 @@ func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { t.Run("invalid claim msg", func(t *testing.T) { // Copy the message and set the morse signature to an empty string. invalidMsgClaim := *msgClaim - invalidMsgClaim.MorseSignature = "" + invalidMsgClaim.MorseSignature = nil expectedErr := status.Error( codes.InvalidArgument, diff --git a/x/migration/types/message_claim_morse_account.go b/x/migration/types/message_claim_morse_account.go index 542adf247..10a3e10e3 100644 --- a/x/migration/types/message_claim_morse_account.go +++ b/x/migration/types/message_claim_morse_account.go @@ -1,8 +1,6 @@ package types import ( - "encoding/hex" - errorsmod "cosmossdk.io/errors" cometcrypto "github.com/cometbft/cometbft/crypto" sdk "github.com/cosmos/cosmos-sdk/types" @@ -23,7 +21,7 @@ func NewMsgClaimMorseAccount( } if morsePrivateKey != nil { - if err := msg.SignMorseSignature(morsePrivateKey); err != nil { + if err := msg.SignMsgClaimMorseAccount(morsePrivateKey); err != nil { return nil, err } } @@ -36,7 +34,7 @@ func (msg *MsgClaimMorseAccount) ValidateBasic() error { return ErrMorseAccountClaim.Wrapf("invalid morseSrcAddress length (%d): %q", len(msg.MorseSrcAddress), msg.MorseSrcAddress) } - if len(msg.MorseSignature) != MorseSignatureHexLengthBytes { + if len(msg.MorseSignature) != MorseSignatureLengthBytes { return ErrMorseAccountClaim.Wrapf("invalid morseSignature length (%d): %q", len(msg.MorseSignature), msg.MorseSignature) } @@ -46,38 +44,27 @@ func (msg *MsgClaimMorseAccount) ValidateBasic() error { return nil } -// SignMorseSignature signs the given MsgClaimMorseAccount with the given Morse private key. -func (msg *MsgClaimMorseAccount) SignMorseSignature(morsePrivKey cometcrypto.PrivKey) error { +// SignMsgClaimMorseAccount signs the given MsgClaimMorseAccount with the given Morse private key. +func (msg *MsgClaimMorseAccount) SignMsgClaimMorseAccount(morsePrivKey cometcrypto.PrivKey) (err error) { signingMsgBz, err := msg.getSigningBytes() if err != nil { return err } - signatureBz, err := morsePrivKey.Sign(signingMsgBz) - if err != nil { - return err - } - - msg.MorseSignature = hex.EncodeToString(signatureBz) - return nil + msg.MorseSignature, err = morsePrivKey.Sign(signingMsgBz) + return err } // ValidateMorseSignature validates the signature of the given MsgClaimMorseAccount // matches the given Morse public key. func (msg *MsgClaimMorseAccount) ValidateMorseSignature(morsePublicKey cometcrypto.PubKey) error { - // Validate the morse signature. - morseSignature, err := hex.DecodeString(msg.MorseSignature) - if err != nil { - return err - } - signingMsgBz, err := msg.getSigningBytes() if err != nil { return err } // Validate the morse signature. - if !morsePublicKey.VerifySignature(signingMsgBz, morseSignature) { + if !morsePublicKey.VerifySignature(signingMsgBz, msg.MorseSignature) { return ErrMorseAccountClaim.Wrapf("morseSignature is invalid") } @@ -90,7 +77,7 @@ func (msg *MsgClaimMorseAccount) getSigningBytes() ([]byte, error) { // Copy msg and clear the morse signature field (ONLY on the copy) to prevent // it from being included in the signature validation. signingMsg := *msg - signingMsg.MorseSignature = "" + signingMsg.MorseSignature = nil return proto.Marshal(&signingMsg) } diff --git a/x/migration/types/message_claim_morse_account_test.go b/x/migration/types/message_claim_morse_account_test.go index 9313c1b23..2d4ca8b85 100644 --- a/x/migration/types/message_claim_morse_account_test.go +++ b/x/migration/types/message_claim_morse_account_test.go @@ -12,10 +12,20 @@ import ( migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) -const mockMorseSignature = "6c0d3b25a3e53eb6739f00ac66fc70168dfbb6dfe306a50f48a5f9d732b23068be3840a7127e1d849b4b2c54f5d34c2db36c2d6da46263cc72270f8f5dfdec5f" +const mockMorseSignatureHex = "6c0d3b25a3e53eb6739f00ac66fc70168dfbb6dfe306a50f48a5f9d732b23068be3840a7127e1d849b4b2c54f5d34c2db36c2d6da46263cc72270f8f5dfdec5f" + +var mockMorseSignature []byte + +func init() { + var err error + mockMorseSignature, err = hex.DecodeString(mockMorseSignatureHex) + if err != nil { + panic(err) + } +} func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { - require.Len(t, mockMorseSignature, migrationtypes.MorseSignatureHexLengthBytes) + require.Len(t, mockMorseSignature, migrationtypes.MorseSignatureLengthBytes) tests := []struct { desc string @@ -43,7 +53,7 @@ func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { msg: migrationtypes.MsgClaimMorseAccount{ ShannonDestAddress: sample.AccAddress(), MorseSrcAddress: "invalid_address", - MorseSignature: "", + MorseSignature: nil, }, err: migrationtypes.ErrMorseAccountClaim, }, { @@ -75,7 +85,7 @@ func TestMsgClaimMorseAccount_ValidateMorseSignature(t *testing.T) { msg := migrationtypes.MsgClaimMorseAccount{ ShannonDestAddress: sample.AccAddress(), MorseSrcAddress: sample.MorseAddressHex(), - MorseSignature: hex.EncodeToString([]byte("invalid_signature")), + MorseSignature: []byte("invalid_signature"), } expectedErr := migrationtypes.ErrMorseAccountClaim.Wrapf("morseSignature is invalid") @@ -87,9 +97,9 @@ func TestMsgClaimMorseAccount_ValidateMorseSignature(t *testing.T) { msg := migrationtypes.MsgClaimMorseAccount{ ShannonDestAddress: sample.AccAddress(), MorseSrcAddress: sample.MorseAddressHex(), - // MorseSignature: (intenionally omitted; set in #SignMorseSignature) + // MorseSignature: (intenionally omitted; set in #SignMsgClaimMorseAccount) } - err := msg.SignMorseSignature(morsePrivKey) + err := msg.SignMsgClaimMorseAccount(morsePrivKey) require.NoError(t, err) err = msg.ValidateMorseSignature(morsePublicKey) diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 0476b60b0..a41bf7a26 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -255,7 +255,7 @@ type MsgClaimMorseAccount struct { MorseSrcAddress string `protobuf:"bytes,2,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address"` // The hex-encoded signature, by the Morse account, of this message (where this field is nil). // I.e.: morse_signature = private_key.sign(marshal(MsgClaimMorseAccount{morse_signature: nil, ...})) - MorseSignature string `protobuf:"bytes,3,opt,name=morse_signature,json=morseSignature,proto3" json:"morse_signature"` + MorseSignature []byte `protobuf:"bytes,3,opt,name=morse_signature,json=morseSignature,proto3" json:"morse_signature"` } func (m *MsgClaimMorseAccount) Reset() { *m = MsgClaimMorseAccount{} } @@ -301,11 +301,11 @@ func (m *MsgClaimMorseAccount) GetMorseSrcAddress() string { return "" } -func (m *MsgClaimMorseAccount) GetMorseSignature() string { +func (m *MsgClaimMorseAccount) GetMorseSignature() []byte { if m != nil { return m.MorseSignature } - return "" + return nil } // MsgClaimMorseAccountResponse is returned from MsgClaimMorseAccount. @@ -383,7 +383,7 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 772 bytes of a gzipped FileDescriptorProto + // 770 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x4f, 0x4f, 0xdb, 0x48, 0x14, 0x8f, 0xc3, 0x2e, 0x52, 0x06, 0x94, 0x6c, 0x4c, 0x10, 0x49, 0x40, 0x36, 0xca, 0xfe, 0x8b, 0xb2, 0xc2, 0xe6, 0x8f, 0xb4, 0x2b, 0xb1, 0xbb, 0x87, 0x98, 0x1e, 0xe8, 0x21, 0x12, 0x32, 0xe2, @@ -417,22 +417,22 @@ var fileDescriptor_21658240592266b6 = []byte{ 0x0d, 0x31, 0x26, 0xd8, 0xe8, 0x20, 0xca, 0x0c, 0x18, 0x0f, 0x8b, 0x8f, 0x71, 0x33, 0xf0, 0xe5, 0x54, 0xff, 0xcc, 0xf1, 0x8a, 0x1c, 0xfd, 0x0c, 0x51, 0xc6, 0x3d, 0x62, 0x13, 0xc4, 0x83, 0x30, 0xa8, 0x67, 0x0e, 0x0b, 0x64, 0xa3, 0x02, 0xcb, 0x81, 0x2f, 0x4f, 0x3b, 0xf5, 0x42, 0x64, 0x3a, - 0xf4, 0xcc, 0x24, 0xc5, 0x7f, 0xa0, 0xc0, 0x51, 0x8e, 0x85, 0x21, 0xeb, 0x7b, 0x28, 0x9a, 0x56, - 0x4e, 0x5b, 0x0a, 0x7c, 0x79, 0xd2, 0xa5, 0xe7, 0xe3, 0xf0, 0xe4, 0xbc, 0x5b, 0x09, 0xa7, 0x93, - 0xda, 0x47, 0x2d, 0x10, 0xc0, 0x5a, 0x9a, 0x30, 0xc3, 0xe9, 0xa4, 0x92, 0x17, 0x7e, 0x88, 0xfc, - 0x4b, 0x50, 0x30, 0xc3, 0xfc, 0xa8, 0x63, 0xb4, 0x61, 0x17, 0x62, 0x33, 0xb9, 0xe3, 0x15, 0x85, - 0x6b, 0x18, 0x2e, 0x17, 0x85, 0x2f, 0x17, 0x65, 0x8f, 0x38, 0x58, 0x5b, 0xe1, 0xf7, 0x7a, 0x32, - 0x52, 0xcf, 0x73, 0x83, 0x16, 0x9f, 0xc5, 0x06, 0x28, 0x26, 0x10, 0xc8, 0x0c, 0x1b, 0x39, 0x96, - 0xcd, 0x22, 0x6d, 0xe6, 0xf4, 0x24, 0xb6, 0xc9, 0xf6, 0x23, 0xf3, 0xf6, 0xd7, 0x2c, 0x98, 0x6b, - 0x51, 0x4b, 0x7c, 0x05, 0x16, 0xc7, 0xf6, 0xd5, 0xaf, 0xa9, 0xef, 0xda, 0xf8, 0x46, 0xa8, 0xfe, - 0xf5, 0x08, 0xd0, 0x50, 0xb5, 0x73, 0x01, 0xac, 0x3d, 0xb8, 0x33, 0x76, 0x66, 0x64, 0x7b, 0x28, - 0xa8, 0xfa, 0xef, 0x13, 0x82, 0x86, 0x94, 0x08, 0x28, 0x4e, 0x5f, 0xff, 0xfa, 0x8c, 0x8c, 0x53, - 0xc8, 0xea, 0xe6, 0x63, 0x91, 0x49, 0xc1, 0xea, 0xcf, 0x6f, 0xc2, 0xed, 0xac, 0x1d, 0x5c, 0x0d, - 0x24, 0xe1, 0x7a, 0x20, 0x09, 0x37, 0x03, 0x49, 0xf8, 0x32, 0x90, 0x84, 0xf3, 0x5b, 0x29, 0x73, - 0x7d, 0x2b, 0x65, 0x6e, 0x6e, 0xa5, 0xcc, 0x8b, 0x6d, 0xcb, 0x61, 0x76, 0xbf, 0xad, 0x98, 0xc4, - 0x55, 0xc3, 0x02, 0x1b, 0x18, 0xb1, 0xd7, 0xc4, 0x3b, 0x56, 0x53, 0x17, 0x37, 0x3b, 0xeb, 0x21, - 0xda, 0x9e, 0x8f, 0xbe, 0x3c, 0x3b, 0xdf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x17, 0x88, 0x75, - 0x72, 0x07, 0x00, 0x00, + 0xf4, 0xcc, 0x24, 0xc5, 0x7f, 0xa0, 0xc0, 0x51, 0x8e, 0x85, 0x21, 0xeb, 0x7b, 0x88, 0x4f, 0x6b, + 0x29, 0xf0, 0xe5, 0x49, 0x97, 0x9e, 0x8f, 0xc3, 0x93, 0xf3, 0x6e, 0x25, 0x9c, 0x4e, 0x6a, 0x1f, + 0xb5, 0x40, 0x00, 0x6b, 0x69, 0xc2, 0x0c, 0xa7, 0x93, 0x4a, 0x5e, 0xf8, 0x21, 0xf2, 0x2f, 0x41, + 0xc1, 0x0c, 0xf3, 0xa3, 0x8e, 0xd1, 0x86, 0x5d, 0x88, 0xcd, 0xe4, 0x8e, 0x57, 0x14, 0xae, 0x61, + 0xb8, 0x5c, 0x14, 0xbe, 0x5c, 0x94, 0x3d, 0xe2, 0x60, 0x6d, 0x85, 0xdf, 0xeb, 0xc9, 0x48, 0x3d, + 0xcf, 0x0d, 0x5a, 0x7c, 0x16, 0x1b, 0xa0, 0x98, 0x40, 0x20, 0x33, 0x6c, 0xe4, 0x58, 0x36, 0x8b, + 0xb4, 0x99, 0xd3, 0x93, 0xd8, 0x26, 0xdb, 0x8f, 0xcc, 0xdb, 0x5f, 0xb3, 0x60, 0xae, 0x45, 0x2d, + 0xf1, 0x15, 0x58, 0x1c, 0xdb, 0x57, 0xbf, 0xa6, 0xbe, 0x6b, 0xe3, 0x1b, 0xa1, 0xfa, 0xd7, 0x23, + 0x40, 0x43, 0xd5, 0xce, 0x05, 0xb0, 0xf6, 0xe0, 0xce, 0xd8, 0x99, 0x91, 0xed, 0xa1, 0xa0, 0xea, + 0xbf, 0x4f, 0x08, 0x1a, 0x52, 0x22, 0xa0, 0x38, 0x7d, 0xfd, 0xeb, 0x33, 0x32, 0x4e, 0x21, 0xab, + 0x9b, 0x8f, 0x45, 0x26, 0x05, 0xab, 0x3f, 0xbf, 0x09, 0xb7, 0xb3, 0x76, 0x70, 0x35, 0x90, 0x84, + 0xeb, 0x81, 0x24, 0xdc, 0x0c, 0x24, 0xe1, 0xcb, 0x40, 0x12, 0xce, 0x6f, 0xa5, 0xcc, 0xf5, 0xad, + 0x94, 0xb9, 0xb9, 0x95, 0x32, 0x2f, 0xb6, 0x2d, 0x87, 0xd9, 0xfd, 0xb6, 0x62, 0x12, 0x57, 0x0d, + 0x0b, 0x6c, 0x60, 0xc4, 0x5e, 0x13, 0xef, 0x58, 0x4d, 0x5d, 0xdc, 0xec, 0xac, 0x87, 0x68, 0x7b, + 0x3e, 0xfa, 0xf2, 0xec, 0x7c, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x0a, 0x73, 0x6f, 0x72, 0x07, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1455,7 +1455,7 @@ func (m *MsgClaimMorseAccount) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MorseSignature", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1465,23 +1465,25 @@ func (m *MsgClaimMorseAccount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.MorseSignature = string(dAtA[iNdEx:postIndex]) + m.MorseSignature = append(m.MorseSignature[:0], dAtA[iNdEx:postIndex]...) + if m.MorseSignature == nil { + m.MorseSignature = []byte{} + } iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/migration/types/types.go b/x/migration/types/types.go index 492b41162..80f9b6723 100644 --- a/x/migration/types/types.go +++ b/x/migration/types/types.go @@ -4,6 +4,5 @@ const ( MorseAddressLengthBytes = 20 MorseSignatureLengthBytes = 64 - MorseAddressHexLengthBytes = MorseAddressLengthBytes * 2 - MorseSignatureHexLengthBytes = MorseSignatureLengthBytes * 2 + MorseAddressHexLengthBytes = MorseAddressLengthBytes * 2 ) From a36d875a88247e6012934e1435ea898cb370043e Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 27 Feb 2025 11:33:09 +0100 Subject: [PATCH 67/81] chore: regenerate protobufs --- api/poktroll/migration/event.pulsar.go | 2 +- x/migration/types/tx.pb.go | 132 +++++++++++++------------ 2 files changed, 68 insertions(+), 66 deletions(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index 4fbc33289..e89a244c3 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -3,11 +3,11 @@ package migration import ( v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + _ "github.com/pokt-network/poktroll/api/poktroll/shared" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" - _ "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 5e4660bbb..295270aab 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -255,7 +255,7 @@ type MsgClaimMorseAccount struct { MorseSrcAddress string `protobuf:"bytes,2,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address"` // The hex-encoded signature, by the Morse account, of this message (where this field is nil). // I.e.: morse_signature = private_key.sign(marshal(MsgClaimMorseAccount{morse_signature: nil, ...})) - MorseSignature string `protobuf:"bytes,3,opt,name=morse_signature,json=morseSignature,proto3" json:"morse_signature"` + MorseSignature []byte `protobuf:"bytes,3,opt,name=morse_signature,json=morseSignature,proto3" json:"morse_signature"` } func (m *MsgClaimMorseAccount) Reset() { *m = MsgClaimMorseAccount{} } @@ -301,11 +301,11 @@ func (m *MsgClaimMorseAccount) GetMorseSrcAddress() string { return "" } -func (m *MsgClaimMorseAccount) GetMorseSignature() string { +func (m *MsgClaimMorseAccount) GetMorseSignature() []byte { if m != nil { return m.MorseSignature } - return "" + return nil } // MsgClaimMorseAccountResponse is returned from MsgClaimMorseAccount. @@ -529,66 +529,66 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 936 bytes of a gzipped FileDescriptorProto + // 935 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x3d, 0x6f, 0xdb, 0x46, 0x18, 0x36, 0x65, 0x3b, 0x80, 0xde, 0xb8, 0x76, 0xcd, 0xd8, 0x90, 0xac, 0x18, 0xa2, 0xa1, 0xa6, - 0xa9, 0xe0, 0xd6, 0x64, 0x6c, 0xf7, 0x03, 0x70, 0xdb, 0xc1, 0x74, 0x81, 0x26, 0x83, 0x80, 0x80, + 0xa9, 0xe0, 0xd6, 0x64, 0x6c, 0xf7, 0x03, 0x70, 0xdb, 0xc1, 0x72, 0x81, 0x26, 0x83, 0x80, 0x80, 0x46, 0x86, 0xb6, 0x03, 0x7b, 0xa2, 0xae, 0x24, 0x61, 0xf1, 0x8e, 0xe0, 0x9d, 0xdc, 0x04, 0x5d, 0x8a, 0x8e, 0x05, 0x0a, 0x04, 0x1d, 0xfa, 0x1b, 0x3a, 0x7a, 0xc8, 0xd0, 0xb5, 0x5b, 0xc6, 0xa0, - 0x53, 0x26, 0xa1, 0xb0, 0x07, 0x03, 0x5a, 0xfa, 0x17, 0x0a, 0xf2, 0x8e, 0x92, 0x45, 0x9d, 0xa2, - 0xd8, 0x8b, 0x2d, 0xbe, 0xef, 0xf3, 0x7e, 0x3c, 0xcf, 0x73, 0xfc, 0x80, 0xbb, 0x31, 0x3d, 0xe1, - 0x09, 0xed, 0x76, 0xad, 0x28, 0xf4, 0x13, 0xc4, 0x43, 0x4a, 0x2c, 0xfe, 0xd4, 0x8c, 0x13, 0xca, - 0xa9, 0xae, 0xe7, 0x49, 0x73, 0x98, 0xac, 0xad, 0xa2, 0x28, 0x24, 0xd4, 0xca, 0xfe, 0x0a, 0x58, - 0xad, 0xe2, 0x51, 0x16, 0x51, 0x66, 0x45, 0xcc, 0xb7, 0x4e, 0x77, 0xd3, 0x7f, 0x32, 0xb1, 0x21, - 0x12, 0x6e, 0x76, 0x65, 0x89, 0x0b, 0x99, 0x5a, 0xf3, 0xa9, 0x4f, 0x45, 0x3c, 0xfd, 0x25, 0xa3, - 0xf7, 0x15, 0xdb, 0x44, 0x34, 0x61, 0xd8, 0xa5, 0xc4, 0x0b, 0x50, 0x48, 0x24, 0xce, 0x50, 0xe0, - 0x62, 0x94, 0xa0, 0x28, 0x6f, 0x5f, 0x97, 0x2b, 0xb5, 0x11, 0xc3, 0xd6, 0xe9, 0x6e, 0x1b, 0x73, - 0xb4, 0x6b, 0x79, 0x34, 0x6f, 0xd0, 0xf8, 0x5b, 0x83, 0x95, 0x16, 0xf3, 0x9f, 0xc4, 0x1d, 0xc4, - 0xf1, 0xe3, 0xac, 0x52, 0xff, 0x14, 0xca, 0xa8, 0xc7, 0x03, 0x9a, 0x84, 0xfc, 0x59, 0x55, 0xdb, - 0xd2, 0x9a, 0x65, 0xbb, 0xfa, 0xcf, 0x8b, 0x9d, 0x35, 0xb9, 0xf7, 0x61, 0xa7, 0x93, 0x60, 0xc6, - 0x8e, 0x79, 0x12, 0x12, 0xdf, 0x19, 0x41, 0xf5, 0x2f, 0xe1, 0x96, 0x98, 0x5d, 0x2d, 0x6d, 0x69, - 0xcd, 0xdb, 0x7b, 0x35, 0x73, 0x52, 0x36, 0x53, 0xcc, 0xb0, 0xcb, 0x2f, 0xfb, 0xc6, 0xdc, 0x9f, - 0x97, 0x67, 0xdb, 0x9a, 0x23, 0x8b, 0x0e, 0x3e, 0xfb, 0xe5, 0xf2, 0x6c, 0x7b, 0xd4, 0xee, 0xd7, - 0xcb, 0xb3, 0xed, 0x7b, 0x43, 0x7a, 0x4f, 0xaf, 0x10, 0x2c, 0xec, 0xdb, 0xd8, 0x80, 0x4a, 0x21, - 0xe4, 0x60, 0x16, 0x53, 0xc2, 0x70, 0xe3, 0x45, 0x09, 0x8c, 0x16, 0xf3, 0x1f, 0x45, 0x31, 0x4d, - 0x78, 0x2b, 0x15, 0xf0, 0xa8, 0x8b, 0xc2, 0x08, 0xb5, 0xbb, 0xf8, 0xd0, 0xf3, 0x68, 0x8f, 0xf0, - 0x9b, 0xd3, 0x4d, 0xe0, 0x8e, 0xb0, 0x04, 0x89, 0x4e, 0x2e, 0xe3, 0x88, 0x63, 0xc9, 0xfd, 0x7d, - 0x15, 0xf7, 0x6c, 0x01, 0x39, 0xf7, 0x38, 0x05, 0xdb, 0x77, 0x53, 0x19, 0x06, 0x7d, 0x43, 0xd5, - 0xc9, 0x59, 0x8d, 0x8a, 0x78, 0xfd, 0x09, 0x54, 0x15, 0x48, 0x37, 0x40, 0x2c, 0xa8, 0xce, 0x6f, - 0x69, 0xcd, 0x25, 0x7b, 0x73, 0xd0, 0x37, 0xa6, 0x62, 0x9c, 0xf5, 0x89, 0x96, 0x0f, 0x11, 0x0b, - 0x0e, 0x96, 0xc7, 0xa5, 0x6f, 0xfc, 0xa6, 0xc1, 0x07, 0x33, 0x64, 0xcb, 0x25, 0xd6, 0x77, 0x00, - 0xae, 0x2c, 0xa1, 0x65, 0x4b, 0x2c, 0x0f, 0xfa, 0xc6, 0x95, 0xa8, 0x53, 0x66, 0xf9, 0x28, 0x7d, - 0x1f, 0x96, 0x48, 0x2f, 0xca, 0x77, 0x13, 0x47, 0x65, 0xc1, 0x7e, 0x77, 0xd0, 0x37, 0xc6, 0xe2, - 0xce, 0x6d, 0xd2, 0x8b, 0xf2, 0x59, 0x8d, 0x3f, 0x4a, 0xb0, 0xd6, 0x62, 0x7e, 0xb6, 0xc4, 0x55, - 0x11, 0xf5, 0x36, 0xac, 0xb1, 0x00, 0x11, 0x42, 0x89, 0xdb, 0xc1, 0x8c, 0xbb, 0x48, 0x98, 0x25, - 0x6d, 0x7c, 0x30, 0xe8, 0x1b, 0xca, 0xfc, 0x54, 0x7b, 0x75, 0x89, 0xfe, 0x0a, 0x33, 0x2e, 0x33, - 0xfa, 0x21, 0x08, 0x23, 0x5c, 0x96, 0x78, 0xc3, 0x01, 0xa5, 0x6c, 0xc0, 0xfa, 0xa0, 0x6f, 0x4c, - 0x26, 0x9d, 0x95, 0x2c, 0x74, 0x9c, 0x78, 0x79, 0x8b, 0x2f, 0x60, 0x45, 0xa2, 0x42, 0x9f, 0x20, - 0xde, 0x4b, 0x70, 0xe6, 0x56, 0xd9, 0xbe, 0x33, 0xe8, 0x1b, 0xc5, 0x94, 0xb3, 0x2c, 0xca, 0xf3, - 0xeb, 0x83, 0x8d, 0xd4, 0x1d, 0x25, 0x8f, 0xc6, 0x40, 0x83, 0x4d, 0x95, 0x30, 0x43, 0x77, 0x94, - 0xcb, 0x6b, 0xd7, 0x5a, 0xfe, 0x3b, 0x58, 0xf1, 0xd2, 0xfe, 0xb8, 0xe3, 0xb6, 0x51, 0x17, 0x11, - 0x2f, 0x3f, 0xe3, 0x1b, 0xa6, 0xd4, 0x30, 0x7d, 0xb8, 0x98, 0xf2, 0xe1, 0x62, 0x1e, 0xd1, 0x90, - 0xd8, 0x15, 0x79, 0xae, 0x8b, 0x95, 0xce, 0xb2, 0x0c, 0xd8, 0xe2, 0x5a, 0xdf, 0x86, 0xd5, 0x1c, - 0x82, 0xb8, 0x1b, 0xe0, 0xd0, 0x0f, 0x78, 0xa6, 0xcd, 0xbc, 0x93, 0xd7, 0x1e, 0xf2, 0x87, 0x59, - 0xb8, 0xf1, 0x7b, 0x09, 0xaa, 0xe3, 0x64, 0xe3, 0xb8, 0x1b, 0x7a, 0xd9, 0xbd, 0xa5, 0x9b, 0xa0, - 0xf0, 0x4e, 0x30, 0x55, 0xba, 0xda, 0x84, 0x22, 0x51, 0xe1, 0xe9, 0x24, 0xff, 0xfb, 0x50, 0x30, - 0x44, 0x78, 0x57, 0xb4, 0x49, 0xff, 0x04, 0x16, 0x19, 0x47, 0x27, 0xb8, 0xba, 0x30, 0x4b, 0x9d, - 0x85, 0x54, 0x1d, 0x47, 0xa0, 0xf5, 0x7b, 0xf0, 0x0e, 0xc3, 0xc9, 0x69, 0xe8, 0xe1, 0x23, 0x4a, - 0x7e, 0x08, 0xfd, 0xea, 0x62, 0xd6, 0x7d, 0x3c, 0x78, 0x50, 0x49, 0xcf, 0x80, 0x82, 0x47, 0xe3, - 0xaf, 0x12, 0x6c, 0x4d, 0x13, 0x65, 0x78, 0x0a, 0x14, 0x64, 0x35, 0x35, 0xd9, 0xaf, 0xa1, 0xe0, - 0xd0, 0x6c, 0xaf, 0x05, 0x9b, 0xa2, 0xb1, 0x9b, 0x50, 0x96, 0x0c, 0x1e, 0x75, 0xa4, 0x60, 0xa3, - 0x80, 0xfe, 0x0d, 0x54, 0x72, 0x77, 0x47, 0xeb, 0x1e, 0x5f, 0x47, 0xbd, 0x69, 0xf5, 0x29, 0xd7, - 0xc2, 0xc1, 0xc9, 0x14, 0x5d, 0x9c, 0x38, 0x4f, 0x7b, 0xff, 0xcd, 0xc3, 0x7c, 0x8b, 0xf9, 0xfa, - 0xf7, 0xb0, 0x34, 0xf6, 0xfe, 0x7b, 0x4f, 0xf9, 0xec, 0x1e, 0x7f, 0xc3, 0xd4, 0x3e, 0x7c, 0x0b, - 0xd0, 0x50, 0xff, 0xe7, 0x1a, 0x6c, 0xbe, 0xf1, 0x1d, 0xb4, 0x3f, 0xa5, 0xdb, 0x9b, 0x8a, 0x6a, - 0x9f, 0xdf, 0xa0, 0x68, 0xb8, 0x12, 0x85, 0xd5, 0xc9, 0xc7, 0x69, 0x73, 0x4a, 0xc7, 0x09, 0x64, - 0xed, 0xc1, 0xdb, 0x22, 0x87, 0x03, 0x7f, 0x82, 0x75, 0xf5, 0x9d, 0xfb, 0xd1, 0xec, 0x56, 0x23, - 0x74, 0xed, 0xe3, 0xeb, 0xa0, 0xf3, 0xe1, 0xb5, 0xc5, 0x9f, 0xd3, 0x4f, 0x0d, 0xfb, 0xf1, 0xcb, - 0xf3, 0xba, 0xf6, 0xea, 0xbc, 0xae, 0xbd, 0x3e, 0xaf, 0x6b, 0xff, 0x9e, 0xd7, 0xb5, 0xe7, 0x17, - 0xf5, 0xb9, 0x57, 0x17, 0xf5, 0xb9, 0xd7, 0x17, 0xf5, 0xb9, 0x6f, 0xf7, 0xfc, 0x90, 0x07, 0xbd, - 0xb6, 0xe9, 0xd1, 0xc8, 0x4a, 0x87, 0xec, 0x10, 0xcc, 0x7f, 0xa4, 0xc9, 0x89, 0xa5, 0xfc, 0x0a, - 0xe1, 0xcf, 0x62, 0xcc, 0xda, 0xb7, 0xb2, 0xcf, 0xa8, 0xfd, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, - 0xde, 0xeb, 0xbd, 0x12, 0x3f, 0x0a, 0x00, 0x00, + 0x53, 0x26, 0xa1, 0xb0, 0x07, 0x03, 0x5a, 0xfa, 0x17, 0x0a, 0xf2, 0x8e, 0x94, 0x45, 0x9d, 0xa2, + 0xd8, 0x8b, 0x2d, 0xbe, 0xef, 0xf3, 0x7e, 0x3c, 0xcf, 0x73, 0xfc, 0x80, 0xbb, 0x11, 0x3d, 0xe1, + 0x31, 0xed, 0xf5, 0xac, 0x30, 0xf0, 0x62, 0xc4, 0x03, 0x4a, 0x2c, 0xfe, 0xd4, 0x8c, 0x62, 0xca, + 0xa9, 0xae, 0x67, 0x49, 0x33, 0x4f, 0xd6, 0x56, 0x51, 0x18, 0x10, 0x6a, 0xa5, 0x7f, 0x05, 0xac, + 0x56, 0x71, 0x29, 0x0b, 0x29, 0xb3, 0x42, 0xe6, 0x59, 0xa7, 0xbb, 0xc9, 0x3f, 0x99, 0xd8, 0x10, + 0x09, 0x27, 0xbd, 0xb2, 0xc4, 0x85, 0x4c, 0xad, 0x79, 0xd4, 0xa3, 0x22, 0x9e, 0xfc, 0x92, 0xd1, + 0xfb, 0x8a, 0x6d, 0x42, 0x1a, 0x33, 0xec, 0x50, 0xe2, 0xfa, 0x28, 0x20, 0x12, 0x67, 0x28, 0x70, + 0x11, 0x8a, 0x51, 0x98, 0xb5, 0xaf, 0xcb, 0x95, 0x3a, 0x88, 0x61, 0xeb, 0x74, 0xb7, 0x83, 0x39, + 0xda, 0xb5, 0x5c, 0x9a, 0x35, 0x68, 0xfc, 0xad, 0xc1, 0x4a, 0x9b, 0x79, 0x4f, 0xa2, 0x2e, 0xe2, + 0xf8, 0x71, 0x5a, 0xa9, 0x7f, 0x0a, 0x65, 0xd4, 0xe7, 0x3e, 0x8d, 0x03, 0xfe, 0xac, 0xaa, 0x6d, + 0x69, 0xcd, 0x72, 0xab, 0xfa, 0xcf, 0x8b, 0x9d, 0x35, 0xb9, 0xf7, 0x61, 0xb7, 0x1b, 0x63, 0xc6, + 0x8e, 0x79, 0x1c, 0x10, 0xcf, 0x1e, 0x41, 0xf5, 0x2f, 0xe1, 0x96, 0x98, 0x5d, 0x2d, 0x6d, 0x69, + 0xcd, 0xdb, 0x7b, 0x35, 0x73, 0x52, 0x36, 0x53, 0xcc, 0x68, 0x95, 0x5f, 0x0e, 0x8c, 0xb9, 0x3f, + 0x2f, 0xcf, 0xb6, 0x35, 0x5b, 0x16, 0x1d, 0x7c, 0xf6, 0xcb, 0xe5, 0xd9, 0xf6, 0xa8, 0xdd, 0xaf, + 0x97, 0x67, 0xdb, 0xf7, 0x72, 0x7a, 0x4f, 0xaf, 0x10, 0x2c, 0xec, 0xdb, 0xd8, 0x80, 0x4a, 0x21, + 0x64, 0x63, 0x16, 0x51, 0xc2, 0x70, 0xe3, 0x45, 0x09, 0x8c, 0x36, 0xf3, 0x1e, 0x85, 0x11, 0x8d, + 0x79, 0x3b, 0x11, 0xf0, 0xa8, 0x87, 0x82, 0x10, 0x75, 0x7a, 0xf8, 0xd0, 0x75, 0x69, 0x9f, 0xf0, + 0x9b, 0xd3, 0x8d, 0xe1, 0x8e, 0xb0, 0x04, 0x89, 0x4e, 0x0e, 0xe3, 0x88, 0x63, 0xc9, 0xfd, 0x7d, + 0x15, 0xf7, 0x74, 0x01, 0x39, 0xf7, 0x38, 0x01, 0xb7, 0xee, 0x26, 0x32, 0x0c, 0x07, 0x86, 0xaa, + 0x93, 0xbd, 0x1a, 0x16, 0xf1, 0xfa, 0x13, 0xa8, 0x2a, 0x90, 0x8e, 0x8f, 0x98, 0x5f, 0x9d, 0xdf, + 0xd2, 0x9a, 0x4b, 0xad, 0xcd, 0xe1, 0xc0, 0x98, 0x8a, 0xb1, 0xd7, 0x27, 0x5a, 0x3e, 0x44, 0xcc, + 0x3f, 0x58, 0x1e, 0x97, 0xbe, 0xf1, 0x9b, 0x06, 0x1f, 0xcc, 0x90, 0x2d, 0x93, 0x58, 0xdf, 0x01, + 0xb8, 0xb2, 0x84, 0x96, 0x2e, 0xb1, 0x3c, 0x1c, 0x18, 0x57, 0xa2, 0x76, 0x99, 0x65, 0xa3, 0xf4, + 0x7d, 0x58, 0x22, 0xfd, 0x30, 0xdb, 0x4d, 0x1c, 0x95, 0x85, 0xd6, 0xbb, 0xc3, 0x81, 0x31, 0x16, + 0xb7, 0x6f, 0x93, 0x7e, 0x98, 0xcd, 0x6a, 0xfc, 0x51, 0x82, 0xb5, 0x36, 0xf3, 0xd2, 0x25, 0xae, + 0x8a, 0xa8, 0x77, 0x60, 0x8d, 0xf9, 0x88, 0x10, 0x4a, 0x9c, 0x2e, 0x66, 0xdc, 0x41, 0xc2, 0x2c, + 0x69, 0xe3, 0x83, 0xe1, 0xc0, 0x50, 0xe6, 0xa7, 0xda, 0xab, 0x4b, 0xf4, 0x57, 0x98, 0x71, 0x99, + 0xd1, 0x0f, 0x41, 0x18, 0xe1, 0xb0, 0xd8, 0xcd, 0x07, 0x94, 0xd2, 0x01, 0xeb, 0xc3, 0x81, 0x31, + 0x99, 0xb4, 0x57, 0xd2, 0xd0, 0x71, 0xec, 0x66, 0x2d, 0xbe, 0x80, 0x15, 0x89, 0x0a, 0x3c, 0x82, + 0x78, 0x3f, 0xc6, 0xd2, 0xad, 0x3b, 0xc3, 0x81, 0x51, 0x4c, 0xd9, 0xcb, 0xa2, 0x3c, 0xbb, 0x3e, + 0xd8, 0x48, 0xdc, 0x51, 0xf2, 0x68, 0x0c, 0x35, 0xd8, 0x54, 0x09, 0x93, 0xbb, 0xa3, 0x5c, 0x5e, + 0xbb, 0xd6, 0xf2, 0xdf, 0xc1, 0x8a, 0x9b, 0xf4, 0xc7, 0x5d, 0xa7, 0x83, 0x7a, 0x88, 0xb8, 0xd9, + 0x19, 0xdf, 0x30, 0xa5, 0x86, 0xc9, 0xc3, 0xc5, 0x94, 0x0f, 0x17, 0xf3, 0x88, 0x06, 0xa4, 0x55, + 0x91, 0xe7, 0xba, 0x58, 0x69, 0x2f, 0xcb, 0x40, 0x4b, 0x5c, 0xeb, 0xdb, 0xb0, 0x9a, 0x41, 0x10, + 0x77, 0x7c, 0x1c, 0x78, 0x3e, 0x4f, 0xb5, 0x99, 0xb7, 0xb3, 0xda, 0x43, 0xfe, 0x30, 0x0d, 0x37, + 0x7e, 0x2f, 0x41, 0x75, 0x9c, 0x6c, 0x14, 0xf5, 0x02, 0x37, 0xbd, 0xb7, 0x74, 0x13, 0x14, 0xde, + 0x09, 0xa6, 0x4a, 0x57, 0x9b, 0x50, 0x24, 0x2a, 0x3c, 0x9d, 0xe4, 0x7f, 0x1f, 0x0a, 0x86, 0xa4, + 0xfb, 0x95, 0x8b, 0x36, 0xe9, 0x9f, 0xc0, 0x22, 0xe3, 0xe8, 0x04, 0x57, 0x17, 0x66, 0xa9, 0xb3, + 0x90, 0xa8, 0x63, 0x0b, 0xb4, 0x7e, 0x0f, 0xde, 0x61, 0x38, 0x3e, 0x0d, 0x5c, 0x7c, 0x44, 0xc9, + 0x0f, 0x81, 0x57, 0x5d, 0x4c, 0xbb, 0x8f, 0x07, 0x0f, 0x2a, 0xc9, 0x19, 0x50, 0xf0, 0x68, 0xfc, + 0x55, 0x82, 0xad, 0x69, 0xa2, 0xe4, 0xa7, 0x40, 0x41, 0x56, 0x53, 0x93, 0xfd, 0x1a, 0x0a, 0x0e, + 0xcd, 0xf6, 0x5a, 0xb0, 0x29, 0x1a, 0xbb, 0x09, 0x65, 0xc9, 0xe0, 0x51, 0x57, 0x0a, 0x36, 0x0a, + 0xe8, 0xdf, 0x40, 0x25, 0x73, 0x77, 0xb4, 0xee, 0xf1, 0x75, 0xd4, 0x9b, 0x56, 0x9f, 0x70, 0x2d, + 0x1c, 0x9c, 0x54, 0xd1, 0xc5, 0x89, 0xf3, 0xb4, 0xf7, 0xdf, 0x3c, 0xcc, 0xb7, 0x99, 0xa7, 0x7f, + 0x0f, 0x4b, 0x63, 0xef, 0xbf, 0xf7, 0x94, 0xcf, 0xee, 0xf1, 0x37, 0x4c, 0xed, 0xc3, 0xb7, 0x00, + 0xe5, 0xfa, 0x3f, 0xd7, 0x60, 0xf3, 0x8d, 0xef, 0xa0, 0xfd, 0x29, 0xdd, 0xde, 0x54, 0x54, 0xfb, + 0xfc, 0x06, 0x45, 0xf9, 0x4a, 0x14, 0x56, 0x27, 0x1f, 0xa7, 0xcd, 0x29, 0x1d, 0x27, 0x90, 0xb5, + 0x07, 0x6f, 0x8b, 0xcc, 0x07, 0xfe, 0x04, 0xeb, 0xea, 0x3b, 0xf7, 0xa3, 0xd9, 0xad, 0x46, 0xe8, + 0xda, 0xc7, 0xd7, 0x41, 0x67, 0xc3, 0x6b, 0x8b, 0x3f, 0x27, 0x9f, 0x1a, 0xad, 0xc7, 0x2f, 0xcf, + 0xeb, 0xda, 0xab, 0xf3, 0xba, 0xf6, 0xfa, 0xbc, 0xae, 0xfd, 0x7b, 0x5e, 0xd7, 0x9e, 0x5f, 0xd4, + 0xe7, 0x5e, 0x5d, 0xd4, 0xe7, 0x5e, 0x5f, 0xd4, 0xe7, 0xbe, 0xdd, 0xf3, 0x02, 0xee, 0xf7, 0x3b, + 0xa6, 0x4b, 0x43, 0x2b, 0x19, 0xb2, 0x43, 0x30, 0xff, 0x91, 0xc6, 0x27, 0x96, 0xf2, 0x2b, 0x84, + 0x3f, 0x8b, 0x30, 0xeb, 0xdc, 0x4a, 0x3f, 0xa3, 0xf6, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x42, + 0x53, 0x34, 0x55, 0x3f, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1821,7 +1821,7 @@ func (m *MsgClaimMorseAccount) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MorseSignature", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1831,23 +1831,25 @@ func (m *MsgClaimMorseAccount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.MorseSignature = string(dAtA[iNdEx:postIndex]) + m.MorseSignature = append(m.MorseSignature[:0], dAtA[iNdEx:postIndex]...) + if m.MorseSignature == nil { + m.MorseSignature = []byte{} + } iNdEx = postIndex default: iNdEx = preIndex From 321c0c3b89730704c52ed14e25415edd4c615975 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 3 Mar 2025 10:05:24 +0100 Subject: [PATCH 68/81] test: refactor & cleanup testutils --- cmd/poktrolld/cmd/migrate/migrate_test.go | 51 ++++++++++--------- .../morse_account_import_and_claim_test.go | 2 +- testutil/integration/suites/migration.go | 3 +- testutil/testmigration/fixtures.go | 11 ++-- .../msg_server_claim_morse_acount_test.go | 2 +- 5 files changed, 36 insertions(+), 33 deletions(-) diff --git a/cmd/poktrolld/cmd/migrate/migrate_test.go b/cmd/poktrolld/cmd/migrate/migrate_test.go index 7fc11035c..b6623bde6 100644 --- a/cmd/poktrolld/cmd/migrate/migrate_test.go +++ b/cmd/poktrolld/cmd/migrate/migrate_test.go @@ -61,44 +61,47 @@ func TestCollectMorseAccounts(t *testing.T) { require.Equal(t, expectedMorseAccountState, actualMorseAccountState) } +// TestNewTestMorseStateExport exercises the NewTestMorseStateExport testutil function +// by using it to generate a MorseStateExport which contains an increasing number of +// accounts; verifying the number of accounts and their total balances and stakes of +// each MorseStateExport's (via transformMorseState). func TestNewTestMorseStateExport(t *testing.T) { - // DEV_NOTE: Beyond i=3, the naive method for calculating the expected Shannon accumulated actor stakes fails. - for i := 1; i < 4; i++ { - t.Run(fmt.Sprintf("num_accounts=%d", i), func(t *testing.T) { + for numAccounts := 1; numAccounts <= 10; numAccounts++ { + t.Run(fmt.Sprintf("num_accounts=%d", numAccounts), func(t *testing.T) { morseStateExport := new(migrationtypes.MorseStateExport) - stateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes(t, i) + stateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes(t, numAccounts) err := cmtjson.Unmarshal(stateExportBz, morseStateExport) require.NoError(t, err) exportAccounts := morseStateExport.AppState.Auth.Accounts - require.Equal(t, i, len(exportAccounts)) + require.Equal(t, numAccounts, len(exportAccounts)) + morseWorkspace := newMorseImportWorkspace() + err = transformMorseState(morseStateExport, morseWorkspace) + require.NoError(t, err) + + require.Equal(t, uint64(numAccounts), morseWorkspace.getNumAccounts()) + require.Equal(t, uint64(numAccounts), morseWorkspace.numApplications) + require.Equal(t, uint64(numAccounts), morseWorkspace.numSuppliers) + + // Sum numAccounts from previous iterations to get total number of accounts. numTotalAccounts := 1 - for k := i; k > 1; k-- { + for k := numAccounts; k > 1; k-- { numTotalAccounts += k } - // i=1 -> "100000001", i=2 -> "200000002": creates scaled balance with unique ID - expectedShannonAccountBalance := fmt.Sprintf("%d00000%d", i, i) + // numTotalAccounts=1 -> "100000001", numTotalAccounts=2 -> "200000002": creates scaled balance with unique ID + expectedShannonTotalUnstakedBalance := int64(1e6*numTotalAccounts + numTotalAccounts) - // n=5 -> "5000050": scales with total accounts plus unique suffix - expectedShannonTotalAppStake := fmt.Sprintf("%d000%d0", numTotalAccounts, numTotalAccounts) - - // n=5 -> "505000": different scaling pattern using same total accounts - expectedShannonTotalSupplierStake := fmt.Sprintf("%d0%d00", numTotalAccounts, numTotalAccounts) - - morseWorkspace := newMorseImportWorkspace() - err = transformMorseState(morseStateExport, morseWorkspace) - require.NoError(t, err) + // numTotalAccounts=5 -> "5000050": scales with total accounts plus unique suffix + expectedShannonTotalAppStake := int64(1e5*numTotalAccounts + (numTotalAccounts * 10)) - require.Equal(t, uint64(i), morseWorkspace.getNumAccounts()) - require.Equal(t, uint64(i), morseWorkspace.numApplications) - require.Equal(t, uint64(i), morseWorkspace.numSuppliers) + // numTotalAccounts=5 -> "505000": different scaling pattern using same total accounts + expectedShannonTotalSupplierStake := int64(1e4*numTotalAccounts + (numTotalAccounts * 100)) - morseAccounts := morseWorkspace.accountState.Accounts[i-1] - require.Equal(t, expectedShannonAccountBalance, morseAccounts.UnstakedBalance.Amount.String()) - require.Equal(t, expectedShannonTotalAppStake, morseWorkspace.accumulatedTotalAppStake.String()) - require.Equal(t, expectedShannonTotalSupplierStake, morseWorkspace.accumulatedTotalSupplierStake.String()) + require.Equal(t, expectedShannonTotalUnstakedBalance, morseWorkspace.accumulatedTotalBalance.Int64()) + require.Equal(t, expectedShannonTotalAppStake, morseWorkspace.accumulatedTotalAppStake.Int64()) + require.Equal(t, expectedShannonTotalSupplierStake, morseWorkspace.accumulatedTotalSupplierStake.Int64()) }) } } diff --git a/tests/integration/migration/morse_account_import_and_claim_test.go b/tests/integration/migration/morse_account_import_and_claim_test.go index dd418019c..6d87df5ae 100644 --- a/tests/integration/migration/morse_account_import_and_claim_test.go +++ b/tests/integration/migration/morse_account_import_and_claim_test.go @@ -82,7 +82,7 @@ func (s *MigrationModuleTestSuite) TestClaimMorseAccount() { require.NoError(s.T(), err) require.True(s.T(), shannonDestBalance.IsZero()) - morseSrcAddr, claimAccountRes := s.ClaimMorseAccount(s.T(), 1, shannonDestAddr) + morseSrcAddr, claimAccountRes := s.ClaimMorseAccount(s.T(), 0, shannonDestAddr) expectedMorseClaimableAccount := s.GetAccountState(s.T()).Accounts[0] expectedBalance := expectedMorseClaimableAccount.GetUnstakedBalance(). diff --git a/testutil/integration/suites/migration.go b/testutil/integration/suites/migration.go index 95a3b117e..156cc22ee 100644 --- a/testutil/integration/suites/migration.go +++ b/testutil/integration/suites/migration.go @@ -60,7 +60,6 @@ func (s *MigrationModuleSuite) ImportMorseClaimableAccounts(t *testing.T) *migra // ClaimMorseAccount claims the given MorseClaimableAccount by running a MsgClaimMorseAccount message. // It returns the expected Morse source address and the MsgClaimMorseAccountResponse. -// DEV_NOTE: morseAccountIdx is 1-based. func (s *MigrationModuleSuite) ClaimMorseAccount( t *testing.T, morseAccountIdx uint64, @@ -70,7 +69,7 @@ func (s *MigrationModuleSuite) ClaimMorseAccount( morsePrivateKey := testmigration.NewMorsePrivateKey(t, morseAccountIdx) expectedMorseSrcAddr = morsePrivateKey.PubKey().Address().String() - require.Equal(t, expectedMorseSrcAddr, s.accountState.Accounts[0].MorseSrcAddress) + require.Equal(t, expectedMorseSrcAddr, s.accountState.Accounts[morseAccountIdx].MorseSrcAddress) morseClaimMsg, err := migrationtypes.NewMsgClaimMorseAccount( shannonDestAddr, diff --git a/testutil/testmigration/fixtures.go b/testutil/testmigration/fixtures.go index 5c4c26393..18b9ab6fb 100644 --- a/testutil/testmigration/fixtures.go +++ b/testutil/testmigration/fixtures.go @@ -71,12 +71,13 @@ func NewMorseStateExportAndAccountState( Accounts: make([]*migrationtypes.MorseClaimableAccount, numAccounts), } - for i := 1; i < numAccounts+1; i++ { + for i := 0; i < numAccounts; i++ { privKey := NewMorsePrivateKey(t, uint64(i)) pubKey := privKey.PubKey() - balanceAmount := int64(1e6*i + i) // i_000_00i - appStakeAmount := int64(1e5*i + (i * 10)) // i00_0i0 - supplierStakeAmount := int64(1e4*i + (i * 100)) // i0_i00 + j := i + 1 + balanceAmount := int64(1e6*j + j) // j_000_00j + appStakeAmount := int64(1e5*j + (j * 10)) // j00_0j0 + supplierStakeAmount := int64(1e4*j + (j * 100)) // j0_j00 // Add an account. morseStateExport.AppState.Auth.Accounts = append( @@ -120,7 +121,7 @@ func NewMorseStateExportAndAccountState( ) // Add the account to the morseAccountState. - morseAccountState.Accounts[i-1] = &migrationtypes.MorseClaimableAccount{ + morseAccountState.Accounts[i] = &migrationtypes.MorseClaimableAccount{ MorseSrcAddress: pubKey.Address().String(), PublicKey: pubKey.Bytes(), UnstakedBalance: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, balanceAmount), diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go index 74ad4b17d..fd7eefaec 100644 --- a/x/migration/keeper/msg_server_claim_morse_acount_test.go +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -42,7 +42,7 @@ func TestMsgServer_ClaimMorseAccount_Success(t *testing.T) { // Claim each MorseClaimableAccount. for morseAccountIdx, morseAccount := range accountState.Accounts { // Generate the corresponding morse private key using the account slice index as a seed. - morsePrivKey := testmigration.NewMorsePrivateKey(t, uint64(morseAccountIdx+1)) + morsePrivKey := testmigration.NewMorsePrivateKey(t, uint64(morseAccountIdx)) // Claim the MorseClaimableAccount. msgClaim, err := migrationtypes.NewMsgClaimMorseAccount( From 9ed6a36e1f9c7e1d171bb63c5fc940c86859b189 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Mar 2025 11:38:09 +0100 Subject: [PATCH 69/81] refactor: MorseStateExport & MorseClaimableAccount fixtures --- cmd/poktrolld/cmd/migrate/migrate_test.go | 54 ++-- testutil/integration/suites/migration.go | 2 +- testutil/testmigration/fixtures.go | 247 +++++++++++++----- .../msg_server_claim_morse_acount_test.go | 17 +- ...er_import_morse_claimable_accounts_test.go | 6 +- .../types/message_claim_morse_account_test.go | 2 +- 6 files changed, 233 insertions(+), 95 deletions(-) diff --git a/cmd/poktrolld/cmd/migrate/migrate_test.go b/cmd/poktrolld/cmd/migrate/migrate_test.go index b6623bde6..3388301fa 100644 --- a/cmd/poktrolld/cmd/migrate/migrate_test.go +++ b/cmd/poktrolld/cmd/migrate/migrate_test.go @@ -32,7 +32,7 @@ func TestCollectMorseAccounts(t *testing.T) { require.NoError(t, err) // Generate and write the MorseStateExport input JSON file. - morseStateExportBz, morseAccountStateBz := testmigration.NewMorseStateExportAndAccountStateBytes(t, 10) + morseStateExportBz, morseAccountStateBz := testmigration.NewMorseStateExportAndAccountStateBytes(t, 10, testmigration.EquallyDistributedMorseAccountStakeState) _, err = inputFile.Write(morseStateExportBz) require.NoError(t, err) @@ -69,7 +69,7 @@ func TestNewTestMorseStateExport(t *testing.T) { for numAccounts := 1; numAccounts <= 10; numAccounts++ { t.Run(fmt.Sprintf("num_accounts=%d", numAccounts), func(t *testing.T) { morseStateExport := new(migrationtypes.MorseStateExport) - stateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes(t, numAccounts) + stateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes(t, numAccounts, testmigration.EquallyDistributedMorseAccountStakeState) err := cmtjson.Unmarshal(stateExportBz, morseStateExport) require.NoError(t, err) @@ -80,24 +80,40 @@ func TestNewTestMorseStateExport(t *testing.T) { err = transformMorseState(morseStateExport, morseWorkspace) require.NoError(t, err) - require.Equal(t, uint64(numAccounts), morseWorkspace.getNumAccounts()) - require.Equal(t, uint64(numAccounts), morseWorkspace.numApplications) - require.Equal(t, uint64(numAccounts), morseWorkspace.numSuppliers) - - // Sum numAccounts from previous iterations to get total number of accounts. - numTotalAccounts := 1 - for k := numAccounts; k > 1; k-- { - numTotalAccounts += k + // Construct account number expectations based on equal distribution of unstaked, app, and supplier accounts. + expectedNumApps := numAccounts / 3 + expectedNumSuppliers := numAccounts / 3 + switch (numAccounts - 1) % 3 { + case 1: + expectedNumApps++ } + t.Logf("numAccounts: %d; expectedNumApps: %d; expectedNumSuppliers: %d", numAccounts, expectedNumApps, expectedNumSuppliers) - // numTotalAccounts=1 -> "100000001", numTotalAccounts=2 -> "200000002": creates scaled balance with unique ID - expectedShannonTotalUnstakedBalance := int64(1e6*numTotalAccounts + numTotalAccounts) - - // numTotalAccounts=5 -> "5000050": scales with total accounts plus unique suffix - expectedShannonTotalAppStake := int64(1e5*numTotalAccounts + (numTotalAccounts * 10)) - - // numTotalAccounts=5 -> "505000": different scaling pattern using same total accounts - expectedShannonTotalSupplierStake := int64(1e4*numTotalAccounts + (numTotalAccounts * 100)) + // Assert the number of accounts and staked actors matches expectations. + require.Equal(t, uint64(numAccounts), morseWorkspace.getNumAccounts()) + require.Equal(t, uint64(expectedNumApps), morseWorkspace.numApplications) + require.Equal(t, uint64(expectedNumSuppliers), morseWorkspace.numSuppliers) + + // Compute expected totals for unstaked balance, application stake, and supplier stake, for all MorseClaimableAccounts. + var expectedShannonTotalUnstakedBalance, + expectedShannonTotalAppStake, + expectedShannonTotalSupplierStake int64 + + for i := 0; i < numAccounts; i++ { + expectedShannonTotalUnstakedBalance += testmigration.GenMorseUnstakedBalanceAmount(uint64(i)) + + morseAccountStakeState := testmigration.EquallyDistributedMorseAccountStakeState(uint64(i)) + switch morseAccountStakeState { + case testmigration.MorseUnstakedActor: + // No-op. + case testmigration.MorseApplicationActor: + expectedShannonTotalAppStake += testmigration.GenMorseApplicationStakeAmount(uint64(i)) + case testmigration.MorseSupplierActor: + expectedShannonTotalSupplierStake += testmigration.GenMorseSupplierStakeAmount(uint64(i)) + default: + t.Fatalf("unknown morse account stake state: %q", morseAccountStakeState) + } + } require.Equal(t, expectedShannonTotalUnstakedBalance, morseWorkspace.accumulatedTotalBalance.Int64()) require.Equal(t, expectedShannonTotalAppStake, morseWorkspace.accumulatedTotalAppStake.Int64()) @@ -110,7 +126,7 @@ func BenchmarkTransformMorseState(b *testing.B) { for i := 0; i < 5; i++ { numAccounts := int(math.Pow10(i + 1)) morseStateExport := new(migrationtypes.MorseStateExport) - morseStateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes(b, numAccounts) + morseStateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes(b, numAccounts, testmigration.EquallyDistributedMorseAccountStakeState) err := cmtjson.Unmarshal(morseStateExportBz, morseStateExport) require.NoError(b, err) diff --git a/testutil/integration/suites/migration.go b/testutil/integration/suites/migration.go index 156cc22ee..0159574c3 100644 --- a/testutil/integration/suites/migration.go +++ b/testutil/integration/suites/migration.go @@ -67,7 +67,7 @@ func (s *MigrationModuleSuite) ClaimMorseAccount( ) (expectedMorseSrcAddr string, _ *migrationtypes.MsgClaimMorseAccountResponse) { t.Helper() - morsePrivateKey := testmigration.NewMorsePrivateKey(t, morseAccountIdx) + morsePrivateKey := testmigration.GenMorsePrivateKey(t, morseAccountIdx) expectedMorseSrcAddr = morsePrivateKey.PubKey().Address().String() require.Equal(t, expectedMorseSrcAddr, s.accountState.Accounts[morseAccountIdx].MorseSrcAddress) diff --git a/testutil/testmigration/fixtures.go b/testutil/testmigration/fixtures.go index 18b9ab6fb..9c03deeae 100644 --- a/testutil/testmigration/fixtures.go +++ b/testutil/testmigration/fixtures.go @@ -14,9 +14,37 @@ import ( migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) -// TODO_CONSIDERATION/TODO_IMPROVE: Generate more "realistic" fixtures. -// I.e.: Non-actor accounts, applications, and suppliers. -// See: https://github.com/pokt-network/poktroll/pull/1072#discussion_r1961769422 +// MorseAccountActorType is an enum which represents all possible staked and +// unstaked actor types which are considered in the migration module. +type MorseAccountActorType string + +const ( + MorseUnstakedActor = MorseAccountActorType("unstaked") + MorseApplicationActor = MorseAccountActorType("application") + MorseSupplierActor = MorseAccountActorType("supplier") +) + +// MorseAccountStakeStateDistributionFn is a function which returns a MorseStakeState +// derived from the given index. It is intended to be used in conjunction with +// MorseStateExport and MorseAccountState fixture generation logic. +type MorseAccountStakeStateDistributionFn func(index uint64) MorseAccountActorType + +// EquallyDistributedMorseAccountStakeState cyclically returns each MorseAccountActorType, one after the other, as the index increases. +func EquallyDistributedMorseAccountStakeState(index uint64) MorseAccountActorType { + switch index % 3 { + case 0: + return MorseUnstakedActor + case 1: + return MorseApplicationActor + default: + return MorseSupplierActor + } +} + +// AllUnstakedMorseAccountStakeState returns MorseUnstakedActor for every index. +func AllUnstakedMorseAccountStakeState(_ uint64) MorseAccountActorType { + return MorseUnstakedActor +} // NewMorseStateExportAndAccountStateBytes returns: // - A serialized MorseStateExport. @@ -29,13 +57,13 @@ import ( // The states are populated with: // - Random account addresses // - Monotonically increasing balances/stakes -// - One application per account -// - One supplier per account +// - Unstaked, application, supplier accounts are distributed according to the given distribution function. func NewMorseStateExportAndAccountStateBytes( t gocuke.TestingT, numAccounts int, + distributionFn MorseAccountStakeStateDistributionFn, ) (morseStateExportBz []byte, morseAccountStateBz []byte) { - morseStateExport, morseAccountState := NewMorseStateExportAndAccountState(t, numAccounts) + morseStateExport, morseAccountState := NewMorseStateExportAndAccountState(t, numAccounts, distributionFn) var err error morseStateExportBz, err = cmtjson.Marshal(morseStateExport) @@ -49,12 +77,13 @@ func NewMorseStateExportAndAccountStateBytes( // NewMorseStateExportAndAccountState returns MorseStateExport and MorseAccountState // structs populated with: -// - Random account addresses -// - Monotonically increasing balances/stakes -// - One application per account -// - One supplier per account +// - Random account addresses +// - Monotonically increasing balances/stakes +// - Unstaked, application, supplier accounts are distributed according to the given distribution function. func NewMorseStateExportAndAccountState( - t gocuke.TestingT, numAccounts int, + t gocuke.TestingT, + numAccounts int, + distributionFn MorseAccountStakeStateDistributionFn, ) (export *migrationtypes.MorseStateExport, state *migrationtypes.MorseAccountState) { t.Helper() @@ -72,71 +101,47 @@ func NewMorseStateExportAndAccountState( } for i := 0; i < numAccounts; i++ { - privKey := NewMorsePrivateKey(t, uint64(i)) - pubKey := privKey.PubKey() - j := i + 1 - balanceAmount := int64(1e6*j + j) // j_000_00j - appStakeAmount := int64(1e5*j + (j * 10)) // j00_0j0 - supplierStakeAmount := int64(1e4*j + (j * 100)) // j0_j00 - - // Add an account. + morseAccountStakeState := distributionFn(uint64(i)) + switch morseAccountStakeState { + case MorseUnstakedActor: + // No-op. + case MorseApplicationActor: + // Add an application. + morseStateExport.AppState.Application.Applications = append( + morseStateExport.AppState.Application.Applications, + GenMorseApplication(t, uint64(i)), + ) + case MorseSupplierActor: + // Add a supplier. + // In Morse, a node (aka a Service) is a Shannon supplier. + // In Morse, Validators are, by default, the top 1000 staked nodes. + morseStateExport.AppState.Pos.Validators = append( + morseStateExport.AppState.Pos.Validators, + GenMorseValidator(t, uint64(i)), + ) + default: + panic(fmt.Sprintf("unknown morse account stake state %q", morseAccountStakeState)) + } + + // Add an account (regardless of whether it is staked or not). + // All MorseClaimableAccount fixtures get an unstaked balance. morseStateExport.AppState.Auth.Accounts = append( morseStateExport.AppState.Auth.Accounts, &migrationtypes.MorseAuthAccount{ - Type: "posmint/Account", - Value: &migrationtypes.MorseAccount{ - Address: pubKey.Address(), - Coins: cosmostypes.NewCoins(cosmostypes.NewInt64Coin(volatile.DenomuPOKT, balanceAmount)), - PubKey: &migrationtypes.MorsePublicKey{ - Value: pubKey.Bytes(), - }, - }, - }, - ) - - // Add an application. - morseStateExport.AppState.Application.Applications = append( - morseStateExport.AppState.Application.Applications, - &migrationtypes.MorseApplication{ - Address: pubKey.Address(), - PublicKey: pubKey.Bytes(), - Jailed: false, - Status: 2, - StakedTokens: fmt.Sprintf("%d", appStakeAmount), - }, - ) - - // Add a supplier. - // In Morse, a node (aka a Service) is a Shannon supplier. - // In Morse, Validators are, by default, the top 1000 staked nodes. - morseStateExport.AppState.Pos.Validators = append( - morseStateExport.AppState.Pos.Validators, - &migrationtypes.MorseValidator{ - Address: pubKey.Address(), - PublicKey: pubKey.Bytes(), - Jailed: false, - Status: 2, - StakedTokens: fmt.Sprintf("%d", supplierStakeAmount), + Type: "posmint/Account", + Value: GenMorseAccount(t, uint64(i)), }, ) // Add the account to the morseAccountState. - morseAccountState.Accounts[i] = &migrationtypes.MorseClaimableAccount{ - MorseSrcAddress: pubKey.Address().String(), - PublicKey: pubKey.Bytes(), - UnstakedBalance: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, balanceAmount), - SupplierStake: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, supplierStakeAmount), - ApplicationStake: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, appStakeAmount), - // ShannonDestAddress: (intentionally omitted). - // ClaimedAtHeight: (intentionally omitted) - } + morseAccountState.Accounts[i] = GenMorseClaimableAccount(t, uint64(i), distributionFn) } return morseStateExport, morseAccountState } -// NewMorsePrivateKey creates a new ed25519 private key from the given seed. -func NewMorsePrivateKey(t gocuke.TestingT, seed uint64) cometcrypto.PrivKey { +// GenMorsePrivateKey creates a new ed25519 private key from the given seed. +func GenMorsePrivateKey(t gocuke.TestingT, seed uint64) cometcrypto.PrivKey { t.Helper() seedBz := make([]byte, 8) @@ -144,3 +149,117 @@ func NewMorsePrivateKey(t gocuke.TestingT, seed uint64) cometcrypto.PrivKey { return cometcrypto.GenPrivKeyFromSecret(seedBz) } + +// GenMorseUnstakedBalanceAmount returns an amount by applying the given index to +// a pattern such that the generated amount is unique to the unstaked balance +// (as opposed to actor stake(s)) and the given index. +func GenMorseUnstakedBalanceAmount(index uint64) int64 { + index++ + return int64(1e6*index + index) // idx_000_00i +} + +// GenMorseSupplierStakeAmount returns an amount by applying the given index to +// a pattern such that the generated amount is unique to the supplier stake +// (as opposed to the unstaked balance or application stake) and the given index. +func GenMorseSupplierStakeAmount(index uint64) int64 { + index++ + return int64(1e4*index + (index * 100)) // idx0_j00 +} + +// GenMorseApplicationStakeAmount returns an amount by applying the given index to +// a pattern such that the generated amount is unique to the application stake +// (as opposed to the unstaked balance or supplier stake) and the given index. +func GenMorseApplicationStakeAmount(index uint64) int64 { + index++ + return int64(1e5*index + (index * 10)) // j00_0j0 +} + +// GenMorseAccount returns a new MorseAccount fixture. The given index is used +// to deterministically generate the account's address and unstaked balance. +func GenMorseAccount(t gocuke.TestingT, index uint64) *migrationtypes.MorseAccount { + privKey := GenMorsePrivateKey(t, index) + pubKey := privKey.PubKey() + unstakedBalanceAmount := GenMorseUnstakedBalanceAmount(index) + unstakedBalance := cosmostypes.NewInt64Coin(volatile.DenomuPOKT, unstakedBalanceAmount) + + return &migrationtypes.MorseAccount{ + Address: pubKey.Address(), + Coins: cosmostypes.NewCoins(unstakedBalance), + PubKey: &migrationtypes.MorsePublicKey{ + Value: pubKey.Bytes(), + }, + } +} + +// GenMorseApplication returns a new MorseApplication fixture. The given index is used +// to deterministically generate the application's address and staked tokens. +func GenMorseApplication(t gocuke.TestingT, idx uint64) *migrationtypes.MorseApplication { + privKey := GenMorsePrivateKey(t, idx) + pubKey := privKey.PubKey() + stakeAmount := GenMorseApplicationStakeAmount(idx) + + return &migrationtypes.MorseApplication{ + Address: pubKey.Address(), + PublicKey: pubKey.Bytes(), + Jailed: false, + Status: 2, + StakedTokens: fmt.Sprintf("%d", stakeAmount), + } +} + +// GenMorseValidator returns a new MorseValidator fixture. The given index is used +// to deterministically generate the validator's address and staked tokens. +func GenMorseValidator(t gocuke.TestingT, idx uint64) *migrationtypes.MorseValidator { + privKey := GenMorsePrivateKey(t, idx) + pubKey := privKey.PubKey() + stakeAmount := GenMorseSupplierStakeAmount(idx) + + return &migrationtypes.MorseValidator{ + Address: pubKey.Address(), + PublicKey: pubKey.Bytes(), + Jailed: false, + Status: 2, + StakedTokens: fmt.Sprintf("%d", stakeAmount), + } +} + +// GenMorseClaimableAccount returns a new MorseClaimableAccount fixture. The given index is used +// to deterministically generate the account's address and staked tokens. The given distribution +// function is used to determine the account's actor type (and stake if applicable). +func GenMorseClaimableAccount( + t gocuke.TestingT, + index uint64, + distributionFn func(uint64) MorseAccountActorType, +) *migrationtypes.MorseClaimableAccount { + require.NotNil(t, distributionFn) + + var appStakeAmount, + supplierStakeAmount int64 + privKey := GenMorsePrivateKey(t, index) + pubKey := privKey.PubKey() + + morseAccountActorType := distributionFn(index) + switch morseAccountActorType { + case MorseUnstakedActor: + // No-op. + case MorseApplicationActor: + appStakeAmount = GenMorseApplicationStakeAmount(index) + case MorseSupplierActor: + supplierStakeAmount = GenMorseSupplierStakeAmount(index) + default: + t.Fatalf("unknown morse account stake state %q", morseAccountActorType) + } + + // All MorseClaimableAccount fixtures get an unstaked balance. + unstakedBalanceAmount := GenMorseUnstakedBalanceAmount(index) + + return &migrationtypes.MorseClaimableAccount{ + MorseSrcAddress: pubKey.Address().String(), + PublicKey: pubKey.Bytes(), + UnstakedBalance: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, unstakedBalanceAmount), + SupplierStake: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, supplierStakeAmount), + ApplicationStake: cosmostypes.NewInt64Coin(volatile.DenomuPOKT, appStakeAmount), + // ShannonDestAddress: (intentionally omitted). + // ClaimedAtHeight: (intentionally omitted) + } +} diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go index fd7eefaec..6ea15f3c7 100644 --- a/x/migration/keeper/msg_server_claim_morse_acount_test.go +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -28,7 +28,7 @@ func TestMsgServer_ClaimMorseAccount_Success(t *testing.T) { // Generate and import Morse claimable accounts. numAccounts := 6 - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts) + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.AllUnstakedMorseAccountStakeState) accountStateHash, err := accountState.GetHash() require.NoError(t, err) @@ -39,10 +39,10 @@ func TestMsgServer_ClaimMorseAccount_Success(t *testing.T) { }) require.NoError(t, err) - // Claim each MorseClaimableAccount. + // Claim each MorseClaimableAccount (all of which SHOULD NOT be staked as onchain actor). for morseAccountIdx, morseAccount := range accountState.Accounts { // Generate the corresponding morse private key using the account slice index as a seed. - morsePrivKey := testmigration.NewMorsePrivateKey(t, uint64(morseAccountIdx)) + morsePrivKey := testmigration.GenMorsePrivateKey(t, uint64(morseAccountIdx)) // Claim the MorseClaimableAccount. msgClaim, err := migrationtypes.NewMsgClaimMorseAccount( @@ -97,9 +97,12 @@ func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { k, ctx := keepertest.MigrationKeeper(t) srv := keeper.NewMsgServerImpl(k) - // Generate and import a Morse claimable account. - numAccounts := 1 - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts) + // Generate and import a set of Morse claimable accounts: + // - One unstaked + // - One staked as an application + // - One staked as a supplier + numAccounts := 3 + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.EquallyDistributedMorseAccountStakeState) accountStateHash, err := accountState.GetHash() require.NoError(t, err) @@ -111,7 +114,7 @@ func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { require.NoError(t, err) // Generate the corresponding morse private key using the account slice index as a seed. - morsePrivKey := testmigration.NewMorsePrivateKey(t, 0) + morsePrivKey := testmigration.GenMorsePrivateKey(t, 0) // Claim the MorseClaimableAccount with a random Shannon address. msgClaim, err := migrationtypes.NewMsgClaimMorseAccount( diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go index e2ab7e96e..a12dbe52d 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go @@ -21,7 +21,7 @@ func TestMsgServer_ImportMorseClaimableAccounts_Success(t *testing.T) { srv := keeper.NewMsgServerImpl(k) numAccounts := 10 - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts) + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.EquallyDistributedMorseAccountStakeState) // Assert that the MorseAccountState is not set initially. morseClaimableAccounts := k.GetAllMorseClaimableAccounts(ctx) @@ -76,7 +76,7 @@ func TestMsgServer_ImportMorseClaimableAccounts_ErrorAlreadySet(t *testing.T) { srv := keeper.NewMsgServerImpl(k) // Set at least one MorseAccountState initially. - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, 1) + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, 1, testmigration.EquallyDistributedMorseAccountStakeState) k.SetMorseClaimableAccount(ctx, *accountState.Accounts[0]) // Set up the MsgImportMorseClaimableAccounts to fail. @@ -105,7 +105,7 @@ func TestMsgServer_ImportMorseClaimableAccounts_ErrorInvalidAuthority(t *testing srv := keeper.NewMsgServerImpl(k) numAccounts := 10 - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts) + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.EquallyDistributedMorseAccountStakeState) msgImportMorseClaimableAccounts, err := migrationtypes.NewMsgImportMorseClaimableAccounts( authtypes.NewModuleAddress("invalid_authority").String(), diff --git a/x/migration/types/message_claim_morse_account_test.go b/x/migration/types/message_claim_morse_account_test.go index 2d4ca8b85..fae2f7bdf 100644 --- a/x/migration/types/message_claim_morse_account_test.go +++ b/x/migration/types/message_claim_morse_account_test.go @@ -78,7 +78,7 @@ func TestMsgClaimMorseAccount_ValidateBasic(t *testing.T) { } func TestMsgClaimMorseAccount_ValidateMorseSignature(t *testing.T) { - morsePrivKey := testmigration.NewMorsePrivateKey(t, 0) + morsePrivKey := testmigration.GenMorsePrivateKey(t, 0) morsePublicKey := morsePrivKey.PubKey() t.Run("invalid Morse signature", func(t *testing.T) { From 3678306398a6af353e8d70f5d8e22e8db4a17323 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Mar 2025 11:38:31 +0100 Subject: [PATCH 70/81] chore: review feedback improvements --- proto/poktroll/migration/event.proto | 2 +- .../keeper/msg_server_claim_morse_account.go | 35 ++++++++--- .../msg_server_claim_morse_acount_test.go | 59 ++++++++++++++++++- 3 files changed, 84 insertions(+), 12 deletions(-) diff --git a/proto/poktroll/migration/event.proto b/proto/poktroll/migration/event.proto index 4f1f51a8b..897cbdce8 100644 --- a/proto/poktroll/migration/event.proto +++ b/proto/poktroll/migration/event.proto @@ -29,7 +29,7 @@ message EventMorseAccountClaimed { // The height (on Shannon) at which the claim was executed (i.e. claimed). int64 claimed_at_height = 1 [(gogoproto.jsontag) = "claimed_at_height"]; - // The balance which was claimed. + // The unstaked balance which was claimed. cosmos.base.v1beta1.Coin claimed_balance = 2 [(gogoproto.jsontag) = "claimed_balance", (gogoproto.nullable) = false]; // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. diff --git a/x/migration/keeper/msg_server_claim_morse_account.go b/x/migration/keeper/msg_server_claim_morse_account.go index 27c60bef7..129d05b44 100644 --- a/x/migration/keeper/msg_server_claim_morse_account.go +++ b/x/migration/keeper/msg_server_claim_morse_account.go @@ -66,14 +66,33 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms morseClaimableAccount, ) - // Add any actor stakes to the account balance because we're not creating - // a shannon actor (i.e. not a re-stake claim). - totalTokens := morseClaimableAccount.UnstakedBalance. - Add(morseClaimableAccount.ApplicationStake). - Add(morseClaimableAccount.SupplierStake) + // ONLY allow claiming as a non-actor account if the MorseClaimableAccount + // was NOT staked as an application or supplier. A claim of staked POKT from + // Morse to Shannon SHOULD NOT allow applications or suppliers to bypass the + // onchain unbonding period. + if !morseClaimableAccount.ApplicationStake.IsZero() { + return nil, status.Error( + codes.FailedPrecondition, + migrationtypes.ErrMorseAccountClaim.Wrapf( + "Morse account %q is staked as an application, please use `poktrolld migrate claim-application` instead", + morseClaimableAccount.GetMorseSrcAddress(), + ).Error(), + ) + } + + if !morseClaimableAccount.SupplierStake.IsZero() { + return nil, status.Error( + codes.FailedPrecondition, + migrationtypes.ErrMorseAccountClaim.Wrapf( + "Morse account %q is staked as an supplier, please use `poktrolld migrate claim-supplier` instead", + morseClaimableAccount.GetMorseSrcAddress(), + ).Error(), + ) + } // Mint the totalTokens to the shannonDestAddress account balance. - if err := k.MintClaimedMorseTokens(ctx, shannonAccAddr, totalTokens); err != nil { + unstakedBalance := morseClaimableAccount.UnstakedBalance + if err := k.MintClaimedMorseTokens(ctx, shannonAccAddr, unstakedBalance); err != nil { return nil, status.Error(codes.Internal, err.Error()) } @@ -82,7 +101,7 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms ClaimedAtHeight: sdkCtx.BlockHeight(), ShannonDestAddress: msg.ShannonDestAddress, MorseSrcAddress: msg.MorseSrcAddress, - ClaimedBalance: totalTokens, + ClaimedBalance: unstakedBalance, } if err := sdkCtx.EventManager().EmitTypedEvent(&event); err != nil { return nil, status.Error( @@ -97,7 +116,7 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms return &migrationtypes.MsgClaimMorseAccountResponse{ MorseSrcAddress: msg.MorseSrcAddress, - ClaimedBalance: totalTokens, + ClaimedBalance: unstakedBalance, ClaimedAtHeight: sdkCtx.BlockHeight(), }, nil } diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go index 6ea15f3c7..a1ad708a0 100644 --- a/x/migration/keeper/msg_server_claim_morse_acount_test.go +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -52,9 +52,6 @@ func TestMsgServer_ClaimMorseAccount_Success(t *testing.T) { ) require.NoError(t, err) - err = msgClaim.SignMsgClaimMorseAccount(morsePrivKey) - require.NoError(t, err) - msgClaimRes, err := srv.ClaimMorseAccount(ctx, msgClaim) require.NoError(t, err) @@ -197,4 +194,60 @@ func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { _, err := srv.ClaimMorseAccount(ctx, msgClaim) require.EqualError(t, err, expectedErr.Error()) }) + + t.Run("account is staked as an application", func(t *testing.T) { + morseAccountStakedAppIdx := uint64(1) + morseAccount := accountState.Accounts[morseAccountStakedAppIdx] + morseSrcAddress := morseAccount.GetMorseSrcAddress() + + // Generate a key which corresponds to the first account which is staked as an application. + morsePrivKey := testmigration.GenMorsePrivateKey(t, morseAccountStakedAppIdx) + require.False(t, morseAccount.ApplicationStake.IsZero()) + + msgClaim, err = migrationtypes.NewMsgClaimMorseAccount( + sample.AccAddress(), + morseAccount.GetMorseSrcAddress(), + morsePrivKey, + ) + require.NoError(t, err) + + expectedErr := status.Error( + codes.FailedPrecondition, + migrationtypes.ErrMorseAccountClaim.Wrapf( + "Morse account %q is staked as an application, please use `poktrolld migrate claim-application` instead", + morseSrcAddress, + ).Error(), + ) + + _, err := srv.ClaimMorseAccount(ctx, msgClaim) + require.EqualError(t, err, expectedErr.Error()) + }) + + t.Run("account is staked as a supplier", func(t *testing.T) { + morseAccountStakedSupplierIdx := uint64(2) + morseAccount := accountState.Accounts[morseAccountStakedSupplierIdx] + morseSrcAddress := morseAccount.GetMorseSrcAddress() + + // Generate a key which corresponds to the first account which is staked as a supplier. + morsePrivKey := testmigration.GenMorsePrivateKey(t, morseAccountStakedSupplierIdx) + require.False(t, morseAccount.SupplierStake.IsZero()) + + msgClaim, err = migrationtypes.NewMsgClaimMorseAccount( + sample.AccAddress(), + morseSrcAddress, + morsePrivKey, + ) + require.NoError(t, err) + + expectedErr := status.Error( + codes.FailedPrecondition, + migrationtypes.ErrMorseAccountClaim.Wrapf( + "Morse account %q is staked as an supplier, please use `poktrolld migrate claim-supplier` instead", + morseSrcAddress, + ).Error(), + ) + + _, err := srv.ClaimMorseAccount(ctx, msgClaim) + require.EqualError(t, err, expectedErr.Error()) + }) } From 6c29d2a575eaf314f18d3463ca2307bce98676c8 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Mar 2025 12:09:06 +0100 Subject: [PATCH 71/81] chore: review feedback improvements --- testutil/integration/suites/migration.go | 2 +- testutil/keeper/migration.go | 98 ++++++++++++++++--- .../msg_server_claim_morse_acount_test.go | 10 +- 3 files changed, 89 insertions(+), 21 deletions(-) diff --git a/testutil/integration/suites/migration.go b/testutil/integration/suites/migration.go index 0159574c3..4643dd395 100644 --- a/testutil/integration/suites/migration.go +++ b/testutil/integration/suites/migration.go @@ -30,7 +30,7 @@ type MigrationModuleSuite struct { // It updates the suite's #numMorseClaimableAccounts and #accountState fields. func (s *MigrationModuleSuite) GenerateMorseAccountState(t *testing.T, numAccounts int) { s.numMorseClaimableAccounts = numAccounts - _, s.accountState = testmigration.NewMorseStateExportAndAccountState(t, s.numMorseClaimableAccounts) + _, s.accountState = testmigration.NewMorseStateExportAndAccountState(t, s.numMorseClaimableAccounts, testmigration.EquallyDistributedMorseAccountStakeState) } // GetAccountState returns the suite's #accountState field. diff --git a/testutil/keeper/migration.go b/testutil/keeper/migration.go index 400bcedf3..0549cb5c0 100644 --- a/testutil/keeper/migration.go +++ b/testutil/keeper/migration.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" "testing" "cosmossdk.io/log" @@ -13,12 +14,13 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" - sdk "github.com/cosmos/cosmos-sdk/types" + cosmostypes "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" + "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/testutil/migration/mocks" "github.com/pokt-network/poktroll/x/migration/keeper" migrationtypes "github.com/pokt-network/poktroll/x/migration/types" @@ -39,7 +41,7 @@ type MigrationKeeperOptionFn func(cfg *MigrationKeeperConfig) func MigrationKeeper( t testing.TB, opts ...MigrationKeeperOptionFn, -) (keeper.Keeper, sdk.Context) { +) (keeper.Keeper, cosmostypes.Context) { storeKey := storetypes.NewKVStoreKey(migrationtypes.StoreKey) db := dbm.NewMemDB() @@ -68,7 +70,7 @@ func MigrationKeeper( cfg.bankKeeper, ) - ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) + ctx := cosmostypes.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) // Initialize params if err := k.SetParams(ctx, migrationtypes.DefaultParams()); err != nil { @@ -85,28 +87,94 @@ func WithBankKeeper(bankKeeper migrationtypes.BankKeeper) MigrationKeeperOptionF } } +// defaultConfigWithMocks returns a MigrationKeeperConfig with a mocked bank keeper +// which respond the following methods by updating mapAccAddrCoins accordingly: +// - SpendableCoins +// - MintCoins +// - SendCoinsFromModuleToAccount func defaultConfigWithMocks(ctrl *gomock.Controller) *MigrationKeeperConfig { mockBankKeeper := mocks.NewMockBankKeeper(ctrl) mockBankKeeper.EXPECT(). SpendableCoins(gomock.Any(), gomock.Any()). - DoAndReturn( - func(ctx context.Context, addr sdk.AccAddress) sdk.Coins { - mapMu.RLock() - defer mapMu.RUnlock() - if coins, ok := mapAccAddrCoins[addr.String()]; ok { - return coins - } - return sdk.Coins{} - }, - ).AnyTimes() + DoAndReturn(mockBankKeeperSpendableCoins).AnyTimes() mockBankKeeper.EXPECT(). MintCoins(gomock.Any(), gomock.Any(), gomock.Any()). - AnyTimes() + DoAndReturn(mockBankKeeperMintCoins).AnyTimes() mockBankKeeper.EXPECT(). SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). - AnyTimes() + DoAndReturn(mockBankKeeperSendFromModuleToAccount).AnyTimes() return &MigrationKeeperConfig{ bankKeeper: mockBankKeeper, } } + +// mockBankKeeperSpendableCoins implements a static version of the corresponding bank +// keeper method that interacts with an in-memory map of account addresses to balances. +func mockBankKeeperSpendableCoins(_ context.Context, addr cosmostypes.AccAddress) cosmostypes.Coins { + mapMu.RLock() + defer mapMu.RUnlock() + if coins, ok := mapAccAddrCoins[addr.String()]; ok { + return coins + } + return cosmostypes.Coins{} +} + +// mockBankKeeperMintCoins implements a static version of the corresponding bank +// keeper method that interacts with an in-memory map of account addresses to balances. +func mockBankKeeperMintCoins( + _ context.Context, + moduleName string, + mintCoins cosmostypes.Coins) error { + mapMu.Lock() + defer mapMu.Unlock() + moduleAddr := authtypes.NewModuleAddress(moduleName) + + // Check for an existing balance + balance, ok := mapAccAddrCoins[moduleAddr.String()] + if !ok { + balance = cosmostypes.NewCoins(cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 0)) + } + + balance = balance.Add(mintCoins...) + + // Update the balance. + mapAccAddrCoins[moduleAddr.String()] = balance + + return nil +} + +// mockBankKeeperSendFromModuleToAccount implements a static version of the corresponding +// bank keeper method that interacts with an in-memory map of account addresses to balances. +func mockBankKeeperSendFromModuleToAccount( + _ context.Context, + senderModule string, + recipientAddr cosmostypes.AccAddress, + sendCoins cosmostypes.Coins, +) error { + mapMu.Lock() + defer mapMu.Unlock() + moduleAddr := authtypes.NewModuleAddress(senderModule) + + moduleBalance, ok := mapAccAddrCoins[moduleAddr.String()] + if !ok { + return fmt.Errorf("no module account for %s (address %s)", senderModule, moduleAddr) + } + + remainingModuleBalance, isNegative := moduleBalance.SafeSub(sendCoins...) + if isNegative { + return fmt.Errorf("not enough coins to send (%s) from module account %q", sendCoins, senderModule) + } + + recipientBalance, ok := mapAccAddrCoins[recipientAddr.String()] + if !ok { + recipientBalance = cosmostypes.NewCoins(cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 0)) + } + + recipientBalance = recipientBalance.Add(sendCoins...) + + mapAccAddrCoins[moduleAddr.String()] = remainingModuleBalance + mapAccAddrCoins[recipientAddr.String()] = recipientBalance + + return nil +} diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go index a1ad708a0..b02ada7f6 100644 --- a/x/migration/keeper/msg_server_claim_morse_acount_test.go +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -133,7 +133,7 @@ func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { ).Error(), ) - _, err := srv.ClaimMorseAccount(ctx, &invalidMsgClaim) + _, err = srv.ClaimMorseAccount(ctx, &invalidMsgClaim) require.EqualError(t, err, expectedErr.Error()) }) @@ -150,7 +150,7 @@ func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { ).Error(), ) - _, err := srv.ClaimMorseAccount(ctx, &invalidMsgClaim) + _, err = srv.ClaimMorseAccount(ctx, &invalidMsgClaim) require.EqualError(t, err, expectedErr.Error()) }) @@ -170,7 +170,7 @@ func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { ).Error(), ) - _, err := srv.ClaimMorseAccount(ctx, msgClaim) + _, err = srv.ClaimMorseAccount(ctx, msgClaim) require.EqualError(t, err, expectedErr.Error()) }) @@ -191,7 +191,7 @@ func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { ).Error(), ) - _, err := srv.ClaimMorseAccount(ctx, msgClaim) + _, err = srv.ClaimMorseAccount(ctx, msgClaim) require.EqualError(t, err, expectedErr.Error()) }) @@ -219,7 +219,7 @@ func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { ).Error(), ) - _, err := srv.ClaimMorseAccount(ctx, msgClaim) + _, err = srv.ClaimMorseAccount(ctx, msgClaim) require.EqualError(t, err, expectedErr.Error()) }) From 3f2a510939e2ebd580c8687f5cc7dde9c0eeb47b Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Mar 2025 12:13:18 +0100 Subject: [PATCH 72/81] chore: regenerate protobufs --- api/poktroll/migration/event.pulsar.go | 2 +- x/migration/types/event.pb.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index e89a244c3..edbc443a0 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -1222,7 +1222,7 @@ type EventMorseAccountClaimed struct { // The height (on Shannon) at which the claim was executed (i.e. claimed). ClaimedAtHeight int64 `protobuf:"varint,1,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` - // The balance which was claimed. + // The unstaked balance which was claimed. ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance,omitempty"` // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. ShannonDestAddress string `protobuf:"bytes,3,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address,omitempty"` diff --git a/x/migration/types/event.pb.go b/x/migration/types/event.pb.go index 4e94701d2..648495a5d 100644 --- a/x/migration/types/event.pb.go +++ b/x/migration/types/event.pb.go @@ -91,7 +91,7 @@ func (m *EventImportMorseClaimableAccounts) GetNumAccounts() uint64 { type EventMorseAccountClaimed struct { // The height (on Shannon) at which the claim was executed (i.e. claimed). ClaimedAtHeight int64 `protobuf:"varint,1,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height"` - // The balance which was claimed. + // The unstaked balance which was claimed. ClaimedBalance types.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance"` // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. ShannonDestAddress string `protobuf:"bytes,3,opt,name=shannon_dest_address,json=shannonDestAddress,proto3" json:"shannon_dest_address"` From 1e6e39cd7ca3ffaa4bf82f55ee1ca6c6bcb924cf Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Mar 2025 13:43:52 +0100 Subject: [PATCH 73/81] chore: review feedback improvements Co-authored-by: Daniel Olshansky --- proto/poktroll/application/types.proto | 1 + proto/poktroll/migration/tx.proto | 52 +++++++++++++++---- x/migration/module/autocli.go | 10 ++-- .../types/message_claim_morse_application.go | 4 ++ 4 files changed, 51 insertions(+), 16 deletions(-) diff --git a/proto/poktroll/application/types.proto b/proto/poktroll/application/types.proto index 4979807e1..50ba8babe 100644 --- a/proto/poktroll/application/types.proto +++ b/proto/poktroll/application/types.proto @@ -22,6 +22,7 @@ message Application { // Total amount of staked uPOKT cosmos.base.v1beta1.Coin stake = 2; + // TODO_MAINNET: Refactor this to be a single service config field. // CRITICAL: Must contain EXACTLY ONE service config // This prevents applications from over-servicing. // Kept as repeated field for legacy and future compatibility diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index dea825a6f..8e776fedb 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -115,22 +115,52 @@ message MsgClaimMorseAccountResponse { // TODO_UPNEXT(@bryanchriswhite, #1034): // - Refactor to consistent naming convention -// - Add comments describing the purpose of each message/field +// MsgClaimMorseApplication is used to execute a claim (one-time minting of tokens on Shannon), +// of the total tokens owned by the given Morse account, according to the on-chain MorseClaimableAccounts, +// to the balance of the given Shannon account, followed by staking that Shannon account as an application. message MsgClaimMorseApplication { option (cosmos.msg.v1.signer) = "shannonDestAddress"; - string shannonDestAddress = 1; - string morseSrcAddress = 2; - string morseSignature = 3; - cosmos.base.v1beta1.Coin stake = 4 [(gogoproto.nullable) = false]; - string serviceConfig = 5; + + // The bech32-encoded address of the Shannon account to which the claimed tokens + // will be minted and from which the application will be staked. + string shannonDestAddress = 1; + + // The hex-encoded address of the Morse account whose balance will be claimed. + // E.g.: 00f9900606fa3d5c9179fc0c8513078a53a2073e + string morseSrcAddress = 2; + + // The hex-encoded signature, by the Morse account, of this message (where this field is nil). + // I.e.: morse_signature = private_key.sign(marshal(MsgClaimMorseAccount{morse_signature: nil, ...})) + string morseSignature = 3; + + // The upokt which the Shannon destination account will stake as an application. + cosmos.base.v1beta1.Coin stake = 4 [(gogoproto.nullable) = false]; + + // The services this application is staked to request service for. + // NOTE: This is not a repeated field, as in MsgStakeApplication, + // because an application can only be staked for one service. + string serviceConfig = 5; } +// MsgClaimMorseApplicationResponse is returned from MsgClaimMorseApplication. +// It indicates the morse_src_address of the account which was claimed, the unstaked +// balance claimed, the application stake, and the height at which the claim was committed. message MsgClaimMorseApplicationResponse { - string morseSrcAddress = 1; - cosmos.base.v1beta1.Coin claimedBalance = 2 [(gogoproto.nullable) = false]; - string serviceId = 3; - cosmos.base.v1beta1.Coin claimedApplicationStake = 4 [(gogoproto.nullable) = false]; - int32 claimedAtHeight = 5; + // The hex-encoded address of the Morse account whose balance will be claimed. + string morseSrcAddress = 1; + + // The unstaked balance which was claimed. + cosmos.base.v1beta1.Coin claimedBalance = 2 [(gogoproto.nullable) = false]; + + // The stake of the application which was staked as a result of the claim. + // If the application was already staked, this amount does not include the initial stake (i.e. only the portion which was "claimed"). + cosmos.base.v1beta1.Coin claimedApplicationStake = 3 [(gogoproto.nullable) = false]; + + // The height (on Shannon) at which the claim was created. + int32 claimedAtHeight = 4; + + // The application which was staked as a result of the claim. + application.Application application = 5 [(gogoproto.nullable) = false]; } diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index dd01dda47..f529a8945 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -48,7 +48,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Use: "import-morse-claimable-accounts [morse-account-state]", Short: "Send a import_morse_claimable_accounts tx", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morseAccountState"}}, - // TODO_UPNEXT(@bryanchriswhite, #1034): Implement CLI logic. + // TODO_MAINNET(@bryanchriswhite, #1034): Implement CLI logic. Skip: true, // skipped because authority gated }, { @@ -57,16 +57,16 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Short: "Claim the account balance of the given Morse account address", Long: "Claim the account balance of the given Morse account address, by signing the message with the private key of the Morse account.", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morse_src_address"}, {ProtoField: "morse_signature"}}, - Skip: true, // skipped because autoCLI cannot handle signing - // TODO_UPNEXT(@bryanchriswhite, #1034): Add morse account claiming CLI, incl. examples (see x/supplier/module/autocli.go). + Skip: true, // skipped because autoCLI cannot handle loading & signing using the Morse key. + // TODO_MAINNET(@bryanchriswhite, #1034): Add morse account claiming CLI, incl. examples (see x/supplier/module/autocli.go). }, { RpcMethod: "ClaimMorseApplication", Use: "claim-morse-application [morse-src-address] [morse-signature] [stake] [service-config]", Short: "Send a claim_morse_application tx", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "morseSrcAddress"}, {ProtoField: "morseSignature"}, {ProtoField: "stake"}, {ProtoField: "serviceConfig"}}, - Skip: true, // skipped because autoCLI cannot handle signing - // TODO_UPNEXT(@bryanchriswhite, #1034): Add morse application claiming CLI, incl. examples (see x/supplier/module/autocli.go). + Skip: true, // skipped because autoCLI cannot handle loading & signing using the Morse key. + // TODO_MAINNET(@bryanchriswhite, #1034): Add morse application claiming CLI, incl. examples (see x/supplier/module/autocli.go). }, // this line is used by ignite scaffolding # autocli/tx }, diff --git a/x/migration/types/message_claim_morse_application.go b/x/migration/types/message_claim_morse_application.go index 50f36d6c2..5b2dc1894 100644 --- a/x/migration/types/message_claim_morse_application.go +++ b/x/migration/types/message_claim_morse_application.go @@ -9,6 +9,8 @@ import ( var _ sdk.Msg = &MsgClaimMorseApplication{} func NewMsgClaimMorseApplication(shannonDestAddress string, morseSrcAddress string, morseSignature string, stake sdk.Coin, serviceConfig string) *MsgClaimMorseApplication { + // TODO_MAINNET(@bryanchriswhite, #1034): Add message signing. + return &MsgClaimMorseApplication{ ShannonDestAddress: shannonDestAddress, MorseSrcAddress: morseSrcAddress, @@ -19,6 +21,8 @@ func NewMsgClaimMorseApplication(shannonDestAddress string, morseSrcAddress stri } func (msg *MsgClaimMorseApplication) ValidateBasic() error { + // TODO_MAINNET(@bryanchriswhite, #1034): Add validation. + _, err := sdk.AccAddressFromBech32(msg.ShannonDestAddress) if err != nil { return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid shannonDestAddress address (%s)", err) From bddf3e673317b225076cb33346548d7fdd153627 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Mar 2025 13:45:08 +0100 Subject: [PATCH 74/81] chore: regenerate protobufs --- api/poktroll/application/types.pulsar.go | 1 + api/poktroll/migration/tx.pulsar.go | 535 ++++++++++++----------- proto/poktroll/migration/tx.proto | 1 + x/application/types/types.pb.go | 1 + x/migration/types/tx.pb.go | 258 ++++++----- 5 files changed, 435 insertions(+), 361 deletions(-) diff --git a/api/poktroll/application/types.pulsar.go b/api/poktroll/application/types.pulsar.go index c90d580dd..4c815e20c 100644 --- a/api/poktroll/application/types.pulsar.go +++ b/api/poktroll/application/types.pulsar.go @@ -2192,6 +2192,7 @@ type Application struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // Total amount of staked uPOKT Stake *v1beta1.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` + // TODO_MAINNET: Refactor this to be a single service config field. // CRITICAL: Must contain EXACTLY ONE service config // This prevents applications from over-servicing. // Kept as repeated field for legacy and future compatibility diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index 07b051936..fdf38d194 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -5,6 +5,7 @@ import ( _ "cosmossdk.io/api/amino" v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" _ "cosmossdk.io/api/cosmos/msg/v1" + application "github.com/pokt-network/poktroll/api/poktroll/application" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" @@ -3699,9 +3700,9 @@ var ( md_MsgClaimMorseApplicationResponse protoreflect.MessageDescriptor fd_MsgClaimMorseApplicationResponse_morseSrcAddress protoreflect.FieldDescriptor fd_MsgClaimMorseApplicationResponse_claimedBalance protoreflect.FieldDescriptor - fd_MsgClaimMorseApplicationResponse_serviceId protoreflect.FieldDescriptor fd_MsgClaimMorseApplicationResponse_claimedApplicationStake protoreflect.FieldDescriptor fd_MsgClaimMorseApplicationResponse_claimedAtHeight protoreflect.FieldDescriptor + fd_MsgClaimMorseApplicationResponse_application protoreflect.FieldDescriptor ) func init() { @@ -3709,9 +3710,9 @@ func init() { md_MsgClaimMorseApplicationResponse = File_poktroll_migration_tx_proto.Messages().ByName("MsgClaimMorseApplicationResponse") fd_MsgClaimMorseApplicationResponse_morseSrcAddress = md_MsgClaimMorseApplicationResponse.Fields().ByName("morseSrcAddress") fd_MsgClaimMorseApplicationResponse_claimedBalance = md_MsgClaimMorseApplicationResponse.Fields().ByName("claimedBalance") - fd_MsgClaimMorseApplicationResponse_serviceId = md_MsgClaimMorseApplicationResponse.Fields().ByName("serviceId") fd_MsgClaimMorseApplicationResponse_claimedApplicationStake = md_MsgClaimMorseApplicationResponse.Fields().ByName("claimedApplicationStake") fd_MsgClaimMorseApplicationResponse_claimedAtHeight = md_MsgClaimMorseApplicationResponse.Fields().ByName("claimedAtHeight") + fd_MsgClaimMorseApplicationResponse_application = md_MsgClaimMorseApplicationResponse.Fields().ByName("application") } var _ protoreflect.Message = (*fastReflection_MsgClaimMorseApplicationResponse)(nil) @@ -3791,12 +3792,6 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) Range(f func(protorefl return } } - if x.ServiceId != "" { - value := protoreflect.ValueOfString(x.ServiceId) - if !f(fd_MsgClaimMorseApplicationResponse_serviceId, value) { - return - } - } if x.ClaimedApplicationStake != nil { value := protoreflect.ValueOfMessage(x.ClaimedApplicationStake.ProtoReflect()) if !f(fd_MsgClaimMorseApplicationResponse_claimedApplicationStake, value) { @@ -3809,6 +3804,12 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) Range(f func(protorefl return } } + if x.Application != nil { + value := protoreflect.ValueOfMessage(x.Application.ProtoReflect()) + if !f(fd_MsgClaimMorseApplicationResponse_application, value) { + return + } + } } // Has reports whether a field is populated. @@ -3828,12 +3829,12 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) Has(fd protoreflect.Fi return x.MorseSrcAddress != "" case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedBalance": return x.ClaimedBalance != nil - case "poktroll.migration.MsgClaimMorseApplicationResponse.serviceId": - return x.ServiceId != "" case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedApplicationStake": return x.ClaimedApplicationStake != nil case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedAtHeight": return x.ClaimedAtHeight != int32(0) + case "poktroll.migration.MsgClaimMorseApplicationResponse.application": + return x.Application != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplicationResponse")) @@ -3854,12 +3855,12 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) Clear(fd protoreflect. x.MorseSrcAddress = "" case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedBalance": x.ClaimedBalance = nil - case "poktroll.migration.MsgClaimMorseApplicationResponse.serviceId": - x.ServiceId = "" case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedApplicationStake": x.ClaimedApplicationStake = nil case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedAtHeight": x.ClaimedAtHeight = int32(0) + case "poktroll.migration.MsgClaimMorseApplicationResponse.application": + x.Application = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplicationResponse")) @@ -3882,15 +3883,15 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) Get(descriptor protore case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedBalance": value := x.ClaimedBalance return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "poktroll.migration.MsgClaimMorseApplicationResponse.serviceId": - value := x.ServiceId - return protoreflect.ValueOfString(value) case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedApplicationStake": value := x.ClaimedApplicationStake return protoreflect.ValueOfMessage(value.ProtoReflect()) case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedAtHeight": value := x.ClaimedAtHeight return protoreflect.ValueOfInt32(value) + case "poktroll.migration.MsgClaimMorseApplicationResponse.application": + value := x.Application + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplicationResponse")) @@ -3915,12 +3916,12 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) Set(fd protoreflect.Fi x.MorseSrcAddress = value.Interface().(string) case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedBalance": x.ClaimedBalance = value.Message().Interface().(*v1beta1.Coin) - case "poktroll.migration.MsgClaimMorseApplicationResponse.serviceId": - x.ServiceId = value.Interface().(string) case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedApplicationStake": x.ClaimedApplicationStake = value.Message().Interface().(*v1beta1.Coin) case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedAtHeight": x.ClaimedAtHeight = int32(value.Int()) + case "poktroll.migration.MsgClaimMorseApplicationResponse.application": + x.Application = value.Message().Interface().(*application.Application) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplicationResponse")) @@ -3951,10 +3952,13 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) Mutable(fd protoreflec x.ClaimedApplicationStake = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.ClaimedApplicationStake.ProtoReflect()) + case "poktroll.migration.MsgClaimMorseApplicationResponse.application": + if x.Application == nil { + x.Application = new(application.Application) + } + return protoreflect.ValueOfMessage(x.Application.ProtoReflect()) case "poktroll.migration.MsgClaimMorseApplicationResponse.morseSrcAddress": panic(fmt.Errorf("field morseSrcAddress of message poktroll.migration.MsgClaimMorseApplicationResponse is not mutable")) - case "poktroll.migration.MsgClaimMorseApplicationResponse.serviceId": - panic(fmt.Errorf("field serviceId of message poktroll.migration.MsgClaimMorseApplicationResponse is not mutable")) case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedAtHeight": panic(fmt.Errorf("field claimedAtHeight of message poktroll.migration.MsgClaimMorseApplicationResponse is not mutable")) default: @@ -3975,13 +3979,14 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) NewField(fd protorefle case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedBalance": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "poktroll.migration.MsgClaimMorseApplicationResponse.serviceId": - return protoreflect.ValueOfString("") case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedApplicationStake": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "poktroll.migration.MsgClaimMorseApplicationResponse.claimedAtHeight": return protoreflect.ValueOfInt32(int32(0)) + case "poktroll.migration.MsgClaimMorseApplicationResponse.application": + m := new(application.Application) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseApplicationResponse")) @@ -4059,10 +4064,6 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) ProtoMethods() *protoi l = options.Size(x.ClaimedBalance) n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.ServiceId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } if x.ClaimedApplicationStake != nil { l = options.Size(x.ClaimedApplicationStake) n += 1 + l + runtime.Sov(uint64(l)) @@ -4070,6 +4071,10 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) ProtoMethods() *protoi if x.ClaimedAtHeight != 0 { n += 1 + runtime.Sov(uint64(x.ClaimedAtHeight)) } + if x.Application != nil { + l = options.Size(x.Application) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -4099,10 +4104,24 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) ProtoMethods() *protoi i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Application != nil { + encoded, err := options.Marshal(x.Application) + 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] = 0x2a + } if x.ClaimedAtHeight != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimedAtHeight)) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x20 } if x.ClaimedApplicationStake != nil { encoded, err := options.Marshal(x.ClaimedApplicationStake) @@ -4116,13 +4135,6 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) ProtoMethods() *protoi copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x22 - } - if len(x.ServiceId) > 0 { - i -= len(x.ServiceId) - copy(dAtA[i:], x.ServiceId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceId))) - i-- dAtA[i] = 0x1a } if x.ClaimedBalance != nil { @@ -4265,9 +4277,9 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) ProtoMethods() *protoi iNdEx = postIndex case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedApplicationStake", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -4277,27 +4289,50 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) ProtoMethods() *protoi } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + 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.ServiceId = string(dAtA[iNdEx:postIndex]) + if x.ClaimedApplicationStake == nil { + x.ClaimedApplicationStake = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedApplicationStake); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) + } + x.ClaimedAtHeight = 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.ClaimedAtHeight |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedApplicationStake", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4324,32 +4359,13 @@ func (x *fastReflection_MsgClaimMorseApplicationResponse) ProtoMethods() *protoi if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.ClaimedApplicationStake == nil { - x.ClaimedApplicationStake = &v1beta1.Coin{} + if x.Application == nil { + x.Application = &application.Application{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedApplicationStake); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Application); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 5: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) - } - x.ClaimedAtHeight = 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.ClaimedAtHeight |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -4705,16 +4721,29 @@ func (x *MsgClaimMorseAccountResponse) GetClaimedAtHeight() int64 { return 0 } +// MsgClaimMorseApplication is used to execute a claim (one-time minting of tokens on Shannon), +// of the total tokens owned by the given Morse account, according to the on-chain MorseClaimableAccounts, +// to the balance of the given Shannon account, followed by staking that Shannon account as an application. type MsgClaimMorseApplication struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannonDestAddress,proto3" json:"shannonDestAddress,omitempty"` - MorseSrcAddress string `protobuf:"bytes,2,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` - MorseSignature string `protobuf:"bytes,3,opt,name=morseSignature,proto3" json:"morseSignature,omitempty"` - Stake *v1beta1.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake,omitempty"` - ServiceConfig string `protobuf:"bytes,5,opt,name=serviceConfig,proto3" json:"serviceConfig,omitempty"` + // The bech32-encoded address of the Shannon account to which the claimed tokens + // will be minted and from which the application will be staked. + ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannonDestAddress,proto3" json:"shannonDestAddress,omitempty"` + // The hex-encoded address of the Morse account whose balance will be claimed. + // E.g.: 00f9900606fa3d5c9179fc0c8513078a53a2073e + MorseSrcAddress string `protobuf:"bytes,2,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` + // The hex-encoded signature, by the Morse account, of this message (where this field is nil). + // I.e.: morse_signature = private_key.sign(marshal(MsgClaimMorseAccount{morse_signature: nil, ...})) + MorseSignature string `protobuf:"bytes,3,opt,name=morseSignature,proto3" json:"morseSignature,omitempty"` + // The upokt which the Shannon destination account will stake as an application. + Stake *v1beta1.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake,omitempty"` + // The services this application is staked to request service for. + // NOTE: This is not a repeated field, as in MsgStakeApplication, + // because an application can only be staked for one service. + ServiceConfig string `protobuf:"bytes,5,opt,name=serviceConfig,proto3" json:"serviceConfig,omitempty"` } func (x *MsgClaimMorseApplication) Reset() { @@ -4772,16 +4801,25 @@ func (x *MsgClaimMorseApplication) GetServiceConfig() string { return "" } +// MsgClaimMorseApplicationResponse is returned from MsgClaimMorseApplication. +// It indicates the morse_src_address of the account which was claimed, the unstaked +// balance claimed, the application stake, and the height at which the claim was committed. type MsgClaimMorseApplicationResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MorseSrcAddress string `protobuf:"bytes,1,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` - ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimedBalance,proto3" json:"claimedBalance,omitempty"` - ServiceId string `protobuf:"bytes,3,opt,name=serviceId,proto3" json:"serviceId,omitempty"` - ClaimedApplicationStake *v1beta1.Coin `protobuf:"bytes,4,opt,name=claimedApplicationStake,proto3" json:"claimedApplicationStake,omitempty"` - ClaimedAtHeight int32 `protobuf:"varint,5,opt,name=claimedAtHeight,proto3" json:"claimedAtHeight,omitempty"` + // The hex-encoded address of the Morse account whose balance will be claimed. + MorseSrcAddress string `protobuf:"bytes,1,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` + // The unstaked balance which was claimed. + ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimedBalance,proto3" json:"claimedBalance,omitempty"` + // The stake of the application which was staked as a result of the claim. + // If the application was already staked, this amount does not include the initial stake (i.e. only the portion which was "claimed"). + ClaimedApplicationStake *v1beta1.Coin `protobuf:"bytes,3,opt,name=claimedApplicationStake,proto3" json:"claimedApplicationStake,omitempty"` + // The height (on Shannon) at which the claim was created. + ClaimedAtHeight int32 `protobuf:"varint,4,opt,name=claimedAtHeight,proto3" json:"claimedAtHeight,omitempty"` + // The application which was staked as a result of the claim. + Application *application.Application `protobuf:"bytes,5,opt,name=application,proto3" json:"application,omitempty"` } func (x *MsgClaimMorseApplicationResponse) Reset() { @@ -4818,13 +4856,6 @@ func (x *MsgClaimMorseApplicationResponse) GetClaimedBalance() *v1beta1.Coin { return nil } -func (x *MsgClaimMorseApplicationResponse) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - func (x *MsgClaimMorseApplicationResponse) GetClaimedApplicationStake() *v1beta1.Coin { if x != nil { return x.ClaimedApplicationStake @@ -4839,6 +4870,13 @@ func (x *MsgClaimMorseApplicationResponse) GetClaimedAtHeight() int32 { return 0 } +func (x *MsgClaimMorseApplicationResponse) GetApplication() *application.Application { + if x != nil { + return x.Application + } + return nil +} + var File_poktroll_migration_tx_proto protoreflect.FileDescriptor var file_poktroll_migration_tx_proto_rawDesc = []byte{ @@ -4855,164 +4893,169 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x6f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 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, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, - 0x6e, 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, 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, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, - 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, - 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x3a, 0x37, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x24, 0x70, 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, 0xb4, 0x02, 0x0a, 0x1f, 0x4d, 0x73, 0x67, 0x49, 0x6d, - 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, - 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, - 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x12, 0x72, 0x0a, 0x13, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 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, 0x1b, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x13, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, + 0x6f, 0x69, 0x6e, 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, 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, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x37, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x24, 0x70, 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, 0xb4, 0x02, 0x0a, 0x1f, 0x4d, 0x73, 0x67, + 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x12, 0x72, 0x0a, 0x13, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 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, 0x1b, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, + 0x1f, 0x13, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x55, 0x0a, 0x18, 0x6d, 0x6f, 0x72, 0x73, + 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x1c, 0xea, 0xde, 0x1f, 0x18, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x55, 0x0a, 0x18, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x1c, 0xea, 0xde, 0x1f, 0x18, 0x6d, 0x6f, - 0x72, 0x73, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x52, 0x15, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x3a, 0x0e, 0x82, - 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x8d, 0x01, - 0x0a, 0x27, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, - 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 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, 0x0c, 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, 0x22, 0x96, 0x02, - 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x62, 0x0a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, - 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xea, 0xde, 0x1f, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, - 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, - 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6d, 0x6f, - 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, - 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, - 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3c, 0x0a, - 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x13, 0xea, 0xde, 0x1f, 0x0f, 0x6d, 0x6f, 0x72, 0x73, - 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0e, 0x6d, 0x6f, 0x72, - 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x19, 0x82, 0xe7, 0xb0, - 0x2a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xea, 0x01, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x43, 0x6c, - 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, - 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, - 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, - 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x5b, 0x0a, 0x0f, 0x63, 0x6c, - 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, + 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x52, 0x15, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x3a, + 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, + 0x8d, 0x01, 0x0a, 0x27, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, + 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 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, 0x0c, 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, 0x22, + 0x96, 0x02, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x62, 0x0a, 0x14, 0x73, 0x68, 0x61, 0x6e, + 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xea, 0xde, 0x1f, 0x14, 0x73, 0x68, 0x61, 0x6e, + 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 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, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, + 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x11, + 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, + 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, + 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x3c, 0x0a, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x13, 0xea, 0xde, 0x1f, 0x0f, 0x6d, 0x6f, + 0x72, 0x73, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0e, 0x6d, + 0x6f, 0x72, 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x19, 0x82, + 0xe7, 0xb0, 0x2a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xea, 0x01, 0x0a, 0x1c, 0x4d, 0x73, 0x67, + 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x11, 0x6d, 0x6f, 0x72, + 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, + 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, 0x72, + 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x5b, 0x0a, 0x0f, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, + 0x42, 0x17, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, + 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x92, 0x02, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, + 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, + 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x6f, 0x72, + 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x26, 0x0a, 0x0e, + 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x17, - 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, - 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, - 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x22, 0x92, 0x02, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, - 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x2e, 0x0a, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x68, - 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x28, 0x0a, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, - 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x6d, 0x6f, - 0x72, 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x3a, 0x17, 0x82, 0xe7, 0xb0, 0x2a, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, + 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xe5, 0x02, 0x0a, 0x20, 0x4d, + 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x28, 0x0a, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, + 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x47, 0x0a, 0x0e, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, - 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3a, - 0x17, 0x82, 0xe7, 0xb0, 0x2a, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, - 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xb8, 0x02, 0x0a, 0x20, 0x4d, 0x73, 0x67, + 0x1f, 0x00, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x12, 0x59, 0x0a, 0x17, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x17, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x28, 0x0a, + 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, + 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x49, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x32, 0xef, 0x03, 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, 0x90, 0x01, 0x0a, + 0x1c, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x33, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x1a, 0x3b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, + 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x6f, 0x0a, 0x11, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x30, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x7b, 0x0a, 0x15, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, + 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x34, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, - 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x47, 0x0a, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, - 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, - 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x59, - 0x0a, 0x17, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, - 0x52, 0x17, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6c, 0x61, - 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x32, 0xef, 0x03, 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, 0x90, 0x01, - 0x0a, 0x1c, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, - 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x33, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, - 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, - 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, - 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x6f, 0x0a, 0x11, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, - 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, - 0x30, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, - 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x7b, 0x0a, 0x15, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x34, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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 ( @@ -5040,6 +5083,7 @@ var file_poktroll_migration_tx_proto_goTypes = []interface{}{ (*Params)(nil), // 8: poktroll.migration.Params (*MorseAccountState)(nil), // 9: poktroll.migration.MorseAccountState (*v1beta1.Coin)(nil), // 10: cosmos.base.v1beta1.Coin + (*application.Application)(nil), // 11: poktroll.application.Application } var file_poktroll_migration_tx_proto_depIdxs = []int32{ 8, // 0: poktroll.migration.MsgUpdateParams.params:type_name -> poktroll.migration.Params @@ -5048,19 +5092,20 @@ var file_poktroll_migration_tx_proto_depIdxs = []int32{ 10, // 3: poktroll.migration.MsgClaimMorseApplication.stake:type_name -> cosmos.base.v1beta1.Coin 10, // 4: poktroll.migration.MsgClaimMorseApplicationResponse.claimedBalance:type_name -> cosmos.base.v1beta1.Coin 10, // 5: poktroll.migration.MsgClaimMorseApplicationResponse.claimedApplicationStake:type_name -> cosmos.base.v1beta1.Coin - 0, // 6: poktroll.migration.Msg.UpdateParams:input_type -> poktroll.migration.MsgUpdateParams - 2, // 7: poktroll.migration.Msg.ImportMorseClaimableAccounts:input_type -> poktroll.migration.MsgImportMorseClaimableAccounts - 4, // 8: poktroll.migration.Msg.ClaimMorseAccount:input_type -> poktroll.migration.MsgClaimMorseAccount - 6, // 9: poktroll.migration.Msg.ClaimMorseApplication:input_type -> poktroll.migration.MsgClaimMorseApplication - 1, // 10: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.MsgUpdateParamsResponse - 3, // 11: poktroll.migration.Msg.ImportMorseClaimableAccounts:output_type -> poktroll.migration.MsgImportMorseClaimableAccountsResponse - 5, // 12: poktroll.migration.Msg.ClaimMorseAccount:output_type -> poktroll.migration.MsgClaimMorseAccountResponse - 7, // 13: poktroll.migration.Msg.ClaimMorseApplication:output_type -> poktroll.migration.MsgClaimMorseApplicationResponse - 10, // [10:14] is the sub-list for method output_type - 6, // [6:10] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 11, // 6: poktroll.migration.MsgClaimMorseApplicationResponse.application:type_name -> poktroll.application.Application + 0, // 7: poktroll.migration.Msg.UpdateParams:input_type -> poktroll.migration.MsgUpdateParams + 2, // 8: poktroll.migration.Msg.ImportMorseClaimableAccounts:input_type -> poktroll.migration.MsgImportMorseClaimableAccounts + 4, // 9: poktroll.migration.Msg.ClaimMorseAccount:input_type -> poktroll.migration.MsgClaimMorseAccount + 6, // 10: poktroll.migration.Msg.ClaimMorseApplication:input_type -> poktroll.migration.MsgClaimMorseApplication + 1, // 11: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.MsgUpdateParamsResponse + 3, // 12: poktroll.migration.Msg.ImportMorseClaimableAccounts:output_type -> poktroll.migration.MsgImportMorseClaimableAccountsResponse + 5, // 13: poktroll.migration.Msg.ClaimMorseAccount:output_type -> poktroll.migration.MsgClaimMorseAccountResponse + 7, // 14: poktroll.migration.Msg.ClaimMorseApplication:output_type -> poktroll.migration.MsgClaimMorseApplicationResponse + 11, // [11:15] is the sub-list for method output_type + 7, // [7:11] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_poktroll_migration_tx_proto_init() } diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 8e776fedb..be0ce8f80 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -8,6 +8,7 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "poktroll/migration/morse_onchain.proto"; import "poktroll/migration/params.proto"; +import "poktroll/application/types.proto"; import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/pokt-network/poktroll/x/migration/types"; diff --git a/x/application/types/types.pb.go b/x/application/types/types.pb.go index 0bc5d391a..5baafbfce 100644 --- a/x/application/types/types.pb.go +++ b/x/application/types/types.pb.go @@ -33,6 +33,7 @@ type Application struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // Total amount of staked uPOKT Stake *types.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` + // TODO_MAINNET: Refactor this to be a single service config field. // CRITICAL: Must contain EXACTLY ONE service config // This prevents applications from over-servicing. // Kept as repeated field for legacy and future compatibility diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 295270aab..5b0bf1ed2 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -13,6 +13,7 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + types1 "github.com/pokt-network/poktroll/x/application/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -371,12 +372,25 @@ func (m *MsgClaimMorseAccountResponse) GetClaimedAtHeight() int64 { return 0 } +// MsgClaimMorseApplication is used to execute a claim (one-time minting of tokens on Shannon), +// of the total tokens owned by the given Morse account, according to the on-chain MorseClaimableAccounts, +// to the balance of the given Shannon account, followed by staking that Shannon account as an application. type MsgClaimMorseApplication struct { - ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannonDestAddress,proto3" json:"shannonDestAddress,omitempty"` - MorseSrcAddress string `protobuf:"bytes,2,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` - MorseSignature string `protobuf:"bytes,3,opt,name=morseSignature,proto3" json:"morseSignature,omitempty"` - Stake types.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake"` - ServiceConfig string `protobuf:"bytes,5,opt,name=serviceConfig,proto3" json:"serviceConfig,omitempty"` + // The bech32-encoded address of the Shannon account to which the claimed tokens + // will be minted and from which the application will be staked. + ShannonDestAddress string `protobuf:"bytes,1,opt,name=shannonDestAddress,proto3" json:"shannonDestAddress,omitempty"` + // The hex-encoded address of the Morse account whose balance will be claimed. + // E.g.: 00f9900606fa3d5c9179fc0c8513078a53a2073e + MorseSrcAddress string `protobuf:"bytes,2,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` + // The hex-encoded signature, by the Morse account, of this message (where this field is nil). + // I.e.: morse_signature = private_key.sign(marshal(MsgClaimMorseAccount{morse_signature: nil, ...})) + MorseSignature string `protobuf:"bytes,3,opt,name=morseSignature,proto3" json:"morseSignature,omitempty"` + // The upokt which the Shannon destination account will stake as an application. + Stake types.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake"` + // The services this application is staked to request service for. + // NOTE: This is not a repeated field, as in MsgStakeApplication, + // because an application can only be staked for one service. + ServiceConfig string `protobuf:"bytes,5,opt,name=serviceConfig,proto3" json:"serviceConfig,omitempty"` } func (m *MsgClaimMorseApplication) Reset() { *m = MsgClaimMorseApplication{} } @@ -443,12 +457,21 @@ func (m *MsgClaimMorseApplication) GetServiceConfig() string { return "" } +// MsgClaimMorseApplicationResponse is returned from MsgClaimMorseApplication. +// It indicates the morse_src_address of the account which was claimed, the unstaked +// balance claimed, the application stake, and the height at which the claim was committed. type MsgClaimMorseApplicationResponse struct { - MorseSrcAddress string `protobuf:"bytes,1,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` - ClaimedBalance types.Coin `protobuf:"bytes,2,opt,name=claimedBalance,proto3" json:"claimedBalance"` - ServiceId string `protobuf:"bytes,3,opt,name=serviceId,proto3" json:"serviceId,omitempty"` - ClaimedApplicationStake types.Coin `protobuf:"bytes,4,opt,name=claimedApplicationStake,proto3" json:"claimedApplicationStake"` - ClaimedAtHeight int32 `protobuf:"varint,5,opt,name=claimedAtHeight,proto3" json:"claimedAtHeight,omitempty"` + // The hex-encoded address of the Morse account whose balance will be claimed. + MorseSrcAddress string `protobuf:"bytes,1,opt,name=morseSrcAddress,proto3" json:"morseSrcAddress,omitempty"` + // The unstaked balance which was claimed. + ClaimedBalance types.Coin `protobuf:"bytes,2,opt,name=claimedBalance,proto3" json:"claimedBalance"` + // The stake of the application which was staked as a result of the claim. + // If the application was already staked, this amount does not include the initial stake (i.e. only the portion which was "claimed"). + ClaimedApplicationStake types.Coin `protobuf:"bytes,3,opt,name=claimedApplicationStake,proto3" json:"claimedApplicationStake"` + // The height (on Shannon) at which the claim was created. + ClaimedAtHeight int32 `protobuf:"varint,4,opt,name=claimedAtHeight,proto3" json:"claimedAtHeight,omitempty"` + // The application which was staked as a result of the claim. + Application types1.Application `protobuf:"bytes,5,opt,name=application,proto3" json:"application"` } func (m *MsgClaimMorseApplicationResponse) Reset() { *m = MsgClaimMorseApplicationResponse{} } @@ -494,13 +517,6 @@ func (m *MsgClaimMorseApplicationResponse) GetClaimedBalance() types.Coin { return types.Coin{} } -func (m *MsgClaimMorseApplicationResponse) GetServiceId() string { - if m != nil { - return m.ServiceId - } - return "" -} - func (m *MsgClaimMorseApplicationResponse) GetClaimedApplicationStake() types.Coin { if m != nil { return m.ClaimedApplicationStake @@ -515,6 +531,13 @@ func (m *MsgClaimMorseApplicationResponse) GetClaimedAtHeight() int32 { return 0 } +func (m *MsgClaimMorseApplicationResponse) GetApplication() types1.Application { + if m != nil { + return m.Application + } + return types1.Application{} +} + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.migration.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.migration.MsgUpdateParamsResponse") @@ -529,66 +552,67 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 935 bytes of a gzipped FileDescriptorProto + // 959 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x3d, 0x6f, 0xdb, 0x46, - 0x18, 0x36, 0x65, 0x3b, 0x80, 0xde, 0xb8, 0x76, 0xcd, 0xd8, 0x90, 0xac, 0x18, 0xa2, 0xa1, 0xa6, + 0x18, 0x36, 0x25, 0x3b, 0x80, 0x5e, 0xbb, 0x76, 0xcd, 0xd8, 0x90, 0xac, 0x18, 0xa2, 0xaa, 0xa6, 0xa9, 0xe0, 0xd6, 0x64, 0x6c, 0xf7, 0x03, 0x70, 0xdb, 0xc1, 0x72, 0x81, 0x26, 0x83, 0x80, 0x80, - 0x46, 0x86, 0xb6, 0x03, 0x7b, 0xa2, 0xae, 0x24, 0x61, 0xf1, 0x8e, 0xe0, 0x9d, 0xdc, 0x04, 0x5d, - 0x8a, 0x8e, 0x05, 0x0a, 0x04, 0x1d, 0xfa, 0x1b, 0x3a, 0x7a, 0xc8, 0xd0, 0xb5, 0x5b, 0xc6, 0xa0, - 0x53, 0x26, 0xa1, 0xb0, 0x07, 0x03, 0x5a, 0xfa, 0x17, 0x0a, 0xf2, 0x8e, 0x94, 0x45, 0x9d, 0xa2, - 0xd8, 0x8b, 0x2d, 0xbe, 0xef, 0xf3, 0x7e, 0x3c, 0xcf, 0x73, 0xfc, 0x80, 0xbb, 0x11, 0x3d, 0xe1, - 0x31, 0xed, 0xf5, 0xac, 0x30, 0xf0, 0x62, 0xc4, 0x03, 0x4a, 0x2c, 0xfe, 0xd4, 0x8c, 0x62, 0xca, - 0xa9, 0xae, 0x67, 0x49, 0x33, 0x4f, 0xd6, 0x56, 0x51, 0x18, 0x10, 0x6a, 0xa5, 0x7f, 0x05, 0xac, - 0x56, 0x71, 0x29, 0x0b, 0x29, 0xb3, 0x42, 0xe6, 0x59, 0xa7, 0xbb, 0xc9, 0x3f, 0x99, 0xd8, 0x10, - 0x09, 0x27, 0xbd, 0xb2, 0xc4, 0x85, 0x4c, 0xad, 0x79, 0xd4, 0xa3, 0x22, 0x9e, 0xfc, 0x92, 0xd1, - 0xfb, 0x8a, 0x6d, 0x42, 0x1a, 0x33, 0xec, 0x50, 0xe2, 0xfa, 0x28, 0x20, 0x12, 0x67, 0x28, 0x70, - 0x11, 0x8a, 0x51, 0x98, 0xb5, 0xaf, 0xcb, 0x95, 0x3a, 0x88, 0x61, 0xeb, 0x74, 0xb7, 0x83, 0x39, - 0xda, 0xb5, 0x5c, 0x9a, 0x35, 0x68, 0xfc, 0xad, 0xc1, 0x4a, 0x9b, 0x79, 0x4f, 0xa2, 0x2e, 0xe2, - 0xf8, 0x71, 0x5a, 0xa9, 0x7f, 0x0a, 0x65, 0xd4, 0xe7, 0x3e, 0x8d, 0x03, 0xfe, 0xac, 0xaa, 0x6d, - 0x69, 0xcd, 0x72, 0xab, 0xfa, 0xcf, 0x8b, 0x9d, 0x35, 0xb9, 0xf7, 0x61, 0xb7, 0x1b, 0x63, 0xc6, - 0x8e, 0x79, 0x1c, 0x10, 0xcf, 0x1e, 0x41, 0xf5, 0x2f, 0xe1, 0x96, 0x98, 0x5d, 0x2d, 0x6d, 0x69, - 0xcd, 0xdb, 0x7b, 0x35, 0x73, 0x52, 0x36, 0x53, 0xcc, 0x68, 0x95, 0x5f, 0x0e, 0x8c, 0xb9, 0x3f, - 0x2f, 0xcf, 0xb6, 0x35, 0x5b, 0x16, 0x1d, 0x7c, 0xf6, 0xcb, 0xe5, 0xd9, 0xf6, 0xa8, 0xdd, 0xaf, - 0x97, 0x67, 0xdb, 0xf7, 0x72, 0x7a, 0x4f, 0xaf, 0x10, 0x2c, 0xec, 0xdb, 0xd8, 0x80, 0x4a, 0x21, - 0x64, 0x63, 0x16, 0x51, 0xc2, 0x70, 0xe3, 0x45, 0x09, 0x8c, 0x36, 0xf3, 0x1e, 0x85, 0x11, 0x8d, - 0x79, 0x3b, 0x11, 0xf0, 0xa8, 0x87, 0x82, 0x10, 0x75, 0x7a, 0xf8, 0xd0, 0x75, 0x69, 0x9f, 0xf0, - 0x9b, 0xd3, 0x8d, 0xe1, 0x8e, 0xb0, 0x04, 0x89, 0x4e, 0x0e, 0xe3, 0x88, 0x63, 0xc9, 0xfd, 0x7d, - 0x15, 0xf7, 0x74, 0x01, 0x39, 0xf7, 0x38, 0x01, 0xb7, 0xee, 0x26, 0x32, 0x0c, 0x07, 0x86, 0xaa, - 0x93, 0xbd, 0x1a, 0x16, 0xf1, 0xfa, 0x13, 0xa8, 0x2a, 0x90, 0x8e, 0x8f, 0x98, 0x5f, 0x9d, 0xdf, - 0xd2, 0x9a, 0x4b, 0xad, 0xcd, 0xe1, 0xc0, 0x98, 0x8a, 0xb1, 0xd7, 0x27, 0x5a, 0x3e, 0x44, 0xcc, - 0x3f, 0x58, 0x1e, 0x97, 0xbe, 0xf1, 0x9b, 0x06, 0x1f, 0xcc, 0x90, 0x2d, 0x93, 0x58, 0xdf, 0x01, - 0xb8, 0xb2, 0x84, 0x96, 0x2e, 0xb1, 0x3c, 0x1c, 0x18, 0x57, 0xa2, 0x76, 0x99, 0x65, 0xa3, 0xf4, - 0x7d, 0x58, 0x22, 0xfd, 0x30, 0xdb, 0x4d, 0x1c, 0x95, 0x85, 0xd6, 0xbb, 0xc3, 0x81, 0x31, 0x16, - 0xb7, 0x6f, 0x93, 0x7e, 0x98, 0xcd, 0x6a, 0xfc, 0x51, 0x82, 0xb5, 0x36, 0xf3, 0xd2, 0x25, 0xae, - 0x8a, 0xa8, 0x77, 0x60, 0x8d, 0xf9, 0x88, 0x10, 0x4a, 0x9c, 0x2e, 0x66, 0xdc, 0x41, 0xc2, 0x2c, - 0x69, 0xe3, 0x83, 0xe1, 0xc0, 0x50, 0xe6, 0xa7, 0xda, 0xab, 0x4b, 0xf4, 0x57, 0x98, 0x71, 0x99, - 0xd1, 0x0f, 0x41, 0x18, 0xe1, 0xb0, 0xd8, 0xcd, 0x07, 0x94, 0xd2, 0x01, 0xeb, 0xc3, 0x81, 0x31, - 0x99, 0xb4, 0x57, 0xd2, 0xd0, 0x71, 0xec, 0x66, 0x2d, 0xbe, 0x80, 0x15, 0x89, 0x0a, 0x3c, 0x82, - 0x78, 0x3f, 0xc6, 0xd2, 0xad, 0x3b, 0xc3, 0x81, 0x51, 0x4c, 0xd9, 0xcb, 0xa2, 0x3c, 0xbb, 0x3e, - 0xd8, 0x48, 0xdc, 0x51, 0xf2, 0x68, 0x0c, 0x35, 0xd8, 0x54, 0x09, 0x93, 0xbb, 0xa3, 0x5c, 0x5e, - 0xbb, 0xd6, 0xf2, 0xdf, 0xc1, 0x8a, 0x9b, 0xf4, 0xc7, 0x5d, 0xa7, 0x83, 0x7a, 0x88, 0xb8, 0xd9, - 0x19, 0xdf, 0x30, 0xa5, 0x86, 0xc9, 0xc3, 0xc5, 0x94, 0x0f, 0x17, 0xf3, 0x88, 0x06, 0xa4, 0x55, - 0x91, 0xe7, 0xba, 0x58, 0x69, 0x2f, 0xcb, 0x40, 0x4b, 0x5c, 0xeb, 0xdb, 0xb0, 0x9a, 0x41, 0x10, - 0x77, 0x7c, 0x1c, 0x78, 0x3e, 0x4f, 0xb5, 0x99, 0xb7, 0xb3, 0xda, 0x43, 0xfe, 0x30, 0x0d, 0x37, - 0x7e, 0x2f, 0x41, 0x75, 0x9c, 0x6c, 0x14, 0xf5, 0x02, 0x37, 0xbd, 0xb7, 0x74, 0x13, 0x14, 0xde, - 0x09, 0xa6, 0x4a, 0x57, 0x9b, 0x50, 0x24, 0x2a, 0x3c, 0x9d, 0xe4, 0x7f, 0x1f, 0x0a, 0x86, 0xa4, - 0xfb, 0x95, 0x8b, 0x36, 0xe9, 0x9f, 0xc0, 0x22, 0xe3, 0xe8, 0x04, 0x57, 0x17, 0x66, 0xa9, 0xb3, - 0x90, 0xa8, 0x63, 0x0b, 0xb4, 0x7e, 0x0f, 0xde, 0x61, 0x38, 0x3e, 0x0d, 0x5c, 0x7c, 0x44, 0xc9, - 0x0f, 0x81, 0x57, 0x5d, 0x4c, 0xbb, 0x8f, 0x07, 0x0f, 0x2a, 0xc9, 0x19, 0x50, 0xf0, 0x68, 0xfc, - 0x55, 0x82, 0xad, 0x69, 0xa2, 0xe4, 0xa7, 0x40, 0x41, 0x56, 0x53, 0x93, 0xfd, 0x1a, 0x0a, 0x0e, - 0xcd, 0xf6, 0x5a, 0xb0, 0x29, 0x1a, 0xbb, 0x09, 0x65, 0xc9, 0xe0, 0x51, 0x57, 0x0a, 0x36, 0x0a, - 0xe8, 0xdf, 0x40, 0x25, 0x73, 0x77, 0xb4, 0xee, 0xf1, 0x75, 0xd4, 0x9b, 0x56, 0x9f, 0x70, 0x2d, - 0x1c, 0x9c, 0x54, 0xd1, 0xc5, 0x89, 0xf3, 0xb4, 0xf7, 0xdf, 0x3c, 0xcc, 0xb7, 0x99, 0xa7, 0x7f, - 0x0f, 0x4b, 0x63, 0xef, 0xbf, 0xf7, 0x94, 0xcf, 0xee, 0xf1, 0x37, 0x4c, 0xed, 0xc3, 0xb7, 0x00, - 0xe5, 0xfa, 0x3f, 0xd7, 0x60, 0xf3, 0x8d, 0xef, 0xa0, 0xfd, 0x29, 0xdd, 0xde, 0x54, 0x54, 0xfb, - 0xfc, 0x06, 0x45, 0xf9, 0x4a, 0x14, 0x56, 0x27, 0x1f, 0xa7, 0xcd, 0x29, 0x1d, 0x27, 0x90, 0xb5, - 0x07, 0x6f, 0x8b, 0xcc, 0x07, 0xfe, 0x04, 0xeb, 0xea, 0x3b, 0xf7, 0xa3, 0xd9, 0xad, 0x46, 0xe8, - 0xda, 0xc7, 0xd7, 0x41, 0x67, 0xc3, 0x6b, 0x8b, 0x3f, 0x27, 0x9f, 0x1a, 0xad, 0xc7, 0x2f, 0xcf, - 0xeb, 0xda, 0xab, 0xf3, 0xba, 0xf6, 0xfa, 0xbc, 0xae, 0xfd, 0x7b, 0x5e, 0xd7, 0x9e, 0x5f, 0xd4, - 0xe7, 0x5e, 0x5d, 0xd4, 0xe7, 0x5e, 0x5f, 0xd4, 0xe7, 0xbe, 0xdd, 0xf3, 0x02, 0xee, 0xf7, 0x3b, - 0xa6, 0x4b, 0x43, 0x2b, 0x19, 0xb2, 0x43, 0x30, 0xff, 0x91, 0xc6, 0x27, 0x96, 0xf2, 0x2b, 0x84, - 0x3f, 0x8b, 0x30, 0xeb, 0xdc, 0x4a, 0x3f, 0xa3, 0xf6, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x42, - 0x53, 0x34, 0x55, 0x3f, 0x0a, 0x00, 0x00, + 0x46, 0x86, 0xb6, 0x03, 0x7b, 0xa2, 0xae, 0x24, 0x61, 0x91, 0x47, 0xf0, 0x4e, 0x6e, 0x82, 0x2e, + 0x45, 0xc7, 0x02, 0x05, 0x82, 0x0e, 0xfd, 0x0d, 0x1d, 0x3d, 0xe4, 0x0f, 0x74, 0xcb, 0x18, 0x74, + 0xca, 0x24, 0x14, 0x36, 0x0a, 0x03, 0x5a, 0xfa, 0x17, 0x02, 0xf2, 0x8e, 0x94, 0x44, 0x9d, 0x22, + 0xc7, 0x8b, 0x6d, 0xbe, 0xef, 0xf3, 0x7e, 0x3c, 0xcf, 0x73, 0x3e, 0x12, 0xee, 0x84, 0xe4, 0x94, + 0x45, 0xa4, 0xd7, 0x33, 0x7c, 0xcf, 0x89, 0x10, 0xf3, 0x48, 0x60, 0xb0, 0x27, 0x7a, 0x18, 0x11, + 0x46, 0x54, 0x35, 0x4d, 0xea, 0x59, 0xb2, 0xba, 0x8e, 0x7c, 0x2f, 0x20, 0x46, 0xf2, 0x93, 0xc3, + 0xaa, 0x65, 0x9b, 0x50, 0x9f, 0x50, 0xc3, 0xa7, 0x8e, 0x71, 0xb6, 0x17, 0xff, 0x12, 0x89, 0x2d, + 0x9e, 0xb0, 0x92, 0x27, 0x83, 0x3f, 0x88, 0xd4, 0x86, 0x43, 0x1c, 0xc2, 0xe3, 0xf1, 0x5f, 0x22, + 0x7a, 0x4f, 0xb2, 0x8d, 0x4f, 0x22, 0x8a, 0x2d, 0x12, 0xd8, 0x2e, 0xf2, 0x02, 0x81, 0xd3, 0x24, + 0xb8, 0x10, 0x45, 0xc8, 0x4f, 0xdb, 0xd7, 0x33, 0x00, 0x0a, 0xc3, 0x9e, 0x67, 0x0b, 0x62, 0x4f, + 0x43, 0x9c, 0x22, 0x6a, 0x62, 0xe9, 0x0e, 0xa2, 0xd8, 0x38, 0xdb, 0xeb, 0x60, 0x86, 0xf6, 0x0c, + 0x9b, 0xa4, 0x23, 0x1a, 0x7f, 0x2b, 0xb0, 0xd6, 0xa6, 0xce, 0xe3, 0xb0, 0x8b, 0x18, 0x7e, 0x94, + 0xf4, 0x56, 0x3f, 0x83, 0x12, 0xea, 0x33, 0x97, 0x44, 0x1e, 0x7b, 0x5a, 0x51, 0xea, 0x4a, 0xb3, + 0xd4, 0xaa, 0xfc, 0xf3, 0x7c, 0x77, 0x43, 0x30, 0x3b, 0xea, 0x76, 0x23, 0x4c, 0xe9, 0x09, 0x8b, + 0xbc, 0xc0, 0x31, 0x47, 0x50, 0xf5, 0x2b, 0xb8, 0xc5, 0xb7, 0xab, 0x14, 0xea, 0x4a, 0x73, 0x79, + 0xbf, 0xaa, 0x4f, 0x0b, 0xab, 0xf3, 0x19, 0xad, 0xd2, 0x8b, 0x81, 0xb6, 0xf0, 0xd7, 0xd5, 0xf9, + 0x8e, 0x62, 0x8a, 0xa2, 0xc3, 0xcf, 0x7f, 0xbd, 0x3a, 0xdf, 0x19, 0xb5, 0xfb, 0xed, 0xea, 0x7c, + 0xe7, 0x6e, 0xc6, 0xef, 0xc9, 0x98, 0x04, 0xb9, 0x7d, 0x1b, 0x5b, 0x50, 0xce, 0x85, 0x4c, 0x4c, + 0x43, 0x12, 0x50, 0xdc, 0x78, 0x5e, 0x00, 0xad, 0x4d, 0x9d, 0x87, 0x7e, 0x48, 0x22, 0xd6, 0x8e, + 0x25, 0x3e, 0xee, 0x21, 0xcf, 0x47, 0x9d, 0x1e, 0x3e, 0xb2, 0x6d, 0xd2, 0x0f, 0xd8, 0xcd, 0xe9, + 0x46, 0x70, 0x9b, 0x9b, 0x86, 0x78, 0x27, 0x8b, 0x32, 0xc4, 0xb0, 0xe0, 0xfe, 0x81, 0x8c, 0x7b, + 0xb2, 0x80, 0x98, 0x7b, 0x12, 0x83, 0x5b, 0x77, 0x62, 0x19, 0x86, 0x03, 0x4d, 0xd6, 0xc9, 0x5c, + 0xf7, 0xf3, 0x78, 0xf5, 0x31, 0x54, 0x24, 0x48, 0xcb, 0x45, 0xd4, 0xad, 0x14, 0xeb, 0x4a, 0x73, + 0xa5, 0xb5, 0x3d, 0x1c, 0x68, 0x33, 0x31, 0xe6, 0xe6, 0x54, 0xcb, 0x07, 0x88, 0xba, 0x87, 0xab, + 0x93, 0xd2, 0x37, 0x7e, 0x57, 0xe0, 0xc3, 0x39, 0xb2, 0xa5, 0x12, 0xab, 0xbb, 0x00, 0x63, 0x4b, + 0x28, 0xc9, 0x12, 0xab, 0xc3, 0x81, 0x36, 0x16, 0x35, 0x4b, 0x34, 0x1d, 0xa5, 0x1e, 0xc0, 0x4a, + 0xd0, 0xf7, 0xd3, 0xdd, 0xf8, 0x51, 0x59, 0x6c, 0xbd, 0x3b, 0x1c, 0x68, 0x13, 0x71, 0x73, 0x39, + 0xe8, 0xfb, 0xe9, 0xac, 0xc6, 0x9f, 0x05, 0xd8, 0x68, 0x53, 0x27, 0x59, 0x62, 0x5c, 0x44, 0xb5, + 0x03, 0x1b, 0xd4, 0x45, 0x41, 0x40, 0x02, 0xab, 0x8b, 0x29, 0xb3, 0x10, 0x37, 0x4b, 0xd8, 0x78, + 0x7f, 0x38, 0xd0, 0xa4, 0xf9, 0x99, 0xf6, 0xaa, 0x02, 0xfd, 0x35, 0xa6, 0x4c, 0x64, 0xd4, 0x23, + 0xe0, 0x46, 0x58, 0x34, 0xb2, 0xb3, 0x01, 0x85, 0x64, 0xc0, 0xe6, 0x70, 0xa0, 0x4d, 0x27, 0xcd, + 0xb5, 0x24, 0x74, 0x12, 0xd9, 0x69, 0x8b, 0x2f, 0x61, 0x4d, 0xa0, 0x3c, 0x27, 0x40, 0xac, 0x1f, + 0x61, 0xe1, 0xd6, 0xed, 0xe1, 0x40, 0xcb, 0xa7, 0xcc, 0x55, 0x5e, 0x9e, 0x3e, 0x1f, 0x6e, 0xc5, + 0xee, 0x48, 0x79, 0x34, 0x86, 0x0a, 0x6c, 0xcb, 0x84, 0xc9, 0xdc, 0x91, 0x2e, 0xaf, 0xbc, 0xd5, + 0xf2, 0xdf, 0xc3, 0x9a, 0x1d, 0xf7, 0xc7, 0x5d, 0xab, 0x83, 0x7a, 0x28, 0xb0, 0xd3, 0x33, 0xbe, + 0xa5, 0x0b, 0x0d, 0xe3, 0xcb, 0x45, 0x17, 0x97, 0x8b, 0x7e, 0x4c, 0xbc, 0xa0, 0x55, 0x16, 0xe7, + 0x3a, 0x5f, 0x69, 0xae, 0x8a, 0x40, 0x8b, 0x3f, 0xab, 0x3b, 0xb0, 0x9e, 0x42, 0x10, 0xb3, 0x5c, + 0xec, 0x39, 0x2e, 0x4b, 0xb4, 0x29, 0x9a, 0x69, 0xed, 0x11, 0x7b, 0x90, 0x84, 0x1b, 0x7f, 0x14, + 0xa0, 0x32, 0x49, 0x76, 0x74, 0xe9, 0xa9, 0x3a, 0x48, 0xbc, 0xe3, 0x4c, 0xa5, 0xae, 0x36, 0x21, + 0x4f, 0x94, 0x7b, 0x3a, 0xcd, 0xff, 0x1e, 0xe4, 0x0c, 0x49, 0xf6, 0x2b, 0xe5, 0x6d, 0x52, 0x3f, + 0x85, 0x25, 0xca, 0xd0, 0x29, 0xae, 0x2c, 0xce, 0x53, 0x67, 0x31, 0x56, 0xc7, 0xe4, 0x68, 0xf5, + 0x2e, 0xbc, 0x43, 0x71, 0x74, 0xe6, 0xd9, 0xf8, 0x98, 0x04, 0x3f, 0x7a, 0x4e, 0x65, 0x29, 0xe9, + 0x3e, 0x19, 0x3c, 0x2c, 0xc7, 0x67, 0x40, 0xc2, 0xa3, 0xf1, 0x5f, 0x01, 0xea, 0xb3, 0x44, 0xc9, + 0x4e, 0x81, 0x84, 0xac, 0x22, 0x27, 0xfb, 0x0d, 0xe4, 0x1c, 0x9a, 0xef, 0x35, 0x67, 0x93, 0x37, + 0xf6, 0x5b, 0x28, 0xa7, 0xfe, 0x8d, 0x16, 0x3a, 0x49, 0xf4, 0x29, 0x5e, 0xaf, 0xe3, 0xac, 0xfa, + 0x98, 0x4d, 0xee, 0x68, 0x24, 0x92, 0x2f, 0x4d, 0x9d, 0x18, 0xf5, 0x21, 0x2c, 0x8f, 0xbd, 0x18, + 0x13, 0x65, 0x97, 0xf7, 0xdf, 0x1b, 0x5d, 0xcd, 0x63, 0x49, 0x7d, 0x6c, 0x8c, 0x58, 0x60, 0xbc, + 0x76, 0xff, 0xff, 0x22, 0x14, 0xdb, 0xd4, 0x51, 0x7f, 0x80, 0x95, 0x89, 0x97, 0xe5, 0xfb, 0xd2, + 0x8b, 0x7e, 0xf2, 0x75, 0x54, 0xfd, 0xe8, 0x1a, 0xa0, 0xcc, 0xac, 0x67, 0x0a, 0x6c, 0xbf, 0xf1, + 0x85, 0x75, 0x30, 0xa3, 0xdb, 0x9b, 0x8a, 0xaa, 0x5f, 0xdc, 0xa0, 0x28, 0x5b, 0x89, 0xc0, 0xfa, + 0xf4, 0xdd, 0xdb, 0x9c, 0xd1, 0x71, 0x0a, 0x59, 0xbd, 0x7f, 0x5d, 0x64, 0x36, 0xf0, 0x67, 0xd8, + 0x94, 0xff, 0x9b, 0x7f, 0x3c, 0xbf, 0xd5, 0x08, 0x5d, 0xfd, 0xe4, 0x6d, 0xd0, 0xe9, 0xf0, 0xea, + 0xd2, 0x2f, 0xf1, 0x77, 0x49, 0xeb, 0xd1, 0x8b, 0x8b, 0x9a, 0xf2, 0xf2, 0xa2, 0xa6, 0xbc, 0xba, + 0xa8, 0x29, 0xff, 0x5e, 0xd4, 0x94, 0x67, 0x97, 0xb5, 0x85, 0x97, 0x97, 0xb5, 0x85, 0x57, 0x97, + 0xb5, 0x85, 0xef, 0xf6, 0x1d, 0x8f, 0xb9, 0xfd, 0x8e, 0x6e, 0x13, 0xdf, 0x88, 0x87, 0xec, 0x06, + 0x98, 0xfd, 0x44, 0xa2, 0x53, 0x43, 0xfa, 0xc9, 0x92, 0x7c, 0x92, 0x75, 0x6e, 0x25, 0xdf, 0x5c, + 0x07, 0xaf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xc8, 0xde, 0xec, 0x7b, 0x8e, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1099,10 +1123,20 @@ func (m *MsgClaimMorseApplicationResponse) MarshalToSizedBuffer(dAtA []byte) (in _ = i var l int _ = l + { + size, err := m.Application.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a if m.ClaimedAtHeight != 0 { i = encodeVarintTx(dAtA, i, uint64(m.ClaimedAtHeight)) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x20 } { size, err := m.ClaimedApplicationStake.MarshalToSizedBuffer(dAtA[:i]) @@ -1113,14 +1147,7 @@ func (m *MsgClaimMorseApplicationResponse) MarshalToSizedBuffer(dAtA []byte) (in i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 - if len(m.ServiceId) > 0 { - i -= len(m.ServiceId) - copy(dAtA[i:], m.ServiceId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ServiceId))) - i-- - dAtA[i] = 0x1a - } + dAtA[i] = 0x1a { size, err := m.ClaimedBalance.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1289,15 +1316,13 @@ func (m *MsgClaimMorseApplicationResponse) Size() (n int) { } l = m.ClaimedBalance.Size() n += 1 + l + sovTx(uint64(l)) - l = len(m.ServiceId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } l = m.ClaimedApplicationStake.Size() n += 1 + l + sovTx(uint64(l)) if m.ClaimedAtHeight != 0 { n += 1 + sovTx(uint64(m.ClaimedAtHeight)) } + l = m.Application.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -2313,9 +2338,9 @@ func (m *MsgClaimMorseApplicationResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedApplicationStake", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2325,27 +2350,47 @@ func (m *MsgClaimMorseApplicationResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.ServiceId = string(dAtA[iNdEx:postIndex]) + if err := m.ClaimedApplicationStake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) + } + m.ClaimedAtHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClaimedAtHeight |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimedApplicationStake", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2372,29 +2417,10 @@ func (m *MsgClaimMorseApplicationResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ClaimedApplicationStake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Application.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) - } - m.ClaimedAtHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ClaimedAtHeight |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From 7453e3a9570849b3f4a6a2e2314eea3bc251bae4 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Mar 2025 13:11:31 +0100 Subject: [PATCH 75/81] chore: self-review improvements --- cmd/poktrolld/cmd/migrate/migrate_test.go | 21 ++++---- pkg/client/query/bankquerier.go | 4 +- .../morse_account_import_and_claim_test.go | 5 +- testutil/integration/suites/base.go | 8 +++- testutil/integration/suites/migration.go | 4 +- testutil/testcache/mocks.go | 35 ++++++++++++++ testutil/testmigration/fixtures.go | 48 ++++++++++++------- .../msg_server_claim_morse_acount_test.go | 4 +- ...er_import_morse_claimable_accounts_test.go | 6 +-- 9 files changed, 97 insertions(+), 38 deletions(-) create mode 100644 testutil/testcache/mocks.go diff --git a/cmd/poktrolld/cmd/migrate/migrate_test.go b/cmd/poktrolld/cmd/migrate/migrate_test.go index 3388301fa..f27d035a1 100644 --- a/cmd/poktrolld/cmd/migrate/migrate_test.go +++ b/cmd/poktrolld/cmd/migrate/migrate_test.go @@ -32,7 +32,8 @@ func TestCollectMorseAccounts(t *testing.T) { require.NoError(t, err) // Generate and write the MorseStateExport input JSON file. - morseStateExportBz, morseAccountStateBz := testmigration.NewMorseStateExportAndAccountStateBytes(t, 10, testmigration.EquallyDistributedMorseAccountStakeState) + morseStateExportBz, morseAccountStateBz := testmigration.NewMorseStateExportAndAccountStateBytes( + t, 10, testmigration.EquallyDistributedMorseAccountActorTypes) _, err = inputFile.Write(morseStateExportBz) require.NoError(t, err) @@ -69,7 +70,8 @@ func TestNewTestMorseStateExport(t *testing.T) { for numAccounts := 1; numAccounts <= 10; numAccounts++ { t.Run(fmt.Sprintf("num_accounts=%d", numAccounts), func(t *testing.T) { morseStateExport := new(migrationtypes.MorseStateExport) - stateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes(t, numAccounts, testmigration.EquallyDistributedMorseAccountStakeState) + stateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes( + t, numAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) err := cmtjson.Unmarshal(stateExportBz, morseStateExport) require.NoError(t, err) @@ -81,10 +83,10 @@ func TestNewTestMorseStateExport(t *testing.T) { require.NoError(t, err) // Construct account number expectations based on equal distribution of unstaked, app, and supplier accounts. - expectedNumApps := numAccounts / 3 expectedNumSuppliers := numAccounts / 3 - switch (numAccounts - 1) % 3 { - case 1: + expectedNumApps := numAccounts / 3 + expectedActorType := testmigration.EquallyDistributedMorseAccountActorTypes(uint64(numAccounts - 1)) + if expectedActorType == testmigration.MorseApplicationActor { expectedNumApps++ } t.Logf("numAccounts: %d; expectedNumApps: %d; expectedNumSuppliers: %d", numAccounts, expectedNumApps, expectedNumSuppliers) @@ -102,8 +104,8 @@ func TestNewTestMorseStateExport(t *testing.T) { for i := 0; i < numAccounts; i++ { expectedShannonTotalUnstakedBalance += testmigration.GenMorseUnstakedBalanceAmount(uint64(i)) - morseAccountStakeState := testmigration.EquallyDistributedMorseAccountStakeState(uint64(i)) - switch morseAccountStakeState { + morseAccountType := testmigration.EquallyDistributedMorseAccountActorTypes(uint64(i)) + switch morseAccountType { case testmigration.MorseUnstakedActor: // No-op. case testmigration.MorseApplicationActor: @@ -111,7 +113,7 @@ func TestNewTestMorseStateExport(t *testing.T) { case testmigration.MorseSupplierActor: expectedShannonTotalSupplierStake += testmigration.GenMorseSupplierStakeAmount(uint64(i)) default: - t.Fatalf("unknown morse account stake state: %q", morseAccountStakeState) + t.Fatalf("unknown morse account stake state: %q", morseAccountType) } } @@ -126,7 +128,8 @@ func BenchmarkTransformMorseState(b *testing.B) { for i := 0; i < 5; i++ { numAccounts := int(math.Pow10(i + 1)) morseStateExport := new(migrationtypes.MorseStateExport) - morseStateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes(b, numAccounts, testmigration.EquallyDistributedMorseAccountStakeState) + morseStateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes( + b, numAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) err := cmtjson.Unmarshal(morseStateExportBz, morseStateExport) require.NoError(b, err) diff --git a/pkg/client/query/bankquerier.go b/pkg/client/query/bankquerier.go index 7b6b42391..0eadd533e 100644 --- a/pkg/client/query/bankquerier.go +++ b/pkg/client/query/bankquerier.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/depinject" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - grpc "github.com/cosmos/gogoproto/grpc" + "github.com/cosmos/gogoproto/grpc" "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/pkg/cache" @@ -32,6 +32,8 @@ type bankQuerier struct { // // Required dependencies: // - clientCtx +// - polylog.Logger +// - cache.KeyValueCache[Balance] func NewBankQuerier(deps depinject.Config) (client.BankQueryClient, error) { bq := &bankQuerier{} diff --git a/tests/integration/migration/morse_account_import_and_claim_test.go b/tests/integration/migration/morse_account_import_and_claim_test.go index 6d87df5ae..3cf4a80dc 100644 --- a/tests/integration/migration/morse_account_import_and_claim_test.go +++ b/tests/integration/migration/morse_account_import_and_claim_test.go @@ -12,6 +12,7 @@ import ( "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/testutil/integration/suites" "github.com/pokt-network/poktroll/testutil/sample" + "github.com/pokt-network/poktroll/testutil/testmigration" migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) @@ -40,7 +41,7 @@ func TestMigrationModuleSuite(t *testing.T) { // TestImportMorseClaimableAccounts exercises importing and persistence of morse claimable accounts. func (s *MigrationModuleTestSuite) TestImportMorseClaimableAccounts() { - s.GenerateMorseAccountState(s.T(), s.numMorseClaimableAccounts) + s.GenerateMorseAccountState(s.T(), s.numMorseClaimableAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) msgImportRes := s.ImportMorseClaimableAccounts(s.T()) morseAccountState := s.GetAccountState(s.T()) morseAccountStateHash, err := morseAccountState.GetHash() @@ -72,7 +73,7 @@ func (s *MigrationModuleTestSuite) TestImportMorseClaimableAccounts() { // It only exercises claiming of account balances and does not exercise // the staking any actors as a result of claiming. func (s *MigrationModuleTestSuite) TestClaimMorseAccount() { - s.GenerateMorseAccountState(s.T(), s.numMorseClaimableAccounts) + s.GenerateMorseAccountState(s.T(), s.numMorseClaimableAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) s.ImportMorseClaimableAccounts(s.T()) shannonDestAddr := sample.AccAddress() diff --git a/testutil/integration/suites/base.go b/testutil/integration/suites/base.go index 1a2adb5f6..405298eca 100644 --- a/testutil/integration/suites/base.go +++ b/testutil/integration/suites/base.go @@ -18,8 +18,10 @@ import ( "github.com/pokt-network/poktroll/pkg/client" "github.com/pokt-network/poktroll/pkg/client/query" "github.com/pokt-network/poktroll/pkg/polylog" + "github.com/pokt-network/poktroll/pkg/polylog/polyzero" _ "github.com/pokt-network/poktroll/pkg/polylog/polyzero" "github.com/pokt-network/poktroll/testutil/integration" + "github.com/pokt-network/poktroll/testutil/testcache" ) var _ IntegrationSuite = (*BaseIntegrationSuite)(nil) @@ -103,7 +105,11 @@ func (s *BaseIntegrationSuite) FundAddress( func (s *BaseIntegrationSuite) GetBankQueryClient(t *testing.T) client.BankQueryClient { t.Helper() - deps := depinject.Supply(s.GetApp().QueryHelper()) + deps := depinject.Supply( + polyzero.NewLogger(), + testcache.NewNoopKeyValueCache[query.Balance](), + s.GetApp().QueryHelper(), + ) bankqueryClient, err := query.NewBankQuerier(deps) require.NoError(t, err) diff --git a/testutil/integration/suites/migration.go b/testutil/integration/suites/migration.go index 4643dd395..5cc7082ec 100644 --- a/testutil/integration/suites/migration.go +++ b/testutil/integration/suites/migration.go @@ -28,9 +28,9 @@ type MigrationModuleSuite struct { // GenerateMorseAccountState generates a MorseAccountState with the given number of MorseClaimableAccounts. // It updates the suite's #numMorseClaimableAccounts and #accountState fields. -func (s *MigrationModuleSuite) GenerateMorseAccountState(t *testing.T, numAccounts int) { +func (s *MigrationModuleSuite) GenerateMorseAccountState(t *testing.T, numAccounts int, distributionFn testmigration.MorseAccountActorTypeDistributionFn) { s.numMorseClaimableAccounts = numAccounts - _, s.accountState = testmigration.NewMorseStateExportAndAccountState(t, s.numMorseClaimableAccounts, testmigration.EquallyDistributedMorseAccountStakeState) + _, s.accountState = testmigration.NewMorseStateExportAndAccountState(t, s.numMorseClaimableAccounts, distributionFn) } // GetAccountState returns the suite's #accountState field. diff --git a/testutil/testcache/mocks.go b/testutil/testcache/mocks.go new file mode 100644 index 000000000..cc571b767 --- /dev/null +++ b/testutil/testcache/mocks.go @@ -0,0 +1,35 @@ +package testcache + +import "github.com/stretchr/testify/mock" + +type MockKeyValueCache[T any] struct { + mock.Mock +} + +func NewNoopKeyValueCache[T any]() *MockKeyValueCache[T] { + var zeroT T + cache := &MockKeyValueCache[T]{} + cache.On("Get", mock.Anything).Return(zeroT, false) + cache.On("Set", mock.Anything, mock.Anything) + cache.On("Delete", mock.Anything) + cache.On("Clear") + + return cache +} + +func (m *MockKeyValueCache[T]) Get(key string) (T, bool) { + args := m.Called(key) + return args.Get(0).(T), args.Bool(1) +} + +func (m *MockKeyValueCache[T]) Set(key string, value T) { + m.Called(key, value) +} + +func (m *MockKeyValueCache[T]) Delete(key string) { + m.Called(key) +} + +func (m *MockKeyValueCache[T]) Clear() { + m.Called() +} diff --git a/testutil/testmigration/fixtures.go b/testutil/testmigration/fixtures.go index 9c03deeae..c49e91df5 100644 --- a/testutil/testmigration/fixtures.go +++ b/testutil/testmigration/fixtures.go @@ -16,21 +16,21 @@ import ( // MorseAccountActorType is an enum which represents all possible staked and // unstaked actor types which are considered in the migration module. -type MorseAccountActorType string +type MorseAccountActorType int const ( - MorseUnstakedActor = MorseAccountActorType("unstaked") - MorseApplicationActor = MorseAccountActorType("application") - MorseSupplierActor = MorseAccountActorType("supplier") + MorseUnstakedActor = MorseAccountActorType(iota) + MorseApplicationActor + MorseSupplierActor ) -// MorseAccountStakeStateDistributionFn is a function which returns a MorseStakeState +// MorseAccountActorTypeDistributionFn is a function which returns a MorseAccountActorType // derived from the given index. It is intended to be used in conjunction with // MorseStateExport and MorseAccountState fixture generation logic. -type MorseAccountStakeStateDistributionFn func(index uint64) MorseAccountActorType +type MorseAccountActorTypeDistributionFn func(index uint64) MorseAccountActorType -// EquallyDistributedMorseAccountStakeState cyclically returns each MorseAccountActorType, one after the other, as the index increases. -func EquallyDistributedMorseAccountStakeState(index uint64) MorseAccountActorType { +// EquallyDistributedMorseAccountActorTypes cyclically returns each MorseAccountActorType, one after the other, as the index increases. +func EquallyDistributedMorseAccountActorTypes(index uint64) MorseAccountActorType { switch index % 3 { case 0: return MorseUnstakedActor @@ -41,8 +41,8 @@ func EquallyDistributedMorseAccountStakeState(index uint64) MorseAccountActorTyp } } -// AllUnstakedMorseAccountStakeState returns MorseUnstakedActor for every index. -func AllUnstakedMorseAccountStakeState(_ uint64) MorseAccountActorType { +// AllUnstakedMorseAccountActorType returns MorseUnstakedActor for every index. +func AllUnstakedMorseAccountActorType(_ uint64) MorseAccountActorType { return MorseUnstakedActor } @@ -61,7 +61,7 @@ func AllUnstakedMorseAccountStakeState(_ uint64) MorseAccountActorType { func NewMorseStateExportAndAccountStateBytes( t gocuke.TestingT, numAccounts int, - distributionFn MorseAccountStakeStateDistributionFn, + distributionFn MorseAccountActorTypeDistributionFn, ) (morseStateExportBz []byte, morseAccountStateBz []byte) { morseStateExport, morseAccountState := NewMorseStateExportAndAccountState(t, numAccounts, distributionFn) @@ -83,7 +83,7 @@ func NewMorseStateExportAndAccountStateBytes( func NewMorseStateExportAndAccountState( t gocuke.TestingT, numAccounts int, - distributionFn MorseAccountStakeStateDistributionFn, + distributionFn MorseAccountActorTypeDistributionFn, ) (export *migrationtypes.MorseStateExport, state *migrationtypes.MorseAccountState) { t.Helper() @@ -101,8 +101,8 @@ func NewMorseStateExportAndAccountState( } for i := 0; i < numAccounts; i++ { - morseAccountStakeState := distributionFn(uint64(i)) - switch morseAccountStakeState { + morseAccountType := distributionFn(uint64(i)) + switch morseAccountType { case MorseUnstakedActor: // No-op. case MorseApplicationActor: @@ -120,7 +120,7 @@ func NewMorseStateExportAndAccountState( GenMorseValidator(t, uint64(i)), ) default: - panic(fmt.Sprintf("unknown morse account stake state %q", morseAccountStakeState)) + panic(fmt.Sprintf("unknown morse account stake state %q", morseAccountType)) } // Add an account (regardless of whether it is staked or not). @@ -153,25 +153,37 @@ func GenMorsePrivateKey(t gocuke.TestingT, seed uint64) cometcrypto.PrivKey { // GenMorseUnstakedBalanceAmount returns an amount by applying the given index to // a pattern such that the generated amount is unique to the unstaked balance // (as opposed to actor stake(s)) and the given index. +// E.g.: +// - GenMorseApplicationStakeAmount(0) = 1000001 +// - GenMorseApplicationStakeAmount(1) = 2000002 +// - GenMorseApplicationStakeAmount(10) = 10000010 func GenMorseUnstakedBalanceAmount(index uint64) int64 { index++ - return int64(1e6*index + index) // idx_000_00i + return int64(1e6*index + index) // index_000_00index } // GenMorseSupplierStakeAmount returns an amount by applying the given index to // a pattern such that the generated amount is unique to the supplier stake // (as opposed to the unstaked balance or application stake) and the given index. +// E.g.: +// - GenMorseApplicationStakeAmount(0) = 10100 +// - GenMorseApplicationStakeAmount(1) = 20200 +// - GenMorseApplicationStakeAmount(10) = 101000 func GenMorseSupplierStakeAmount(index uint64) int64 { index++ - return int64(1e4*index + (index * 100)) // idx0_j00 + return int64(1e4*index + (index * 100)) // index0_index00 } // GenMorseApplicationStakeAmount returns an amount by applying the given index to // a pattern such that the generated amount is unique to the application stake // (as opposed to the unstaked balance or supplier stake) and the given index. +// E.g.: +// - GenMorseApplicationStakeAmount(0) = 100010 +// - GenMorseApplicationStakeAmount(1) = 200020 +// - GenMorseApplicationStakeAmount(10) = 1000100 func GenMorseApplicationStakeAmount(index uint64) int64 { index++ - return int64(1e5*index + (index * 10)) // j00_0j0 + return int64(1e5*index + (index * 10)) // index00_0index0 } // GenMorseAccount returns a new MorseAccount fixture. The given index is used diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go index b02ada7f6..e031e9423 100644 --- a/x/migration/keeper/msg_server_claim_morse_acount_test.go +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -28,7 +28,7 @@ func TestMsgServer_ClaimMorseAccount_Success(t *testing.T) { // Generate and import Morse claimable accounts. numAccounts := 6 - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.AllUnstakedMorseAccountStakeState) + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.AllUnstakedMorseAccountActorType) accountStateHash, err := accountState.GetHash() require.NoError(t, err) @@ -99,7 +99,7 @@ func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { // - One staked as an application // - One staked as a supplier numAccounts := 3 - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.EquallyDistributedMorseAccountStakeState) + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) accountStateHash, err := accountState.GetHash() require.NoError(t, err) diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go index a12dbe52d..63fba2d18 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go @@ -21,7 +21,7 @@ func TestMsgServer_ImportMorseClaimableAccounts_Success(t *testing.T) { srv := keeper.NewMsgServerImpl(k) numAccounts := 10 - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.EquallyDistributedMorseAccountStakeState) + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) // Assert that the MorseAccountState is not set initially. morseClaimableAccounts := k.GetAllMorseClaimableAccounts(ctx) @@ -76,7 +76,7 @@ func TestMsgServer_ImportMorseClaimableAccounts_ErrorAlreadySet(t *testing.T) { srv := keeper.NewMsgServerImpl(k) // Set at least one MorseAccountState initially. - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, 1, testmigration.EquallyDistributedMorseAccountStakeState) + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, 1, testmigration.EquallyDistributedMorseAccountActorTypes) k.SetMorseClaimableAccount(ctx, *accountState.Accounts[0]) // Set up the MsgImportMorseClaimableAccounts to fail. @@ -105,7 +105,7 @@ func TestMsgServer_ImportMorseClaimableAccounts_ErrorInvalidAuthority(t *testing srv := keeper.NewMsgServerImpl(k) numAccounts := 10 - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.EquallyDistributedMorseAccountStakeState) + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) msgImportMorseClaimableAccounts, err := migrationtypes.NewMsgImportMorseClaimableAccounts( authtypes.NewModuleAddress("invalid_authority").String(), From 706d90ee6c8d28ebb87e51f073c3dbb8c64ae0af Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Mar 2025 14:24:02 +0100 Subject: [PATCH 76/81] chore: review feedback improvements Co-authored-by: Daniel Olshansky --- x/application/keeper/msg_server_stake_application.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x/application/keeper/msg_server_stake_application.go b/x/application/keeper/msg_server_stake_application.go index c7ef9e765..6b20a0797 100644 --- a/x/application/keeper/msg_server_stake_application.go +++ b/x/application/keeper/msg_server_stake_application.go @@ -22,9 +22,10 @@ func (k msgServer) StakeApplication(ctx context.Context, msg *types.MsgStakeAppl ) logger := k.Logger().With("method", "StakeApplication") - foundApp, err := k.Keeper.StakeApplication(ctx, logger, msg) + // Update the staking configurations of a existing app or stake a new app + stakedApp, err := k.Keeper.StakeApplication(ctx, logger, msg) if err != nil { - // DEV_NOTE: StakeApplication SHOULD ALWAYS return a gRPC status error. + // DEV_NOTE: If the error is non-nil, StakeApplication SHOULD ALWAYS return a gRPC status error. return nil, err } From dd2fcabddf15c050132f6813f6631059304b6e62 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Mar 2025 14:32:07 +0100 Subject: [PATCH 77/81] fix: typo --- x/application/keeper/msg_server_stake_application.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/application/keeper/msg_server_stake_application.go b/x/application/keeper/msg_server_stake_application.go index 6b20a0797..4c288a950 100644 --- a/x/application/keeper/msg_server_stake_application.go +++ b/x/application/keeper/msg_server_stake_application.go @@ -32,7 +32,7 @@ func (k msgServer) StakeApplication(ctx context.Context, msg *types.MsgStakeAppl isSuccessful = true return &types.MsgStakeApplicationResponse{ - Application: foundApp, + Application: stakedApp, }, nil } From 4918cfa26d04384ebf3a0000bfcbf3f0142a349d Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Mar 2025 15:10:00 +0100 Subject: [PATCH 78/81] chore: review feedback improvements --- api/poktroll/migration/event.pulsar.go | 124 ++++++++-------- api/poktroll/migration/tx.pulsar.go | 137 +++++++++--------- proto/poktroll/migration/event.proto | 4 +- proto/poktroll/migration/tx.proto | 4 +- .../morse_account_import_and_claim_test.go | 11 +- testutil/integration/app.go | 2 + testutil/integration/suites/migration.go | 10 ++ testutil/keeper/migration.go | 26 +++- testutil/keeper/tokenomics.go | 1 + x/migration/keeper/keeper.go | 3 + .../keeper/msg_server_claim_morse_account.go | 11 +- .../msg_server_claim_morse_acount_test.go | 11 +- x/migration/module/module.go | 6 + x/migration/types/event.pb.go | 89 ++++++------ x/migration/types/expected_keepers.go | 8 +- x/migration/types/tx.pb.go | 122 ++++++++-------- 16 files changed, 311 insertions(+), 258 deletions(-) diff --git a/api/poktroll/migration/event.pulsar.go b/api/poktroll/migration/event.pulsar.go index edbc443a0..cf7029069 100644 --- a/api/poktroll/migration/event.pulsar.go +++ b/api/poktroll/migration/event.pulsar.go @@ -536,7 +536,7 @@ func (x *fastReflection_EventImportMorseClaimableAccounts) ProtoMethods() *proto var ( md_EventMorseAccountClaimed protoreflect.MessageDescriptor - fd_EventMorseAccountClaimed_claimed_at_height protoreflect.FieldDescriptor + fd_EventMorseAccountClaimed_session_end_height protoreflect.FieldDescriptor fd_EventMorseAccountClaimed_claimed_balance protoreflect.FieldDescriptor fd_EventMorseAccountClaimed_shannon_dest_address protoreflect.FieldDescriptor fd_EventMorseAccountClaimed_morse_src_address protoreflect.FieldDescriptor @@ -545,7 +545,7 @@ var ( func init() { file_poktroll_migration_event_proto_init() md_EventMorseAccountClaimed = File_poktroll_migration_event_proto.Messages().ByName("EventMorseAccountClaimed") - fd_EventMorseAccountClaimed_claimed_at_height = md_EventMorseAccountClaimed.Fields().ByName("claimed_at_height") + fd_EventMorseAccountClaimed_session_end_height = md_EventMorseAccountClaimed.Fields().ByName("session_end_height") fd_EventMorseAccountClaimed_claimed_balance = md_EventMorseAccountClaimed.Fields().ByName("claimed_balance") fd_EventMorseAccountClaimed_shannon_dest_address = md_EventMorseAccountClaimed.Fields().ByName("shannon_dest_address") fd_EventMorseAccountClaimed_morse_src_address = md_EventMorseAccountClaimed.Fields().ByName("morse_src_address") @@ -616,9 +616,9 @@ func (x *fastReflection_EventMorseAccountClaimed) Interface() protoreflect.Proto // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_EventMorseAccountClaimed) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.ClaimedAtHeight != int64(0) { - value := protoreflect.ValueOfInt64(x.ClaimedAtHeight) - if !f(fd_EventMorseAccountClaimed_claimed_at_height, value) { + if x.SessionEndHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.SessionEndHeight) + if !f(fd_EventMorseAccountClaimed_session_end_height, value) { return } } @@ -655,8 +655,8 @@ func (x *fastReflection_EventMorseAccountClaimed) Range(f func(protoreflect.Fiel // a repeated field is populated if it is non-empty. func (x *fastReflection_EventMorseAccountClaimed) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.migration.EventMorseAccountClaimed.claimed_at_height": - return x.ClaimedAtHeight != int64(0) + case "poktroll.migration.EventMorseAccountClaimed.session_end_height": + return x.SessionEndHeight != int64(0) case "poktroll.migration.EventMorseAccountClaimed.claimed_balance": return x.ClaimedBalance != nil case "poktroll.migration.EventMorseAccountClaimed.shannon_dest_address": @@ -679,8 +679,8 @@ func (x *fastReflection_EventMorseAccountClaimed) Has(fd protoreflect.FieldDescr // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_EventMorseAccountClaimed) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.migration.EventMorseAccountClaimed.claimed_at_height": - x.ClaimedAtHeight = int64(0) + case "poktroll.migration.EventMorseAccountClaimed.session_end_height": + x.SessionEndHeight = int64(0) case "poktroll.migration.EventMorseAccountClaimed.claimed_balance": x.ClaimedBalance = nil case "poktroll.migration.EventMorseAccountClaimed.shannon_dest_address": @@ -703,8 +703,8 @@ func (x *fastReflection_EventMorseAccountClaimed) Clear(fd protoreflect.FieldDes // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_EventMorseAccountClaimed) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.migration.EventMorseAccountClaimed.claimed_at_height": - value := x.ClaimedAtHeight + case "poktroll.migration.EventMorseAccountClaimed.session_end_height": + value := x.SessionEndHeight return protoreflect.ValueOfInt64(value) case "poktroll.migration.EventMorseAccountClaimed.claimed_balance": value := x.ClaimedBalance @@ -735,8 +735,8 @@ func (x *fastReflection_EventMorseAccountClaimed) Get(descriptor protoreflect.Fi // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_EventMorseAccountClaimed) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.migration.EventMorseAccountClaimed.claimed_at_height": - x.ClaimedAtHeight = value.Int() + case "poktroll.migration.EventMorseAccountClaimed.session_end_height": + x.SessionEndHeight = value.Int() case "poktroll.migration.EventMorseAccountClaimed.claimed_balance": x.ClaimedBalance = value.Message().Interface().(*v1beta1.Coin) case "poktroll.migration.EventMorseAccountClaimed.shannon_dest_address": @@ -768,8 +768,8 @@ func (x *fastReflection_EventMorseAccountClaimed) Mutable(fd protoreflect.FieldD x.ClaimedBalance = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) - case "poktroll.migration.EventMorseAccountClaimed.claimed_at_height": - panic(fmt.Errorf("field claimed_at_height of message poktroll.migration.EventMorseAccountClaimed is not mutable")) + case "poktroll.migration.EventMorseAccountClaimed.session_end_height": + panic(fmt.Errorf("field session_end_height of message poktroll.migration.EventMorseAccountClaimed is not mutable")) case "poktroll.migration.EventMorseAccountClaimed.shannon_dest_address": panic(fmt.Errorf("field shannon_dest_address of message poktroll.migration.EventMorseAccountClaimed is not mutable")) case "poktroll.migration.EventMorseAccountClaimed.morse_src_address": @@ -787,7 +787,7 @@ func (x *fastReflection_EventMorseAccountClaimed) Mutable(fd protoreflect.FieldD // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_EventMorseAccountClaimed) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.EventMorseAccountClaimed.claimed_at_height": + case "poktroll.migration.EventMorseAccountClaimed.session_end_height": return protoreflect.ValueOfInt64(int64(0)) case "poktroll.migration.EventMorseAccountClaimed.claimed_balance": m := new(v1beta1.Coin) @@ -865,8 +865,8 @@ func (x *fastReflection_EventMorseAccountClaimed) ProtoMethods() *protoiface.Met var n int var l int _ = l - if x.ClaimedAtHeight != 0 { - n += 1 + runtime.Sov(uint64(x.ClaimedAtHeight)) + if x.SessionEndHeight != 0 { + n += 1 + runtime.Sov(uint64(x.SessionEndHeight)) } if x.ClaimedBalance != nil { l = options.Size(x.ClaimedBalance) @@ -937,8 +937,8 @@ func (x *fastReflection_EventMorseAccountClaimed) ProtoMethods() *protoiface.Met i-- dAtA[i] = 0x12 } - if x.ClaimedAtHeight != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimedAtHeight)) + if x.SessionEndHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.SessionEndHeight)) i-- dAtA[i] = 0x8 } @@ -993,9 +993,9 @@ func (x *fastReflection_EventMorseAccountClaimed) ProtoMethods() *protoiface.Met switch fieldNum { case 1: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SessionEndHeight", wireType) } - x.ClaimedAtHeight = 0 + x.SessionEndHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1005,7 +1005,7 @@ func (x *fastReflection_EventMorseAccountClaimed) ProtoMethods() *protoiface.Met } b := dAtA[iNdEx] iNdEx++ - x.ClaimedAtHeight |= int64(b&0x7F) << shift + x.SessionEndHeight |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -1220,8 +1220,8 @@ type EventMorseAccountClaimed struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The height (on Shannon) at which the claim was executed (i.e. claimed). - ClaimedAtHeight int64 `protobuf:"varint,1,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` + // The session end height (on Shannon) in which the claim was committed (i.e. claimed). + SessionEndHeight int64 `protobuf:"varint,1,opt,name=session_end_height,json=sessionEndHeight,proto3" json:"session_end_height,omitempty"` // The unstaked balance which was claimed. ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance,omitempty"` // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. @@ -1250,9 +1250,9 @@ func (*EventMorseAccountClaimed) Descriptor() ([]byte, []int) { return file_poktroll_migration_event_proto_rawDescGZIP(), []int{1} } -func (x *EventMorseAccountClaimed) GetClaimedAtHeight() int64 { +func (x *EventMorseAccountClaimed) GetSessionEndHeight() int64 { if x != nil { - return x.ClaimedAtHeight + return x.SessionEndHeight } return 0 } @@ -1309,41 +1309,41 @@ var file_poktroll_migration_event_proto_rawDesc = []byte{ 0x6e, 0x75, 0x6d, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x03, 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, 0x22, 0xe1, 0x02, 0x0a, 0x18, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x12, 0x41, - 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x63, - 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x12, 0x5b, 0x0a, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x17, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x0f, 0x63, - 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0e, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x62, - 0x0a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xea, 0xde, - 0x1f, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x12, - 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x15, 0xea, - 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, 0x63, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0xb6, 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, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 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, + 0x73, 0x22, 0xe4, 0x02, 0x0a, 0x18, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x12, 0x44, + 0x0a, 0x12, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x16, 0xea, 0xde, 0x1f, 0x12, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x52, 0x10, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x48, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x12, 0x5b, 0x0a, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, + 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x17, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, + 0x1f, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x12, 0x62, 0x0a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, + 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x30, 0xea, 0xde, 0x1f, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, + 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x12, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, + 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x72, + 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0xb6, 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, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 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/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index d974ee54a..acb8f06f8 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -2458,10 +2458,10 @@ func (x *fastReflection_MsgClaimMorseAccount) ProtoMethods() *protoiface.Methods } var ( - md_MsgClaimMorseAccountResponse protoreflect.MessageDescriptor - fd_MsgClaimMorseAccountResponse_morse_src_address protoreflect.FieldDescriptor - fd_MsgClaimMorseAccountResponse_claimed_balance protoreflect.FieldDescriptor - fd_MsgClaimMorseAccountResponse_claimed_at_height protoreflect.FieldDescriptor + md_MsgClaimMorseAccountResponse protoreflect.MessageDescriptor + fd_MsgClaimMorseAccountResponse_morse_src_address protoreflect.FieldDescriptor + fd_MsgClaimMorseAccountResponse_claimed_balance protoreflect.FieldDescriptor + fd_MsgClaimMorseAccountResponse_session_end_height protoreflect.FieldDescriptor ) func init() { @@ -2469,7 +2469,7 @@ func init() { md_MsgClaimMorseAccountResponse = File_poktroll_migration_tx_proto.Messages().ByName("MsgClaimMorseAccountResponse") fd_MsgClaimMorseAccountResponse_morse_src_address = md_MsgClaimMorseAccountResponse.Fields().ByName("morse_src_address") fd_MsgClaimMorseAccountResponse_claimed_balance = md_MsgClaimMorseAccountResponse.Fields().ByName("claimed_balance") - fd_MsgClaimMorseAccountResponse_claimed_at_height = md_MsgClaimMorseAccountResponse.Fields().ByName("claimed_at_height") + fd_MsgClaimMorseAccountResponse_session_end_height = md_MsgClaimMorseAccountResponse.Fields().ByName("session_end_height") } var _ protoreflect.Message = (*fastReflection_MsgClaimMorseAccountResponse)(nil) @@ -2549,9 +2549,9 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) Range(f func(protoreflect. return } } - if x.ClaimedAtHeight != int64(0) { - value := protoreflect.ValueOfInt64(x.ClaimedAtHeight) - if !f(fd_MsgClaimMorseAccountResponse_claimed_at_height, value) { + if x.SessionEndHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.SessionEndHeight) + if !f(fd_MsgClaimMorseAccountResponse_session_end_height, value) { return } } @@ -2574,8 +2574,8 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) Has(fd protoreflect.FieldD return x.MorseSrcAddress != "" case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance": return x.ClaimedBalance != nil - case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_at_height": - return x.ClaimedAtHeight != int64(0) + case "poktroll.migration.MsgClaimMorseAccountResponse.session_end_height": + return x.SessionEndHeight != int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) @@ -2596,8 +2596,8 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) Clear(fd protoreflect.Fiel x.MorseSrcAddress = "" case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance": x.ClaimedBalance = nil - case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_at_height": - x.ClaimedAtHeight = int64(0) + case "poktroll.migration.MsgClaimMorseAccountResponse.session_end_height": + x.SessionEndHeight = int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) @@ -2620,8 +2620,8 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) Get(descriptor protoreflec case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance": value := x.ClaimedBalance return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_at_height": - value := x.ClaimedAtHeight + case "poktroll.migration.MsgClaimMorseAccountResponse.session_end_height": + value := x.SessionEndHeight return protoreflect.ValueOfInt64(value) default: if descriptor.IsExtension() { @@ -2647,8 +2647,8 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) Set(fd protoreflect.FieldD x.MorseSrcAddress = value.Interface().(string) case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance": x.ClaimedBalance = value.Message().Interface().(*v1beta1.Coin) - case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_at_height": - x.ClaimedAtHeight = value.Int() + case "poktroll.migration.MsgClaimMorseAccountResponse.session_end_height": + x.SessionEndHeight = value.Int() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) @@ -2676,8 +2676,8 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) Mutable(fd protoreflect.Fi return protoreflect.ValueOfMessage(x.ClaimedBalance.ProtoReflect()) case "poktroll.migration.MsgClaimMorseAccountResponse.morse_src_address": panic(fmt.Errorf("field morse_src_address of message poktroll.migration.MsgClaimMorseAccountResponse is not mutable")) - case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_at_height": - panic(fmt.Errorf("field claimed_at_height of message poktroll.migration.MsgClaimMorseAccountResponse is not mutable")) + case "poktroll.migration.MsgClaimMorseAccountResponse.session_end_height": + panic(fmt.Errorf("field session_end_height of message poktroll.migration.MsgClaimMorseAccountResponse is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgClaimMorseAccountResponse")) @@ -2696,7 +2696,7 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) NewField(fd protoreflect.F case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_balance": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "poktroll.migration.MsgClaimMorseAccountResponse.claimed_at_height": + case "poktroll.migration.MsgClaimMorseAccountResponse.session_end_height": return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { @@ -2775,8 +2775,8 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) ProtoMethods() *protoiface l = options.Size(x.ClaimedBalance) n += 1 + l + runtime.Sov(uint64(l)) } - if x.ClaimedAtHeight != 0 { - n += 1 + runtime.Sov(uint64(x.ClaimedAtHeight)) + if x.SessionEndHeight != 0 { + n += 1 + runtime.Sov(uint64(x.SessionEndHeight)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -2807,8 +2807,8 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) ProtoMethods() *protoiface i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.ClaimedAtHeight != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimedAtHeight)) + if x.SessionEndHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.SessionEndHeight)) i-- dAtA[i] = 0x18 } @@ -2952,9 +2952,9 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) ProtoMethods() *protoiface iNdEx = postIndex case 3: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SessionEndHeight", wireType) } - x.ClaimedAtHeight = 0 + x.SessionEndHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2964,7 +2964,7 @@ func (x *fastReflection_MsgClaimMorseAccountResponse) ProtoMethods() *protoiface } b := dAtA[iNdEx] iNdEx++ - x.ClaimedAtHeight |= int64(b&0x7F) << shift + x.SessionEndHeight |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -3279,8 +3279,8 @@ type MsgClaimMorseAccountResponse struct { MorseSrcAddress string `protobuf:"bytes,1,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address,omitempty"` // The balance which was claimed. ClaimedBalance *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance,omitempty"` - // The height (on Shannon) at which the claim was created. - ClaimedAtHeight int64 `protobuf:"varint,3,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` + // The session end height (on Shannon) in which the claim was committed (i.e. claimed). + SessionEndHeight int64 `protobuf:"varint,3,opt,name=session_end_height,json=sessionEndHeight,proto3" json:"session_end_height,omitempty"` } func (x *MsgClaimMorseAccountResponse) Reset() { @@ -3317,9 +3317,9 @@ func (x *MsgClaimMorseAccountResponse) GetClaimedBalance() *v1beta1.Coin { return nil } -func (x *MsgClaimMorseAccountResponse) GetClaimedAtHeight() int64 { +func (x *MsgClaimMorseAccountResponse) GetSessionEndHeight() int64 { if x != nil { - return x.ClaimedAtHeight + return x.SessionEndHeight } return 0 } @@ -3402,7 +3402,7 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0e, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x19, 0x82, 0xe7, 0xb0, 0x2a, 0x14, 0x73, 0x68, 0x61, 0x6e, 0x6e, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xea, 0x01, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x43, 0x6c, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x84, 0x02, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x11, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, @@ -3414,45 +3414,46 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x17, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, - 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x48, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x32, 0xf2, 0x02, 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, 0x90, 0x01, - 0x0a, 0x1c, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, - 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x33, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, - 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, - 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x12, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x42, 0x16, 0xea, 0xde, 0x1f, 0x12, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x10, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x32, 0xf2, 0x02, + 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, 0x90, 0x01, 0x0a, 0x1c, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x6f, 0x0a, 0x11, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, - 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, - 0x30, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x33, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, + 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x11, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, - 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 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, + 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x30, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, + 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 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 ( diff --git a/proto/poktroll/migration/event.proto b/proto/poktroll/migration/event.proto index 897cbdce8..49b509edb 100644 --- a/proto/poktroll/migration/event.proto +++ b/proto/poktroll/migration/event.proto @@ -26,8 +26,8 @@ message EventImportMorseClaimableAccounts { // EventMorseAccountClaimed is emitted when a MorseAccount is claimed on-chain. message EventMorseAccountClaimed { - // The height (on Shannon) at which the claim was executed (i.e. claimed). - int64 claimed_at_height = 1 [(gogoproto.jsontag) = "claimed_at_height"]; + // The session end height (on Shannon) in which the claim was committed (i.e. claimed). + int64 session_end_height = 1 [(gogoproto.jsontag) = "session_end_height"]; // The unstaked balance which was claimed. cosmos.base.v1beta1.Coin claimed_balance = 2 [(gogoproto.jsontag) = "claimed_balance", (gogoproto.nullable) = false]; diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 331bbff30..ba50b809c 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -107,7 +107,7 @@ message MsgClaimMorseAccountResponse { // The balance which was claimed. cosmos.base.v1beta1.Coin claimed_balance = 2 [(gogoproto.jsontag) = "claimed_balance", (gogoproto.nullable) = false]; - // The height (on Shannon) at which the claim was created. - int64 claimed_at_height = 3; + // The session end height (on Shannon) in which the claim was committed (i.e. claimed). + int64 session_end_height = 3 [(gogoproto.jsontag) = "session_end_height"]; } diff --git a/tests/integration/migration/morse_account_import_and_claim_test.go b/tests/integration/migration/morse_account_import_and_claim_test.go index 3cf4a80dc..29108bd93 100644 --- a/tests/integration/migration/morse_account_import_and_claim_test.go +++ b/tests/integration/migration/morse_account_import_and_claim_test.go @@ -14,6 +14,7 @@ import ( "github.com/pokt-network/poktroll/testutil/sample" "github.com/pokt-network/poktroll/testutil/testmigration" migrationtypes "github.com/pokt-network/poktroll/x/migration/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) type MigrationModuleTestSuite struct { @@ -90,10 +91,14 @@ func (s *MigrationModuleTestSuite) TestClaimMorseAccount() { Add(expectedMorseClaimableAccount.GetApplicationStake()). Add(expectedMorseClaimableAccount.GetSupplierStake()) + s.GetSharedParams(s.T()) + sharedParams := s.GetSharedParams(s.T()) + currentHeight := s.SdkCtx().BlockHeight() + expectedSessionEndHeight := sharedtypes.GetSessionEndHeight(&sharedParams, currentHeight) expectedClaimAccountRes := &migrationtypes.MsgClaimMorseAccountResponse{ - MorseSrcAddress: morseSrcAddr, - ClaimedBalance: expectedBalance, - ClaimedAtHeight: s.SdkCtx().BlockHeight() - 1, + MorseSrcAddress: morseSrcAddr, + ClaimedBalance: expectedBalance, + SessionEndHeight: expectedSessionEndHeight, } require.Equal(s.T(), expectedClaimAccountRes, claimAccountRes) diff --git a/testutil/integration/app.go b/testutil/integration/app.go index c2ce36e89..a31feb3e6 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -526,12 +526,14 @@ func NewCompleteIntegrationApp(t *testing.T, opts ...IntegrationAppOptionFn) *Ap authority.String(), accountKeeper, bankKeeper, + sharedKeeper, ) migrationModule := migration.NewAppModule( cdc, migrationKeeper, accountKeeper, bankKeeper, + sharedKeeper, ) // Prepare the message & query routers diff --git a/testutil/integration/suites/migration.go b/testutil/integration/suites/migration.go index 5cc7082ec..c384db38d 100644 --- a/testutil/integration/suites/migration.go +++ b/testutil/integration/suites/migration.go @@ -9,6 +9,7 @@ import ( "github.com/pokt-network/poktroll/testutil/testmigration" migrationtypes "github.com/pokt-network/poktroll/x/migration/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) var _ IntegrationSuite = (*MigrationModuleSuite)(nil) @@ -125,3 +126,12 @@ func (s *MigrationModuleSuite) QueryAllMorseClaimableAccounts(t *testing.T) []mi return morseClaimableAcctRes.MorseClaimableAccount } + +// GetSharedParams returns the shared module params. +func (s *MigrationModuleSuite) GetSharedParams(t *testing.T) sharedtypes.Params { + sharedClient := sharedtypes.NewQueryClient(s.GetApp().QueryHelper()) + sharedParamsRes, err := sharedClient.Params(s.SdkCtx(), &sharedtypes.QueryParamsRequest{}) + require.NoError(t, err) + + return sharedParamsRes.Params +} diff --git a/testutil/keeper/migration.go b/testutil/keeper/migration.go index 0549cb5c0..4f44ec053 100644 --- a/testutil/keeper/migration.go +++ b/testutil/keeper/migration.go @@ -24,11 +24,13 @@ import ( "github.com/pokt-network/poktroll/testutil/migration/mocks" "github.com/pokt-network/poktroll/x/migration/keeper" migrationtypes "github.com/pokt-network/poktroll/x/migration/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) // MigrationKeeperConfig is a configuration struct for the MigrationKeeper testutil. type MigrationKeeperConfig struct { - bankKeeper migrationtypes.BankKeeper + bankKeeper migrationtypes.BankKeeper + sharedKeeper migrationtypes.SharedKeeper } // MigrationKeeperOptionFn is a function which receives and potentially modifies @@ -68,6 +70,7 @@ func MigrationKeeper( authority.String(), mockAccountKeeper, cfg.bankKeeper, + cfg.sharedKeeper, ) ctx := cosmostypes.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) @@ -87,11 +90,13 @@ func WithBankKeeper(bankKeeper migrationtypes.BankKeeper) MigrationKeeperOptionF } } -// defaultConfigWithMocks returns a MigrationKeeperConfig with a mocked bank keeper -// which respond the following methods by updating mapAccAddrCoins accordingly: -// - SpendableCoins -// - MintCoins -// - SendCoinsFromModuleToAccount +// defaultConfigWithMocks returns a MigrationKeeperConfig with: +// 1. A Mocked bank keeper which respond the following methods by updating mapAccAddrCoins accordingly: +// - SpendableCoins +// - MintCoins +// - SendCoinsFromModuleToAccount +// +// 2. A Mocked shared keeper which responds to the Params method with the default params. func defaultConfigWithMocks(ctrl *gomock.Controller) *MigrationKeeperConfig { mockBankKeeper := mocks.NewMockBankKeeper(ctrl) mockBankKeeper.EXPECT(). @@ -104,8 +109,15 @@ func defaultConfigWithMocks(ctrl *gomock.Controller) *MigrationKeeperConfig { SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). DoAndReturn(mockBankKeeperSendFromModuleToAccount).AnyTimes() + sharedKeeper := mocks.NewMockSharedKeeper(ctrl) + sharedKeeper.EXPECT(). + GetParams(gomock.Any()). + Return(sharedtypes.DefaultParams()). + AnyTimes() + return &MigrationKeeperConfig{ - bankKeeper: mockBankKeeper, + bankKeeper: mockBankKeeper, + sharedKeeper: sharedKeeper, } } diff --git a/testutil/keeper/tokenomics.go b/testutil/keeper/tokenomics.go index f3c70cc99..d407a1d77 100644 --- a/testutil/keeper/tokenomics.go +++ b/testutil/keeper/tokenomics.go @@ -534,6 +534,7 @@ func NewTokenomicsModuleKeepers( authority.String(), accountKeeper, bankKeeper, + sharedKeeper, ) require.NoError(t, migrationKeeper.SetParams(sdkCtx, migrationtypes.DefaultParams())) diff --git a/x/migration/keeper/keeper.go b/x/migration/keeper/keeper.go index b4019db3f..a4dfbe37a 100644 --- a/x/migration/keeper/keeper.go +++ b/x/migration/keeper/keeper.go @@ -23,6 +23,7 @@ type ( accountKeeper types.AccountKeeper bankKeeper types.BankKeeper + sharedKeeper types.SharedKeeper } ) @@ -33,6 +34,7 @@ func NewKeeper( authority string, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, + sharedKeeper types.SharedKeeper, ) Keeper { if _, err := sdk.AccAddressFromBech32(authority); err != nil { @@ -46,6 +48,7 @@ func NewKeeper( logger: logger, accountKeeper: accountKeeper, bankKeeper: bankKeeper, + sharedKeeper: sharedKeeper, } } diff --git a/x/migration/keeper/msg_server_claim_morse_account.go b/x/migration/keeper/msg_server_claim_morse_account.go index 129d05b44..d32158c56 100644 --- a/x/migration/keeper/msg_server_claim_morse_account.go +++ b/x/migration/keeper/msg_server_claim_morse_account.go @@ -9,6 +9,7 @@ import ( "google.golang.org/grpc/status" migrationtypes "github.com/pokt-network/poktroll/x/migration/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.MsgClaimMorseAccount) (*migrationtypes.MsgClaimMorseAccountResponse, error) { @@ -97,8 +98,10 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms } // Emit an event which signals that the morse account has been claimed. + sharedParams := k.sharedKeeper.GetParams(ctx) + sessionEndHeight := sharedtypes.GetSessionEndHeight(&sharedParams, sdkCtx.BlockHeight()) event := migrationtypes.EventMorseAccountClaimed{ - ClaimedAtHeight: sdkCtx.BlockHeight(), + SessionEndHeight: sessionEndHeight, ShannonDestAddress: msg.ShannonDestAddress, MorseSrcAddress: msg.MorseSrcAddress, ClaimedBalance: unstakedBalance, @@ -115,8 +118,8 @@ func (k msgServer) ClaimMorseAccount(ctx context.Context, msg *migrationtypes.Ms } return &migrationtypes.MsgClaimMorseAccountResponse{ - MorseSrcAddress: msg.MorseSrcAddress, - ClaimedBalance: unstakedBalance, - ClaimedAtHeight: sdkCtx.BlockHeight(), + MorseSrcAddress: msg.MorseSrcAddress, + ClaimedBalance: unstakedBalance, + SessionEndHeight: sessionEndHeight, }, nil } diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go index e031e9423..68f160bc4 100644 --- a/x/migration/keeper/msg_server_claim_morse_acount_test.go +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -17,6 +17,7 @@ import ( "github.com/pokt-network/poktroll/testutil/testmigration" "github.com/pokt-network/poktroll/x/migration/keeper" migrationtypes "github.com/pokt-network/poktroll/x/migration/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) // Prevent strconv unused error @@ -56,13 +57,15 @@ func TestMsgServer_ClaimMorseAccount_Success(t *testing.T) { require.NoError(t, err) // Construct and assert the expected response. + sharedParams := sharedtypes.DefaultParams() + expectedSessionEndHeight := sharedtypes.GetSessionEndHeight(&sharedParams, ctx.BlockHeight()) expectedClaimedBalance := morseAccount.GetUnstakedBalance(). Add(morseAccount.GetSupplierStake()). Add(morseAccount.GetApplicationStake()) expectedRes := &migrationtypes.MsgClaimMorseAccountResponse{ - MorseSrcAddress: msgClaim.MorseSrcAddress, - ClaimedBalance: expectedClaimedBalance, - ClaimedAtHeight: ctx.BlockHeight(), + MorseSrcAddress: msgClaim.MorseSrcAddress, + ClaimedBalance: expectedClaimedBalance, + SessionEndHeight: expectedSessionEndHeight, } require.Equal(t, expectedRes, msgClaimRes) @@ -79,7 +82,7 @@ func TestMsgServer_ClaimMorseAccount_Success(t *testing.T) { ShannonDestAddress: msgClaim.ShannonDestAddress, MorseSrcAddress: msgClaim.MorseSrcAddress, ClaimedBalance: expectedClaimedBalance, - ClaimedAtHeight: ctx.BlockHeight(), + SessionEndHeight: expectedSessionEndHeight, } claimEvents := events.FilterEvents[*migrationtypes.EventMorseAccountClaimed](t, ctx.EventManager().Events()) require.Equal(t, 1, len(claimEvents)) diff --git a/x/migration/module/module.go b/x/migration/module/module.go index 53cb8fc7d..561cf8477 100644 --- a/x/migration/module/module.go +++ b/x/migration/module/module.go @@ -98,6 +98,7 @@ type AppModule struct { keeper keeper.Keeper accountKeeper types.AccountKeeper bankKeeper types.BankKeeper + sharedKeeper types.SharedKeeper } func NewAppModule( @@ -105,12 +106,14 @@ func NewAppModule( keeper keeper.Keeper, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, + sharedKeeper types.SharedKeeper, ) AppModule { return AppModule{ AppModuleBasic: NewAppModuleBasic(cdc), keeper: keeper, accountKeeper: accountKeeper, bankKeeper: bankKeeper, + sharedKeeper: sharedKeeper, } } @@ -182,6 +185,7 @@ type ModuleInputs struct { AccountKeeper types.AccountKeeper BankKeeper types.BankKeeper + SharedKeeper types.SharedKeeper } type ModuleOutputs struct { @@ -204,12 +208,14 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { authority.String(), in.AccountKeeper, in.BankKeeper, + in.SharedKeeper, ) m := NewAppModule( in.Cdc, k, in.AccountKeeper, in.BankKeeper, + in.SharedKeeper, ) return ModuleOutputs{MigrationKeeper: k, Module: m} diff --git a/x/migration/types/event.pb.go b/x/migration/types/event.pb.go index 648495a5d..58fe8a8cc 100644 --- a/x/migration/types/event.pb.go +++ b/x/migration/types/event.pb.go @@ -89,8 +89,8 @@ func (m *EventImportMorseClaimableAccounts) GetNumAccounts() uint64 { // EventMorseAccountClaimed is emitted when a MorseAccount is claimed on-chain. type EventMorseAccountClaimed struct { - // The height (on Shannon) at which the claim was executed (i.e. claimed). - ClaimedAtHeight int64 `protobuf:"varint,1,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height"` + // The session end height (on Shannon) in which the claim was committed (i.e. claimed). + SessionEndHeight int64 `protobuf:"varint,1,opt,name=session_end_height,json=sessionEndHeight,proto3" json:"session_end_height"` // The unstaked balance which was claimed. ClaimedBalance types.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance"` // The bech32-encoded address of the Shannon account to which the claimed balance will be minted. @@ -128,9 +128,9 @@ func (m *EventMorseAccountClaimed) XXX_DiscardUnknown() { var xxx_messageInfo_EventMorseAccountClaimed proto.InternalMessageInfo -func (m *EventMorseAccountClaimed) GetClaimedAtHeight() int64 { +func (m *EventMorseAccountClaimed) GetSessionEndHeight() int64 { if m != nil { - return m.ClaimedAtHeight + return m.SessionEndHeight } return 0 } @@ -164,39 +164,40 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/event.proto", fileDescriptor_d5b0bc9ed37905e1) } var fileDescriptor_d5b0bc9ed37905e1 = []byte{ - // 501 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0xe3, 0xb6, 0x42, 0xc2, 0xad, 0x08, 0x58, 0xa9, 0x48, 0x2b, 0xb0, 0x43, 0x0f, 0x28, - 0x97, 0xda, 0xb4, 0x7d, 0x82, 0xb8, 0x20, 0x95, 0x43, 0x25, 0xe4, 0x88, 0x0b, 0x1c, 0xac, 0xf5, - 0x7a, 0x64, 0x5b, 0x8d, 0x77, 0xa3, 0xdd, 0x49, 0x80, 0xb7, 0xe0, 0x61, 0x78, 0x88, 0x1e, 0x2b, - 0x4e, 0x3d, 0x59, 0x90, 0xdc, 0x7c, 0xe4, 0x09, 0x90, 0x77, 0xd7, 0x56, 0xff, 0xde, 0x76, 0x7f, - 0xdf, 0xec, 0xcc, 0x7c, 0x3b, 0x63, 0xbb, 0x73, 0x7e, 0x81, 0x82, 0xcf, 0x66, 0x41, 0x59, 0x64, - 0x82, 0x60, 0xc1, 0x59, 0x00, 0x4b, 0x60, 0xe8, 0xcf, 0x05, 0x47, 0xee, 0x38, 0xad, 0xee, 0x77, - 0xfa, 0xfe, 0x1e, 0xe5, 0xb2, 0xe4, 0x32, 0x56, 0x11, 0x81, 0xbe, 0xe8, 0xf0, 0xfd, 0x41, 0xc6, - 0x33, 0xae, 0x79, 0x73, 0x32, 0xd4, 0xd5, 0x31, 0x41, 0x42, 0x24, 0x04, 0xcb, 0xa3, 0x04, 0x90, - 0x1c, 0x05, 0x94, 0x17, 0xcc, 0xe8, 0xaf, 0xbb, 0x26, 0x64, 0x4e, 0x04, 0xa4, 0x81, 0x04, 0xb1, - 0x2c, 0x28, 0x18, 0xf9, 0xed, 0x03, 0x3d, 0x96, 0x5c, 0x48, 0x88, 0x39, 0xa3, 0x39, 0x69, 0xd3, - 0x1c, 0xfc, 0xb3, 0xec, 0x37, 0x1f, 0x9a, 0xde, 0x3f, 0x96, 0x73, 0x2e, 0xf0, 0xbc, 0x09, 0x39, - 0x9d, 0x91, 0xa2, 0x24, 0xc9, 0x0c, 0x26, 0x94, 0xf2, 0x05, 0x43, 0xe9, 0x4c, 0xec, 0x17, 0x54, - 0x00, 0x41, 0x48, 0x63, 0x82, 0x71, 0x0e, 0x45, 0x96, 0xe3, 0xd0, 0x1a, 0x59, 0xe3, 0xcd, 0x70, - 0xb7, 0xae, 0xbc, 0xfb, 0x62, 0xd4, 0x37, 0x68, 0x82, 0x67, 0x0a, 0x38, 0x9f, 0xed, 0xa1, 0xae, - 0x4f, 0x74, 0xd2, 0x58, 0x22, 0x41, 0x88, 0x73, 0x22, 0xf3, 0xe1, 0xc6, 0xc8, 0x1a, 0xef, 0x84, - 0xaf, 0xea, 0xca, 0x7b, 0x34, 0x26, 0xda, 0x55, 0x8a, 0xe9, 0x68, 0xda, 0xf0, 0x33, 0x22, 0x73, - 0xe7, 0xc4, 0xde, 0x61, 0x8b, 0xb2, 0x7d, 0x20, 0x87, 0x9b, 0x23, 0x6b, 0xbc, 0x15, 0x3e, 0xaf, - 0x2b, 0xef, 0x16, 0x8f, 0xb6, 0xd9, 0xa2, 0x6c, 0xed, 0x1c, 0xfc, 0xdd, 0xb0, 0x87, 0xca, 0xf4, - 0xf9, 0x8d, 0x9c, 0xca, 0x35, 0xa4, 0xca, 0xab, 0x3e, 0x3e, 0xe2, 0xf5, 0xae, 0x18, 0xf5, 0x0d, - 0xea, 0xbc, 0x7e, 0xb5, 0x5b, 0x14, 0x27, 0x64, 0x46, 0x18, 0x05, 0x65, 0x71, 0xfb, 0x78, 0xcf, - 0x37, 0x93, 0x6f, 0xa6, 0xea, 0x9b, 0xa9, 0xfa, 0xa7, 0xbc, 0x60, 0xe1, 0xcb, 0xcb, 0xca, 0xeb, - 0xd5, 0x95, 0x77, 0xf7, 0x65, 0xf4, 0xcc, 0x80, 0x50, 0xdf, 0x9d, 0xc4, 0x1e, 0xc8, 0x9c, 0x30, - 0xc6, 0x59, 0x9c, 0x82, 0xc4, 0x98, 0xa4, 0xa9, 0x00, 0xa9, 0x9d, 0x3f, 0x0d, 0xdf, 0xd5, 0x95, - 0xf7, 0xa0, 0xfe, 0xfb, 0xd7, 0xe1, 0xc0, 0x14, 0x9f, 0x68, 0x32, 0x45, 0x51, 0xb0, 0x2c, 0x72, - 0x4c, 0xf4, 0x7b, 0x90, 0x68, 0x94, 0xe6, 0x0f, 0xf4, 0x20, 0xa4, 0xa0, 0x5d, 0x81, 0x2d, 0x55, - 0x40, 0xfd, 0xc1, 0x3d, 0x31, 0xea, 0x2b, 0x34, 0x15, 0xd4, 0xa4, 0x08, 0x3f, 0x5d, 0xae, 0x5c, - 0xeb, 0x6a, 0xe5, 0x5a, 0xd7, 0x2b, 0xd7, 0xfa, 0xb3, 0x72, 0xad, 0x9f, 0x6b, 0xb7, 0x77, 0xb5, - 0x76, 0x7b, 0xd7, 0x6b, 0xb7, 0xf7, 0xe5, 0x38, 0x2b, 0x30, 0x5f, 0x24, 0x3e, 0xe5, 0x65, 0xd0, - 0x6c, 0xea, 0x21, 0x03, 0xfc, 0xc6, 0xc5, 0x45, 0xd0, 0xad, 0xed, 0xf7, 0x1b, 0x8b, 0x8b, 0x3f, - 0xe6, 0x20, 0x93, 0x27, 0x6a, 0x63, 0x4f, 0xfe, 0x07, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x11, 0x5d, - 0x08, 0x7f, 0x03, 0x00, 0x00, + // 514 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xc1, 0x6e, 0xd3, 0x40, + 0x14, 0x8c, 0xdb, 0x0a, 0x09, 0xb7, 0x22, 0xc5, 0x4a, 0x21, 0xad, 0xc0, 0x0e, 0x3d, 0xa0, 0x5c, + 0x6a, 0xd3, 0xf6, 0x0b, 0xe2, 0xb6, 0x52, 0x39, 0x54, 0x42, 0x8e, 0xb8, 0xc0, 0xc1, 0x5a, 0xaf, + 0x9f, 0x6c, 0xab, 0xf6, 0x6e, 0xb4, 0x6f, 0x13, 0xe0, 0x2f, 0xf8, 0x18, 0x3e, 0xa2, 0xc7, 0x8a, + 0x53, 0x4f, 0x16, 0x4a, 0x38, 0xf9, 0xc8, 0x17, 0x20, 0xef, 0x6e, 0xa2, 0x96, 0x86, 0x9b, 0x3d, + 0x33, 0x3b, 0xef, 0x8d, 0xe6, 0xd9, 0xee, 0x84, 0x5f, 0x4b, 0xc1, 0xcb, 0x32, 0xa8, 0x8a, 0x4c, + 0x10, 0x59, 0x70, 0x16, 0xc0, 0x0c, 0x98, 0xf4, 0x27, 0x82, 0x4b, 0xee, 0x38, 0x4b, 0xde, 0x5f, + 0xf1, 0x07, 0xfb, 0x94, 0x63, 0xc5, 0x31, 0x56, 0x8a, 0x40, 0xff, 0x68, 0xf9, 0x41, 0x2f, 0xe3, + 0x19, 0xd7, 0x78, 0xfb, 0x65, 0x50, 0x57, 0x6b, 0x82, 0x84, 0x20, 0x04, 0xb3, 0xe3, 0x04, 0x24, + 0x39, 0x0e, 0x28, 0x2f, 0x98, 0xe1, 0x5f, 0xaf, 0x96, 0xc0, 0x9c, 0x08, 0x48, 0x03, 0x04, 0x31, + 0x2b, 0x28, 0x18, 0xfa, 0xed, 0x9a, 0x1d, 0x2b, 0x2e, 0x10, 0x62, 0xce, 0x68, 0x4e, 0x96, 0x36, + 0x87, 0x7f, 0x2c, 0xfb, 0xcd, 0x45, 0xbb, 0xfb, 0xfb, 0x6a, 0xc2, 0x85, 0xbc, 0x6a, 0x25, 0x67, + 0x25, 0x29, 0x2a, 0x92, 0x94, 0x30, 0xa2, 0x94, 0x4f, 0x99, 0x44, 0x67, 0x64, 0x3f, 0xa7, 0x02, + 0x88, 0x84, 0x34, 0x26, 0x32, 0xce, 0xa1, 0xc8, 0x72, 0xd9, 0xb7, 0x06, 0xd6, 0x70, 0x33, 0xdc, + 0x6b, 0x6a, 0xef, 0x31, 0x19, 0x75, 0x0d, 0x34, 0x92, 0x97, 0x0a, 0x70, 0x3e, 0xda, 0x7d, 0x3d, + 0x9f, 0x68, 0xd3, 0x18, 0x25, 0x91, 0x10, 0xe7, 0x04, 0xf3, 0xfe, 0xc6, 0xc0, 0x1a, 0xee, 0x84, + 0xaf, 0x9a, 0xda, 0xfb, 0xaf, 0x26, 0xda, 0x53, 0x8c, 0xd9, 0x68, 0xdc, 0xe2, 0x97, 0x04, 0x73, + 0xe7, 0xd4, 0xde, 0x61, 0xd3, 0x6a, 0xf9, 0x00, 0xfb, 0x9b, 0x03, 0x6b, 0xb8, 0x15, 0xee, 0x36, + 0xb5, 0xf7, 0x00, 0x8f, 0xb6, 0xd9, 0xb4, 0x5a, 0xc6, 0x39, 0xfc, 0xbd, 0x61, 0xf7, 0x55, 0xe8, + 0xab, 0x7b, 0x9e, 0x2a, 0x35, 0xa4, 0xce, 0xb9, 0xed, 0x20, 0x20, 0x16, 0x9c, 0xc5, 0xc0, 0xd2, + 0x87, 0x61, 0x5f, 0x34, 0xb5, 0xb7, 0x86, 0x8d, 0x76, 0x0d, 0x76, 0xc1, 0x52, 0x13, 0xf7, 0xb3, + 0xdd, 0xa5, 0xda, 0x30, 0x4e, 0x48, 0x49, 0x18, 0x05, 0x95, 0x72, 0xfb, 0x64, 0xdf, 0x37, 0xe5, + 0xb7, 0xc5, 0xfa, 0xa6, 0x58, 0xff, 0x8c, 0x17, 0x2c, 0x7c, 0x79, 0x53, 0x7b, 0x9d, 0xa6, 0xf6, + 0xfe, 0x7d, 0x19, 0x3d, 0x33, 0x40, 0xa8, 0xff, 0x9d, 0xc4, 0xee, 0x61, 0x4e, 0x18, 0xe3, 0x2c, + 0x4e, 0x01, 0x65, 0x4c, 0xd2, 0x54, 0x00, 0xea, 0xf0, 0x4f, 0xc3, 0x77, 0x4d, 0xed, 0xad, 0xe5, + 0x7f, 0xfe, 0x38, 0xea, 0x99, 0xe1, 0x23, 0x8d, 0x8c, 0xa5, 0x28, 0x58, 0x16, 0x39, 0x46, 0x7d, + 0x0e, 0x28, 0x0d, 0xd3, 0x56, 0xae, 0xbb, 0x40, 0x41, 0x57, 0x03, 0xb6, 0xd4, 0x00, 0x55, 0xf9, + 0x23, 0x32, 0xea, 0x2a, 0x68, 0x2c, 0xa8, 0xb1, 0x08, 0x3f, 0xdc, 0xcc, 0x5d, 0xeb, 0x76, 0xee, + 0x5a, 0x77, 0x73, 0xd7, 0xfa, 0x35, 0x77, 0xad, 0xef, 0x0b, 0xb7, 0x73, 0xbb, 0x70, 0x3b, 0x77, + 0x0b, 0xb7, 0xf3, 0xe9, 0x24, 0x2b, 0x64, 0x3e, 0x4d, 0x7c, 0xca, 0xab, 0xa0, 0x3d, 0xd6, 0x23, + 0x06, 0xf2, 0x0b, 0x17, 0xd7, 0xc1, 0xea, 0x72, 0xbf, 0xde, 0xbb, 0x5d, 0xf9, 0x6d, 0x02, 0x98, + 0x3c, 0x51, 0x47, 0x7b, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x21, 0x8a, 0xc0, 0x82, 0x03, + 0x00, 0x00, } func (m *EventImportMorseClaimableAccounts) Marshal() (dAtA []byte, err error) { @@ -283,8 +284,8 @@ func (m *EventMorseAccountClaimed) MarshalToSizedBuffer(dAtA []byte) (int, error } i-- dAtA[i] = 0x12 - if m.ClaimedAtHeight != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.ClaimedAtHeight)) + if m.SessionEndHeight != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.SessionEndHeight)) i-- dAtA[i] = 0x8 } @@ -327,8 +328,8 @@ func (m *EventMorseAccountClaimed) Size() (n int) { } var l int _ = l - if m.ClaimedAtHeight != 0 { - n += 1 + sovEvent(uint64(m.ClaimedAtHeight)) + if m.SessionEndHeight != 0 { + n += 1 + sovEvent(uint64(m.SessionEndHeight)) } l = m.ClaimedBalance.Size() n += 1 + l + sovEvent(uint64(l)) @@ -502,9 +503,9 @@ func (m *EventMorseAccountClaimed) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SessionEndHeight", wireType) } - m.ClaimedAtHeight = 0 + m.SessionEndHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -514,7 +515,7 @@ func (m *EventMorseAccountClaimed) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ClaimedAtHeight |= int64(b&0x7F) << shift + m.SessionEndHeight |= int64(b&0x7F) << shift if b < 0x80 { break } diff --git a/x/migration/types/expected_keepers.go b/x/migration/types/expected_keepers.go index 64aa3a3e3..4d15d6d10 100644 --- a/x/migration/types/expected_keepers.go +++ b/x/migration/types/expected_keepers.go @@ -1,4 +1,4 @@ -//go:generate go run go.uber.org/mock/mockgen -destination ../../../testutil/migration/mocks/expected_keepers_mock.go -package mocks . AccountKeeper,BankKeeper +//go:generate go run go.uber.org/mock/mockgen -destination ../../../testutil/migration/mocks/expected_keepers_mock.go -package mocks . AccountKeeper,BankKeeper,SharedKeeper package types @@ -6,6 +6,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" + + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) // AccountKeeper defines the expected interface for the Account module. @@ -27,3 +29,7 @@ type ParamSubspace interface { Get(context.Context, []byte, interface{}) Set(context.Context, []byte, interface{}) } + +type SharedKeeper interface { + GetParams(ctx context.Context) sharedtypes.Params +} diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index a41bf7a26..090171cd8 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -317,8 +317,8 @@ type MsgClaimMorseAccountResponse struct { MorseSrcAddress string `protobuf:"bytes,1,opt,name=morse_src_address,json=morseSrcAddress,proto3" json:"morse_src_address"` // The balance which was claimed. ClaimedBalance types.Coin `protobuf:"bytes,2,opt,name=claimed_balance,json=claimedBalance,proto3" json:"claimed_balance"` - // The height (on Shannon) at which the claim was created. - ClaimedAtHeight int64 `protobuf:"varint,3,opt,name=claimed_at_height,json=claimedAtHeight,proto3" json:"claimed_at_height,omitempty"` + // The session end height (on Shannon) in which the claim was committed (i.e. claimed). + SessionEndHeight int64 `protobuf:"varint,3,opt,name=session_end_height,json=sessionEndHeight,proto3" json:"session_end_height"` } func (m *MsgClaimMorseAccountResponse) Reset() { *m = MsgClaimMorseAccountResponse{} } @@ -364,9 +364,9 @@ func (m *MsgClaimMorseAccountResponse) GetClaimedBalance() types.Coin { return types.Coin{} } -func (m *MsgClaimMorseAccountResponse) GetClaimedAtHeight() int64 { +func (m *MsgClaimMorseAccountResponse) GetSessionEndHeight() int64 { if m != nil { - return m.ClaimedAtHeight + return m.SessionEndHeight } return 0 } @@ -383,56 +383,56 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 770 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x4f, 0x4f, 0xdb, 0x48, - 0x14, 0x8f, 0xc3, 0x2e, 0x52, 0x06, 0x94, 0x6c, 0x4c, 0x10, 0x49, 0x40, 0x36, 0xca, 0xfe, 0x8b, - 0xb2, 0xc2, 0xe6, 0x8f, 0xb4, 0x2b, 0xb1, 0xbb, 0x87, 0x98, 0x1e, 0xe8, 0x21, 0x12, 0x32, 0xe2, - 0xd2, 0x1e, 0xdc, 0x89, 0x33, 0xb2, 0x2d, 0xe2, 0x99, 0xc8, 0x33, 0xa1, 0x70, 0xab, 0x7a, 0xac, - 0x54, 0x89, 0x53, 0x3f, 0x43, 0x8f, 0x1c, 0xf8, 0x02, 0xbd, 0x71, 0x44, 0x3d, 0x71, 0xb2, 0xaa, - 0x70, 0x40, 0xf2, 0xb1, 0x9f, 0xa0, 0xb2, 0x3d, 0x0e, 0xf9, 0xe3, 0x50, 0xca, 0x25, 0xf1, 0xbc, - 0xf7, 0x7b, 0xef, 0xfd, 0xde, 0xef, 0x8d, 0x9f, 0xc1, 0x6a, 0x8f, 0x1c, 0x33, 0x8f, 0x74, 0xbb, - 0xaa, 0xeb, 0x58, 0x1e, 0x64, 0x0e, 0xc1, 0x2a, 0x3b, 0x55, 0x7a, 0x1e, 0x61, 0x44, 0x14, 0x13, - 0xa7, 0x32, 0x74, 0x56, 0x8b, 0xd0, 0x75, 0x30, 0x51, 0xa3, 0xdf, 0x18, 0x56, 0x5d, 0x31, 0x09, - 0x75, 0x09, 0x55, 0x5d, 0x6a, 0xa9, 0x27, 0x5b, 0xe1, 0x1f, 0x77, 0x54, 0x62, 0x87, 0x11, 0x9d, - 0xd4, 0xf8, 0xc0, 0x5d, 0x25, 0x8b, 0x58, 0x24, 0xb6, 0x87, 0x4f, 0xdc, 0xfa, 0x47, 0x0a, 0x1b, - 0x97, 0x78, 0x14, 0x19, 0x04, 0x9b, 0x36, 0x74, 0x30, 0xc7, 0xc9, 0x29, 0xb8, 0x1e, 0xf4, 0xa0, - 0x9b, 0xa4, 0x97, 0x38, 0xa5, 0x36, 0xa4, 0x48, 0x3d, 0xd9, 0x6a, 0x23, 0x06, 0xb7, 0x54, 0x93, - 0x24, 0x09, 0x6a, 0x9f, 0x04, 0x50, 0x68, 0x51, 0xeb, 0xa8, 0xd7, 0x81, 0x0c, 0x1d, 0x44, 0x91, - 0xe2, 0xdf, 0x20, 0x07, 0xfb, 0xcc, 0x26, 0x9e, 0xc3, 0xce, 0xca, 0xc2, 0xba, 0x50, 0xcf, 0x69, - 0xe5, 0xcf, 0x97, 0x1b, 0x25, 0xce, 0xbb, 0xd9, 0xe9, 0x78, 0x88, 0xd2, 0x43, 0xe6, 0x39, 0xd8, - 0xd2, 0xef, 0xa1, 0xe2, 0xff, 0x60, 0x3e, 0xae, 0x5d, 0xce, 0xae, 0x0b, 0xf5, 0x85, 0xed, 0xaa, - 0x32, 0x2d, 0x9b, 0x12, 0xd7, 0xd0, 0x72, 0x57, 0xbe, 0x9c, 0xf9, 0x78, 0x77, 0xd1, 0x10, 0x74, - 0x1e, 0xb4, 0xfb, 0xcf, 0xdb, 0xbb, 0x8b, 0xc6, 0x7d, 0xba, 0x77, 0x77, 0x17, 0x8d, 0xdf, 0x86, - 0xed, 0x9d, 0x8e, 0x34, 0x38, 0xc1, 0xb7, 0x56, 0x01, 0x2b, 0x13, 0x26, 0x1d, 0xd1, 0x1e, 0xc1, - 0x14, 0xd5, 0x2e, 0xb3, 0x40, 0x6e, 0x51, 0xeb, 0xb9, 0xdb, 0x23, 0x1e, 0x6b, 0x85, 0x02, 0xee, - 0x75, 0xa1, 0xe3, 0xc2, 0x76, 0x17, 0x35, 0x4d, 0x93, 0xf4, 0x31, 0x7b, 0x7a, 0xbb, 0x1e, 0x58, - 0x8a, 0x47, 0x02, 0xe3, 0x4c, 0x06, 0x65, 0x90, 0x21, 0xde, 0xfb, 0xef, 0x69, 0xbd, 0x47, 0x04, - 0x78, 0xdd, 0xc3, 0x10, 0xac, 0xad, 0x86, 0x32, 0x04, 0xbe, 0x9c, 0x96, 0x49, 0x2f, 0xba, 0x93, - 0x78, 0xf1, 0x08, 0x94, 0x53, 0x90, 0x86, 0x0d, 0xa9, 0x5d, 0x9e, 0x5b, 0x17, 0xea, 0x8b, 0xda, - 0x5a, 0xe0, 0xcb, 0x33, 0x31, 0xfa, 0xf2, 0x54, 0xca, 0x7d, 0x48, 0xed, 0xdd, 0xfc, 0xb8, 0xf4, - 0xb5, 0xf7, 0x02, 0xf8, 0xf3, 0x3b, 0xb2, 0x25, 0x12, 0x8b, 0x1b, 0x00, 0x8c, 0x90, 0x10, 0x22, - 0x12, 0xf9, 0xc0, 0x97, 0x47, 0xac, 0x7a, 0x8e, 0x26, 0xa5, 0xc4, 0x1d, 0xb0, 0x88, 0xfb, 0x6e, - 0xc2, 0x2d, 0xbe, 0x2a, 0x3f, 0x69, 0xbf, 0x04, 0xbe, 0x3c, 0x66, 0xd7, 0x17, 0x70, 0xdf, 0x4d, - 0x6a, 0xd5, 0x3e, 0x64, 0x41, 0xa9, 0x45, 0xad, 0x88, 0xc4, 0xa8, 0x88, 0x62, 0x1b, 0x94, 0xa8, - 0x0d, 0x31, 0x26, 0xd8, 0xe8, 0x20, 0xca, 0x0c, 0x18, 0x0f, 0x8b, 0x8f, 0x71, 0x33, 0xf0, 0xe5, - 0x54, 0xff, 0xcc, 0xf1, 0x8a, 0x1c, 0xfd, 0x0c, 0x51, 0xc6, 0x3d, 0x62, 0x13, 0xc4, 0x83, 0x30, - 0xa8, 0x67, 0x0e, 0x0b, 0x64, 0xa3, 0x02, 0xcb, 0x81, 0x2f, 0x4f, 0x3b, 0xf5, 0x42, 0x64, 0x3a, - 0xf4, 0xcc, 0x24, 0xc5, 0x7f, 0xa0, 0xc0, 0x51, 0x8e, 0x85, 0x21, 0xeb, 0x7b, 0x88, 0x4f, 0x6b, - 0x29, 0xf0, 0xe5, 0x49, 0x97, 0x9e, 0x8f, 0xc3, 0x93, 0xf3, 0x6e, 0x25, 0x9c, 0x4e, 0x6a, 0x1f, - 0xb5, 0x40, 0x00, 0x6b, 0x69, 0xc2, 0x0c, 0xa7, 0x93, 0x4a, 0x5e, 0xf8, 0x21, 0xf2, 0x2f, 0x41, - 0xc1, 0x0c, 0xf3, 0xa3, 0x8e, 0xd1, 0x86, 0x5d, 0x88, 0xcd, 0xe4, 0x8e, 0x57, 0x14, 0xae, 0x61, - 0xb8, 0x5c, 0x14, 0xbe, 0x5c, 0x94, 0x3d, 0xe2, 0x60, 0x6d, 0x85, 0xdf, 0xeb, 0xc9, 0x48, 0x3d, - 0xcf, 0x0d, 0x5a, 0x7c, 0x16, 0x1b, 0xa0, 0x98, 0x40, 0x20, 0x33, 0x6c, 0xe4, 0x58, 0x36, 0x8b, - 0xb4, 0x99, 0xd3, 0x93, 0xd8, 0x26, 0xdb, 0x8f, 0xcc, 0xdb, 0x5f, 0xb3, 0x60, 0xae, 0x45, 0x2d, - 0xf1, 0x15, 0x58, 0x1c, 0xdb, 0x57, 0xbf, 0xa6, 0xbe, 0x6b, 0xe3, 0x1b, 0xa1, 0xfa, 0xd7, 0x23, - 0x40, 0x43, 0xd5, 0xce, 0x05, 0xb0, 0xf6, 0xe0, 0xce, 0xd8, 0x99, 0x91, 0xed, 0xa1, 0xa0, 0xea, - 0xbf, 0x4f, 0x08, 0x1a, 0x52, 0x22, 0xa0, 0x38, 0x7d, 0xfd, 0xeb, 0x33, 0x32, 0x4e, 0x21, 0xab, - 0x9b, 0x8f, 0x45, 0x26, 0x05, 0xab, 0x3f, 0xbf, 0x09, 0xb7, 0xb3, 0x76, 0x70, 0x35, 0x90, 0x84, - 0xeb, 0x81, 0x24, 0xdc, 0x0c, 0x24, 0xe1, 0xcb, 0x40, 0x12, 0xce, 0x6f, 0xa5, 0xcc, 0xf5, 0xad, - 0x94, 0xb9, 0xb9, 0x95, 0x32, 0x2f, 0xb6, 0x2d, 0x87, 0xd9, 0xfd, 0xb6, 0x62, 0x12, 0x57, 0x0d, - 0x0b, 0x6c, 0x60, 0xc4, 0x5e, 0x13, 0xef, 0x58, 0x4d, 0x5d, 0xdc, 0xec, 0xac, 0x87, 0x68, 0x7b, - 0x3e, 0xfa, 0xf2, 0xec, 0x7c, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x0a, 0x73, 0x6f, 0x72, 0x07, - 0x00, 0x00, + // 784 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x4e, 0xdb, 0x4a, + 0x14, 0x8e, 0xc3, 0xbd, 0x48, 0x19, 0x50, 0x02, 0x26, 0x5c, 0x92, 0x80, 0x6c, 0x94, 0xfb, 0x17, + 0x71, 0x85, 0xcd, 0x8f, 0x74, 0xaf, 0xc4, 0x6d, 0x17, 0x18, 0x2a, 0xd1, 0x45, 0x24, 0x64, 0xc4, + 0xa6, 0x5d, 0xb8, 0x13, 0x67, 0x64, 0x5b, 0xc4, 0x33, 0x91, 0x67, 0x42, 0x61, 0x57, 0x55, 0x5d, + 0x55, 0xaa, 0xc4, 0xaa, 0xcf, 0xd0, 0x25, 0x0b, 0x5e, 0xa0, 0x3b, 0x96, 0xa8, 0x2b, 0x56, 0x56, + 0x15, 0x16, 0x48, 0x5e, 0xf6, 0x09, 0x2a, 0xdb, 0xe3, 0x90, 0x1f, 0x87, 0x52, 0x36, 0x49, 0xe6, + 0x9c, 0xef, 0x9c, 0xf3, 0x9d, 0xef, 0xcc, 0x9c, 0x80, 0xc5, 0x36, 0x39, 0x62, 0x1e, 0x69, 0xb5, + 0x54, 0xd7, 0xb1, 0x3c, 0xc8, 0x1c, 0x82, 0x55, 0x76, 0xa2, 0xb4, 0x3d, 0xc2, 0x88, 0x28, 0x26, + 0x4e, 0xa5, 0xe7, 0xac, 0xcc, 0x42, 0xd7, 0xc1, 0x44, 0x8d, 0x3e, 0x63, 0x58, 0x65, 0xc1, 0x24, + 0xd4, 0x25, 0x54, 0x75, 0xa9, 0xa5, 0x1e, 0xaf, 0x87, 0x5f, 0xdc, 0x51, 0x8e, 0x1d, 0x46, 0x74, + 0x52, 0xe3, 0x03, 0x77, 0x15, 0x2d, 0x62, 0x91, 0xd8, 0x1e, 0xfe, 0xe2, 0xd6, 0xbf, 0x52, 0xd8, + 0xb8, 0xc4, 0xa3, 0xc8, 0x20, 0xd8, 0xb4, 0xa1, 0x83, 0x39, 0x4e, 0x4e, 0xc1, 0xb5, 0xa1, 0x07, + 0xdd, 0x24, 0xbd, 0xc4, 0x29, 0x35, 0x20, 0x45, 0xea, 0xf1, 0x7a, 0x03, 0x31, 0xb8, 0xae, 0x9a, + 0x24, 0x49, 0x50, 0xfd, 0x2c, 0x80, 0x42, 0x9d, 0x5a, 0x87, 0xed, 0x26, 0x64, 0x68, 0x3f, 0x8a, + 0x14, 0xff, 0x05, 0x39, 0xd8, 0x61, 0x36, 0xf1, 0x1c, 0x76, 0x5a, 0x12, 0x96, 0x85, 0x5a, 0x4e, + 0x2b, 0x7d, 0xb9, 0x58, 0x2d, 0x72, 0xde, 0xdb, 0xcd, 0xa6, 0x87, 0x28, 0x3d, 0x60, 0x9e, 0x83, + 0x2d, 0xfd, 0x0e, 0x2a, 0x3e, 0x05, 0x93, 0x71, 0xed, 0x52, 0x76, 0x59, 0xa8, 0x4d, 0x6d, 0x54, + 0x94, 0x51, 0xd9, 0x94, 0xb8, 0x86, 0x96, 0xbb, 0xf4, 0xe5, 0xcc, 0xa7, 0xdb, 0xf3, 0x15, 0x41, + 0xe7, 0x41, 0x5b, 0xff, 0xbd, 0xbd, 0x3d, 0x5f, 0xb9, 0x4b, 0xf7, 0xfe, 0xf6, 0x7c, 0xe5, 0x8f, + 0x5e, 0x7b, 0x27, 0x7d, 0x0d, 0x0e, 0xf1, 0xad, 0x96, 0xc1, 0xc2, 0x90, 0x49, 0x47, 0xb4, 0x4d, + 0x30, 0x45, 0xd5, 0x8b, 0x2c, 0x90, 0xeb, 0xd4, 0x7a, 0xee, 0xb6, 0x89, 0xc7, 0xea, 0xa1, 0x80, + 0x3b, 0x2d, 0xe8, 0xb8, 0xb0, 0xd1, 0x42, 0xdb, 0xa6, 0x49, 0x3a, 0x98, 0x3d, 0xbe, 0x5d, 0x0f, + 0xcc, 0xc5, 0x23, 0x81, 0x71, 0x26, 0x83, 0x32, 0xc8, 0x10, 0xef, 0xfd, 0xcf, 0xb4, 0xde, 0x23, + 0x02, 0xbc, 0xee, 0x41, 0x08, 0xd6, 0x16, 0x43, 0x19, 0x02, 0x5f, 0x4e, 0xcb, 0xa4, 0xcf, 0xba, + 0xc3, 0x78, 0xf1, 0x10, 0x94, 0x52, 0x90, 0x86, 0x0d, 0xa9, 0x5d, 0x9a, 0x58, 0x16, 0x6a, 0xd3, + 0xda, 0x52, 0xe0, 0xcb, 0x63, 0x31, 0xfa, 0xfc, 0x48, 0xca, 0x3d, 0x48, 0xed, 0xad, 0xfc, 0xa0, + 0xf4, 0xd5, 0x0f, 0x02, 0xf8, 0xfb, 0x07, 0xb2, 0x25, 0x12, 0x8b, 0xab, 0x00, 0xf4, 0x91, 0x10, + 0x22, 0x12, 0xf9, 0xc0, 0x97, 0xfb, 0xac, 0x7a, 0x8e, 0x26, 0xa5, 0xc4, 0x4d, 0x30, 0x8d, 0x3b, + 0x6e, 0xc2, 0x2d, 0xbe, 0x2a, 0xbf, 0x68, 0x33, 0x81, 0x2f, 0x0f, 0xd8, 0xf5, 0x29, 0xdc, 0x71, + 0x93, 0x5a, 0xd5, 0x8f, 0x59, 0x50, 0xac, 0x53, 0x2b, 0x22, 0xd1, 0x2f, 0xa2, 0xd8, 0x00, 0x45, + 0x6a, 0x43, 0x8c, 0x09, 0x36, 0x9a, 0x88, 0x32, 0x03, 0xc6, 0xc3, 0xe2, 0x63, 0x5c, 0x0b, 0x7c, + 0x39, 0xd5, 0x3f, 0x76, 0xbc, 0x22, 0x47, 0xef, 0x22, 0xca, 0xb8, 0x47, 0xdc, 0x06, 0xf1, 0x20, + 0x0c, 0xea, 0x99, 0xbd, 0x02, 0xd9, 0xa8, 0xc0, 0x7c, 0xe0, 0xcb, 0xa3, 0x4e, 0xbd, 0x10, 0x99, + 0x0e, 0x3c, 0x33, 0x49, 0xf1, 0x04, 0x14, 0x38, 0xca, 0xb1, 0x30, 0x64, 0x1d, 0x0f, 0xf1, 0x69, + 0xcd, 0x05, 0xbe, 0x3c, 0xec, 0xd2, 0xf3, 0x71, 0x78, 0x72, 0xde, 0x2a, 0x87, 0xd3, 0x49, 0xed, + 0xa3, 0xfa, 0x2e, 0x0b, 0x96, 0xd2, 0x84, 0xe9, 0x4d, 0x27, 0x95, 0xbc, 0xf0, 0x53, 0xe4, 0x5f, + 0x82, 0x82, 0x19, 0xe6, 0x47, 0x4d, 0xa3, 0x01, 0x5b, 0x10, 0x9b, 0xc9, 0x1d, 0x2f, 0x2b, 0x5c, + 0xc3, 0x70, 0xb9, 0x28, 0x7c, 0xb9, 0x28, 0x3b, 0xc4, 0xc1, 0xda, 0x02, 0xbf, 0xd7, 0xc3, 0x91, + 0x7a, 0x9e, 0x1b, 0xb4, 0xf8, 0x2c, 0xee, 0x02, 0x91, 0x22, 0x4a, 0x1d, 0x82, 0x0d, 0x84, 0x9b, + 0x86, 0x8d, 0x1c, 0xcb, 0x66, 0x91, 0x38, 0x13, 0xda, 0x6f, 0x81, 0x2f, 0xa7, 0x78, 0xf5, 0x19, + 0x6e, 0x7b, 0x86, 0x9b, 0x7b, 0x91, 0x65, 0xe3, 0x5b, 0x16, 0x4c, 0xd4, 0xa9, 0x25, 0xbe, 0x02, + 0xd3, 0x03, 0x9b, 0xec, 0xf7, 0xd4, 0x57, 0x38, 0xb8, 0x2b, 0x2a, 0xff, 0x3c, 0x00, 0xd4, 0xd3, + 0xf3, 0x4c, 0x00, 0x4b, 0xf7, 0x6e, 0x93, 0xcd, 0x31, 0xd9, 0xee, 0x0b, 0xaa, 0xfc, 0xff, 0x88, + 0xa0, 0x1e, 0x25, 0x02, 0x66, 0x47, 0x1f, 0x46, 0x6d, 0x4c, 0xc6, 0x11, 0x64, 0x65, 0xed, 0xa1, + 0xc8, 0xa4, 0x60, 0xe5, 0xd7, 0x37, 0xe1, 0xde, 0xd6, 0xf6, 0x2f, 0xbb, 0x92, 0x70, 0xd5, 0x95, + 0x84, 0xeb, 0xae, 0x24, 0x7c, 0xed, 0x4a, 0xc2, 0xd9, 0x8d, 0x94, 0xb9, 0xba, 0x91, 0x32, 0xd7, + 0x37, 0x52, 0xe6, 0xc5, 0x86, 0xe5, 0x30, 0xbb, 0xd3, 0x50, 0x4c, 0xe2, 0xaa, 0x61, 0x81, 0x55, + 0x8c, 0xd8, 0x6b, 0xe2, 0x1d, 0xa9, 0xa9, 0x2b, 0x9d, 0x9d, 0xb6, 0x11, 0x6d, 0x4c, 0x46, 0xff, + 0x49, 0x9b, 0xdf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x6a, 0xac, 0x28, 0x9f, 0x8c, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -801,8 +801,8 @@ func (m *MsgClaimMorseAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l - if m.ClaimedAtHeight != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ClaimedAtHeight)) + if m.SessionEndHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SessionEndHeight)) i-- dAtA[i] = 0x18 } @@ -929,8 +929,8 @@ func (m *MsgClaimMorseAccountResponse) Size() (n int) { } l = m.ClaimedBalance.Size() n += 1 + l + sovTx(uint64(l)) - if m.ClaimedAtHeight != 0 { - n += 1 + sovTx(uint64(m.ClaimedAtHeight)) + if m.SessionEndHeight != 0 { + n += 1 + sovTx(uint64(m.SessionEndHeight)) } return n } @@ -1602,9 +1602,9 @@ func (m *MsgClaimMorseAccountResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAtHeight", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SessionEndHeight", wireType) } - m.ClaimedAtHeight = 0 + m.SessionEndHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1614,7 +1614,7 @@ func (m *MsgClaimMorseAccountResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ClaimedAtHeight |= int64(b&0x7F) << shift + m.SessionEndHeight |= int64(b&0x7F) << shift if b < 0x80 { break } From 739f2b1d2e4ea51e0f5aed044375764603ff1207 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Mar 2025 15:26:34 +0100 Subject: [PATCH 79/81] self-review improvements --- cmd/poktrolld/cmd/migrate/migrate_test.go | 10 +++++----- .../morse_account_import_and_claim_test.go | 4 ++-- testutil/testmigration/fixtures.go | 16 ++++++++++++---- .../keeper/msg_server_claim_morse_acount_test.go | 2 +- ...erver_import_morse_claimable_accounts_test.go | 6 +++--- 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/cmd/poktrolld/cmd/migrate/migrate_test.go b/cmd/poktrolld/cmd/migrate/migrate_test.go index f27d035a1..cba9549e2 100644 --- a/cmd/poktrolld/cmd/migrate/migrate_test.go +++ b/cmd/poktrolld/cmd/migrate/migrate_test.go @@ -33,7 +33,7 @@ func TestCollectMorseAccounts(t *testing.T) { // Generate and write the MorseStateExport input JSON file. morseStateExportBz, morseAccountStateBz := testmigration.NewMorseStateExportAndAccountStateBytes( - t, 10, testmigration.EquallyDistributedMorseAccountActorTypes) + t, 10, testmigration.RoundRobinAllMorseAccountActorTypes) _, err = inputFile.Write(morseStateExportBz) require.NoError(t, err) @@ -71,7 +71,7 @@ func TestNewTestMorseStateExport(t *testing.T) { t.Run(fmt.Sprintf("num_accounts=%d", numAccounts), func(t *testing.T) { morseStateExport := new(migrationtypes.MorseStateExport) stateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes( - t, numAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) + t, numAccounts, testmigration.RoundRobinAllMorseAccountActorTypes) err := cmtjson.Unmarshal(stateExportBz, morseStateExport) require.NoError(t, err) @@ -85,7 +85,7 @@ func TestNewTestMorseStateExport(t *testing.T) { // Construct account number expectations based on equal distribution of unstaked, app, and supplier accounts. expectedNumSuppliers := numAccounts / 3 expectedNumApps := numAccounts / 3 - expectedActorType := testmigration.EquallyDistributedMorseAccountActorTypes(uint64(numAccounts - 1)) + expectedActorType := testmigration.RoundRobinAllMorseAccountActorTypes(uint64(numAccounts - 1)) if expectedActorType == testmigration.MorseApplicationActor { expectedNumApps++ } @@ -104,7 +104,7 @@ func TestNewTestMorseStateExport(t *testing.T) { for i := 0; i < numAccounts; i++ { expectedShannonTotalUnstakedBalance += testmigration.GenMorseUnstakedBalanceAmount(uint64(i)) - morseAccountType := testmigration.EquallyDistributedMorseAccountActorTypes(uint64(i)) + morseAccountType := testmigration.RoundRobinAllMorseAccountActorTypes(uint64(i)) switch morseAccountType { case testmigration.MorseUnstakedActor: // No-op. @@ -129,7 +129,7 @@ func BenchmarkTransformMorseState(b *testing.B) { numAccounts := int(math.Pow10(i + 1)) morseStateExport := new(migrationtypes.MorseStateExport) morseStateExportBz, _ := testmigration.NewMorseStateExportAndAccountStateBytes( - b, numAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) + b, numAccounts, testmigration.RoundRobinAllMorseAccountActorTypes) err := cmtjson.Unmarshal(morseStateExportBz, morseStateExport) require.NoError(b, err) diff --git a/tests/integration/migration/morse_account_import_and_claim_test.go b/tests/integration/migration/morse_account_import_and_claim_test.go index 29108bd93..62815b117 100644 --- a/tests/integration/migration/morse_account_import_and_claim_test.go +++ b/tests/integration/migration/morse_account_import_and_claim_test.go @@ -42,7 +42,7 @@ func TestMigrationModuleSuite(t *testing.T) { // TestImportMorseClaimableAccounts exercises importing and persistence of morse claimable accounts. func (s *MigrationModuleTestSuite) TestImportMorseClaimableAccounts() { - s.GenerateMorseAccountState(s.T(), s.numMorseClaimableAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) + s.GenerateMorseAccountState(s.T(), s.numMorseClaimableAccounts, testmigration.RoundRobinAllMorseAccountActorTypes) msgImportRes := s.ImportMorseClaimableAccounts(s.T()) morseAccountState := s.GetAccountState(s.T()) morseAccountStateHash, err := morseAccountState.GetHash() @@ -74,7 +74,7 @@ func (s *MigrationModuleTestSuite) TestImportMorseClaimableAccounts() { // It only exercises claiming of account balances and does not exercise // the staking any actors as a result of claiming. func (s *MigrationModuleTestSuite) TestClaimMorseAccount() { - s.GenerateMorseAccountState(s.T(), s.numMorseClaimableAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) + s.GenerateMorseAccountState(s.T(), s.numMorseClaimableAccounts, testmigration.RoundRobinAllMorseAccountActorTypes) s.ImportMorseClaimableAccounts(s.T()) shannonDestAddr := sample.AccAddress() diff --git a/testutil/testmigration/fixtures.go b/testutil/testmigration/fixtures.go index c49e91df5..d52cf2d69 100644 --- a/testutil/testmigration/fixtures.go +++ b/testutil/testmigration/fixtures.go @@ -29,8 +29,8 @@ const ( // MorseStateExport and MorseAccountState fixture generation logic. type MorseAccountActorTypeDistributionFn func(index uint64) MorseAccountActorType -// EquallyDistributedMorseAccountActorTypes cyclically returns each MorseAccountActorType, one after the other, as the index increases. -func EquallyDistributedMorseAccountActorTypes(index uint64) MorseAccountActorType { +// RoundRobinAllMorseAccountActorTypes cyclically returns each MorseAccountActorType, one after the other, as the index increases. +func RoundRobinAllMorseAccountActorTypes(index uint64) MorseAccountActorType { switch index % 3 { case 0: return MorseUnstakedActor @@ -42,8 +42,16 @@ func EquallyDistributedMorseAccountActorTypes(index uint64) MorseAccountActorTyp } // AllUnstakedMorseAccountActorType returns MorseUnstakedActor for every index. -func AllUnstakedMorseAccountActorType(_ uint64) MorseAccountActorType { - return MorseUnstakedActor +func AllUnstakedMorseAccountActorType(index uint64) MorseAccountActorType { + return NewSingleMorseAccountActorTypeFn(MorseUnstakedActor)(index) +} + +// NewSingleMorseAccountActorTypeFn returns a MorseAccountActorTypeDistributionFn +// which returns the given actor type for every index. +func NewSingleMorseAccountActorTypeFn(actorType MorseAccountActorType) MorseAccountActorTypeDistributionFn { + return func(_ uint64) MorseAccountActorType { + return actorType + } } // NewMorseStateExportAndAccountStateBytes returns: diff --git a/x/migration/keeper/msg_server_claim_morse_acount_test.go b/x/migration/keeper/msg_server_claim_morse_acount_test.go index 68f160bc4..c96cbb5c6 100644 --- a/x/migration/keeper/msg_server_claim_morse_acount_test.go +++ b/x/migration/keeper/msg_server_claim_morse_acount_test.go @@ -102,7 +102,7 @@ func TestMsgServer_ClaimMorseAccount_Error(t *testing.T) { // - One staked as an application // - One staked as a supplier numAccounts := 3 - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.RoundRobinAllMorseAccountActorTypes) accountStateHash, err := accountState.GetHash() require.NoError(t, err) diff --git a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go index 63fba2d18..c241a7306 100644 --- a/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go +++ b/x/migration/keeper/msg_server_import_morse_claimable_accounts_test.go @@ -21,7 +21,7 @@ func TestMsgServer_ImportMorseClaimableAccounts_Success(t *testing.T) { srv := keeper.NewMsgServerImpl(k) numAccounts := 10 - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.RoundRobinAllMorseAccountActorTypes) // Assert that the MorseAccountState is not set initially. morseClaimableAccounts := k.GetAllMorseClaimableAccounts(ctx) @@ -76,7 +76,7 @@ func TestMsgServer_ImportMorseClaimableAccounts_ErrorAlreadySet(t *testing.T) { srv := keeper.NewMsgServerImpl(k) // Set at least one MorseAccountState initially. - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, 1, testmigration.EquallyDistributedMorseAccountActorTypes) + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, 1, testmigration.RoundRobinAllMorseAccountActorTypes) k.SetMorseClaimableAccount(ctx, *accountState.Accounts[0]) // Set up the MsgImportMorseClaimableAccounts to fail. @@ -105,7 +105,7 @@ func TestMsgServer_ImportMorseClaimableAccounts_ErrorInvalidAuthority(t *testing srv := keeper.NewMsgServerImpl(k) numAccounts := 10 - _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.EquallyDistributedMorseAccountActorTypes) + _, accountState := testmigration.NewMorseStateExportAndAccountState(t, numAccounts, testmigration.RoundRobinAllMorseAccountActorTypes) msgImportMorseClaimableAccounts, err := migrationtypes.NewMsgImportMorseClaimableAccounts( authtypes.NewModuleAddress("invalid_authority").String(), From 06b734f73a7fce2b106c91827ce63deb1e17c6f4 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 7 Mar 2025 16:34:30 +0100 Subject: [PATCH 80/81] fix: linter error --- x/migration/types/message_claim_morse_application.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/migration/types/message_claim_morse_application.go b/x/migration/types/message_claim_morse_application.go index 5b2dc1894..8fef893ab 100644 --- a/x/migration/types/message_claim_morse_application.go +++ b/x/migration/types/message_claim_morse_application.go @@ -6,7 +6,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -var _ sdk.Msg = &MsgClaimMorseApplication{} +var _ sdk.Msg = (*MsgClaimMorseApplication)(nil) func NewMsgClaimMorseApplication(shannonDestAddress string, morseSrcAddress string, morseSignature string, stake sdk.Coin, serviceConfig string) *MsgClaimMorseApplication { // TODO_MAINNET(@bryanchriswhite, #1034): Add message signing. From 4ea63d44dd455523f2cffb6d6aea318124fac4e8 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 11 Mar 2025 08:40:03 +0100 Subject: [PATCH 81/81] chore: review feedback improvements Co-authored-by: Daniel Olshansky --- proto/poktroll/application/types.proto | 1 - proto/poktroll/migration/tx.proto | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/proto/poktroll/application/types.proto b/proto/poktroll/application/types.proto index 50ba8babe..4979807e1 100644 --- a/proto/poktroll/application/types.proto +++ b/proto/poktroll/application/types.proto @@ -22,7 +22,6 @@ message Application { // Total amount of staked uPOKT cosmos.base.v1beta1.Coin stake = 2; - // TODO_MAINNET: Refactor this to be a single service config field. // CRITICAL: Must contain EXACTLY ONE service config // This prevents applications from over-servicing. // Kept as repeated field for legacy and future compatibility diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index d6b88848d..1a2009b8c 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -158,7 +158,7 @@ message MsgClaimMorseApplicationResponse { // If the application was already staked, this amount does not include the initial stake (i.e. only the portion which was "claimed"). cosmos.base.v1beta1.Coin claimedApplicationStake = 3 [(gogoproto.nullable) = false]; - // The height (on Shannon) at which the claim was created. + // The height (on Shannon) at which the morse application claim was created. int32 claimedAtHeight = 4; // The application which was staked as a result of the claim.