From d53e53bd5feb2de89c227c3660d4fd32d21ad0d8 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 17 Jan 2022 16:09:37 +0100 Subject: [PATCH 001/112] - implemented expiration time for app links TODO: - fix migrations - tests --- .../profiles/v1beta1/models_app_links.proto | 7 + .../profiles/v1beta1/models_params.proto | 17 + x/profiles/keeper/alias_functions.go | 27 ++ x/profiles/keeper/keeper_app_links.go | 22 +- x/profiles/keeper/migrations.go | 26 +- x/profiles/keeper/relay_app_links.go | 10 +- x/profiles/legacy/v200/types.go | 21 ++ x/profiles/module.go | 4 +- x/profiles/types/keys.go | 19 +- x/profiles/types/models_app_links.go | 25 +- x/profiles/types/models_app_links.pb.go | 176 ++++++---- x/profiles/types/models_params.pb.go | 310 +++++++++++++++--- 12 files changed, 538 insertions(+), 126 deletions(-) create mode 100644 x/profiles/legacy/v200/types.go diff --git a/proto/desmos/profiles/v1beta1/models_app_links.proto b/proto/desmos/profiles/v1beta1/models_app_links.proto index a8d0c358b9..d25fbd05cb 100644 --- a/proto/desmos/profiles/v1beta1/models_app_links.proto +++ b/proto/desmos/profiles/v1beta1/models_app_links.proto @@ -37,6 +37,13 @@ message ApplicationLink { (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"creation_time\"" ]; + + // ExpirationTime represents the time in which the link will expire + google.protobuf.Timestamp expiration_time = 7 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"expiration_time\"" + ]; } // Data contains the data associated to a specific user of a diff --git a/proto/desmos/profiles/v1beta1/models_params.proto b/proto/desmos/profiles/v1beta1/models_params.proto index a1259a9a0f..4f7c50760f 100644 --- a/proto/desmos/profiles/v1beta1/models_params.proto +++ b/proto/desmos/profiles/v1beta1/models_params.proto @@ -3,6 +3,7 @@ package desmos.profiles.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "github.com/desmos-labs/desmos/v2/x/profiles/types"; @@ -28,6 +29,11 @@ message Params { (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"oracle\"" ]; + + AppLinksParams appLinks = 5 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"applinks\"" + ]; } // NicknameParams defines the parameters related to the profiles nicknames @@ -115,3 +121,14 @@ message OracleParams { (gogoproto.moretags) = "yaml:\"fee_amount\"" ]; } + +// AppLinksParams define the parameters related to the app links +message AppLinksParams { + option (gogoproto.goproto_getters) = false; + + google.protobuf.Timestamp expiration_time = 1 [ + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"expiration_time\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go index 52a1ee7b45..b3099a4de8 100644 --- a/x/profiles/keeper/alias_functions.go +++ b/x/profiles/keeper/alias_functions.go @@ -3,6 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "time" "github.com/desmos-labs/desmos/v2/x/profiles/types" ) @@ -211,6 +212,32 @@ func (k Keeper) GetApplicationLinks(ctx sdk.Context) []types.ApplicationLink { return links } +// IterateExpiringApplicationLinks iterates through all the expiring application links references. +// The key will be skipped and deleted if the application link has already been deleted. +func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, expirationTime time.Time, fn func(index int64, link types.ApplicationLink) (stop bool)) { + store := ctx.KVStore(k.storeKey) + + iterator := sdk.KVStorePrefixIterator(store, types.ExpiringApplicationLinkPrefix(expirationTime)) + defer iterator.Close() + + i := int64(0) + for ; iterator.Valid(); iterator.Next() { + // Skip if application link has been deleted already + clientID := iterator.Value() + if !store.Has(clientID) { + store.Delete(iterator.Key()) + continue + } + applicationKey := store.Get(clientID) + link := types.MustUnmarshalApplicationLink(k.cdc, store.Get(applicationKey)) + stop := fn(i, link) + if stop { + break + } + i++ + } +} + // -------------------------------------------------------------------------------------------------------------------- // IterateChainLinks iterates through the chain links and perform the provided function diff --git a/x/profiles/keeper/keeper_app_links.go b/x/profiles/keeper/keeper_app_links.go index 3fd44674d2..677c581b50 100644 --- a/x/profiles/keeper/keeper_app_links.go +++ b/x/profiles/keeper/keeper_app_links.go @@ -84,6 +84,14 @@ func (k Keeper) GetApplicationLinkByClientID(ctx sdk.Context, clientID string) ( return link, true, nil } +// deleteApplicationLinkStoreKeys deletes all the store keys related to the given application link +func (k Keeper) deleteApplicationLinkStoreKeys(ctx sdk.Context, link types.ApplicationLink) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username)) + store.Delete(types.ApplicationLinkClientIDKey(link.OracleRequest.ClientID)) + store.Delete(types.ExpirationTimeApplicationLinkKey(link.ExpirationTime, link.OracleRequest.ClientID)) +} + // DeleteApplicationLink removes the application link associated to the given user, // for the given application and username func (k Keeper) DeleteApplicationLink(ctx sdk.Context, user string, application, username string) error { @@ -101,10 +109,8 @@ func (k Keeper) DeleteApplicationLink(ctx sdk.Context, user string, application, return sdkerrors.Wrap(sdkerrors.ErrorInvalidSigner, "cannot delete the application link of another user") } - // Delete the data - store := ctx.KVStore(k.storeKey) - store.Delete(types.UserApplicationLinkKey(user, application, username)) - store.Delete(types.ApplicationLinkClientIDKey(link.OracleRequest.ClientID)) + // Delete the application link data and keys + k.deleteApplicationLinkStoreKeys(ctx, link) return nil } @@ -122,3 +128,11 @@ func (k Keeper) DeleteAllUserApplicationLinks(ctx sdk.Context, user string) { store.Delete(types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username)) } } + +// DeleteExpiredApplicationLinks deletes all the expired application links in the given context +func (k Keeper) DeleteExpiredApplicationLinks(ctx sdk.Context) { + k.IterateExpiringApplicationLinks(ctx, ctx.BlockTime(), func(_ int64, link types.ApplicationLink) (stop bool) { + k.deleteApplicationLinkStoreKeys(ctx, link) + return false + }) +} diff --git a/x/profiles/keeper/migrations.go b/x/profiles/keeper/migrations.go index 5da56adf7d..64e29b1c56 100644 --- a/x/profiles/keeper/migrations.go +++ b/x/profiles/keeper/migrations.go @@ -7,9 +7,8 @@ import ( v043 "github.com/cosmos/cosmos-sdk/x/auth/legacy/v043" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" - "github.com/gogo/protobuf/grpc" - "github.com/desmos-labs/desmos/v2/x/profiles/types" + "github.com/gogo/protobuf/grpc" v210 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v210" @@ -78,6 +77,29 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error { return iterErr } +// Migrate4to5 migrates from version 4 to 5 +func (m Migrator) Migrate4to5(ctx sdk.Context) error { + params := m.keeper.GetParams(ctx) + blockTime := ctx.BlockTime() + expirationTimeParam := params.AppLinks.ExpirationTime + + m.keeper.IterateApplicationLinks(ctx, func(index int64, link types.ApplicationLink) (stop bool) { + expirationTime := types.CalculateExpirationTime(link.CreationTime, expirationTimeParam) + // if the existent app link is expired, delete it + if expirationTime.Before(blockTime) { + m.keeper.deleteApplicationLinkStoreKeys(ctx, link) + return false + } + + link.ExpirationTime = expirationTime + // TODO can this error be unchecked? it checks if the link is associated to a profile + _ = m.keeper.SaveApplicationLink(ctx, link) + return false + }) + + return nil +} + func (m Migrator) migrateProfile(ctx sdk.Context, profile *types.Profile) error { // Do not migrate those profiles that are not based on a VestingAccount vestingAcc, ok := profile.GetAccount().(exported.VestingAccount) diff --git a/x/profiles/keeper/relay_app_links.go b/x/profiles/keeper/relay_app_links.go index 162598086b..530b28d0af 100644 --- a/x/profiles/keeper/relay_app_links.go +++ b/x/profiles/keeper/relay_app_links.go @@ -3,8 +3,6 @@ package keeper import ( "encoding/hex" "fmt" - "strings" - "github.com/armon/go-metrics" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,6 +10,7 @@ import ( clienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v2/modules/core/24-host" + "strings" "github.com/desmos-labs/desmos/v2/pkg/obi" @@ -115,6 +114,9 @@ func (k Keeper) StartProfileConnection( return err } + // Get block time as the creation time of the appLink + creationTime := ctx.BlockTime() + // Store the connection err = k.SaveApplicationLink(ctx, types.NewApplicationLink( sender.String(), @@ -127,8 +129,10 @@ func (k Keeper) StartProfileConnection( clientID, ), nil, - ctx.BlockTime(), + creationTime, + types.CalculateExpirationTime(creationTime, k.GetParams(ctx).AppLinks.ExpirationTime), )) + if err != nil { return err } diff --git a/x/profiles/legacy/v200/types.go b/x/profiles/legacy/v200/types.go new file mode 100644 index 0000000000..0d69ee1ab7 --- /dev/null +++ b/x/profiles/legacy/v200/types.go @@ -0,0 +1,21 @@ +package v200 + +import ( + "github.com/desmos-labs/desmos/v2/x/profiles/types" + "time" +) + +// NewApplicationLink allows to build a new ApplicationLink instance +func NewApplicationLink( + user string, data types.Data, state types.ApplicationLinkState, oracleRequest types.OracleRequest, result *types.Result, + creationTime time.Time, +) ApplicationLink { + return ApplicationLink{ + User: user, + Data: data, + State: state, + OracleRequest: oracleRequest, + Result: result, + CreationTime: creationTime, + } +} diff --git a/x/profiles/module.go b/x/profiles/module.go index 6a0697178e..aeaa6178c1 100644 --- a/x/profiles/module.go +++ b/x/profiles/module.go @@ -186,7 +186,9 @@ func (AppModule) ConsensusVersion() uint64 { } // BeginBlock returns the begin blocker for the profiles module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { + // TODO should we emit an event for this? + am.keeper.DeleteExpiredApplicationLinks(ctx) } // EndBlock returns the end blocker for the profiles module. It returns no validator diff --git a/x/profiles/types/keys.go b/x/profiles/types/keys.go index b9c6365135..9eb46dc083 100644 --- a/x/profiles/types/keys.go +++ b/x/profiles/types/keys.go @@ -1,6 +1,10 @@ package types -import "strings" +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "strings" + "time" +) // DONTCOVER @@ -41,6 +45,7 @@ var ( ChainLinksPrefix = []byte("chain_links") UserApplicationLinkPrefix = []byte("user_application_link") ApplicationLinkClientIDPrefix = []byte("client_id") + ExpiringAppLinkTimePrefix = []byte("epxiring_app_link_time") // IBCPortKey defines the key to store the port ID in store IBCPortKey = []byte{0x01} @@ -123,3 +128,15 @@ func UserApplicationLinkKey(user, application, username string) []byte { func ApplicationLinkClientIDKey(clientID string) []byte { return append(ApplicationLinkClientIDPrefix, []byte(clientID)...) } + +// ExpiringApplicationLinkPrefix returns the store prefix used to identify the +// expiration time for application links +func ExpiringApplicationLinkPrefix(expirationTime time.Time) []byte { + return append(ExpiringAppLinkTimePrefix, sdk.FormatTimeBytes(expirationTime)...) +} + +// ExpirationTimeApplicationLinkKey returns the key used to store the clientID associated with the expirationTime +// of the application link associated with the given clientID +func ExpirationTimeApplicationLinkKey(expirationTime time.Time, clientID string) []byte { + return append(ExpiringApplicationLinkPrefix(expirationTime), []byte(clientID)...) +} diff --git a/x/profiles/types/models_app_links.go b/x/profiles/types/models_app_links.go index b9f0994d61..e0ffb6f182 100644 --- a/x/profiles/types/models_app_links.go +++ b/x/profiles/types/models_app_links.go @@ -12,18 +12,25 @@ import ( // NewApplicationLink allows to build a new ApplicationLink instance func NewApplicationLink( - user string, data Data, state ApplicationLinkState, oracleRequest OracleRequest, result *Result, creationTime time.Time, + user string, data Data, state ApplicationLinkState, oracleRequest OracleRequest, result *Result, creationTime time.Time, expirationTime time.Time, ) ApplicationLink { return ApplicationLink{ - User: user, - Data: data, - State: state, - OracleRequest: oracleRequest, - Result: result, - CreationTime: creationTime, + User: user, + Data: data, + State: state, + OracleRequest: oracleRequest, + Result: result, + CreationTime: creationTime, + ExpirationTime: expirationTime, } } +// CalculateExpirationTime calculate the expiration time for an application link by adding the expirationTime parameter +// to the app link creationTime +func CalculateExpirationTime(creationTime time.Time, expirationTimeParam time.Time) time.Time { + return creationTime.Add(time.Duration(expirationTimeParam.UnixNano())) +} + // Validate returns an error if the instance does not contain valid data func (l ApplicationLink) Validate() error { _, err := sdk.AccAddressFromBech32(l.User) @@ -52,6 +59,10 @@ func (l ApplicationLink) Validate() error { return fmt.Errorf("invalid creation time: %s", l.CreationTime) } + if l.ExpirationTime.IsZero() { + return fmt.Errorf("invalid expiration time: %s", l.ExpirationTime) + } + return nil } diff --git a/x/profiles/types/models_app_links.pb.go b/x/profiles/types/models_app_links.pb.go index 209a6b3926..1891fdacf9 100644 --- a/x/profiles/types/models_app_links.pb.go +++ b/x/profiles/types/models_app_links.pb.go @@ -83,6 +83,8 @@ type ApplicationLink struct { Result *Result `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty" yaml:"result"` // CreationTime represents the time in which the link was created CreationTime time.Time `protobuf:"bytes,6,opt,name=creation_time,json=creationTime,proto3,stdtime" json:"creation_time" yaml:"creation_time"` + // ExpirationTime represents the time in which the link will expire + ExpirationTime time.Time `protobuf:"bytes,7,opt,name=expiration_time,json=expirationTime,proto3,stdtime" json:"expiration_time" yaml:"expiration_time"` } func (m *ApplicationLink) Reset() { *m = ApplicationLink{} } @@ -451,68 +453,70 @@ func init() { } var fileDescriptor_33caa1214beac081 = []byte{ - // 969 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0x4f, 0x6f, 0xdb, 0x46, - 0x13, 0xc6, 0x45, 0x89, 0x56, 0xac, 0x75, 0x6c, 0xeb, 0x5d, 0xfb, 0x6d, 0x04, 0x02, 0x16, 0x59, - 0xba, 0x70, 0xdd, 0x16, 0x26, 0x61, 0xf5, 0x52, 0x18, 0x28, 0x50, 0x51, 0xa2, 0x11, 0x26, 0xae, - 0x65, 0xac, 0xe8, 0x04, 0xc8, 0x85, 0x58, 0x91, 0x2b, 0x95, 0x08, 0x25, 0xaa, 0xf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 0x13, 0x07, 0x9a, 0xe0, 0xb3, 0x25, 0xe0, 0x27, 0x3a, - 0x32, 0x8e, 0xf3, 0xfb, 0xae, 0xd9, 0x44, 0xa6, 0xde, 0xae, 0x72, 0x33, 0xea, 0x8c, 0xf6, 0x84, - 0x04, 0x6e, 0x3f, 0x2b, 0xd1, 0x8d, 0x70, 0x10, 0x11, 0x07, 0x9e, 0x81, 0x4f, 0xee, 0x42, 0xd5, - 0x11, 0xea, 0xa0, 0x6a, 0x51, 0xf8, 0xf0, 0xf2, 0x4a, 0xda, 0x59, 0xc6, 0xd4, 0xd3, 0xa1, 0xdd, - 0xb9, 0xcf, 0xf3, 0x56, 0x4b, 0xef, 0x76, 0xab, 0xa5, 0x5b, 0xfa, 0xcc, 0x56, 0xe4, 0x11, 0x90, - 0x96, 0x50, 0x4d, 0xe3, 0x6b, 0xbd, 0x6d, 0x75, 0xce, 0xcd, 0x2a, 0x2f, 0x7c, 0x74, 0x79, 0x25, - 0x49, 0xcb, 0x50, 0xe9, 0x73, 0xea, 0x74, 0xe2, 0x48, 0xe0, 0x5f, 0xfe, 0x54, 0x2f, 0x68, 0x8f, - 0xdf, 0x4c, 0xea, 0xdc, 0xdb, 0x49, 0x9d, 0xfb, 0x63, 0x52, 0xe7, 0x5e, 0x5d, 0xd7, 0x0b, 0x6f, - 0xaf, 0xeb, 0x85, 0xdf, 0xae, 0xeb, 0x85, 0x67, 0x87, 0x03, 0x37, 0xfa, 0x26, 0xee, 0x29, 0xb6, - 0x3f, 0x54, 0xd9, 0x56, 0x1f, 0x78, 0xb8, 0x17, 0x66, 0x67, 0xf5, 0xa2, 0xa1, 0x7e, 0x37, 0xff, - 0x0d, 0x10, 0xbd, 0x18, 0x93, 0xb0, 0x57, 0xa6, 0x2f, 0xfd, 0xe7, 0x7f, 0x07, 0x00, 0x00, 0xff, - 0xff, 0xbb, 0xec, 0x83, 0x18, 0x23, 0x08, 0x00, 0x00, + // 996 bytes of a gzipped FileDescriptorProto + 0x1f, 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, 0xdb, 0x41, 0xe0, 0x51, 0x07, 0xc7, 0xd4, + 0x1f, 0xee, 0xd3, 0xe1, 0x33, 0xb8, 0x0e, 0x84, 0x24, 0x22, 0x61, 0xb3, 0x2c, 0x97, 0x37, 0xeb, + 0xfa, 0xf2, 0x38, 0x95, 0x16, 0x5e, 0xe0, 0x81, 0xb7, 0xab, 0x64, 0x51, 0x05, 0xb1, 0x24, 0xdc, + 0x03, 0x82, 0x8b, 0x63, 0xdc, 0xac, 0xc8, 0xe5, 0xcd, 0x85, 0x9d, 0x35, 0x75, 0x46, 0x5f, 0x6a, + 0x17, 0xc7, 0x58, 0x5f, 0x79, 0x93, 0x4a, 0xa5, 0x09, 0x27, 0x2b, 0x54, 0x10, 0xab, 0x87, 0xc7, + 0x60, 0x2e, 0x8a, 0x71, 0x4c, 0x9a, 0x55, 0xb9, 0xbc, 0xb9, 0xb4, 0xb3, 0x35, 0x13, 0xf4, 0x4e, + 0x97, 0xbd, 0xac, 0x48, 0x6f, 0x8c, 0x53, 0xe9, 0x2e, 0x87, 0x32, 0x8a, 0x82, 0x38, 0x0d, 0x7a, + 0x60, 0xc9, 0x0f, 0xb1, 0xe3, 0x11, 0x3b, 0x24, 0x3f, 0x24, 0x24, 0x8a, 0x9b, 0x02, 0x6b, 0x74, + 0x63, 0x26, 0xff, 0x90, 0xc9, 0x11, 0x57, 0xeb, 0x6b, 0x79, 0xc7, 0x1f, 0x73, 0xf8, 0x75, 0x96, + 0x82, 0x16, 0xfd, 0x69, 0x35, 0x7c, 0x08, 0x6a, 0x21, 0x89, 0x12, 0x2f, 0x6e, 0xce, 0x31, 0x17, + 0x69, 0xa6, 0x0b, 0x62, 0x32, 0xfd, 0xa3, 0x71, 0x2a, 0x2d, 0x72, 0x34, 0x2f, 0x54, 0x50, 0x4e, + 0x80, 0x18, 0x2c, 0x3a, 0x21, 0x61, 0xbf, 0xd3, 0xce, 0xa6, 0xd5, 0xac, 0x31, 0xa4, 0xa8, 0xf2, + 0x51, 0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0x2c, 0x0a, 0x2f, 0x7f, 0x69, 0x95, 0xf4, 0x47, 0x6f, 0x46, 0xad, 0xf2, 0xdb, 0x51, + 0xab, 0xfc, 0xd7, 0xa8, 0x55, 0x7e, 0x75, 0xd9, 0x2a, 0xbd, 0xbd, 0x6c, 0x95, 0xfe, 0xb8, 0x6c, + 0x95, 0x9e, 0x6e, 0xf7, 0x69, 0xfc, 0x7d, 0x72, 0xa2, 0x3a, 0xfe, 0x40, 0xe3, 0x5b, 0xbd, 0xe5, + 0xe1, 0x93, 0x28, 0xff, 0xd6, 0xce, 0x76, 0xb4, 0xe7, 0x93, 0x7f, 0x36, 0xe2, 0x17, 0x01, 0x89, + 0x4e, 0x6a, 0xec, 0xb5, 0xff, 0xea, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x13, 0x99, 0x98, 0x10, + 0x8c, 0x08, 0x00, 0x00, } func (this *ApplicationLink) Equal(that interface{}) bool { @@ -552,6 +556,9 @@ func (this *ApplicationLink) Equal(that interface{}) bool { if !this.CreationTime.Equal(that1.CreationTime) { return false } + if !this.ExpirationTime.Equal(that1.ExpirationTime) { + return false + } return true } func (this *Data) Equal(that interface{}) bool { @@ -790,13 +797,21 @@ func (m *ApplicationLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime):]) if err1 != nil { return 0, err1 } i -= n1 i = encodeVarintModelsAppLinks(dAtA, i, uint64(n1)) i-- + dAtA[i] = 0x3a + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintModelsAppLinks(dAtA, i, uint64(n2)) + i-- dAtA[i] = 0x32 if m.Result != nil { { @@ -1144,6 +1159,8 @@ func (m *ApplicationLink) Size() (n int) { } l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime) n += 1 + l + sovModelsAppLinks(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime) + n += 1 + l + sovModelsAppLinks(uint64(l)) return n } @@ -1489,6 +1506,39 @@ func (m *ApplicationLink) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) diff --git a/x/profiles/types/models_params.pb.go b/x/profiles/types/models_params.pb.go index e1297c67c6..6db1cbf849 100644 --- a/x/profiles/types/models_params.pb.go +++ b/x/profiles/types/models_params.pb.go @@ -9,15 +9,19 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -31,6 +35,7 @@ type Params struct { DTag DTagParams `protobuf:"bytes,2,opt,name=dtag,proto3" json:"dtag" yaml:"dtag"` Bio BioParams `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio" yaml:"bio"` Oracle OracleParams `protobuf:"bytes,4,opt,name=oracle,proto3" json:"oracle" yaml:"oracle"` + AppLinks AppLinksParams `protobuf:"bytes,5,opt,name=appLinks,proto3" json:"appLinks" yaml:"applinks"` } func (m *Params) Reset() { *m = Params{} } @@ -239,12 +244,51 @@ func (m *OracleParams) XXX_DiscardUnknown() { var xxx_messageInfo_OracleParams proto.InternalMessageInfo +// AppLinksParams define the parameters related to the app links +type AppLinksParams struct { + ExpirationTime time.Time `protobuf:"bytes,1,opt,name=expiration_time,json=expirationTime,proto3,stdtime" json:"expiration_time" yaml:"expiration_time"` +} + +func (m *AppLinksParams) Reset() { *m = AppLinksParams{} } +func (m *AppLinksParams) String() string { return proto.CompactTextString(m) } +func (*AppLinksParams) ProtoMessage() {} +func (*AppLinksParams) Descriptor() ([]byte, []int) { + return fileDescriptor_a621950d5c07fbad, []int{5} +} +func (m *AppLinksParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AppLinksParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AppLinksParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AppLinksParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_AppLinksParams.Merge(m, src) +} +func (m *AppLinksParams) XXX_Size() int { + return m.Size() +} +func (m *AppLinksParams) XXX_DiscardUnknown() { + xxx_messageInfo_AppLinksParams.DiscardUnknown(m) +} + +var xxx_messageInfo_AppLinksParams proto.InternalMessageInfo + func init() { proto.RegisterType((*Params)(nil), "desmos.profiles.v1beta1.Params") proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.v1beta1.NicknameParams") proto.RegisterType((*DTagParams)(nil), "desmos.profiles.v1beta1.DTagParams") proto.RegisterType((*BioParams)(nil), "desmos.profiles.v1beta1.BioParams") proto.RegisterType((*OracleParams)(nil), "desmos.profiles.v1beta1.OracleParams") + proto.RegisterType((*AppLinksParams)(nil), "desmos.profiles.v1beta1.AppLinksParams") } func init() { @@ -252,51 +296,57 @@ func init() { } var fileDescriptor_a621950d5c07fbad = []byte{ - // 693 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xd3, 0x40, - 0x14, 0x86, 0x73, 0x71, 0xa3, 0x78, 0x52, 0x2e, 0xb5, 0x0a, 0x0d, 0x45, 0xb2, 0xab, 0x41, 0x40, - 0x24, 0x54, 0x5b, 0x29, 0x0b, 0xa4, 0x4a, 0x2c, 0x70, 0x5b, 0x41, 0xc5, 0xad, 0x32, 0x5d, 0x21, - 0x24, 0x6b, 0xec, 0x4c, 0x5d, 0x2b, 0xb1, 0xc7, 0xf2, 0x38, 0x55, 0xba, 0x62, 0xcb, 0x92, 0x27, - 0x40, 0xac, 0x11, 0x0f, 0xd2, 0x65, 0x97, 0x88, 0x85, 0x41, 0xee, 0x1b, 0xe4, 0x09, 0xd0, 0x5c, - 0xe2, 0xa4, 0x95, 0x22, 0x0a, 0x88, 0x55, 0x8e, 0x7d, 0xce, 0xff, 0x9d, 0x99, 0xf3, 0x7b, 0x26, - 0xe0, 0x41, 0x0f, 0xd3, 0x88, 0x50, 0x2b, 0x49, 0xc9, 0x41, 0x38, 0xc0, 0xd4, 0x3a, 0xea, 0x7a, - 0x38, 0x43, 0x5d, 0x2b, 0x22, 0x3d, 0x3c, 0xa0, 0x6e, 0x82, 0x52, 0x14, 0x51, 0x33, 0x49, 0x49, - 0x46, 0xb4, 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0xfc, 0xc3, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x10, 0x33, 0x13, - 0x54, 0x5e, 0x06, 0x00, 0x00, + // 794 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xeb, 0x44, + 0x18, 0xc7, 0x93, 0x3a, 0x8d, 0x92, 0xc9, 0xa1, 0xa5, 0x56, 0x69, 0x43, 0x91, 0xe2, 0x6a, 0x10, + 0x10, 0x09, 0xd5, 0x56, 0xca, 0x02, 0xa9, 0x12, 0x8b, 0xba, 0xad, 0xa0, 0xa2, 0x40, 0x65, 0xb2, + 0x42, 0x48, 0xd6, 0xd8, 0x99, 0xb8, 0xa3, 0xd8, 0x1e, 0xcb, 0xe3, 0x54, 0xe9, 0xaa, 0x5b, 0x96, + 0x7d, 0x02, 0xc4, 0x1a, 0xf1, 0x10, 0x2c, 0xbb, 0xec, 0x12, 0xb1, 0x70, 0x51, 0xfa, 0x06, 0x79, + 0x02, 0x34, 0x17, 0x3b, 0x49, 0x45, 0xd4, 0x02, 0x3a, 0x2b, 0x8f, 0x67, 0xbe, 0xff, 0xef, 0xbb, + 0xcd, 0x05, 0x7c, 0x3a, 0xc0, 0x2c, 0xa2, 0xcc, 0x4a, 0x52, 0x3a, 0x24, 0x21, 0x66, 0xd6, 0x75, + 0xcf, 0xc3, 0x19, 0xea, 0x59, 0x11, 0x1d, 0xe0, 0x90, 0xb9, 0x09, 0x4a, 0x51, 0xc4, 0xcc, 0x24, + 0xa5, 0x19, 0xd5, 0x77, 0xa5, 0xb1, 0x59, 0x18, 0x9b, 0xca, 0x78, 0x6f, 0x3b, 0xa0, 0x01, 0x15, + 0x36, 0x16, 0x1f, 0x49, 0xf3, 0xbd, 0x8e, 0x4f, 0x05, 0xdb, 0x43, 0x0c, 0x97, 0x5c, 0x9f, 0x92, + 0x58, 0xad, 0x1b, 0x01, 0xa5, 0x41, 0x88, 0x2d, 0xf1, 0xe7, 0x8d, 0x87, 0x56, 0x46, 0x22, 0xcc, + 0x32, 0x14, 0x25, 0xd2, 0x00, 0xfe, 0xae, 0x81, 0xfa, 0xa5, 0x08, 0x40, 0xff, 0x11, 0x34, 0x62, + 0xe2, 0x8f, 0x62, 0x14, 0xe1, 0x76, 0x75, 0xbf, 0xda, 0x6d, 0x1d, 0x7e, 0x62, 0xae, 0x88, 0xc6, + 0xfc, 0x56, 0x19, 0x4a, 0xa9, 0xbd, 0x7b, 0x9f, 0x1b, 0x95, 0x59, 0x6e, 0x6c, 0xde, 0xa0, 0x28, + 0x3c, 0x82, 0x05, 0x06, 0x3a, 0x25, 0x51, 0xef, 0x83, 0xda, 0x20, 0x43, 0x41, 0x7b, 0x4d, 0x90, + 0x3f, 0x5c, 0x49, 0x3e, 0xed, 0xa3, 0x40, 0x51, 0x3f, 0xe0, 0xd4, 0x69, 0x6e, 0xd4, 0xf8, 0xdc, + 0x2c, 0x37, 0x5a, 0x92, 0xce, 0x31, 0xd0, 0x11, 0x34, 0xfd, 0x2b, 0xa0, 0x79, 0x84, 0xb6, 0x35, + 0x01, 0x85, 0x2b, 0xa1, 0x36, 0xa1, 0x8a, 0xa9, 0xab, 0x48, 0x81, 0x64, 0x79, 0x84, 0x42, 0x87, + 0x23, 0xf4, 0x3e, 0xa8, 0xd3, 0x14, 0xf9, 0x21, 0x6e, 0xd7, 0x04, 0xec, 0xa3, 0x95, 0xb0, 0xef, + 0x84, 0x99, 0xe2, 0xbd, 0xa7, 0x78, 0xef, 0x48, 0x9e, 0x44, 0x40, 0x47, 0xb1, 0x78, 0x4d, 0x51, + 0x92, 0x5c, 0x90, 0x78, 0xc4, 0xda, 0xeb, 0x2f, 0xd4, 0xf4, 0x58, 0x19, 0xfe, 0x73, 0x4d, 0x51, + 0x92, 0x84, 0x7c, 0x15, 0x3a, 0x25, 0xf1, 0xa8, 0xf6, 0xd3, 0x2f, 0x46, 0x05, 0xe6, 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 0x29, 0xb2, 0x5e, 0x02, 0xc0, 0xbb, + 0x47, 0xa3, 0xea, 0x6c, 0xcc, 0x67, 0xb9, 0x50, 0x06, 0x60, 0x7f, 0x7d, 0x3f, 0xed, 0x54, 0x1f, + 0xa6, 0x9d, 0xea, 0x5f, 0xd3, 0x4e, 0xf5, 0xee, 0xa9, 0x53, 0x79, 0x78, 0xea, 0x54, 0xfe, 0x78, + 0xea, 0x54, 0x7e, 0xe8, 0x2d, 0x64, 0x25, 0xaf, 0xc7, 0x83, 0x10, 0x79, 0x4c, 0x8d, 0xad, 0xeb, + 0x43, 0x6b, 0x32, 0x7f, 0x3e, 0x45, 0x92, 0x5e, 0x5d, 0x84, 0xf6, 0xd9, 0xdf, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xb1, 0x1e, 0x36, 0x7b, 0x5e, 0x07, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -319,6 +369,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.AppLinks.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a { size, err := m.Oracle.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -550,6 +610,37 @@ func (m *OracleParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *AppLinksParams) 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 *AppLinksParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AppLinksParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintModelsParams(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintModelsParams(dAtA []byte, offset int, v uint64) int { offset -= sovModelsParams(v) base := offset @@ -575,6 +666,8 @@ func (m *Params) Size() (n int) { n += 1 + l + sovModelsParams(uint64(l)) l = m.Oracle.Size() n += 1 + l + sovModelsParams(uint64(l)) + l = m.AppLinks.Size() + n += 1 + l + sovModelsParams(uint64(l)) return n } @@ -649,6 +742,17 @@ func (m *OracleParams) Size() (n int) { return n } +func (m *AppLinksParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime) + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + func sovModelsParams(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -816,6 +920,39 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppLinks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AppLinks.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipModelsParams(dAtA[iNdEx:]) @@ -1363,6 +1500,89 @@ func (m *OracleParams) Unmarshal(dAtA []byte) error { } return nil } +func (m *AppLinksParams) 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 ErrIntOverflowModelsParams + } + 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: AppLinksParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AppLinksParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipModelsParams(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 01991f42f4f4b4de36265831a664b62ba2a8e8ed Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 17 Jan 2022 17:32:31 +0100 Subject: [PATCH 002/112] - completed appLinksParams implementation - added tests for appLinkParams - fixed migration errors --- x/profiles/keeper/alias_functions.go | 4 +- x/profiles/keeper/keeper_params_test.go | 4 + x/profiles/keeper/relay_app_links.go | 3 +- x/profiles/keeper/relay_app_links_test.go | 25 + x/profiles/legacy/v200/model_app_links.go | 76 + x/profiles/legacy/v200/models_app_links.pb.go | 2293 +++++++++++++++++ x/profiles/legacy/v200/store.go | 20 +- x/profiles/legacy/v200/types.go | 21 - x/profiles/legacy/v210/store.go | 9 +- x/profiles/legacy/v210/store_test.go | 25 +- x/profiles/types/keys.go | 3 +- x/profiles/types/models_params.go | 38 +- x/profiles/types/models_params_test.go | 51 +- 13 files changed, 2518 insertions(+), 54 deletions(-) create mode 100644 x/profiles/legacy/v200/model_app_links.go create mode 100644 x/profiles/legacy/v200/models_app_links.pb.go delete mode 100644 x/profiles/legacy/v200/types.go diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go index b3099a4de8..4df8ecff62 100644 --- a/x/profiles/keeper/alias_functions.go +++ b/x/profiles/keeper/alias_functions.go @@ -1,10 +1,10 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "time" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/desmos-labs/desmos/v2/x/profiles/types" ) diff --git a/x/profiles/keeper/keeper_params_test.go b/x/profiles/keeper/keeper_params_test.go index 202489236e..e7e4a1bc0c 100644 --- a/x/profiles/keeper/keeper_params_test.go +++ b/x/profiles/keeper/keeper_params_test.go @@ -2,6 +2,7 @@ package keeper_test import ( sdk "github.com/cosmos/cosmos-sdk/types" + "time" "github.com/desmos-labs/desmos/v2/x/profiles/types" ) @@ -19,6 +20,7 @@ func (suite *KeeperTestSuite) TestKeeper_SetParams() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(time.Now()), ) suite.k.SetParams(suite.ctx, params) @@ -48,6 +50,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetParams() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC)), ) suite.k.SetParams(ctx, params) }, @@ -64,6 +67,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetParams() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC)), ), }, { diff --git a/x/profiles/keeper/relay_app_links.go b/x/profiles/keeper/relay_app_links.go index 530b28d0af..baf5086f5d 100644 --- a/x/profiles/keeper/relay_app_links.go +++ b/x/profiles/keeper/relay_app_links.go @@ -3,6 +3,8 @@ package keeper import ( "encoding/hex" "fmt" + "strings" + "github.com/armon/go-metrics" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -10,7 +12,6 @@ import ( clienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v2/modules/core/24-host" - "strings" "github.com/desmos-labs/desmos/v2/pkg/obi" diff --git a/x/profiles/keeper/relay_app_links_test.go b/x/profiles/keeper/relay_app_links_test.go index e0f86fff99..8f0536a51b 100644 --- a/x/profiles/keeper/relay_app_links_test.go +++ b/x/profiles/keeper/relay_app_links_test.go @@ -232,6 +232,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -255,6 +256,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewErrorResult(types.ErrRequestExpired), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -275,6 +277,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -298,6 +301,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewErrorResult(types.ErrRequestFailed), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -318,6 +322,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -348,6 +353,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -371,6 +377,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewErrorResult(types.ErrInvalidAppUsername), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -391,6 +398,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -420,6 +428,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -443,6 +452,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewErrorResult(types.ErrInvalidSignature), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -462,6 +472,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -480,6 +491,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewSuccessResult(hexValue, hexSig), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -499,6 +511,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -517,6 +530,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -536,6 +550,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewErrorResult(types.ErrInvalidSignature), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -554,6 +569,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewErrorResult(types.ErrInvalidSignature), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -573,6 +589,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewSuccessResult("value", "signature"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -591,6 +608,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewSuccessResult("value", "signature"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, } @@ -651,6 +669,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestAcknowledgementPacket() ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) suite.ak.SetAccount(ctx, testutil.ProfileFromAddr(address)) @@ -672,6 +691,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestAcknowledgementPacket() ), types.NewErrorResult("error"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -690,6 +710,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestAcknowledgementPacket() ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) suite.ak.SetAccount(ctx, testutil.ProfileFromAddr(address)) @@ -716,6 +737,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestAcknowledgementPacket() ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) suite.ak.SetAccount(ctx, testutil.ProfileFromAddr(address)) @@ -737,6 +759,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestAcknowledgementPacket() ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, } @@ -792,6 +815,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestTimeoutPacket() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) suite.ak.SetAccount(ctx, testutil.ProfileFromAddr(address)) @@ -815,6 +839,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestTimeoutPacket() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().Equal(expected, link) }, diff --git a/x/profiles/legacy/v200/model_app_links.go b/x/profiles/legacy/v200/model_app_links.go new file mode 100644 index 0000000000..0295c28f7c --- /dev/null +++ b/x/profiles/legacy/v200/model_app_links.go @@ -0,0 +1,76 @@ +package v200 + +import ( + "time" + + "github.com/cosmos/cosmos-sdk/codec" +) + +// NewApplicationLink allows to build a new ApplicationLink instance +func NewApplicationLink( + user string, data Data, state ApplicationLinkState, oracleRequest OracleRequest, result *Result, + creationTime time.Time, +) ApplicationLink { + return ApplicationLink{ + User: user, + Data: data, + State: state, + OracleRequest: oracleRequest, + Result: result, + CreationTime: creationTime, + } +} + +// NewOracleRequest allows to build a new OracleRequest instance +func NewOracleRequest(id uint64, scriptID uint64, callData OracleRequest_CallData, clientID string) OracleRequest { + return OracleRequest{ + ID: id, + OracleScriptID: scriptID, + CallData: callData, + ClientID: clientID, + } +} + +// NewOracleRequestCallData allows to build a new OracleRequest_CallData instance +func NewOracleRequestCallData(application, callData string) OracleRequest_CallData { + return OracleRequest_CallData{ + Application: application, + CallData: callData, + } +} + +// NewData allows to build a new Data instance +func NewData(application, username string) Data { + return Data{ + Application: application, + Username: username, + } +} + +// NewSuccessResult allows to build a new Result instance representing a success +func NewSuccessResult(value, signature string) *Result { + return &Result{ + Sum: &Result_Success_{ + Success: &Result_Success{ + Value: value, + Signature: signature, + }, + }, + } +} + +// NewErrorResult allows to build a new Result instance representing an error +func NewErrorResult(error string) *Result { + return &Result{ + Sum: &Result_Failed_{ + Failed: &Result_Failed{ + Error: error, + }, + }, + } +} + +// MustMarshalApplicationLink serializes the given application link using the provided BinaryCodec +func MustMarshalApplicationLink(cdc codec.BinaryCodec, link ApplicationLink) []byte { + return cdc.MustMarshal(&link) +} diff --git a/x/profiles/legacy/v200/models_app_links.pb.go b/x/profiles/legacy/v200/models_app_links.pb.go new file mode 100644 index 0000000000..75f0593ff6 --- /dev/null +++ b/x/profiles/legacy/v200/models_app_links.pb.go @@ -0,0 +1,2293 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v1beta1/models_app_links.proto + +package v200 + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// ApplicationLinkState defines if an application link is in the following +// states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT +type ApplicationLinkState int32 + +const ( + // A link has just been initialized + ApplicationLinkStateInitialized ApplicationLinkState = 0 + // A link has just started being verified + AppLinkStateVerificationStarted ApplicationLinkState = 1 + // A link has errored during the verification process + AppLinkStateVerificationError ApplicationLinkState = 2 + // A link has being verified successfully + AppLinkStateVerificationSuccess ApplicationLinkState = 3 + // A link has timed out while waiting for the verification + AppLinkStateVerificationTimedOut ApplicationLinkState = 4 +) + +var ApplicationLinkState_name = map[int32]string{ + 0: "APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED", + 1: "APPLICATION_LINK_STATE_VERIFICATION_STARTED", + 2: "APPLICATION_LINK_STATE_VERIFICATION_ERROR", + 3: "APPLICATION_LINK_STATE_VERIFICATION_SUCCESS", + 4: "APPLICATION_LINK_STATE_TIMED_OUT", +} + +var ApplicationLinkState_value = map[string]int32{ + "APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED": 0, + "APPLICATION_LINK_STATE_VERIFICATION_STARTED": 1, + "APPLICATION_LINK_STATE_VERIFICATION_ERROR": 2, + "APPLICATION_LINK_STATE_VERIFICATION_SUCCESS": 3, + "APPLICATION_LINK_STATE_TIMED_OUT": 4, +} + +func (x ApplicationLinkState) String() string { + return proto.EnumName(ApplicationLinkState_name, int32(x)) +} + +func (ApplicationLinkState) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{0} +} + +// ApplicationLink contains the data of a link to a centralized application +type ApplicationLink struct { + // User to which the link is associated + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty" yaml:"user"` + // Data contains the details of this specific link + Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data" yaml:"data"` + // State of the link + State ApplicationLinkState `protobuf:"varint,3,opt,name=state,proto3,enum=desmos.profiles.v1beta1.ApplicationLinkState" json:"state,omitempty" yaml:"state"` + // OracleRequest represents the request that has been made to the oracle + OracleRequest OracleRequest `protobuf:"bytes,4,opt,name=oracle_request,json=oracleRequest,proto3" json:"oracle_request" yaml:"oracle_request"` + // Data coming from the result of the verification. + // Only available when the state is STATE_SUCCESS + Result *Result `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty" yaml:"result"` + // CreationTime represents the time in which the link was created + CreationTime time.Time `protobuf:"bytes,6,opt,name=creation_time,json=creationTime,proto3,stdtime" json:"creation_time" yaml:"creation_time"` +} + +func (m *ApplicationLink) Reset() { *m = ApplicationLink{} } +func (m *ApplicationLink) String() string { return proto.CompactTextString(m) } +func (*ApplicationLink) ProtoMessage() {} +func (*ApplicationLink) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{0} +} +func (m *ApplicationLink) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ApplicationLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ApplicationLink.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ApplicationLink) XXX_Merge(src proto.Message) { + xxx_messageInfo_ApplicationLink.Merge(m, src) +} +func (m *ApplicationLink) XXX_Size() int { + return m.Size() +} +func (m *ApplicationLink) XXX_DiscardUnknown() { + xxx_messageInfo_ApplicationLink.DiscardUnknown(m) +} + +var xxx_messageInfo_ApplicationLink proto.InternalMessageInfo + +// Data contains the data associated to a specific user of a +// generic centralized application +type Data struct { + // The application name (eg. Twitter, GitHub, etc) + Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty" yaml:"application"` + // Username on the application (eg. Twitter tag, GitHub profile, etc) + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty" yaml:"username"` +} + +func (m *Data) Reset() { *m = Data{} } +func (m *Data) String() string { return proto.CompactTextString(m) } +func (*Data) ProtoMessage() {} +func (*Data) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{1} +} +func (m *Data) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Data.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Data) XXX_Merge(src proto.Message) { + xxx_messageInfo_Data.Merge(m, src) +} +func (m *Data) XXX_Size() int { + return m.Size() +} +func (m *Data) XXX_DiscardUnknown() { + xxx_messageInfo_Data.DiscardUnknown(m) +} + +var xxx_messageInfo_Data proto.InternalMessageInfo + +// OracleRequest represents a generic oracle request used to +// verify the ownership of a centralized application account +type OracleRequest struct { + // ID is the ID of the request + ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` + // OracleScriptID is ID of an oracle script + OracleScriptID uint64 `protobuf:"varint,2,opt,name=oracle_script_id,json=oracleScriptId,proto3" json:"oracle_script_id,omitempty" yaml:"oracle_script_id"` + // CallData contains the data used to perform the oracle request + CallData OracleRequest_CallData `protobuf:"bytes,3,opt,name=call_data,json=callData,proto3" json:"call_data" yaml:"call_data"` + // ClientID represents the ID of the client that has called the oracle script + ClientID string `protobuf:"bytes,4,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` +} + +func (m *OracleRequest) Reset() { *m = OracleRequest{} } +func (m *OracleRequest) String() string { return proto.CompactTextString(m) } +func (*OracleRequest) ProtoMessage() {} +func (*OracleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{2} +} +func (m *OracleRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleRequest.Merge(m, src) +} +func (m *OracleRequest) XXX_Size() int { + return m.Size() +} +func (m *OracleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_OracleRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleRequest proto.InternalMessageInfo + +// CallData contains the data sent to a single oracle request in order to +// verify the ownership of a centralized application by a Desmos profile +type OracleRequest_CallData struct { + // The application for which the ownership should be verified + Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty" yaml:"application"` + // The hex encoded call data that should be used to verify the application + // account ownership + CallData string `protobuf:"bytes,2,opt,name=call_data,json=callData,proto3" json:"call_data,omitempty" yaml:"call_data"` +} + +func (m *OracleRequest_CallData) Reset() { *m = OracleRequest_CallData{} } +func (m *OracleRequest_CallData) String() string { return proto.CompactTextString(m) } +func (*OracleRequest_CallData) ProtoMessage() {} +func (*OracleRequest_CallData) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{2, 0} +} +func (m *OracleRequest_CallData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleRequest_CallData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleRequest_CallData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleRequest_CallData) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleRequest_CallData.Merge(m, src) +} +func (m *OracleRequest_CallData) XXX_Size() int { + return m.Size() +} +func (m *OracleRequest_CallData) XXX_DiscardUnknown() { + xxx_messageInfo_OracleRequest_CallData.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleRequest_CallData proto.InternalMessageInfo + +func (m *OracleRequest_CallData) GetApplication() string { + if m != nil { + return m.Application + } + return "" +} + +func (m *OracleRequest_CallData) GetCallData() string { + if m != nil { + return m.CallData + } + return "" +} + +// Result represents a verification result +type Result struct { + // sum is the oneof that specifies whether this represents a success or + // failure result + // + // Types that are valid to be assigned to Sum: + // *Result_Success_ + // *Result_Failed_ + Sum isResult_Sum `protobuf_oneof:"sum"` +} + +func (m *Result) Reset() { *m = Result{} } +func (m *Result) String() string { return proto.CompactTextString(m) } +func (*Result) ProtoMessage() {} +func (*Result) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{3} +} +func (m *Result) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result.Merge(m, src) +} +func (m *Result) XXX_Size() int { + return m.Size() +} +func (m *Result) XXX_DiscardUnknown() { + xxx_messageInfo_Result.DiscardUnknown(m) +} + +var xxx_messageInfo_Result proto.InternalMessageInfo + +type isResult_Sum interface { + isResult_Sum() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type Result_Success_ struct { + Success *Result_Success `protobuf:"bytes,1,opt,name=success,proto3,oneof" json:"success,omitempty"` +} +type Result_Failed_ struct { + Failed *Result_Failed `protobuf:"bytes,2,opt,name=failed,proto3,oneof" json:"failed,omitempty"` +} + +func (*Result_Success_) isResult_Sum() {} +func (*Result_Failed_) isResult_Sum() {} + +func (m *Result) GetSum() isResult_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *Result) GetSuccess() *Result_Success { + if x, ok := m.GetSum().(*Result_Success_); ok { + return x.Success + } + return nil +} + +func (m *Result) GetFailed() *Result_Failed { + if x, ok := m.GetSum().(*Result_Failed_); ok { + return x.Failed + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Result) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Result_Success_)(nil), + (*Result_Failed_)(nil), + } +} + +// Success is the result of an application link that has been successfully +// verified +type Result_Success struct { + // Hex-encoded value that has be signed by the profile + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" yaml:"value"` + // Hex-encoded signature that has been produced by signing the value + Signature string `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" yaml:"signature"` +} + +func (m *Result_Success) Reset() { *m = Result_Success{} } +func (m *Result_Success) String() string { return proto.CompactTextString(m) } +func (*Result_Success) ProtoMessage() {} +func (*Result_Success) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{3, 0} +} +func (m *Result_Success) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result_Success) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result_Success.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result_Success) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result_Success.Merge(m, src) +} +func (m *Result_Success) XXX_Size() int { + return m.Size() +} +func (m *Result_Success) XXX_DiscardUnknown() { + xxx_messageInfo_Result_Success.DiscardUnknown(m) +} + +var xxx_messageInfo_Result_Success proto.InternalMessageInfo + +// Failed is the result of an application link that has not been verified +// successfully +type Result_Failed struct { + // Error that is associated with the failure + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty" yaml:"error"` +} + +func (m *Result_Failed) Reset() { *m = Result_Failed{} } +func (m *Result_Failed) String() string { return proto.CompactTextString(m) } +func (*Result_Failed) ProtoMessage() {} +func (*Result_Failed) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{3, 1} +} +func (m *Result_Failed) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result_Failed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result_Failed.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result_Failed) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result_Failed.Merge(m, src) +} +func (m *Result_Failed) XXX_Size() int { + return m.Size() +} +func (m *Result_Failed) XXX_DiscardUnknown() { + xxx_messageInfo_Result_Failed.DiscardUnknown(m) +} + +var xxx_messageInfo_Result_Failed proto.InternalMessageInfo + +func init() { + proto.RegisterEnum("desmos.profiles.v1beta1.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) + proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.v1beta1.ApplicationLink") + proto.RegisterType((*Data)(nil), "desmos.profiles.v1beta1.Data") + proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.v1beta1.OracleRequest") + proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.v1beta1.OracleRequest.CallData") + proto.RegisterType((*Result)(nil), "desmos.profiles.v1beta1.Result") + proto.RegisterType((*Result_Success)(nil), "desmos.profiles.v1beta1.Result.Success") + proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.v1beta1.Result.Failed") +} + +func init() { + proto.RegisterFile("desmos/profiles/v1beta1/models_app_links.proto", fileDescriptor_33caa1214beac081) +} + +var fileDescriptor_33caa1214beac081 = []byte{ + // 969 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0x4f, 0x6f, 0xdb, 0x46, + 0x13, 0xc6, 0x45, 0x89, 0x56, 0xac, 0x75, 0x6c, 0xeb, 0x5d, 0xfb, 0x6d, 0x04, 0x02, 0x16, 0x59, + 0xba, 0x70, 0xdd, 0x16, 0x26, 0x61, 0xf5, 0x52, 0x18, 0x28, 0x50, 0x51, 0xa2, 0x11, 0x26, 0xae, + 0x65, 0xac, 0xe8, 0x04, 0xc8, 0x85, 0x58, 0x91, 0x2b, 0x95, 0x08, 0x25, 0xaa, 0xfc, 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13, 0x07, 0x9a, 0xe0, 0xb3, 0x25, 0xe0, 0x27, 0x3a, + 0x32, 0x8e, 0xf3, 0xfb, 0xae, 0xd9, 0x44, 0xa6, 0xde, 0xae, 0x72, 0x33, 0xea, 0x8c, 0xf6, 0x84, + 0x04, 0x6e, 0x3f, 0x2b, 0xd1, 0x8d, 0x70, 0x10, 0x11, 0x07, 0x9e, 0x81, 0x4f, 0xee, 0x42, 0xd5, + 0x11, 0xea, 0xa0, 0x6a, 0x51, 0xf8, 0xf0, 0xf2, 0x4a, 0xda, 0x59, 0xc6, 0xd4, 0xd3, 0xa1, 0xdd, + 0xb9, 0xcf, 0xf3, 0x56, 0x4b, 0xef, 0x76, 0xab, 0xa5, 0x5b, 0xfa, 0xcc, 0x56, 0xe4, 0x11, 0x90, + 0x96, 0x50, 0x4d, 0xe3, 0x6b, 0xbd, 0x6d, 0x75, 0xce, 0xcd, 0x2a, 0x2f, 0x7c, 0x74, 0x79, 0x25, + 0x49, 0xcb, 0x50, 0xe9, 0x73, 0xea, 0x74, 0xe2, 0x48, 0xe0, 0x5f, 0xfe, 0x54, 0x2f, 0x68, 0x8f, + 0xdf, 0x4c, 0xea, 0xdc, 0xdb, 0x49, 0x9d, 0xfb, 0x63, 0x52, 0xe7, 0x5e, 0x5d, 0xd7, 0x0b, 0x6f, + 0xaf, 0xeb, 0x85, 0xdf, 0xae, 0xeb, 0x85, 0x67, 0x87, 0x03, 0x37, 0xfa, 0x26, 0xee, 0x29, 0xb6, + 0x3f, 0x54, 0xd9, 0x56, 0x1f, 0x78, 0xb8, 0x17, 0x66, 0x67, 0xf5, 0xa2, 0xa1, 0x7e, 0x37, 0xff, + 0x0d, 0x10, 0xbd, 0x18, 0x93, 0xb0, 0x57, 0xa6, 0x2f, 0xfd, 0xe7, 0x7f, 0x07, 0x00, 0x00, 0xff, + 0xff, 0xbb, 0xec, 0x83, 0x18, 0x23, 0x08, 0x00, 0x00, +} + +func (this *ApplicationLink) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ApplicationLink) + if !ok { + that2, ok := that.(ApplicationLink) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.User != that1.User { + return false + } + if !this.Data.Equal(&that1.Data) { + return false + } + if this.State != that1.State { + return false + } + if !this.OracleRequest.Equal(&that1.OracleRequest) { + return false + } + if !this.Result.Equal(that1.Result) { + return false + } + if !this.CreationTime.Equal(that1.CreationTime) { + return false + } + return true +} +func (this *Data) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Data) + if !ok { + that2, ok := that.(Data) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Application != that1.Application { + return false + } + if this.Username != that1.Username { + return false + } + return true +} +func (this *OracleRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*OracleRequest) + if !ok { + that2, ok := that.(OracleRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ID != that1.ID { + return false + } + if this.OracleScriptID != that1.OracleScriptID { + return false + } + if !this.CallData.Equal(&that1.CallData) { + return false + } + if this.ClientID != that1.ClientID { + return false + } + return true +} +func (this *OracleRequest_CallData) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*OracleRequest_CallData) + if !ok { + that2, ok := that.(OracleRequest_CallData) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Application != that1.Application { + return false + } + if this.CallData != that1.CallData { + return false + } + return true +} +func (this *Result) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result) + if !ok { + that2, ok := that.(Result) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if that1.Sum == nil { + if this.Sum != nil { + return false + } + } else if this.Sum == nil { + return false + } else if !this.Sum.Equal(that1.Sum) { + return false + } + return true +} +func (this *Result_Success_) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Success_) + if !ok { + that2, ok := that.(Result_Success_) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Success.Equal(that1.Success) { + return false + } + return true +} +func (this *Result_Failed_) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Failed_) + if !ok { + that2, ok := that.(Result_Failed_) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Failed.Equal(that1.Failed) { + return false + } + return true +} +func (this *Result_Success) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Success) + if !ok { + that2, ok := that.(Result_Success) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Value != that1.Value { + return false + } + if this.Signature != that1.Signature { + return false + } + return true +} +func (this *Result_Failed) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Failed) + if !ok { + that2, ok := that.(Result_Failed) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Error != that1.Error { + return false + } + return true +} +func (m *ApplicationLink) 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 *ApplicationLink) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ApplicationLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintModelsAppLinks(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x32 + if m.Result != nil { + { + size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + { + size, err := m.OracleRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.State != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Data) 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 *Data) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x12 + } + if len(m.Application) > 0 { + i -= len(m.Application) + copy(dAtA[i:], m.Application) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Application))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OracleRequest) 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 *OracleRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ClientID) > 0 { + i -= len(m.ClientID) + copy(dAtA[i:], m.ClientID) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.ClientID))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.CallData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.OracleScriptID != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.OracleScriptID)) + i-- + dAtA[i] = 0x10 + } + if m.ID != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *OracleRequest_CallData) 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 *OracleRequest_CallData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleRequest_CallData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CallData) > 0 { + i -= len(m.CallData) + copy(dAtA[i:], m.CallData) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.CallData))) + i-- + dAtA[i] = 0x12 + } + if len(m.Application) > 0 { + i -= len(m.Application) + copy(dAtA[i:], m.Application) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Application))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Result) 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 *Result) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Result_Success_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Success_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Success != nil { + { + size, err := m.Success.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Result_Failed_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Failed_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Failed != nil { + { + size, err := m.Failed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Result_Success) 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 *Result_Success) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Success) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x12 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Result_Failed) 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 *Result_Failed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Failed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsAppLinks(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsAppLinks(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ApplicationLink) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.User) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = m.Data.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + if m.State != 0 { + n += 1 + sovModelsAppLinks(uint64(m.State)) + } + l = m.OracleRequest.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + if m.Result != nil { + l = m.Result.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime) + n += 1 + l + sovModelsAppLinks(uint64(l)) + return n +} + +func (m *Data) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Application) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.Username) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *OracleRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ID != 0 { + n += 1 + sovModelsAppLinks(uint64(m.ID)) + } + if m.OracleScriptID != 0 { + n += 1 + sovModelsAppLinks(uint64(m.OracleScriptID)) + } + l = m.CallData.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + l = len(m.ClientID) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *OracleRequest_CallData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Application) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.CallData) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *Result) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *Result_Success_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success != nil { + l = m.Success.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} +func (m *Result_Failed_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Failed != nil { + l = m.Failed.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} +func (m *Result_Success) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *Result_Failed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Error) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func sovModelsAppLinks(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsAppLinks(x uint64) (n int) { + return sovModelsAppLinks(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ApplicationLink) 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 ErrIntOverflowModelsAppLinks + } + 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: ApplicationLink: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ApplicationLink: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.User = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= ApplicationLinkState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OracleRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Result == nil { + m.Result = &Result{} + } + if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Data) 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 ErrIntOverflowModelsAppLinks + } + 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: Data: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Data: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Application = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleRequest) 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 ErrIntOverflowModelsAppLinks + } + 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: OracleRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OracleRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleScriptID", wireType) + } + m.OracleScriptID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OracleScriptID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CallData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleRequest_CallData) 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 ErrIntOverflowModelsAppLinks + } + 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: CallData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CallData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Application = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallData", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CallData = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result) 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 ErrIntOverflowModelsAppLinks + } + 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: Result: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Result: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Result_Success{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Result_Success_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Result_Failed{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Result_Failed_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result_Success) 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 ErrIntOverflowModelsAppLinks + } + 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: Success: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Success: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result_Failed) 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 ErrIntOverflowModelsAppLinks + } + 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: Failed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Failed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsAppLinks(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, ErrIntOverflowModelsAppLinks + } + 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, ErrIntOverflowModelsAppLinks + } + 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, ErrIntOverflowModelsAppLinks + } + 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, ErrInvalidLengthModelsAppLinks + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsAppLinks + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsAppLinks + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsAppLinks = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsAppLinks = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsAppLinks = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v200/store.go b/x/profiles/legacy/v200/store.go index 739cf88633..979bbd56ea 100644 --- a/x/profiles/legacy/v200/store.go +++ b/x/profiles/legacy/v200/store.go @@ -42,7 +42,7 @@ func migrateAppLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { defer iterator.Close() var keys [][]byte - var newLinks []types.ApplicationLink + var newLinks []ApplicationLink for ; iterator.Valid(); iterator.Next() { var v1ApplicationLink v100.ApplicationLink err := cdc.Unmarshal(iterator.Value(), &v1ApplicationLink) @@ -51,14 +51,14 @@ func migrateAppLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { } keys = append(keys, iterator.Key()) - newLinks = append(newLinks, types.NewApplicationLink( + newLinks = append(newLinks, NewApplicationLink( v1ApplicationLink.User, - types.NewData(v1ApplicationLink.Data.Application, v1ApplicationLink.Data.Username), - types.ApplicationLinkState(v1ApplicationLink.State), - types.NewOracleRequest( + NewData(v1ApplicationLink.Data.Application, v1ApplicationLink.Data.Username), + ApplicationLinkState(v1ApplicationLink.State), + NewOracleRequest( uint64(v1ApplicationLink.OracleRequest.ID), uint64(v1ApplicationLink.OracleRequest.OracleScriptID), - types.NewOracleRequestCallData( + NewOracleRequestCallData( v1ApplicationLink.OracleRequest.CallData.Application, v1ApplicationLink.OracleRequest.CallData.CallData, ), @@ -72,22 +72,22 @@ func migrateAppLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { } for index, link := range newLinks { - store.Set(keys[index], types.MustMarshalApplicationLink(cdc, link)) + store.Set(keys[index], MustMarshalApplicationLink(cdc, link)) } return nil } -func migrateAppLinkResult(r *v100.Result) *types.Result { +func migrateAppLinkResult(r *v100.Result) *Result { if r == nil { return nil } switch result := (r.Sum).(type) { case *v100.Result_Success_: - return types.NewSuccessResult(result.Success.Value, result.Success.Signature) + return NewSuccessResult(result.Success.Value, result.Success.Signature) case *v100.Result_Failed_: - return types.NewErrorResult(result.Failed.Error) + return NewErrorResult(result.Failed.Error) default: panic(fmt.Errorf("invalid result type")) } diff --git a/x/profiles/legacy/v200/types.go b/x/profiles/legacy/v200/types.go deleted file mode 100644 index 0d69ee1ab7..0000000000 --- a/x/profiles/legacy/v200/types.go +++ /dev/null @@ -1,21 +0,0 @@ -package v200 - -import ( - "github.com/desmos-labs/desmos/v2/x/profiles/types" - "time" -) - -// NewApplicationLink allows to build a new ApplicationLink instance -func NewApplicationLink( - user string, data types.Data, state types.ApplicationLinkState, oracleRequest types.OracleRequest, result *types.Result, - creationTime time.Time, -) ApplicationLink { - return ApplicationLink{ - User: user, - Data: data, - State: state, - OracleRequest: oracleRequest, - Result: result, - CreationTime: creationTime, - } -} diff --git a/x/profiles/legacy/v210/store.go b/x/profiles/legacy/v210/store.go index 0de4cfcbc4..b81938d578 100644 --- a/x/profiles/legacy/v210/store.go +++ b/x/profiles/legacy/v210/store.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + v200 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200" v230 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v230" "github.com/desmos-labs/desmos/v2/x/profiles/types" ) @@ -36,9 +37,9 @@ func migrateAppLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { defer iterator.Close() var keys [][]byte - var newLinks []types.ApplicationLink + var newLinks []v200.ApplicationLink for ; iterator.Valid(); iterator.Next() { - var link types.ApplicationLink + var link v200.ApplicationLink err := cdc.Unmarshal(iterator.Value(), &link) if err != nil { return err @@ -46,7 +47,7 @@ func migrateAppLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { // Change the success result value to be HEX encoded if result := link.Result; result != nil { - if successResult, ok := (result.Sum).(*types.Result_Success_); ok { + if successResult, ok := (result.Sum).(*v200.Result_Success_); ok { successResult.Success.Value = hex.EncodeToString([]byte(successResult.Success.Value)) } } @@ -58,7 +59,7 @@ func migrateAppLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { } for index, link := range newLinks { - store.Set(keys[index], types.MustMarshalApplicationLink(cdc, link)) + store.Set(keys[index], v200.MustMarshalApplicationLink(cdc, link)) } return nil diff --git a/x/profiles/legacy/v210/store_test.go b/x/profiles/legacy/v210/store_test.go index 6a2634e45e..662121ed50 100644 --- a/x/profiles/legacy/v210/store_test.go +++ b/x/profiles/legacy/v210/store_test.go @@ -1,6 +1,7 @@ package v210_test import ( + v200 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200" "testing" "time" @@ -34,30 +35,30 @@ func TestStoreMigration(t *testing.T) { "twitter", "user", ), - oldValue: types.MustMarshalApplicationLink(cdc, types.NewApplicationLink( + oldValue: v200.MustMarshalApplicationLink(cdc, v200.NewApplicationLink( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - types.NewData("twitter", "user"), - types.AppLinkStateVerificationStarted, - types.NewOracleRequest( + v200.NewData("twitter", "user"), + v200.AppLinkStateVerificationStarted, + v200.NewOracleRequest( 1, 1, - types.NewOracleRequestCallData("twitter", "tweet-123456789"), + v200.NewOracleRequestCallData("twitter", "tweet-123456789"), "client_id", ), - types.NewSuccessResult("value", "signature"), + v200.NewSuccessResult("value", "signature"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), )), - newValue: types.MustMarshalApplicationLink(cdc, types.NewApplicationLink( + newValue: v200.MustMarshalApplicationLink(cdc, v200.NewApplicationLink( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - types.NewData("twitter", "user"), - types.AppLinkStateVerificationStarted, - types.NewOracleRequest( + v200.NewData("twitter", "user"), + v200.AppLinkStateVerificationStarted, + v200.NewOracleRequest( 1, 1, - types.NewOracleRequestCallData("twitter", "tweet-123456789"), + v200.NewOracleRequestCallData("twitter", "tweet-123456789"), "client_id", ), - types.NewSuccessResult("76616c7565", "signature"), // The value should be HEX + v200.NewSuccessResult("76616c7565", "signature"), // The value should be HEX time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), )), }, diff --git a/x/profiles/types/keys.go b/x/profiles/types/keys.go index 9eb46dc083..31dc85ec89 100644 --- a/x/profiles/types/keys.go +++ b/x/profiles/types/keys.go @@ -1,9 +1,10 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" "strings" "time" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // DONTCOVER diff --git a/x/profiles/types/models_params.go b/x/profiles/types/models_params.go index 28926b9923..dad8626999 100644 --- a/x/profiles/types/models_params.go +++ b/x/profiles/types/models_params.go @@ -3,6 +3,7 @@ package types import ( "fmt" "strings" + "time" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -30,6 +31,7 @@ var ( DTagParamsKey = []byte("DTagParams") BioParamsKey = []byte("MaxBioLen") OracleParamsKey = []byte("OracleParams") + AppLinksParamsKey = []byte("AppLinksParams") ) // ___________________________________________________________________________________________________________________ @@ -41,12 +43,13 @@ func ParamKeyTable() paramstypes.KeyTable { } // NewParams creates a new ProfileParams obj -func NewParams(nickname NicknameParams, dTag DTagParams, bio BioParams, oracle OracleParams) Params { +func NewParams(nickname NicknameParams, dTag DTagParams, bio BioParams, oracle OracleParams, appLinks AppLinksParams) Params { return Params{ Nickname: nickname, DTag: dTag, Bio: bio, Oracle: oracle, + AppLinks: appLinks, } } @@ -57,6 +60,7 @@ func DefaultParams() Params { DTag: DefaultDTagParams(), Bio: DefaultBioParams(), Oracle: DefaultOracleParams(), + AppLinks: DefaultAppLinksParams(), } } @@ -68,6 +72,7 @@ func (params *Params) ParamSetPairs() paramstypes.ParamSetPairs { paramstypes.NewParamSetPair(DTagParamsKey, ¶ms.DTag, ValidateDTagParams), paramstypes.NewParamSetPair(BioParamsKey, ¶ms.Bio, ValidateBioParams), paramstypes.NewParamSetPair(OracleParamsKey, ¶ms.Oracle, ValidateOracleParams), + paramstypes.NewParamSetPair(AppLinksParamsKey, ¶ms.AppLinks, ValidateAppLinksParams), } } @@ -85,7 +90,11 @@ func (params Params) Validate() error { return err } - return ValidateOracleParams(params.Oracle) + if err := ValidateOracleParams(params.Oracle); err != nil { + return nil + } + + return ValidateAppLinksParams(params.AppLinks) } // ___________________________________________________________________________________________________________________ @@ -257,3 +266,28 @@ func ValidateOracleParams(i interface{}) error { return nil } + +// ___________________________________________________________________________________________________________________ + +func NewAppLinksParams(expirationTime time.Time) AppLinksParams { + return AppLinksParams{ + ExpirationTime: expirationTime, + } +} + +func DefaultAppLinksParams() AppLinksParams { + return NewAppLinksParams(time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC)) +} + +func ValidateAppLinksParams(i interface{}) error { + params, isAppLinksParams := i.(AppLinksParams) + if !isAppLinksParams { + return fmt.Errorf("invalid parameters type: %s", i) + } + + if params.ExpirationTime.IsZero() { + return fmt.Errorf("invalid expiration time param: %s", params.ExpirationTime) + } + + return nil +} diff --git a/x/profiles/types/models_params_test.go b/x/profiles/types/models_params_test.go index 97283df6d2..2732799bfe 100644 --- a/x/profiles/types/models_params_test.go +++ b/x/profiles/types/models_params_test.go @@ -2,6 +2,7 @@ package types_test import ( "testing" + "time" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -22,6 +23,7 @@ func TestValidateParams(t *testing.T) { types.DefaultDTagParams(), types.DefaultBioParams(), types.DefaultOracleParams(), + types.DefaultAppLinksParams(), ), shouldErr: true, }, @@ -32,6 +34,7 @@ func TestValidateParams(t *testing.T) { types.NewDTagParams("regEx", sdk.NewInt(3), sdk.NewInt(-30)), types.DefaultBioParams(), types.DefaultOracleParams(), + types.DefaultAppLinksParams(), ), shouldErr: true, }, @@ -42,6 +45,7 @@ func TestValidateParams(t *testing.T) { types.DefaultDTagParams(), types.NewBioParams(sdk.NewInt(-1000)), types.DefaultOracleParams(), + types.DefaultAppLinksParams(), ), shouldErr: true, }, @@ -58,9 +62,20 @@ func TestValidateParams(t *testing.T) { 0, 0, sdk.NewCoins()..., - )), + ), + types.DefaultAppLinksParams()), shouldErr: true, }, + { + name: "invalid app links params return error", + params: types.NewParams( + types.DefaultNicknameParams(), + types.DefaultDTagParams(), + types.DefaultBioParams(), + types.DefaultOracleParams(), + types.NewAppLinksParams(time.Time{}), + ), + }, { name: "valid params return no error", params: types.NewParams( @@ -68,6 +83,7 @@ func TestValidateParams(t *testing.T) { types.DefaultDTagParams(), types.DefaultBioParams(), types.DefaultOracleParams(), + types.DefaultAppLinksParams(), ), shouldErr: false, }, @@ -197,6 +213,7 @@ func TestValidateBioParams(t *testing.T) { }) } } + func TestValidateOracleParams(t *testing.T) { testCases := []struct { name string @@ -290,3 +307,35 @@ func TestValidateOracleParams(t *testing.T) { }) } } + +func TestValidateAppLinksParams(t *testing.T) { + testCases := []struct { + name string + params types.AppLinksParams + shouldErr bool + }{ + { + name: "invalid value returns error", + params: types.NewAppLinksParams(time.Time{}), + shouldErr: true, + }, + { + name: "valid value returns no error", + params: types.DefaultAppLinksParams(), + shouldErr: false, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + err := types.ValidateBioParams(tc.params) + + if tc.shouldErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} From e4b68b705996435b43191bde569fb2cec7a01f4f Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 18 Jan 2022 16:22:24 +0100 Subject: [PATCH 003/112] - added tests for expiring links - missing benchmarks --- x/profiles/client/cli/cli_app_links_test.go | 2 + x/profiles/client/cli/cli_test.go | 1 + x/profiles/keeper/alias_functions.go | 56 +++++----- x/profiles/keeper/alias_functions_test.go | 60 ++++++++++ x/profiles/keeper/genesis_test.go | 8 ++ x/profiles/keeper/grpc_query.go | 20 ++-- x/profiles/keeper/grpc_query_test.go | 7 ++ x/profiles/keeper/invariants_test.go | 1 + x/profiles/keeper/keeper.go | 14 +-- x/profiles/keeper/keeper_app_links.go | 22 ++-- x/profiles/keeper/keeper_app_links_test.go | 64 +++++++++++ x/profiles/keeper/keeper_blocks.go | 14 +-- x/profiles/keeper/keeper_chain_links.go | 16 +-- x/profiles/keeper/keeper_dtag_transfers.go | 16 +-- x/profiles/keeper/keeper_ibc.go | 4 +- x/profiles/keeper/keeper_params_test.go | 2 +- x/profiles/keeper/keeper_relationships.go | 12 +- x/profiles/keeper/migrations.go | 14 ++- x/profiles/keeper/migrations_test.go | 103 ++++++++++++++++++ x/profiles/keeper/msg_server_chain_link.go | 2 +- x/profiles/keeper/relay_chain_links.go | 6 +- x/profiles/legacy/v200/models_app_links.pb.go | 16 +-- x/profiles/module.go | 4 + x/profiles/simulation/genesis.go | 1 + x/profiles/simulation/utils.go | 5 + x/profiles/types/genesis_test.go | 3 + x/profiles/types/keys.go | 10 +- x/profiles/types/models_app_links.go | 3 +- x/profiles/types/models_app_links_test.go | 52 +++++++++ x/profiles/types/models_params.go | 2 +- x/profiles/types/models_params_test.go | 3 +- 31 files changed, 431 insertions(+), 112 deletions(-) create mode 100644 x/profiles/keeper/migrations_test.go diff --git a/x/profiles/client/cli/cli_app_links_test.go b/x/profiles/client/cli/cli_app_links_test.go index b53d830ff6..53f47596f4 100644 --- a/x/profiles/client/cli/cli_app_links_test.go +++ b/x/profiles/client/cli/cli_app_links_test.go @@ -42,6 +42,7 @@ func (s *IntegrationTestSuite) TestCmdQueryApplicationsLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, @@ -78,6 +79,7 @@ func (s *IntegrationTestSuite) TestCmdQueryApplicationsLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, diff --git a/x/profiles/client/cli/cli_test.go b/x/profiles/client/cli/cli_test.go index 32ea23a935..3506647c3c 100644 --- a/x/profiles/client/cli/cli_test.go +++ b/x/profiles/client/cli/cli_test.go @@ -144,6 +144,7 @@ func (s *IntegrationTestSuite) SetupSuite() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), } diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go index 4df8ecff62..8928b010e5 100644 --- a/x/profiles/keeper/alias_functions.go +++ b/x/profiles/keeper/alias_functions.go @@ -1,8 +1,6 @@ package keeper import ( - "time" - sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/desmos-labs/desmos/v2/x/profiles/types" @@ -49,13 +47,13 @@ func (k Keeper) HasProfile(ctx sdk.Context, user string) bool { func (k Keeper) IterateDTagTransferRequests( ctx sdk.Context, fn func(index int64, dTagTransferRequest types.DTagTransferRequest) (stop bool), ) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) iterator := sdk.KVStorePrefixIterator(store, types.DTagTransferRequestPrefix) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - request := types.MustUnmarshalDTagTransferRequest(k.cdc, iterator.Value()) + request := types.MustUnmarshalDTagTransferRequest(k.Cdc, iterator.Value()) stop := fn(i, request) if stop { break @@ -69,13 +67,13 @@ func (k Keeper) IterateDTagTransferRequests( func (k Keeper) IterateUserIncomingDTagTransferRequests( ctx sdk.Context, user string, fn func(index int64, dTagTransferRequest types.DTagTransferRequest) (stop bool), ) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) iterator := sdk.KVStorePrefixIterator(store, types.IncomingDTagTransferRequestsPrefix(user)) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - request := types.MustUnmarshalDTagTransferRequest(k.cdc, iterator.Value()) + request := types.MustUnmarshalDTagTransferRequest(k.Cdc, iterator.Value()) stop := fn(i, request) if stop { break @@ -88,7 +86,7 @@ func (k Keeper) IterateUserIncomingDTagTransferRequests( // IterateRelationships iterates through the relationships and perform the provided function func (k Keeper) IterateRelationships(ctx sdk.Context, fn func(index int64, relationship types.Relationship) (stop bool)) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) iterator := sdk.KVStorePrefixIterator(store, types.RelationshipsStorePrefix) defer iterator.Close() @@ -96,7 +94,7 @@ func (k Keeper) IterateRelationships(ctx sdk.Context, fn func(index int64, relat i := int64(0) for ; iterator.Valid(); iterator.Next() { - relationship := types.MustUnmarshalRelationship(k.cdc, iterator.Value()) + relationship := types.MustUnmarshalRelationship(k.Cdc, iterator.Value()) stop := fn(i, relationship) @@ -111,7 +109,7 @@ func (k Keeper) IterateRelationships(ctx sdk.Context, fn func(index int64, relat // IterateUserRelationships iterates through the relationships with the given user address // and performs the provided function func (k Keeper) IterateUserRelationships(ctx sdk.Context, user string, fn func(index int64, relationship types.Relationship) (stop bool)) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) iterator := sdk.KVStorePrefixIterator(store, types.UserRelationshipsPrefix(user)) defer iterator.Close() @@ -119,7 +117,7 @@ func (k Keeper) IterateUserRelationships(ctx sdk.Context, user string, fn func(i i := int64(0) for ; iterator.Valid(); iterator.Next() { - relationship := types.MustUnmarshalRelationship(k.cdc, iterator.Value()) + relationship := types.MustUnmarshalRelationship(k.Cdc, iterator.Value()) stop := fn(i, relationship) @@ -132,13 +130,13 @@ func (k Keeper) IterateUserRelationships(ctx sdk.Context, user string, fn func(i // IterateBlocks iterates through the list of user blocks and performs the given function func (k Keeper) IterateBlocks(ctx sdk.Context, fn func(index int64, block types.UserBlock) (stop bool)) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) iterator := sdk.KVStorePrefixIterator(store, types.UsersBlocksStorePrefix) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - block := types.MustUnmarshalUserBlock(k.cdc, iterator.Value()) + block := types.MustUnmarshalUserBlock(k.Cdc, iterator.Value()) stop := fn(i, block) if stop { break @@ -149,13 +147,13 @@ func (k Keeper) IterateBlocks(ctx sdk.Context, fn func(index int64, block types. // IterateUserBlocks iterates through the list of user blocks created by the specified user and performs the given function func (k Keeper) IterateUserBlocks(ctx sdk.Context, user string, fn func(index int64, block types.UserBlock) (stop bool)) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) iterator := sdk.KVStorePrefixIterator(store, types.BlockerPrefix(user)) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - block := types.MustUnmarshalUserBlock(k.cdc, iterator.Value()) + block := types.MustUnmarshalUserBlock(k.Cdc, iterator.Value()) stop := fn(i, block) if stop { break @@ -168,13 +166,13 @@ func (k Keeper) IterateUserBlocks(ctx sdk.Context, user string, fn func(index in // IterateApplicationLinks iterates through all the application links and performs the provided function func (k Keeper) IterateApplicationLinks(ctx sdk.Context, fn func(index int64, link types.ApplicationLink) (stop bool)) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) iterator := sdk.KVStorePrefixIterator(store, types.UserApplicationLinkPrefix) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - link := types.MustUnmarshalApplicationLink(k.cdc, iterator.Value()) + link := types.MustUnmarshalApplicationLink(k.Cdc, iterator.Value()) stop := fn(i, link) if stop { break @@ -186,13 +184,13 @@ func (k Keeper) IterateApplicationLinks(ctx sdk.Context, fn func(index int64, li // IterateUserApplicationLinks iterates through all the application links related to the given user // and performs the provided function func (k Keeper) IterateUserApplicationLinks(ctx sdk.Context, user string, fn func(index int64, link types.ApplicationLink) (stop bool)) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) iterator := sdk.KVStorePrefixIterator(store, types.UserApplicationLinksPrefix(user)) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - link := types.MustUnmarshalApplicationLink(k.cdc, iterator.Value()) + link := types.MustUnmarshalApplicationLink(k.Cdc, iterator.Value()) stop := fn(i, link) if stop { break @@ -214,22 +212,22 @@ func (k Keeper) GetApplicationLinks(ctx sdk.Context) []types.ApplicationLink { // IterateExpiringApplicationLinks iterates through all the expiring application links references. // The key will be skipped and deleted if the application link has already been deleted. -func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, expirationTime time.Time, fn func(index int64, link types.ApplicationLink) (stop bool)) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index int64, link types.ApplicationLink) (stop bool)) { + store := ctx.KVStore(k.StoreKey) - iterator := sdk.KVStorePrefixIterator(store, types.ExpiringApplicationLinkPrefix(expirationTime)) + iterator := sdk.KVStorePrefixIterator(store, types.ApplicationLinkExpiringTimePrefix(ctx.BlockTime())) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { // Skip if application link has been deleted already - clientID := iterator.Value() - if !store.Has(clientID) { + clientIDKey := types.ApplicationLinkClientIDKey(string(iterator.Value())) + if !store.Has(clientIDKey) { store.Delete(iterator.Key()) continue } - applicationKey := store.Get(clientID) - link := types.MustUnmarshalApplicationLink(k.cdc, store.Get(applicationKey)) + applicationKey := store.Get(clientIDKey) + link := types.MustUnmarshalApplicationLink(k.Cdc, store.Get(applicationKey)) stop := fn(i, link) if stop { break @@ -242,13 +240,13 @@ func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, expirationTime // IterateChainLinks iterates through the chain links and perform the provided function func (k Keeper) IterateChainLinks(ctx sdk.Context, fn func(index int64, link types.ChainLink) (stop bool)) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) iterator := sdk.KVStorePrefixIterator(store, types.ChainLinksPrefix) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - link := types.MustUnmarshalChainLink(k.cdc, iterator.Value()) + link := types.MustUnmarshalChainLink(k.Cdc, iterator.Value()) stop := fn(i, link) if stop { break @@ -259,14 +257,14 @@ func (k Keeper) IterateChainLinks(ctx sdk.Context, fn func(index int64, link typ // IterateUserChainLinks iterates through all the chain links related to the given user and perform the provided function func (k Keeper) IterateUserChainLinks(ctx sdk.Context, user string, fn func(index int64, link types.ChainLink) (stop bool)) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) iterator := sdk.KVStorePrefixIterator(store, types.UserChainLinksPrefix(user)) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - link := types.MustUnmarshalChainLink(k.cdc, iterator.Value()) + link := types.MustUnmarshalChainLink(k.Cdc, iterator.Value()) stop := fn(i, link) if stop { diff --git a/x/profiles/keeper/alias_functions_test.go b/x/profiles/keeper/alias_functions_test.go index f1a00e74b9..2b8be9ce73 100644 --- a/x/profiles/keeper/alias_functions_test.go +++ b/x/profiles/keeper/alias_functions_test.go @@ -162,6 +162,7 @@ func (suite *KeeperTestSuite) TestKeeper_IterateUserApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), types.NewApplicationLink( address, @@ -175,6 +176,7 @@ func (suite *KeeperTestSuite) TestKeeper_IterateUserApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), types.NewApplicationLink( address, @@ -188,6 +190,7 @@ func (suite *KeeperTestSuite) TestKeeper_IterateUserApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), } @@ -224,6 +227,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), types.NewApplicationLink( address, @@ -237,6 +241,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), types.NewApplicationLink( address, @@ -250,6 +255,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), } @@ -265,6 +271,60 @@ func (suite *KeeperTestSuite) TestKeeper_GetApplicationLinks() { suite.Require().Equal(links, suite.k.GetApplicationLinks(ctx)) } +func (suite *KeeperTestSuite) TestKeeper_IterateExpiringApplicationLinks() { + address := "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47" + links := []types.ApplicationLink{ + types.NewApplicationLink( + address, + types.NewData("github", "github-user"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("github", "call_data"), + "client_id", + ), + nil, + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + ), + types.NewApplicationLink( + address, + types.NewData("reddit", "reddit-user"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("reddit", "call_data"), + "client_id2", + ), + nil, + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + ), + } + + // ensure the expiring time is the same of the links + suite.ctx = suite.ctx.WithBlockTime( + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + ) + ctx, _ := suite.ctx.CacheContext() + + for _, link := range links { + suite.ak.SetAccount(ctx, testutil.ProfileFromAddr(link.User)) + err := suite.k.SaveApplicationLink(ctx, link) + suite.Require().NoError(err) + } + + var expiredLinks []types.ApplicationLink + suite.k.IterateExpiringApplicationLinks(ctx, func(index int64, link types.ApplicationLink) (stop bool) { + expiredLinks = append(expiredLinks, link) + return index == 1 + }) + + suite.Require().Equal([]types.ApplicationLink{links[0], links[1]}, expiredLinks) +} + // -------------------------------------------------------------------------------------------------------------------- func (suite *KeeperTestSuite) TestKeeper_GetChainLinks() { diff --git a/x/profiles/keeper/genesis_test.go b/x/profiles/keeper/genesis_test.go index 77f65297ef..40ecc81d87 100644 --- a/x/profiles/keeper/genesis_test.go +++ b/x/profiles/keeper/genesis_test.go @@ -100,6 +100,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC)), ) suite.k.SetParams(ctx, params) suite.k.SetPort(ctx, "port-id") @@ -135,6 +136,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), } for _, link := range applicationLinks { @@ -185,6 +187,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC)), ), "port-id", []types.ChainLink{ @@ -213,6 +216,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), }, ), @@ -385,6 +389,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC)), ), "profiles-port-id", []types.ChainLink{ @@ -413,6 +418,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), }, ), @@ -465,6 +471,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC)), ) suite.Require().Equal(params, suite.k.GetParams(ctx)) @@ -499,6 +506,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), } suite.Require().Equal(applicationLinks, suite.k.GetApplicationLinks(ctx)) diff --git a/x/profiles/keeper/grpc_query.go b/x/profiles/keeper/grpc_query.go index 6a4d6753b4..f0bff0241b 100644 --- a/x/profiles/keeper/grpc_query.go +++ b/x/profiles/keeper/grpc_query.go @@ -63,13 +63,13 @@ func (k Keeper) IncomingDTagTransferRequests(ctx context.Context, request *types var requests []types.DTagTransferRequest // Get user requests prefix store - store := sdkCtx.KVStore(k.storeKey) + store := sdkCtx.KVStore(k.StoreKey) reqStore := prefix.NewStore(store, types.IncomingDTagTransferRequestsPrefix(request.Receiver)) // Get paginated user requests pageRes, err := query.Paginate(reqStore, request.Pagination, func(key []byte, value []byte) error { var req types.DTagTransferRequest - if err := k.cdc.Unmarshal(value, &req); err != nil { + if err := k.Cdc.Unmarshal(value, &req); err != nil { return status.Error(codes.Internal, err.Error()) } @@ -90,13 +90,13 @@ func (k Keeper) Relationships(ctx context.Context, request *types.QueryRelations var relationships []types.Relationship // Get user relationships prefix store - store := sdkCtx.KVStore(k.storeKey) + store := sdkCtx.KVStore(k.StoreKey) relsStore := prefix.NewStore(store, types.UserRelationshipsSubspacePrefix(request.User, request.SubspaceId)) // Get paginated user relationships pageRes, err := query.Paginate(relsStore, request.Pagination, func(key []byte, value []byte) error { var rel types.Relationship - if err := k.cdc.Unmarshal(value, &rel); err != nil { + if err := k.Cdc.Unmarshal(value, &rel); err != nil { return status.Error(codes.Internal, err.Error()) } @@ -117,13 +117,13 @@ func (k Keeper) Blocks(ctx context.Context, request *types.QueryBlocksRequest) ( var userblocks []types.UserBlock // Get user blocks prefix store - store := sdkCtx.KVStore(k.storeKey) + store := sdkCtx.KVStore(k.StoreKey) userBlocksStore := prefix.NewStore(store, types.BlockerSubspacePrefix(request.User, request.SubspaceId)) // Get paginated user blocks pageRes, err := query.Paginate(userBlocksStore, request.Pagination, func(key []byte, value []byte) error { var userBlock types.UserBlock - if err := k.cdc.Unmarshal(value, &userBlock); err != nil { + if err := k.Cdc.Unmarshal(value, &userBlock); err != nil { return status.Error(codes.Internal, err.Error()) } @@ -152,13 +152,13 @@ func (k Keeper) ChainLinks(ctx context.Context, request *types.QueryChainLinksRe var links []types.ChainLink // Get user chain links prefix store - store := sdkCtx.KVStore(k.storeKey) + store := sdkCtx.KVStore(k.StoreKey) linksStore := prefix.NewStore(store, types.UserChainLinksPrefix(request.User)) // Get paginated user chain links pageRes, err := query.Paginate(linksStore, request.Pagination, func(key []byte, value []byte) error { var link types.ChainLink - if err := k.cdc.Unmarshal(value, &link); err != nil { + if err := k.Cdc.Unmarshal(value, &link); err != nil { return status.Error(codes.Internal, err.Error()) } links = append(links, link) @@ -190,13 +190,13 @@ func (k Keeper) ApplicationLinks(ctx context.Context, request *types.QueryApplic var links []types.ApplicationLink // Get user links prefix store - store := sdkCtx.KVStore(k.storeKey) + store := sdkCtx.KVStore(k.StoreKey) linksStore := prefix.NewStore(store, types.UserApplicationLinksPrefix(request.User)) // Get paginated user links pageRes, err := query.Paginate(linksStore, request.Pagination, func(key []byte, value []byte) error { var link types.ApplicationLink - if err := k.cdc.Unmarshal(value, &link); err != nil { + if err := k.Cdc.Unmarshal(value, &link); err != nil { return status.Error(codes.Internal, err.Error()) } diff --git a/x/profiles/keeper/grpc_query_test.go b/x/profiles/keeper/grpc_query_test.go index 7803589e42..8e9caebabd 100644 --- a/x/profiles/keeper/grpc_query_test.go +++ b/x/profiles/keeper/grpc_query_test.go @@ -664,6 +664,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), )), ) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -683,6 +684,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), )) }, @@ -707,6 +709,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, @@ -767,6 +770,7 @@ func (suite *KeeperTestSuite) TestQueryServer_UserApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), )), ) }, @@ -792,6 +796,7 @@ func (suite *KeeperTestSuite) TestQueryServer_UserApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, @@ -852,6 +857,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkByClientID() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), )), ) }, @@ -872,6 +878,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkByClientID() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), }, } diff --git a/x/profiles/keeper/invariants_test.go b/x/profiles/keeper/invariants_test.go index 800c82387c..c79103b163 100644 --- a/x/profiles/keeper/invariants_test.go +++ b/x/profiles/keeper/invariants_test.go @@ -160,6 +160,7 @@ func (suite *KeeperTestSuite) TestInvariants() { types.AppLinkStateVerificationStarted, types.NewOracleRequest(1, 1, types.NewOracleRequestCallData("", ""), "client_id"), nil, + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), time.Now(), ) store.Set( diff --git a/x/profiles/keeper/keeper.go b/x/profiles/keeper/keeper.go index e8a36f4af0..f4f129f824 100644 --- a/x/profiles/keeper/keeper.go +++ b/x/profiles/keeper/keeper.go @@ -19,8 +19,8 @@ import ( // Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine type Keeper struct { - storeKey sdk.StoreKey - cdc codec.BinaryCodec + StoreKey sdk.StoreKey + Cdc codec.BinaryCodec paramSubspace paramstypes.Subspace ak authkeeper.AccountKeeper @@ -50,8 +50,8 @@ func NewKeeper( } return Keeper{ - storeKey: storeKey, - cdc: cdc, + StoreKey: storeKey, + Cdc: cdc, paramSubspace: paramSpace, ak: ak, channelKeeper: channelKeeper, @@ -69,7 +69,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { // without checking if another profile with the same DTag already exists. // It assumes that the given profile has already been validated. func (k Keeper) storeProfileWithoutDTagCheck(ctx sdk.Context, profile *types.Profile) error { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) oldProfile, found, err := k.GetProfile(ctx, profile.GetAddress().String()) if err != nil { @@ -122,7 +122,7 @@ func (k Keeper) GetProfile(ctx sdk.Context, address string) (profile *types.Prof // GetAddressFromDTag returns the address associated to the given DTag or an empty string if it does not exists func (k Keeper) GetAddressFromDTag(ctx sdk.Context, dTag string) (addr string) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) bz := store.Get(types.DTagStoreKey(dTag)) if bz == nil { @@ -146,7 +146,7 @@ func (k Keeper) RemoveProfile(ctx sdk.Context, address string) error { } // Delete the DTag -> Address association - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) store.Delete(types.DTagStoreKey(profile.DTag)) // Delete all the blocks diff --git a/x/profiles/keeper/keeper_app_links.go b/x/profiles/keeper/keeper_app_links.go index 677c581b50..c1f1d2df90 100644 --- a/x/profiles/keeper/keeper_app_links.go +++ b/x/profiles/keeper/keeper_app_links.go @@ -22,11 +22,13 @@ func (k Keeper) SaveApplicationLink(ctx sdk.Context, link types.ApplicationLink) // Get the keys userApplicationLinkKey := types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username) applicationLinkClientIDKey := types.ApplicationLinkClientIDKey(link.OracleRequest.ClientID) + applicationLinkExpiringTimeKey := types.ApplicationLinkExpiringTimeKey(link.ExpirationTime, link.OracleRequest.ClientID) // Store the data - store := ctx.KVStore(k.storeKey) - store.Set(userApplicationLinkKey, types.MustMarshalApplicationLink(k.cdc, link)) + store := ctx.KVStore(k.StoreKey) + store.Set(userApplicationLinkKey, types.MustMarshalApplicationLink(k.Cdc, link)) store.Set(applicationLinkClientIDKey, userApplicationLinkKey) + store.Set(applicationLinkExpiringTimeKey, []byte(link.OracleRequest.ClientID)) ctx.EventManager().EmitEvent( sdk.NewEvent( @@ -43,7 +45,7 @@ func (k Keeper) SaveApplicationLink(ctx sdk.Context, link types.ApplicationLink) // GetApplicationLink returns the link for the given application and username. // If the link is not found returns an error instead. func (k Keeper) GetApplicationLink(ctx sdk.Context, user, application, username string) (types.ApplicationLink, bool, error) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) // Check to see if the key exists userApplicationLinkKey := types.UserApplicationLinkKey(user, application, username) @@ -52,7 +54,7 @@ func (k Keeper) GetApplicationLink(ctx sdk.Context, user, application, username } var link types.ApplicationLink - err := k.cdc.Unmarshal(store.Get(userApplicationLinkKey), &link) + err := k.Cdc.Unmarshal(store.Get(userApplicationLinkKey), &link) if err != nil { return types.ApplicationLink{}, false, err } @@ -63,7 +65,7 @@ func (k Keeper) GetApplicationLink(ctx sdk.Context, user, application, username // GetApplicationLinkByClientID returns the application link and user given a specific client id. // If the link is not found, returns false instead. func (k Keeper) GetApplicationLinkByClientID(ctx sdk.Context, clientID string) (types.ApplicationLink, bool, error) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) // Get the client request using the client id clientIDKey := types.ApplicationLinkClientIDKey(clientID) @@ -76,7 +78,7 @@ func (k Keeper) GetApplicationLinkByClientID(ctx sdk.Context, clientID string) ( // Read the link var link types.ApplicationLink - err := k.cdc.Unmarshal(store.Get(applicationLinkKey), &link) + err := k.Cdc.Unmarshal(store.Get(applicationLinkKey), &link) if err != nil { return types.ApplicationLink{}, true, sdkerrors.Wrap(err, "error while reading application link") } @@ -86,10 +88,10 @@ func (k Keeper) GetApplicationLinkByClientID(ctx sdk.Context, clientID string) ( // deleteApplicationLinkStoreKeys deletes all the store keys related to the given application link func (k Keeper) deleteApplicationLinkStoreKeys(ctx sdk.Context, link types.ApplicationLink) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) store.Delete(types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username)) store.Delete(types.ApplicationLinkClientIDKey(link.OracleRequest.ClientID)) - store.Delete(types.ExpirationTimeApplicationLinkKey(link.ExpirationTime, link.OracleRequest.ClientID)) + store.Delete(types.ApplicationLinkExpiringTimeKey(link.ExpirationTime, link.OracleRequest.ClientID)) } // DeleteApplicationLink removes the application link associated to the given user, @@ -123,7 +125,7 @@ func (k Keeper) DeleteAllUserApplicationLinks(ctx sdk.Context, user string) { return false }) - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) for _, link := range links { store.Delete(types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username)) } @@ -131,7 +133,7 @@ func (k Keeper) DeleteAllUserApplicationLinks(ctx sdk.Context, user string) { // DeleteExpiredApplicationLinks deletes all the expired application links in the given context func (k Keeper) DeleteExpiredApplicationLinks(ctx sdk.Context) { - k.IterateExpiringApplicationLinks(ctx, ctx.BlockTime(), func(_ int64, link types.ApplicationLink) (stop bool) { + k.IterateExpiringApplicationLinks(ctx, func(_ int64, link types.ApplicationLink) (stop bool) { k.deleteApplicationLinkStoreKeys(ctx, link) return false }) diff --git a/x/profiles/keeper/keeper_app_links_test.go b/x/profiles/keeper/keeper_app_links_test.go index c956998a4d..a7f6d4e783 100644 --- a/x/profiles/keeper/keeper_app_links_test.go +++ b/x/profiles/keeper/keeper_app_links_test.go @@ -31,6 +31,7 @@ func (suite *KeeperTestSuite) Test_SaveApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: true, }, @@ -52,6 +53,7 @@ func (suite *KeeperTestSuite) Test_SaveApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: false, }, @@ -105,6 +107,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.StoreProfile(ctx, testutil.ProfileFromAddr(address))) @@ -132,6 +135,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.StoreProfile(ctx, testutil.ProfileFromAddr(address))) @@ -159,6 +163,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.StoreProfile(ctx, testutil.ProfileFromAddr(address))) @@ -186,6 +191,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.StoreProfile(ctx, testutil.ProfileFromAddr(address))) @@ -208,6 +214,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), }, } @@ -262,6 +269,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLinkByClientID() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.StoreProfile(ctx, testutil.ProfileFromAddr(address))) @@ -284,6 +292,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLinkByClientID() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), }, } @@ -335,6 +344,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.StoreProfile(ctx, testutil.ProfileFromAddr(address))) @@ -362,6 +372,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.StoreProfile(ctx, testutil.ProfileFromAddr(address))) @@ -389,6 +400,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.StoreProfile(ctx, testutil.ProfileFromAddr(address))) @@ -416,6 +428,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.StoreProfile(ctx, testutil.ProfileFromAddr(address))) @@ -450,3 +463,54 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { }) } } + +func (suite *KeeperTestSuite) Test_DeleteExpiredApplicationLinks() { + testCases := []struct { + name string + store func(store sdk.Context) + expectedAppLinksLen int + }{ + { + name: "Expired links are deleted correctly", + store: func(ctx sdk.Context) { + address := "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773" + link := types.NewApplicationLink( + address, + types.NewData("twitter", "twitteruser"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("twitter", "calldata"), + "client_id", + ), + nil, + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + ) + + suite.Require().NoError(suite.k.StoreProfile(ctx, testutil.ProfileFromAddr(address))) + err := suite.k.SaveApplicationLink(ctx, link) + suite.Require().NoError(err) + }, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + // ensure the expiring time is the same of the links + suite.ctx = suite.ctx.WithBlockTime( + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + ) + ctx, _ := suite.ctx.CacheContext() + if tc.store != nil { + tc.store(ctx) + } + suite.k.DeleteExpiredApplicationLinks(ctx) + appLinks := suite.k.GetApplicationLinks(ctx) + + suite.Require().Equal(0, len(appLinks)) + }) + } +} diff --git a/x/profiles/keeper/keeper_blocks.go b/x/profiles/keeper/keeper_blocks.go index 1ea6b0d4c6..8fd357493f 100644 --- a/x/profiles/keeper/keeper_blocks.go +++ b/x/profiles/keeper/keeper_blocks.go @@ -21,14 +21,14 @@ func (k Keeper) SaveUserBlock(ctx sdk.Context, userBlock types.UserBlock) error return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "blocker and blocked cannot be the same user") } - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) key := types.UserBlockStoreKey(userBlock.Blocker, userBlock.Subspace, userBlock.Blocked) if store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "the user with address %s has already been blocked", userBlock.Blocked) } - store.Set(key, k.cdc.MustMarshal(&userBlock)) + store.Set(key, k.Cdc.MustMarshal(&userBlock)) return nil } @@ -44,14 +44,14 @@ func (k Keeper) GetUserBlocks(ctx sdk.Context, blocker string) []types.UserBlock // GetAllUsersBlocks returns a list of all the users blocks inside the given context. func (k Keeper) GetAllUsersBlocks(ctx sdk.Context) []types.UserBlock { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) iterator := sdk.KVStorePrefixIterator(store, types.UsersBlocksStorePrefix) defer iterator.Close() var usersBlocks []types.UserBlock for ; iterator.Valid(); iterator.Next() { - block := types.MustUnmarshalUserBlock(k.cdc, iterator.Value()) + block := types.MustUnmarshalUserBlock(k.Cdc, iterator.Value()) usersBlocks = append(usersBlocks, block) } @@ -67,7 +67,7 @@ func (k Keeper) IsUserBlocked(ctx sdk.Context, blocker, blocked string) bool { // If the provided subspace is empty, all subspaces will be checked func (k Keeper) HasUserBlocked(ctx sdk.Context, blocker, blocked, subspace string) bool { if subspace != "" { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) key := types.UserBlockStoreKey(blocker, subspace, blocked) return store.Has(key) @@ -85,7 +85,7 @@ func (k Keeper) HasUserBlocked(ctx sdk.Context, blocker, blocked, subspace strin // DeleteUserBlock allows to the specified blocker to unblock the given blocked user. func (k Keeper) DeleteUserBlock(ctx sdk.Context, blocker, blocked string, subspace string) error { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) key := types.UserBlockStoreKey(blocker, subspace, blocked) if !store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, @@ -103,7 +103,7 @@ func (k Keeper) DeleteAllUserBlocks(ctx sdk.Context, user string) { return false }) - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) for _, block := range blocks { store.Delete(types.UserBlockStoreKey(block.Blocker, block.Subspace, block.Blocked)) } diff --git a/x/profiles/keeper/keeper_chain_links.go b/x/profiles/keeper/keeper_chain_links.go index 54a1384583..58ec370b43 100644 --- a/x/profiles/keeper/keeper_chain_links.go +++ b/x/profiles/keeper/keeper_chain_links.go @@ -21,7 +21,7 @@ func (k Keeper) SaveChainLink(ctx sdk.Context, link types.ChainLink) error { } // Validate the source address - srcAddrData, err := types.UnpackAddressData(k.cdc, link.Address) + srcAddrData, err := types.UnpackAddressData(k.Cdc, link.Address) if err != nil { return err } @@ -32,7 +32,7 @@ func (k Keeper) SaveChainLink(ctx sdk.Context, link types.ChainLink) error { } // Verify the proof - err = link.Proof.Verify(k.cdc, srcAddrData) + err = link.Proof.Verify(k.Cdc, srcAddrData) if err != nil { return sdkerrors.Wrap(types.ErrInvalidProof, err.Error()) } @@ -43,28 +43,28 @@ func (k Keeper) SaveChainLink(ctx sdk.Context, link types.ChainLink) error { } // Set chain link -> address association - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) key := types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, target) - store.Set(key, types.MustMarshalChainLink(k.cdc, link)) + store.Set(key, types.MustMarshalChainLink(k.Cdc, link)) return nil } // GetChainLink returns the chain link for the given owner, chain name and target. // If such link does not exist, returns false instead. func (k Keeper) GetChainLink(ctx sdk.Context, owner, chainName, target string) (types.ChainLink, bool) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) key := types.ChainLinksStoreKey(owner, chainName, target) if !store.Has(key) { return types.ChainLink{}, false } - return types.MustUnmarshalChainLink(k.cdc, store.Get(key)), true + return types.MustUnmarshalChainLink(k.Cdc, store.Get(key)), true } // DeleteChainLink deletes the link associated with the given address and chain name func (k Keeper) DeleteChainLink(ctx sdk.Context, owner, chainName, target string) error { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) key := types.ChainLinksStoreKey(owner, chainName, target) if !store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, @@ -84,7 +84,7 @@ func (k Keeper) DeleteAllUserChainLinks(ctx sdk.Context, user string) { return false }) - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) for _, link := range links { address := link.Address.GetCachedValue().(types.AddressData) store.Delete(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, address.GetValue())) diff --git a/x/profiles/keeper/keeper_dtag_transfers.go b/x/profiles/keeper/keeper_dtag_transfers.go index 579cef65d2..0ac41f1922 100644 --- a/x/profiles/keeper/keeper_dtag_transfers.go +++ b/x/profiles/keeper/keeper_dtag_transfers.go @@ -16,7 +16,7 @@ func (k Keeper) SaveDTagTransferRequest(ctx sdk.Context, request types.DTagTrans return sdkerrors.Wrap(types.ErrProfileNotFound, "request receiver does not have a profile") } - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) key := types.DTagTransferRequestStoreKey(request.Sender, request.Receiver) if store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, @@ -24,7 +24,7 @@ func (k Keeper) SaveDTagTransferRequest(ctx sdk.Context, request types.DTagTrans request.Sender, request.Receiver) } - store.Set(key, k.cdc.MustMarshal(&request)) + store.Set(key, k.Cdc.MustMarshal(&request)) k.Logger(ctx).Info("DTag transfer request", "sender", request.Sender, "receiver", request.Receiver) return nil } @@ -32,14 +32,14 @@ func (k Keeper) SaveDTagTransferRequest(ctx sdk.Context, request types.DTagTrans // GetDTagTransferRequest retries the DTag transfer request made from the specified sender to the given receiver. // If the request was not found, returns false instead. func (k Keeper) GetDTagTransferRequest(ctx sdk.Context, sender, receiver string) (types.DTagTransferRequest, bool, error) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) key := types.DTagTransferRequestStoreKey(sender, receiver) if !store.Has(key) { return types.DTagTransferRequest{}, false, nil } var request types.DTagTransferRequest - err := k.cdc.Unmarshal(store.Get(key), &request) + err := k.Cdc.Unmarshal(store.Get(key), &request) if err != nil { return types.DTagTransferRequest{}, false, err } @@ -49,12 +49,12 @@ func (k Keeper) GetDTagTransferRequest(ctx sdk.Context, sender, receiver string) // GetDTagTransferRequests returns all the requests inside the given context func (k Keeper) GetDTagTransferRequests(ctx sdk.Context) (requests []types.DTagTransferRequest) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) iterator := sdk.KVStorePrefixIterator(store, types.DTagTransferRequestPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - request := types.MustUnmarshalDTagTransferRequest(k.cdc, iterator.Value()) + request := types.MustUnmarshalDTagTransferRequest(k.Cdc, iterator.Value()) requests = append(requests, request) } @@ -63,7 +63,7 @@ func (k Keeper) GetDTagTransferRequests(ctx sdk.Context) (requests []types.DTagT // DeleteDTagTransferRequest deletes the transfer request made from the sender towards the recipient func (k Keeper) DeleteDTagTransferRequest(ctx sdk.Context, sender, recipient string) error { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) key := types.DTagTransferRequestStoreKey(sender, recipient) if !store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "request from %s to %s not found", sender, recipient) @@ -81,7 +81,7 @@ func (k Keeper) DeleteAllUserIncomingDTagTransferRequests(ctx sdk.Context, recei return false }) - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) for _, request := range requests { store.Delete(types.DTagTransferRequestStoreKey(request.Sender, request.Receiver)) } diff --git a/x/profiles/keeper/keeper_ibc.go b/x/profiles/keeper/keeper_ibc.go index 31ab82f743..158e937163 100644 --- a/x/profiles/keeper/keeper_ibc.go +++ b/x/profiles/keeper/keeper_ibc.go @@ -38,13 +38,13 @@ func (k Keeper) BindPort(ctx sdk.Context, portID string) error { // GetPort returns the portID for the module. Used in ExportGenesis func (k Keeper) GetPort(ctx sdk.Context) string { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) return string(store.Get(types.IBCPortKey)) } // SetPort sets the portID for the module. Used in InitGenesis func (k Keeper) SetPort(ctx sdk.Context, portID string) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) store.Set(types.IBCPortKey, []byte(portID)) } diff --git a/x/profiles/keeper/keeper_params_test.go b/x/profiles/keeper/keeper_params_test.go index e7e4a1bc0c..586a8cb39f 100644 --- a/x/profiles/keeper/keeper_params_test.go +++ b/x/profiles/keeper/keeper_params_test.go @@ -20,7 +20,7 @@ func (suite *KeeperTestSuite) TestKeeper_SetParams() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(time.Now()), + types.NewAppLinksParams(time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC)), ) suite.k.SetParams(suite.ctx, params) diff --git a/x/profiles/keeper/keeper_relationships.go b/x/profiles/keeper/keeper_relationships.go index 1ba9bc2e4d..98ed5f8c27 100644 --- a/x/profiles/keeper/keeper_relationships.go +++ b/x/profiles/keeper/keeper_relationships.go @@ -20,27 +20,27 @@ func (k Keeper) SaveRelationship(ctx sdk.Context, relationship types.Relationshi return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "relationship creator and recipient cannot be the same user") } - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) key := types.RelationshipsStoreKey(relationship.Creator, relationship.Subspace, relationship.Recipient) if store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "relationship already exists with %s", relationship.Recipient) } - store.Set(key, types.MustMarshalRelationship(k.cdc, relationship)) + store.Set(key, types.MustMarshalRelationship(k.Cdc, relationship)) return nil } // GetRelationship returns the relationship existing between the provided creator and recipient inside the given subspace func (k Keeper) GetRelationship(ctx sdk.Context, creator, subspace, recipient string) (types.Relationship, bool) { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) key := types.RelationshipsStoreKey(creator, subspace, recipient) if !store.Has(key) { return types.Relationship{}, false } - return types.MustUnmarshalRelationship(k.cdc, store.Get(key)), true + return types.MustUnmarshalRelationship(k.Cdc, store.Get(key)), true } // GetUserRelationships allows to list all the stored relationships that involve the given user. @@ -65,7 +65,7 @@ func (k Keeper) GetAllRelationships(ctx sdk.Context) []types.Relationship { // RemoveRelationship allows to delete the relationship between the given user and his counterparty func (k Keeper) RemoveRelationship(ctx sdk.Context, relationship types.Relationship) error { - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) key := types.RelationshipsStoreKey(relationship.Creator, relationship.Subspace, relationship.Recipient) if !store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, @@ -84,7 +84,7 @@ func (k Keeper) DeleteAllUserRelationships(ctx sdk.Context, user string) { return false }) - store := ctx.KVStore(k.storeKey) + store := ctx.KVStore(k.StoreKey) for _, relationship := range relationships { store.Delete(types.RelationshipsStoreKey(relationship.Creator, relationship.Subspace, relationship.Recipient)) } diff --git a/x/profiles/keeper/migrations.go b/x/profiles/keeper/migrations.go index 64e29b1c56..4a47c7a996 100644 --- a/x/profiles/keeper/migrations.go +++ b/x/profiles/keeper/migrations.go @@ -35,12 +35,12 @@ func NewMigrator(keeper Keeper, amino *codec.LegacyAmino, queryServer grpc.Serve // Migrate1to2 migrates from version 1 to 2. func (m Migrator) Migrate1to2(ctx sdk.Context) error { - return v200.MigrateStore(ctx, m.keeper.storeKey, m.keeper.paramSubspace, m.keeper.cdc, m.amino) + return v200.MigrateStore(ctx, m.keeper.StoreKey, m.keeper.paramSubspace, m.keeper.Cdc, m.amino) } // Migrate2to3 migrates from version 2 to 3. func (m Migrator) Migrate2to3(ctx sdk.Context) error { - return v210.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc) + return v210.MigrateStore(ctx, m.keeper.StoreKey, m.keeper.Cdc) } // Migrate3to4 migrates from version 3 to 4. @@ -79,6 +79,8 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error { // Migrate4to5 migrates from version 4 to 5 func (m Migrator) Migrate4to5(ctx sdk.Context) error { + var iterErr error + params := m.keeper.GetParams(ctx) blockTime := ctx.BlockTime() expirationTimeParam := params.AppLinks.ExpirationTime @@ -93,11 +95,15 @@ func (m Migrator) Migrate4to5(ctx sdk.Context) error { link.ExpirationTime = expirationTime // TODO can this error be unchecked? it checks if the link is associated to a profile - _ = m.keeper.SaveApplicationLink(ctx, link) + err := m.keeper.SaveApplicationLink(ctx, link) + if err != nil { + iterErr = err + return true + } return false }) - return nil + return iterErr } func (m Migrator) migrateProfile(ctx sdk.Context, profile *types.Profile) error { diff --git a/x/profiles/keeper/migrations_test.go b/x/profiles/keeper/migrations_test.go new file mode 100644 index 0000000000..946117d796 --- /dev/null +++ b/x/profiles/keeper/migrations_test.go @@ -0,0 +1,103 @@ +package keeper_test + +import ( + "time" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/desmos-labs/desmos/v2/testutil" + "github.com/desmos-labs/desmos/v2/x/profiles/keeper" + v200 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200" + "github.com/desmos-labs/desmos/v2/x/profiles/types" +) + +func (suite KeeperTestSuite) saveAppLinkV200(link v200.ApplicationLink) error { + if !suite.k.HasProfile(suite.ctx, link.User) { + return sdkerrors.Wrapf(types.ErrProfileNotFound, "a profile is required to link an application") + } + + // Get the keys + userApplicationLinkKey := types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username) + applicationLinkClientIDKey := types.ApplicationLinkClientIDKey(link.OracleRequest.ClientID) + + // Store the data + store := suite.ctx.KVStore(suite.k.StoreKey) + store.Set(userApplicationLinkKey, v200.MustMarshalApplicationLink(suite.k.Cdc, link)) + store.Set(applicationLinkClientIDKey, userApplicationLinkKey) + + return nil +} + +func (suite KeeperTestSuite) Test_Migrate4to5() { + suite.ctx = suite.ctx.WithBlockTime(time.Date(2022, 5, 0, 00, 00, 00, 000, time.UTC)) + ctx, _ := suite.ctx.CacheContext() + + suite.k.SetParams(ctx, types.NewParams( + types.DefaultNicknameParams(), + types.DefaultDTagParams(), + types.DefaultBioParams(), + types.DefaultOracleParams(), + types.NewAppLinksParams(time.Date(1, 1, 0, 00, 00, 00, 000, time.UTC)), + )) + + profile := testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") + suite.Require().NoError(suite.k.StoreProfile(ctx, profile)) + + v200Links := []v200.ApplicationLink{ + v200.NewApplicationLink( + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + v200.NewData("twitter", "twitteruser"), + v200.ApplicationLinkStateInitialized, + v200.NewOracleRequest( + 0, + 1, + v200.NewOracleRequestCallData("twitter", "calldata"), + "client_id", + ), + nil, + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + ), + v200.NewApplicationLink( + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + v200.NewData("reddit", "reddituser"), + v200.ApplicationLinkStateInitialized, + v200.NewOracleRequest( + 0, + 1, + v200.NewOracleRequestCallData("reddit", "calldata"), + "client_id2", + ), + nil, + time.Date(2022, 5, 1, 00, 00, 00, 000, time.UTC), + ), + } + + expectedAppLink := types.NewApplicationLink( + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + types.NewData("reddit", "reddituser"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("reddit", "calldata"), + "client_id2", + ), + nil, + time.Date(2022, 5, 1, 00, 00, 00, 000, time.UTC), + time.Date(2023, 6, 1, 00, 00, 00, 000, time.UTC), + ) + + suite.ctx = ctx + for _, link := range v200Links { + err := suite.saveAppLinkV200(link) + suite.Require().NoError(err) + } + + migrator := keeper.NewMigrator(suite.k, suite.legacyAminoCdc, nil) + + err := migrator.Migrate4to5(suite.ctx) + suite.Require().NoError(err) + + migratedAppLinks := suite.k.GetApplicationLinks(suite.ctx) + + suite.Require().Equal([]types.ApplicationLink{expectedAppLink}, migratedAppLinks) +} diff --git a/x/profiles/keeper/msg_server_chain_link.go b/x/profiles/keeper/msg_server_chain_link.go index 1290f4d792..d6c2f200fb 100644 --- a/x/profiles/keeper/msg_server_chain_link.go +++ b/x/profiles/keeper/msg_server_chain_link.go @@ -12,7 +12,7 @@ import ( func (k msgServer) LinkChainAccount(goCtx context.Context, msg *types.MsgLinkChainAccount) (*types.MsgLinkChainAccountResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - srcAddrData, err := types.UnpackAddressData(k.cdc, msg.ChainAddress) + srcAddrData, err := types.UnpackAddressData(k.Cdc, msg.ChainAddress) if err != nil { return nil, err } diff --git a/x/profiles/keeper/relay_chain_links.go b/x/profiles/keeper/relay_chain_links.go index ce80aa86f5..dd0f46bc94 100644 --- a/x/profiles/keeper/relay_chain_links.go +++ b/x/profiles/keeper/relay_chain_links.go @@ -21,7 +21,7 @@ func (k Keeper) OnRecvLinkChainAccountPacket( return packetAck, err } - srcAddrData, err := types.UnpackAddressData(k.cdc, data.SourceAddress) + srcAddrData, err := types.UnpackAddressData(k.Cdc, data.SourceAddress) if err != nil { return packetAck, err } @@ -40,7 +40,7 @@ func (k Keeper) OnRecvLinkChainAccountPacket( // Get the destination proof public key var pubKey cryptotypes.PubKey - err = k.cdc.UnpackAny(data.DestinationProof.PubKey, &pubKey) + err = k.Cdc.UnpackAny(data.DestinationProof.PubKey, &pubKey) if err != nil { return packetAck, sdkerrors.Wrap(sdkerrors.ErrInvalidType, "invalid public key type") } @@ -54,7 +54,7 @@ func (k Keeper) OnRecvLinkChainAccountPacket( // Verify the destination proof destAddrData := types.NewBech32Address(data.DestinationAddress, sdk.GetConfig().GetBech32AccountAddrPrefix()) - err = data.DestinationProof.Verify(k.cdc, destAddrData) + err = data.DestinationProof.Verify(k.Cdc, destAddrData) if err != nil { return packetAck, err } diff --git a/x/profiles/legacy/v200/models_app_links.pb.go b/x/profiles/legacy/v200/models_app_links.pb.go index 75f0593ff6..0d5d947d81 100644 --- a/x/profiles/legacy/v200/models_app_links.pb.go +++ b/x/profiles/legacy/v200/models_app_links.pb.go @@ -436,14 +436,14 @@ func (m *Result_Failed) XXX_DiscardUnknown() { var xxx_messageInfo_Result_Failed proto.InternalMessageInfo func init() { - proto.RegisterEnum("desmos.profiles.v1beta1.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) - proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.v1beta1.ApplicationLink") - proto.RegisterType((*Data)(nil), "desmos.profiles.v1beta1.Data") - proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.v1beta1.OracleRequest") - proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.v1beta1.OracleRequest.CallData") - proto.RegisterType((*Result)(nil), "desmos.profiles.v1beta1.Result") - proto.RegisterType((*Result_Success)(nil), "desmos.profiles.v1beta1.Result.Success") - proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.v1beta1.Result.Failed") + proto.RegisterEnum("desmos.profiles.v200.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) + proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.v200.ApplicationLink") + proto.RegisterType((*Data)(nil), "desmos.profiles.v200.Data") + proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.v200.OracleRequest") + proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.v200.OracleRequest.CallData") + proto.RegisterType((*Result)(nil), "desmos.profiles.v200.Result") + proto.RegisterType((*Result_Success)(nil), "desmos.profiles.v200.Result.Success") + proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.v200.Result.Failed") } func init() { diff --git a/x/profiles/module.go b/x/profiles/module.go index aeaa6178c1..e0d70d7fdb 100644 --- a/x/profiles/module.go +++ b/x/profiles/module.go @@ -120,6 +120,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { if err != nil { panic(err) } + err = cfg.RegisterMigration(types.ModuleName, 4, m.Migrate4to5) + if err != nil { + panic(err) + } } // NewAppModule creates a new AppModule Object diff --git a/x/profiles/simulation/genesis.go b/x/profiles/simulation/genesis.go index 77dac13872..e4436ba7f1 100644 --- a/x/profiles/simulation/genesis.go +++ b/x/profiles/simulation/genesis.go @@ -47,6 +47,7 @@ func RandomizedGenState(simsState *module.SimulationState) { RandomDTagParams(simsState.Rand), RandomBioParams(simsState.Rand), RandomOracleParams(simsState.Rand), + RandomAppLinksParams(simsState.Rand), ), types.IBCPortID, nil, diff --git a/x/profiles/simulation/utils.go b/x/profiles/simulation/utils.go index c954de9645..49b70926da 100644 --- a/x/profiles/simulation/utils.go +++ b/x/profiles/simulation/utils.go @@ -173,6 +173,11 @@ func RandomOracleParams(r *rand.Rand) types.OracleParams { ) } +// RandomAppLinksParams return a random appLinks param +func RandomAppLinksParams(r *rand.Rand) types.AppLinksParams { + return types.NewAppLinksParams(simtypes.RandTimestamp(r)) +} + // RandomRelationship picks and returns a random relationships from an array func RandomRelationship(r *rand.Rand, relationships []types.Relationship) types.Relationship { idx := r.Intn(len(relationships)) diff --git a/x/profiles/types/genesis_test.go b/x/profiles/types/genesis_test.go index 09b99bf36e..6c6db7bcd8 100644 --- a/x/profiles/types/genesis_test.go +++ b/x/profiles/types/genesis_test.go @@ -34,6 +34,7 @@ func TestValidateGenesis(t *testing.T) { types.DefaultDTagParams(), types.DefaultBioParams(), types.DefaultOracleParams(), + types.DefaultAppLinksParams(), ), types.IBCPortID, nil, @@ -196,6 +197,7 @@ func TestValidateGenesis(t *testing.T) { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), }, ), @@ -292,6 +294,7 @@ func TestValidateGenesis(t *testing.T) { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), }, ), diff --git a/x/profiles/types/keys.go b/x/profiles/types/keys.go index 31dc85ec89..642490cbb2 100644 --- a/x/profiles/types/keys.go +++ b/x/profiles/types/keys.go @@ -130,14 +130,14 @@ func ApplicationLinkClientIDKey(clientID string) []byte { return append(ApplicationLinkClientIDPrefix, []byte(clientID)...) } -// ExpiringApplicationLinkPrefix returns the store prefix used to identify the +// ApplicationLinkExpiringTimePrefix returns the store prefix used to identify the // expiration time for application links -func ExpiringApplicationLinkPrefix(expirationTime time.Time) []byte { +func ApplicationLinkExpiringTimePrefix(expirationTime time.Time) []byte { return append(ExpiringAppLinkTimePrefix, sdk.FormatTimeBytes(expirationTime)...) } -// ExpirationTimeApplicationLinkKey returns the key used to store the clientID associated with the expirationTime +// ApplicationLinkExpiringTimeKey returns the key used to store the clientID associated with the expirationTime // of the application link associated with the given clientID -func ExpirationTimeApplicationLinkKey(expirationTime time.Time, clientID string) []byte { - return append(ExpiringApplicationLinkPrefix(expirationTime), []byte(clientID)...) +func ApplicationLinkExpiringTimeKey(expirationTime time.Time, clientID string) []byte { + return append(ApplicationLinkExpiringTimePrefix(expirationTime), []byte(clientID)...) } diff --git a/x/profiles/types/models_app_links.go b/x/profiles/types/models_app_links.go index e0ffb6f182..089f13af85 100644 --- a/x/profiles/types/models_app_links.go +++ b/x/profiles/types/models_app_links.go @@ -28,7 +28,8 @@ func NewApplicationLink( // CalculateExpirationTime calculate the expiration time for an application link by adding the expirationTime parameter // to the app link creationTime func CalculateExpirationTime(creationTime time.Time, expirationTimeParam time.Time) time.Time { - return creationTime.Add(time.Duration(expirationTimeParam.UnixNano())) + y, m, d := expirationTimeParam.Date() + return creationTime.AddDate(y, int(m), d) } // Validate returns an error if the instance does not contain valid data diff --git a/x/profiles/types/models_app_links_test.go b/x/profiles/types/models_app_links_test.go index d7d0177814..effc2eb966 100644 --- a/x/profiles/types/models_app_links_test.go +++ b/x/profiles/types/models_app_links_test.go @@ -9,6 +9,30 @@ import ( "github.com/desmos-labs/desmos/v2/x/profiles/types" ) +func TestCalculateExpirationTime(t *testing.T) { + testCases := []struct { + name string + creationTime time.Time + expirationTimeParam time.Time + expectedExpirationTime time.Time + }{ + { + name: "calculate expiration time correctly", + creationTime: time.Date(2022, 1, 0, 00, 00, 00, 000, time.UTC), + expirationTimeParam: time.Date(0, 3, 0, 00, 00, 00, 000, time.UTC), + expectedExpirationTime: time.Date(2022, 4, 1, 0, 00, 00, 000, time.UTC), + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + actualExpirationTime := types.CalculateExpirationTime(tc.creationTime, tc.expirationTimeParam) + require.Equal(t, tc.expectedExpirationTime, actualExpirationTime) + }) + } +} + func TestApplicationLink_Validate(t *testing.T) { testCases := []struct { name string @@ -32,6 +56,7 @@ func TestApplicationLink_Validate(t *testing.T) { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: true, }, @@ -52,6 +77,7 @@ func TestApplicationLink_Validate(t *testing.T) { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: true, }, @@ -72,6 +98,7 @@ func TestApplicationLink_Validate(t *testing.T) { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: true, }, @@ -92,6 +119,7 @@ func TestApplicationLink_Validate(t *testing.T) { ), nil, time.Time{}, + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: true, }, @@ -112,6 +140,7 @@ func TestApplicationLink_Validate(t *testing.T) { ), types.NewErrorResult(""), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: true, }, @@ -132,6 +161,28 @@ func TestApplicationLink_Validate(t *testing.T) { ), types.NewSuccessResult("value", "signature"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + ), + shouldErr: true, + }, + { + name: "invalid expiration time returns error", + link: types.NewApplicationLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + types.NewData("twitter", "twitteruser"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData( + "twitter", + "7B22757365726E616D65223A22526963636172646F4D222C22676973745F6964223A223732306530303732333930613930316262383065353966643630643766646564227D", + ), + "client_id", + ), + nil, + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Time{}, ), shouldErr: true, }, @@ -152,6 +203,7 @@ func TestApplicationLink_Validate(t *testing.T) { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: false, }, diff --git a/x/profiles/types/models_params.go b/x/profiles/types/models_params.go index dad8626999..208f83633a 100644 --- a/x/profiles/types/models_params.go +++ b/x/profiles/types/models_params.go @@ -91,7 +91,7 @@ func (params Params) Validate() error { } if err := ValidateOracleParams(params.Oracle); err != nil { - return nil + return err } return ValidateAppLinksParams(params.AppLinks) diff --git a/x/profiles/types/models_params_test.go b/x/profiles/types/models_params_test.go index 2732799bfe..90463c3a73 100644 --- a/x/profiles/types/models_params_test.go +++ b/x/profiles/types/models_params_test.go @@ -75,6 +75,7 @@ func TestValidateParams(t *testing.T) { types.DefaultOracleParams(), types.NewAppLinksParams(time.Time{}), ), + shouldErr: true, }, { name: "valid params return no error", @@ -329,7 +330,7 @@ func TestValidateAppLinksParams(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - err := types.ValidateBioParams(tc.params) + err := types.ValidateAppLinksParams(tc.params) if tc.shouldErr { require.Error(t, err) From 5d4d03aa27ac4f4aba0212cdc16b733c724dafa4 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 19 Jan 2022 10:20:27 +0100 Subject: [PATCH 004/112] fixed proto file lint error --- proto/desmos/profiles/v1beta1/models_params.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/desmos/profiles/v1beta1/models_params.proto b/proto/desmos/profiles/v1beta1/models_params.proto index 4f7c50760f..3e1d970ac6 100644 --- a/proto/desmos/profiles/v1beta1/models_params.proto +++ b/proto/desmos/profiles/v1beta1/models_params.proto @@ -32,7 +32,7 @@ message Params { AppLinksParams appLinks = 5 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"applinks\"" + (gogoproto.moretags) = "yaml:\"app_links\"" ]; } From 85bdf16bfc4702770be1e85c4b2071e63c0d2738 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 19 Jan 2022 15:18:07 +0100 Subject: [PATCH 005/112] reviewed migration code --- .../legacy/v200/models_app_links.proto | 155 ++++++++++++++++ x/profiles/keeper/migrations.go | 27 +-- x/profiles/keeper/migrations_test.go | 2 +- x/profiles/legacy/v200/models_app_links.pb.go | 168 +++++++++--------- x/profiles/legacy/v210/store.go | 1 - x/profiles/legacy/v231/store.go | 97 ++++++++++ x/profiles/legacy/v231/store_test.go | 72 ++++++++ x/profiles/types/models_params.go | 15 +- x/profiles/types/models_params.pb.go | 74 ++++---- 9 files changed, 456 insertions(+), 155 deletions(-) create mode 100644 proto/desmos/profiles/legacy/v200/models_app_links.proto create mode 100644 x/profiles/legacy/v231/store.go create mode 100644 x/profiles/legacy/v231/store_test.go diff --git a/proto/desmos/profiles/legacy/v200/models_app_links.proto b/proto/desmos/profiles/legacy/v200/models_app_links.proto new file mode 100644 index 0000000000..5fdf2659f9 --- /dev/null +++ b/proto/desmos/profiles/legacy/v200/models_app_links.proto @@ -0,0 +1,155 @@ +syntax = "proto3"; +package desmos.profiles.legacy.v200; + +option go_package = "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +// ApplicationLink contains the data of a link to a centralized application +message ApplicationLink { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // User to which the link is associated + string user = 1 [ (gogoproto.moretags) = "yaml:\"user\"" ]; + + // Data contains the details of this specific link + Data data = 2 + [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"data\"" ]; + + // State of the link + ApplicationLinkState state = 3 [ (gogoproto.moretags) = "yaml:\"state\"" ]; + + // OracleRequest represents the request that has been made to the oracle + OracleRequest oracle_request = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"oracle_request\"" + ]; + + // Data coming from the result of the verification. + // Only available when the state is STATE_SUCCESS + Result result = 5 [ (gogoproto.moretags) = "yaml:\"result\"" ]; + + // CreationTime represents the time in which the link was created + google.protobuf.Timestamp creation_time = 6 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"creation_time\"" + ]; +} + +// Data contains the data associated to a specific user of a +// generic centralized application +message Data { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // The application name (eg. Twitter, GitHub, etc) + string application = 1 [ (gogoproto.moretags) = "yaml:\"application\"" ]; + // Username on the application (eg. Twitter tag, GitHub profile, etc) + string username = 2 [ (gogoproto.moretags) = "yaml:\"username\"" ]; +} + +// OracleRequest represents a generic oracle request used to +// verify the ownership of a centralized application account +message OracleRequest { + option (gogoproto.goproto_getters) = false; + + option (gogoproto.equal) = true; + + // ID is the ID of the request + uint64 id = 1 + [ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ]; + + // OracleScriptID is ID of an oracle script + uint64 oracle_script_id = 2 [ + (gogoproto.customname) = "OracleScriptID", + (gogoproto.moretags) = "yaml:\"oracle_script_id\"" + ]; + + // CallData contains the data used to perform the oracle request + CallData call_data = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"call_data\"" + ]; + + // ClientID represents the ID of the client that has called the oracle script + string client_id = 4 [ + (gogoproto.customname) = "ClientID", + (gogoproto.moretags) = "yaml:\"client_id\"" + ]; + + // CallData contains the data sent to a single oracle request in order to + // verify the ownership of a centralized application by a Desmos profile + message CallData { + option (gogoproto.equal) = true; + + // The application for which the ownership should be verified + string application = 1 [ (gogoproto.moretags) = "yaml:\"application\"" ]; + + // The hex encoded call data that should be used to verify the application + // account ownership + string call_data = 2 [ (gogoproto.moretags) = "yaml:\"call_data\"" ]; + } +} + +// ApplicationLinkState defines if an application link is in the following +// states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT +enum ApplicationLinkState { + option (gogoproto.goproto_enum_prefix) = false; + + // A link has just been initialized + APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED = 0 + [ (gogoproto.enumvalue_customname) = "ApplicationLinkStateInitialized" ]; + // A link has just started being verified + APPLICATION_LINK_STATE_VERIFICATION_STARTED = 1 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationStarted" ]; + // A link has errored during the verification process + APPLICATION_LINK_STATE_VERIFICATION_ERROR = 2 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationError" ]; + // A link has being verified successfully + APPLICATION_LINK_STATE_VERIFICATION_SUCCESS = 3 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationSuccess" ]; + // A link has timed out while waiting for the verification + APPLICATION_LINK_STATE_TIMED_OUT = 4 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationTimedOut" ]; +} + +// Result represents a verification result +message Result { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // sum is the oneof that specifies whether this represents a success or + // failure result + oneof sum { + // Success represents a successful verification + Success success = 1; + + // Failed represents a failed verification + Failed failed = 2; + } + + // Success is the result of an application link that has been successfully + // verified + message Success { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // Hex-encoded value that has be signed by the profile + string value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; + // Hex-encoded signature that has been produced by signing the value + string signature = 2 [ (gogoproto.moretags) = "yaml:\"signature\"" ]; + } + + // Failed is the result of an application link that has not been verified + // successfully + message Failed { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // Error that is associated with the failure + string error = 1 [ (gogoproto.moretags) = "yaml:\"error\"" ]; + } +} diff --git a/x/profiles/keeper/migrations.go b/x/profiles/keeper/migrations.go index 4a47c7a996..3d31964ddd 100644 --- a/x/profiles/keeper/migrations.go +++ b/x/profiles/keeper/migrations.go @@ -7,6 +7,7 @@ import ( v043 "github.com/cosmos/cosmos-sdk/x/auth/legacy/v043" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" + v231 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v231" "github.com/desmos-labs/desmos/v2/x/profiles/types" "github.com/gogo/protobuf/grpc" @@ -79,31 +80,7 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error { // Migrate4to5 migrates from version 4 to 5 func (m Migrator) Migrate4to5(ctx sdk.Context) error { - var iterErr error - - params := m.keeper.GetParams(ctx) - blockTime := ctx.BlockTime() - expirationTimeParam := params.AppLinks.ExpirationTime - - m.keeper.IterateApplicationLinks(ctx, func(index int64, link types.ApplicationLink) (stop bool) { - expirationTime := types.CalculateExpirationTime(link.CreationTime, expirationTimeParam) - // if the existent app link is expired, delete it - if expirationTime.Before(blockTime) { - m.keeper.deleteApplicationLinkStoreKeys(ctx, link) - return false - } - - link.ExpirationTime = expirationTime - // TODO can this error be unchecked? it checks if the link is associated to a profile - err := m.keeper.SaveApplicationLink(ctx, link) - if err != nil { - iterErr = err - return true - } - return false - }) - - return iterErr + return v231.MigrateStore(ctx, m.keeper.StoreKey, m.keeper.paramSubspace, m.keeper.Cdc) } func (m Migrator) migrateProfile(ctx sdk.Context, profile *types.Profile) error { diff --git a/x/profiles/keeper/migrations_test.go b/x/profiles/keeper/migrations_test.go index 946117d796..ce5cea064d 100644 --- a/x/profiles/keeper/migrations_test.go +++ b/x/profiles/keeper/migrations_test.go @@ -6,7 +6,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/desmos-labs/desmos/v2/testutil" "github.com/desmos-labs/desmos/v2/x/profiles/keeper" - v200 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200" + "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200" "github.com/desmos-labs/desmos/v2/x/profiles/types" ) diff --git a/x/profiles/legacy/v200/models_app_links.pb.go b/x/profiles/legacy/v200/models_app_links.pb.go index 0d5d947d81..d06695d2d4 100644 --- a/x/profiles/legacy/v200/models_app_links.pb.go +++ b/x/profiles/legacy/v200/models_app_links.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v1beta1/models_app_links.proto +// source: desmos/profiles/legacy/v200/models_app_links.proto package v200 @@ -65,7 +65,7 @@ func (x ApplicationLinkState) String() string { } func (ApplicationLinkState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_33caa1214beac081, []int{0} + return fileDescriptor_5df3c995b2a7b875, []int{0} } // ApplicationLink contains the data of a link to a centralized application @@ -75,7 +75,7 @@ type ApplicationLink struct { // Data contains the details of this specific link Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data" yaml:"data"` // State of the link - State ApplicationLinkState `protobuf:"varint,3,opt,name=state,proto3,enum=desmos.profiles.v1beta1.ApplicationLinkState" json:"state,omitempty" yaml:"state"` + State ApplicationLinkState `protobuf:"varint,3,opt,name=state,proto3,enum=desmos.profiles.legacy.v200.ApplicationLinkState" json:"state,omitempty" yaml:"state"` // OracleRequest represents the request that has been made to the oracle OracleRequest OracleRequest `protobuf:"bytes,4,opt,name=oracle_request,json=oracleRequest,proto3" json:"oracle_request" yaml:"oracle_request"` // Data coming from the result of the verification. @@ -89,7 +89,7 @@ func (m *ApplicationLink) Reset() { *m = ApplicationLink{} } func (m *ApplicationLink) String() string { return proto.CompactTextString(m) } func (*ApplicationLink) ProtoMessage() {} func (*ApplicationLink) Descriptor() ([]byte, []int) { - return fileDescriptor_33caa1214beac081, []int{0} + return fileDescriptor_5df3c995b2a7b875, []int{0} } func (m *ApplicationLink) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -131,7 +131,7 @@ func (m *Data) Reset() { *m = Data{} } func (m *Data) String() string { return proto.CompactTextString(m) } func (*Data) ProtoMessage() {} func (*Data) Descriptor() ([]byte, []int) { - return fileDescriptor_33caa1214beac081, []int{1} + return fileDescriptor_5df3c995b2a7b875, []int{1} } func (m *Data) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -177,7 +177,7 @@ func (m *OracleRequest) Reset() { *m = OracleRequest{} } func (m *OracleRequest) String() string { return proto.CompactTextString(m) } func (*OracleRequest) ProtoMessage() {} func (*OracleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_33caa1214beac081, []int{2} + return fileDescriptor_5df3c995b2a7b875, []int{2} } func (m *OracleRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -220,7 +220,7 @@ func (m *OracleRequest_CallData) Reset() { *m = OracleRequest_CallData{} func (m *OracleRequest_CallData) String() string { return proto.CompactTextString(m) } func (*OracleRequest_CallData) ProtoMessage() {} func (*OracleRequest_CallData) Descriptor() ([]byte, []int) { - return fileDescriptor_33caa1214beac081, []int{2, 0} + return fileDescriptor_5df3c995b2a7b875, []int{2, 0} } func (m *OracleRequest_CallData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -278,7 +278,7 @@ func (m *Result) Reset() { *m = Result{} } func (m *Result) String() string { return proto.CompactTextString(m) } func (*Result) ProtoMessage() {} func (*Result) Descriptor() ([]byte, []int) { - return fileDescriptor_33caa1214beac081, []int{3} + return fileDescriptor_5df3c995b2a7b875, []int{3} } func (m *Result) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -366,7 +366,7 @@ func (m *Result_Success) Reset() { *m = Result_Success{} } func (m *Result_Success) String() string { return proto.CompactTextString(m) } func (*Result_Success) ProtoMessage() {} func (*Result_Success) Descriptor() ([]byte, []int) { - return fileDescriptor_33caa1214beac081, []int{3, 0} + return fileDescriptor_5df3c995b2a7b875, []int{3, 0} } func (m *Result_Success) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -406,7 +406,7 @@ func (m *Result_Failed) Reset() { *m = Result_Failed{} } func (m *Result_Failed) String() string { return proto.CompactTextString(m) } func (*Result_Failed) ProtoMessage() {} func (*Result_Failed) Descriptor() ([]byte, []int) { - return fileDescriptor_33caa1214beac081, []int{3, 1} + return fileDescriptor_5df3c995b2a7b875, []int{3, 1} } func (m *Result_Failed) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -436,83 +436,83 @@ func (m *Result_Failed) XXX_DiscardUnknown() { var xxx_messageInfo_Result_Failed proto.InternalMessageInfo func init() { - proto.RegisterEnum("desmos.profiles.v200.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) - proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.v200.ApplicationLink") - proto.RegisterType((*Data)(nil), "desmos.profiles.v200.Data") - proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.v200.OracleRequest") - proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.v200.OracleRequest.CallData") - proto.RegisterType((*Result)(nil), "desmos.profiles.v200.Result") - proto.RegisterType((*Result_Success)(nil), "desmos.profiles.v200.Result.Success") - proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.v200.Result.Failed") + proto.RegisterEnum("desmos.profiles.legacy.v200.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) + proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.legacy.v200.ApplicationLink") + proto.RegisterType((*Data)(nil), "desmos.profiles.legacy.v200.Data") + proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.legacy.v200.OracleRequest") + proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.legacy.v200.OracleRequest.CallData") + proto.RegisterType((*Result)(nil), "desmos.profiles.legacy.v200.Result") + proto.RegisterType((*Result_Success)(nil), "desmos.profiles.legacy.v200.Result.Success") + proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.legacy.v200.Result.Failed") } func init() { - proto.RegisterFile("desmos/profiles/v1beta1/models_app_links.proto", fileDescriptor_33caa1214beac081) -} - -var fileDescriptor_33caa1214beac081 = []byte{ - // 969 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0x4f, 0x6f, 0xdb, 0x46, - 0x13, 0xc6, 0x45, 0x89, 0x56, 0xac, 0x75, 0x6c, 0xeb, 0x5d, 0xfb, 0x6d, 0x04, 0x02, 0x16, 0x59, - 0xba, 0x70, 0xdd, 0x16, 0x26, 0x61, 0xf5, 0x52, 0x18, 0x28, 0x50, 0x51, 0xa2, 0x11, 0x26, 0xae, - 0x65, 0xac, 0xe8, 0x04, 0xc8, 0x85, 0x58, 0x91, 0x2b, 0x95, 0x08, 0x25, 0xaa, 0xfc, 0x63, 0x34, - 0x2d, 0x7a, 0x0f, 0x7c, 0xca, 0x17, 0x30, 0x10, 0xa0, 0x9f, 0xa3, 0xe8, 0x35, 0x97, 0x02, 0x39, - 0xf6, 0xc4, 0x16, 0xf2, 0xa5, 0x67, 0x9d, 0x7b, 0x28, 0xb8, 0x4b, 0x4a, 0x72, 0x13, 0xd5, 0x06, - 0x7a, 0x5b, 0xef, 0x3c, 0xf3, 0x9b, 0xe1, 0x3c, 0xe3, 0x85, 0x80, 0xe2, 0x90, 0x70, 0xe8, 0x87, - 0xea, 0x38, 0xf0, 0xfb, 0xae, 0x47, 0x42, 0xf5, 0xe2, 0xb0, 0x47, 0x22, 0x7c, 0xa8, 0x0e, 0x7d, - 0x87, 0x78, 0xa1, 0x85, 0xc7, 0x63, 0xcb, 0x73, 0x47, 0xcf, 0x43, 0x65, 0x1c, 0xf8, 0x91, 0x0f, - 0x1f, 0x30, 0xbd, 0x92, 0xeb, 0x95, 0x4c, 0x2f, 0x6c, 0x0f, 0xfc, 0x81, 0x4f, 0x35, 0x6a, 0x7a, - 0x62, 0x72, 0x41, 0x1c, 0xf8, 0xfe, 0xc0, 0x23, 0x2a, 0xfd, 0xab, 0x17, 0xf7, 0xd5, 0xc8, 0x1d, - 0x92, 0x30, 0xc2, 0xc3, 0x31, 0x13, 0xc8, 0x7f, 0x95, 0xc0, 0x66, 0x73, 0x3c, 0xf6, 0x5c, 0x1b, - 0x47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37, 0xfa, 0x26, 0xee, 0x29, 0xb6, - 0x3f, 0x54, 0xd9, 0x56, 0x1f, 0x78, 0xb8, 0x17, 0x66, 0x67, 0xf5, 0xa2, 0xa1, 0x7e, 0x37, 0xff, - 0x0d, 0x10, 0xbd, 0x18, 0x93, 0xb0, 0x57, 0xa6, 0x2f, 0xfd, 0xe7, 0x7f, 0x07, 0x00, 0x00, 0xff, - 0xff, 0xbb, 0xec, 0x83, 0x18, 0x23, 0x08, 0x00, 0x00, + proto.RegisterFile("desmos/profiles/legacy/v200/models_app_links.proto", fileDescriptor_5df3c995b2a7b875) +} + +var fileDescriptor_5df3c995b2a7b875 = []byte{ + // 974 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xdf, 0x6f, 0xdb, 0x54, + 0x14, 0xc7, 0xe3, 0xc4, 0xcd, 0x9a, 0xdb, 0xb5, 0x0d, 0xb7, 0x05, 0x22, 0xa3, 0xc5, 0x9e, 0x8b, + 0x50, 0xe9, 0x34, 0x7b, 0xcb, 0x1e, 0x40, 0x95, 0x78, 0x88, 0x13, 0x97, 0x79, 0x94, 0xa6, 0xdc, + 0xb8, 0x9b, 0xd8, 0x8b, 0x75, 0x6b, 0xdf, 0x06, 0x33, 0x27, 0x0e, 0xfe, 0x51, 0x31, 0x10, 0xef, + 0x53, 0xc5, 0xc3, 0xfe, 0x81, 0x4a, 0x93, 0xf8, 0x43, 0x10, 0x6f, 0x7b, 0xdc, 0x0b, 0x12, 0x4f, + 0x06, 0xa5, 0x2f, 0x3c, 0xe7, 0x2f, 0x40, 0xbe, 0xd7, 0x4e, 0x52, 0xd6, 0x86, 0x48, 0xbc, 0xdd, + 0xde, 0x73, 0xbe, 0x9f, 0x73, 0x7c, 0xbe, 0xa7, 0x57, 0x01, 0x0d, 0x87, 0x84, 0x7d, 0x3f, 0x54, + 0x87, 0x81, 0x7f, 0xe2, 0x7a, 0x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xb3, 0x73, + 0xe9, 0xd6, 0x75, 0x4c, 0x3d, 0x1d, 0xda, 0xc2, 0x7d, 0x1e, 0xb5, 0x5a, 0x7a, 0xb7, 0x5b, 0x2d, + 0xfd, 0x47, 0x9f, 0xd9, 0x8a, 0x3c, 0x02, 0xd2, 0x35, 0x54, 0xd3, 0xf8, 0x52, 0x6f, 0x5b, 0x9d, + 0x23, 0xb3, 0xca, 0x0b, 0x1f, 0x9e, 0x9d, 0x4b, 0xd2, 0x75, 0xa8, 0xf4, 0x69, 0x75, 0x3a, 0x71, + 0x24, 0xf0, 0x2f, 0x7e, 0xa9, 0x17, 0xb4, 0xaf, 0x5e, 0x8f, 0xea, 0xdc, 0x9b, 0x51, 0x9d, 0xfb, + 0x6b, 0x54, 0xe7, 0x5e, 0x5e, 0xd4, 0x0b, 0x6f, 0x2e, 0xea, 0x85, 0x3f, 0x2e, 0xea, 0x85, 0xa7, + 0x9f, 0xf4, 0xdc, 0xe8, 0x9b, 0xf8, 0x58, 0xb1, 0xfd, 0xbe, 0xca, 0x36, 0xfb, 0xae, 0x87, 0x8f, + 0xc3, 0xec, 0xac, 0x9e, 0x36, 0xd4, 0xef, 0xaf, 0xfc, 0x9d, 0x70, 0x5c, 0xa6, 0x6f, 0xff, 0x83, + 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x78, 0x9b, 0xda, 0x4d, 0x08, 0x00, 0x00, } func (this *ApplicationLink) Equal(that interface{}) bool { diff --git a/x/profiles/legacy/v210/store.go b/x/profiles/legacy/v210/store.go index b81938d578..f317026988 100644 --- a/x/profiles/legacy/v210/store.go +++ b/x/profiles/legacy/v210/store.go @@ -2,7 +2,6 @@ package v210 import ( "encoding/hex" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/profiles/legacy/v231/store.go b/x/profiles/legacy/v231/store.go new file mode 100644 index 0000000000..af656ee95e --- /dev/null +++ b/x/profiles/legacy/v231/store.go @@ -0,0 +1,97 @@ +package v231 + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + v200 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200" + "github.com/desmos-labs/desmos/v2/x/profiles/types" +) + +// MigrateStore performs in-place store migrations from v2.3.1 to v2.4.0 The +// migration includes: +// - Add the AppLinkParams to the params set +// - Added expiration time to all app links +func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, subspace paramstypes.Subspace, cdc codec.BinaryCodec) error { + store := ctx.KVStore(storeKey) + + migrateParams(ctx, subspace) + + err := migrateAppLinks(store, cdc) + if err != nil { + return err + } + + return nil +} + +func migrateAppLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { + iterator := sdk.KVStorePrefixIterator(store, types.UserApplicationLinkPrefix) + defer iterator.Close() + + var keys [][]byte + var newLinks []types.ApplicationLink + for ; iterator.Valid(); iterator.Next() { + var legacyAppLink v200.ApplicationLink + err := cdc.Unmarshal(iterator.Value(), &legacyAppLink) + if err != nil { + return err + } + + link := types.NewApplicationLink( + legacyAppLink.User, + types.NewData(legacyAppLink.Data.Application, legacyAppLink.Data.Username), + types.ApplicationLinkState(legacyAppLink.State), + types.NewOracleRequest( + legacyAppLink.OracleRequest.ID, + legacyAppLink.OracleRequest.OracleScriptID, + types.NewOracleRequestCallData( + legacyAppLink.OracleRequest.CallData.Application, + legacyAppLink.OracleRequest.CallData.CallData, + ), + legacyAppLink.OracleRequest.ClientID, + ), + migrateAppLinkResult(legacyAppLink.Result), + legacyAppLink.CreationTime, + types.CalculateExpirationTime(legacyAppLink.CreationTime, types.DefaultAppLinksParams().ExpirationTime), + ) + + keys = append(keys, iterator.Key()) + newLinks = append(newLinks, link) + + store.Delete(iterator.Key()) + } + + for index, link := range newLinks { + store.Set(keys[index], types.MustMarshalApplicationLink(cdc, link)) + store.Set( + types.ApplicationLinkExpiringTimeKey(link.ExpirationTime, link.OracleRequest.ClientID), + []byte(link.OracleRequest.ClientID), + ) + } + + return nil +} + +func migrateAppLinkResult(r *v200.Result) *types.Result { + if r == nil { + return nil + } + + switch result := (r.Sum).(type) { + case *v200.Result_Success_: + return types.NewSuccessResult(result.Success.Value, result.Success.Signature) + case *v200.Result_Failed_: + return types.NewErrorResult(result.Failed.Error) + default: + panic(fmt.Errorf("invalid result type")) + } +} + +// migrateParams add the AppLinksParams to the params set +func migrateParams(ctx sdk.Context, subspace paramstypes.Subspace) { + appLinkParams := types.DefaultAppLinksParams() + subspace.Set(ctx, types.AppLinksParamsKey, &appLinkParams) +} diff --git a/x/profiles/legacy/v231/store_test.go b/x/profiles/legacy/v231/store_test.go new file mode 100644 index 0000000000..01f8bff8f9 --- /dev/null +++ b/x/profiles/legacy/v231/store_test.go @@ -0,0 +1,72 @@ +package v231_test + +import ( + v100 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v100" + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/desmos-labs/desmos/v2/app" + v200 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200" + "github.com/desmos-labs/desmos/v2/x/profiles/types" +) + +func TestStoreMigration(t *testing.T) { + cdc, _ := app.MakeCodecs() + profilesKey := sdk.NewKVStoreKey("profiles") + ctx := testutil.DefaultContext(profilesKey, sdk.NewTransientStoreKey("transient_test")) + store := ctx.KVStore(profilesKey) + + testCases := []struct { + name string + key []byte + oldValue []byte + newValue []byte + }{ + { + name: "Application links migrated correctly", + key: types.UserApplicationLinkKey( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "twitter", + "user", + ), + oldValue: v200.MustMarshalApplicationLink(cdc, v200.NewApplicationLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + v200.NewData("twitter", "user"), + v200.AppLinkStateVerificationStarted, + v200.NewOracleRequest( + 1, + 1, + v200.NewOracleRequestCallData("twitter", "tweet-123456789"), + "client_id", + ), + v200.NewSuccessResult("76616c7565", "signature"), // The value should be HEX + time.Date(2022, 1, 0, 00, 00, 00, 000, time.UTC), + )), + newValue: types.MustMarshalApplicationLink(cdc, types.NewApplicationLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + types.NewData("twitter", "user"), + types.AppLinkStateVerificationStarted, + types.NewOracleRequest( + 1, + 1, + types.NewOracleRequestCallData("twitter", "tweet-123456789"), + "client_id", + ), + types.NewSuccessResult("76616c7565", "signature"), // The value should be HEX + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 3, 1, 00, 00, 00, 000, time.UTC), + )), + }, + { + name: "Profiles params are migrated correctly", + key: v100.Params{ + Nickname: v100.NicknameParams{}, + DTag: v100.DTagParams{}, + Bio: v100.BioParams{}, + Oracle: v100.OracleParams{}, + }, + }, + } +} diff --git a/x/profiles/types/models_params.go b/x/profiles/types/models_params.go index 208f83633a..76bcd50429 100644 --- a/x/profiles/types/models_params.go +++ b/x/profiles/types/models_params.go @@ -17,12 +17,13 @@ const ( // Default profile paramsModule var ( - DefaultMinNicknameLength = sdk.NewInt(2) - DefaultMaxNicknameLength = sdk.NewInt(1000) // Longest name on earth count 954 chars - DefaultRegEx = `^[A-Za-z0-9_]+$` - DefaultMinDTagLength = sdk.NewInt(3) - DefaultMaxDTagLength = sdk.NewInt(30) - DefaultMaxBioLength = sdk.NewInt(1000) + DefaultMinNicknameLength = sdk.NewInt(2) + DefaultMaxNicknameLength = sdk.NewInt(1000) // Longest name on earth count 954 chars + DefaultRegEx = `^[A-Za-z0-9_]+$` + DefaultMinDTagLength = sdk.NewInt(3) + DefaultMaxDTagLength = sdk.NewInt(30) + DefaultMaxBioLength = sdk.NewInt(1000) + DefaultAppLinksExpirationTime = time.Date(0, 3, 0, 00, 00, 00, 000, time.UTC) ) // Parameters store keys @@ -276,7 +277,7 @@ func NewAppLinksParams(expirationTime time.Time) AppLinksParams { } func DefaultAppLinksParams() AppLinksParams { - return NewAppLinksParams(time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC)) + return NewAppLinksParams(DefaultAppLinksExpirationTime) } func ValidateAppLinksParams(i interface{}) error { diff --git a/x/profiles/types/models_params.pb.go b/x/profiles/types/models_params.pb.go index 6db1cbf849..3087b55dcb 100644 --- a/x/profiles/types/models_params.pb.go +++ b/x/profiles/types/models_params.pb.go @@ -35,7 +35,7 @@ type Params struct { DTag DTagParams `protobuf:"bytes,2,opt,name=dtag,proto3" json:"dtag" yaml:"dtag"` Bio BioParams `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio" yaml:"bio"` Oracle OracleParams `protobuf:"bytes,4,opt,name=oracle,proto3" json:"oracle" yaml:"oracle"` - AppLinks AppLinksParams `protobuf:"bytes,5,opt,name=appLinks,proto3" json:"appLinks" yaml:"applinks"` + AppLinks AppLinksParams `protobuf:"bytes,5,opt,name=appLinks,proto3" json:"appLinks" yaml:"app_links"` } func (m *Params) Reset() { *m = Params{} } @@ -296,19 +296,19 @@ func init() { } var fileDescriptor_a621950d5c07fbad = []byte{ - // 794 bytes of a gzipped FileDescriptorProto + // 798 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xeb, 0x44, 0x18, 0xc7, 0x93, 0x3a, 0x8d, 0x92, 0xc9, 0xa1, 0xa5, 0x56, 0x69, 0x43, 0x91, 0xe2, 0x6a, 0x10, 0x10, 0x09, 0xd5, 0x56, 0xca, 0x02, 0xa9, 0x12, 0x8b, 0xba, 0xad, 0xa0, 0xa2, 0x40, 0x65, 0xb2, - 0x42, 0x48, 0xd6, 0xd8, 0x99, 0xb8, 0xa3, 0xd8, 0x1e, 0xcb, 0xe3, 0x54, 0xe9, 0xaa, 0x5b, 0x96, - 0x7d, 0x02, 0xc4, 0x1a, 0xf1, 0x10, 0x2c, 0xbb, 0xec, 0x12, 0xb1, 0x70, 0x51, 0xfa, 0x06, 0x79, - 0x02, 0x34, 0x17, 0x3b, 0x49, 0x45, 0xd4, 0x02, 0x3a, 0x2b, 0x8f, 0x67, 0xbe, 0xff, 0xef, 0xbb, + 0x42, 0x20, 0x6b, 0xec, 0x4c, 0xdc, 0x51, 0x6c, 0x8f, 0xe5, 0x71, 0xaa, 0x74, 0xd5, 0x2d, 0xcb, + 0x3e, 0x01, 0x62, 0x8d, 0x78, 0x09, 0x76, 0x5d, 0x76, 0x89, 0x58, 0xb8, 0x28, 0x7d, 0x83, 0x3c, + 0x01, 0x9a, 0x8b, 0x9d, 0xa4, 0x52, 0xd4, 0x02, 0x3a, 0x2b, 0x8f, 0x67, 0xbe, 0xff, 0xef, 0xbb, 0xcd, 0x05, 0x7c, 0x3a, 0xc0, 0x2c, 0xa2, 0xcc, 0x4a, 0x52, 0x3a, 0x24, 0x21, 0x66, 0xd6, 0x75, 0xcf, 0xc3, 0x19, 0xea, 0x59, 0x11, 0x1d, 0xe0, 0x90, 0xb9, 0x09, 0x4a, 0x51, 0xc4, 0xcc, 0x24, 0xa5, 0x19, 0xd5, 0x77, 0xa5, 0xb1, 0x59, 0x18, 0x9b, 0xca, 0x78, 0x6f, 0x3b, 0xa0, 0x01, 0x15, 0x36, 0x16, 0x1f, 0x49, 0xf3, 0xbd, 0x8e, 0x4f, 0x05, 0xdb, 0x43, 0x0c, 0x97, 0x5c, 0x9f, 0x92, 0x58, 0xad, 0x1b, 0x01, 0xa5, 0x41, 0x88, 0x2d, 0xf1, 0xe7, 0x8d, 0x87, 0x56, 0x46, 0x22, 0xcc, - 0x32, 0x14, 0x25, 0xd2, 0x00, 0xfe, 0xae, 0x81, 0xfa, 0xa5, 0x08, 0x40, 0xff, 0x11, 0x34, 0x62, + 0x32, 0x14, 0x25, 0xd2, 0x00, 0xfe, 0xa1, 0x81, 0xfa, 0xa5, 0x08, 0x40, 0xff, 0x11, 0x34, 0x62, 0xe2, 0x8f, 0x62, 0x14, 0xe1, 0x76, 0x75, 0xbf, 0xda, 0x6d, 0x1d, 0x7e, 0x62, 0xae, 0x88, 0xc6, 0xfc, 0x56, 0x19, 0x4a, 0xa9, 0xbd, 0x7b, 0x9f, 0x1b, 0x95, 0x59, 0x6e, 0x6c, 0xde, 0xa0, 0x28, 0x3c, 0x82, 0x05, 0x06, 0x3a, 0x25, 0x51, 0xef, 0x83, 0xda, 0x20, 0x43, 0x41, 0x7b, 0x4d, 0x90, @@ -316,37 +316,37 @@ var fileDescriptor_a621950d5c07fbad = []byte{ 0x2c, 0x37, 0x5a, 0x92, 0xce, 0x31, 0xd0, 0x11, 0x34, 0xfd, 0x2b, 0xa0, 0x79, 0x84, 0xb6, 0x35, 0x01, 0x85, 0x2b, 0xa1, 0x36, 0xa1, 0x8a, 0xa9, 0xab, 0x48, 0x81, 0x64, 0x79, 0x84, 0x42, 0x87, 0x23, 0xf4, 0x3e, 0xa8, 0xd3, 0x14, 0xf9, 0x21, 0x6e, 0xd7, 0x04, 0xec, 0xa3, 0x95, 0xb0, 0xef, - 0x84, 0x99, 0xe2, 0xbd, 0xa7, 0x78, 0xef, 0x48, 0x9e, 0x44, 0x40, 0x47, 0xb1, 0x78, 0x4d, 0x51, - 0x92, 0x5c, 0x90, 0x78, 0xc4, 0xda, 0xeb, 0x2f, 0xd4, 0xf4, 0x58, 0x19, 0xfe, 0x73, 0x4d, 0x51, - 0x92, 0x84, 0x7c, 0x15, 0x3a, 0x25, 0xf1, 0xa8, 0xf6, 0xd3, 0x2f, 0x46, 0x05, 0xe6, 0x55, 0xb0, - 0xb1, 0xdc, 0x0f, 0xdd, 0x03, 0x20, 0x22, 0xb1, 0x1b, 0xe2, 0x38, 0xc8, 0xae, 0x44, 0x33, 0xdf, - 0xd8, 0x27, 0x9c, 0xf7, 0x67, 0x6e, 0x7c, 0x1c, 0x90, 0xec, 0x6a, 0xec, 0x99, 0x3e, 0x8d, 0x2c, - 0xb5, 0x7b, 0xe4, 0xe7, 0x80, 0x0d, 0x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6f, 0x01, 0x18, 0x62, 0xec, 0xa2, 0x48, 0x44, 0x59, 0xdf, + 0xd7, 0xba, 0xad, 0xc3, 0xf7, 0x4d, 0x59, 0x78, 0x93, 0x5f, 0xdd, 0xe5, 0x1d, 0x70, 0x42, 0x49, + 0x6c, 0x9f, 0xa9, 0x93, 0xaf, 0x5a, 0x30, 0x97, 0xc2, 0xdf, 0x1e, 0x8d, 0xee, 0x2b, 0x3a, 0xc8, + 0x29, 0xcc, 0x69, 0x0e, 0x31, 0x3e, 0x16, 0x3a, 0xd5, 0xae, 0x5b, 0xb0, 0xb1, 0x7c, 0xc7, 0xe8, + 0x01, 0xd8, 0xc4, 0x93, 0x84, 0xa4, 0x28, 0x23, 0x34, 0x76, 0xf9, 0xdb, 0xa0, 0x6e, 0xfe, 0x3d, + 0x53, 0x3e, 0x1c, 0x66, 0xf1, 0x70, 0x98, 0xfd, 0xe2, 0xe1, 0xb0, 0xa1, 0x0a, 0x6f, 0xa7, 0xc8, + 0x7a, 0x09, 0x00, 0xef, 0x1e, 0x8d, 0xaa, 0xb3, 0x31, 0x9f, 0xe5, 0x42, 0x19, 0x80, 0xfd, 0xf5, + 0xfd, 0xb4, 0x53, 0x7d, 0x98, 0x76, 0xaa, 0x7f, 0x4f, 0x3b, 0xd5, 0xbb, 0xa7, 0x4e, 0xe5, 0xe1, + 0xa9, 0x53, 0xf9, 0xf3, 0xa9, 0x53, 0xf9, 0xa1, 0xb7, 0x90, 0x95, 0xbc, 0x1f, 0x0f, 0x42, 0xe4, + 0x31, 0x35, 0xb6, 0xae, 0x0f, 0xad, 0xc9, 0xfc, 0xfd, 0x14, 0x49, 0x7a, 0x75, 0x11, 0xda, 0x67, + 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x19, 0x69, 0x42, 0x5f, 0x07, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { From edb7793411fc818866914bf58afe6073caf5785c Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 19 Jan 2022 16:41:01 +0100 Subject: [PATCH 006/112] added migrations tests (need to fix some) --- .../profiles/legacy/v200/models_params.proto | 117 ++ x/profiles/legacy/v200/models_params.go | 59 + x/profiles/legacy/v200/models_params.pb.go | 1450 +++++++++++++++++ x/profiles/legacy/v231/store_test.go | 56 +- 4 files changed, 1666 insertions(+), 16 deletions(-) create mode 100644 proto/desmos/profiles/legacy/v200/models_params.proto create mode 100644 x/profiles/legacy/v200/models_params.go create mode 100644 x/profiles/legacy/v200/models_params.pb.go diff --git a/proto/desmos/profiles/legacy/v200/models_params.proto b/proto/desmos/profiles/legacy/v200/models_params.proto new file mode 100644 index 0000000000..c98a54696f --- /dev/null +++ b/proto/desmos/profiles/legacy/v200/models_params.proto @@ -0,0 +1,117 @@ +syntax = "proto3"; +package desmos.profiles.legacy.v200; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200"; + +// Params contains the parameters for the profiles module +message Params { + option (gogoproto.goproto_getters) = false; + + NicknameParams nickname = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"nickname\"" + ]; + + DTagParams dtag = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"dtag\"", + (gogoproto.customname) = "DTag" + ]; + + BioParams bio = 3 + [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"bio\"" ]; + + OracleParams oracle = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"oracle\"" + ]; +} + +// NicknameParams defines the parameters related to the profiles nicknames +message NicknameParams { + option (gogoproto.goproto_getters) = false; + + bytes min_length = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"min_length\"" + ]; + + bytes max_length = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"max_length\"" + ]; +} + +// DTagParams defines the parameters related to profile DTags +message DTagParams { + option (gogoproto.goproto_getters) = false; + + string reg_ex = 1 [ (gogoproto.moretags) = "yaml:\"reg_ex\"" ]; + + bytes min_length = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"min_length\"", + (gogoproto.customname) = "MinLength" + ]; + + bytes max_length = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"max_length\"", + (gogoproto.customname) = "MaxLength" + ]; +} + +// BioParams defines the parameters related to profile biography +message BioParams { + option (gogoproto.goproto_getters) = false; + + bytes max_length = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"max_length\"" + ]; +} + +// OracleParams defines the parameters related to the oracle +// that will be used to verify the ownership of a centralized +// application account by a Desmos profile +message OracleParams { + option (gogoproto.goproto_getters) = false; + + // ScriptID represents the ID of the oracle script to be called to verify the + // data + uint64 script_id = 1 [ + (gogoproto.customname) = "ScriptID", + (gogoproto.moretags) = "yaml:\"script_id\"" + ]; + + // AskCount represents the number of oracles to which ask to verify the data + uint64 ask_count = 2 [ (gogoproto.moretags) = "yaml:\"ask_count\"" ]; + + // MinCount represents the minimum count of oracles that should complete the + // verification successfully + uint64 min_count = 3 [ (gogoproto.moretags) = "yaml:\"min_count\"" ]; + + // PrepareGas represents the amount of gas to be used during the preparation + // stage of the oracle script + uint64 prepare_gas = 4 [ (gogoproto.moretags) = "yaml:\"prepare_gas\"" ]; + + // ExecuteGas represents the amount of gas to be used during the execution of + // the oracle script + uint64 execute_gas = 5 [ (gogoproto.moretags) = "yaml:\"execute_gas\"" ]; + + // FeeAmount represents the amount of fees to be payed in order to execute the + // oracle script + repeated cosmos.base.v1beta1.Coin fee_amount = 6 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"fee_amount\"" + ]; +} diff --git a/x/profiles/legacy/v200/models_params.go b/x/profiles/legacy/v200/models_params.go new file mode 100644 index 0000000000..763fb56bf6 --- /dev/null +++ b/x/profiles/legacy/v200/models_params.go @@ -0,0 +1,59 @@ +package v200 + +import ( + "github.com/cosmos/cosmos-sdk/codec" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/desmos-labs/desmos/v2/x/profiles/types" +) + +// ParamKeyTable Key declaration for parameters +func ParamKeyTable() paramstypes.KeyTable { + return paramstypes.NewKeyTable(). + RegisterParamSet(&Params{}) +} + +// ParamSetPairs implements the ParamSet interface and returns the key/value pairs +// of profile module's parameters. +func (params *Params) ParamSetPairs() paramstypes.ParamSetPairs { + return paramstypes.ParamSetPairs{ + paramstypes.NewParamSetPair(types.NicknameParamsKey, ¶ms.Nickname, types.ValidateNicknameParams), + paramstypes.NewParamSetPair(types.DTagParamsKey, ¶ms.DTag, types.ValidateDTagParams), + paramstypes.NewParamSetPair(types.BioParamsKey, ¶ms.Bio, types.ValidateBioParams), + paramstypes.NewParamSetPair(types.OracleParamsKey, ¶ms.Oracle, types.ValidateOracleParams), + } +} + +func DefaultParams() Params { + nicknameParams := types.DefaultNicknameParams() + dTagParams := types.DefaultDTagParams() + bioParams := types.DefaultBioParams() + oracleParams := types.DefaultOracleParams() + + return Params{ + Nickname: NicknameParams{ + MinLength: nicknameParams.MinLength, + MaxLength: nicknameParams.MaxLength, + }, + DTag: DTagParams{ + RegEx: dTagParams.RegEx, + MinLength: dTagParams.MinLength, + MaxLength: dTagParams.MaxLength, + }, + Bio: BioParams{ + MaxLength: bioParams.MaxLength, + }, + Oracle: OracleParams{ + ScriptID: oracleParams.ScriptID, + AskCount: oracleParams.AskCount, + MinCount: oracleParams.MinCount, + PrepareGas: oracleParams.PrepareGas, + ExecuteGas: oracleParams.ExecuteGas, + FeeAmount: oracleParams.FeeAmount, + }, + } +} + +// MustMarshalAppLinksParams serializes the given application links params using the provided BinaryCodec +func MustMarshalAppLinksParams(cdc codec.BinaryCodec, params Params) []byte { + return cdc.MustMarshal(¶ms) +} diff --git a/x/profiles/legacy/v200/models_params.pb.go b/x/profiles/legacy/v200/models_params.pb.go new file mode 100644 index 0000000000..1ee3c0a65b --- /dev/null +++ b/x/profiles/legacy/v200/models_params.pb.go @@ -0,0 +1,1450 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/legacy/v200/models_params.proto + +package v200 + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params contains the parameters for the profiles module +type Params struct { + Nickname NicknameParams `protobuf:"bytes,1,opt,name=nickname,proto3" json:"nickname" yaml:"nickname"` + DTag DTagParams `protobuf:"bytes,2,opt,name=dtag,proto3" json:"dtag" yaml:"dtag"` + Bio BioParams `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio" yaml:"bio"` + Oracle OracleParams `protobuf:"bytes,4,opt,name=oracle,proto3" json:"oracle" yaml:"oracle"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_25d12bc4496b54d5, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +// NicknameParams defines the parameters related to the profiles nicknames +type NicknameParams struct { + MinLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=min_length,json=minLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_length" yaml:"min_length"` + MaxLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=max_length,json=maxLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_length" yaml:"max_length"` +} + +func (m *NicknameParams) Reset() { *m = NicknameParams{} } +func (m *NicknameParams) String() string { return proto.CompactTextString(m) } +func (*NicknameParams) ProtoMessage() {} +func (*NicknameParams) Descriptor() ([]byte, []int) { + return fileDescriptor_25d12bc4496b54d5, []int{1} +} +func (m *NicknameParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NicknameParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NicknameParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NicknameParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_NicknameParams.Merge(m, src) +} +func (m *NicknameParams) XXX_Size() int { + return m.Size() +} +func (m *NicknameParams) XXX_DiscardUnknown() { + xxx_messageInfo_NicknameParams.DiscardUnknown(m) +} + +var xxx_messageInfo_NicknameParams proto.InternalMessageInfo + +// DTagParams defines the parameters related to profile DTags +type DTagParams struct { + RegEx string `protobuf:"bytes,1,opt,name=reg_ex,json=regEx,proto3" json:"reg_ex,omitempty" yaml:"reg_ex"` + MinLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=min_length,json=minLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_length" yaml:"min_length"` + MaxLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=max_length,json=maxLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_length" yaml:"max_length"` +} + +func (m *DTagParams) Reset() { *m = DTagParams{} } +func (m *DTagParams) String() string { return proto.CompactTextString(m) } +func (*DTagParams) ProtoMessage() {} +func (*DTagParams) Descriptor() ([]byte, []int) { + return fileDescriptor_25d12bc4496b54d5, []int{2} +} +func (m *DTagParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DTagParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DTagParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DTagParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_DTagParams.Merge(m, src) +} +func (m *DTagParams) XXX_Size() int { + return m.Size() +} +func (m *DTagParams) XXX_DiscardUnknown() { + xxx_messageInfo_DTagParams.DiscardUnknown(m) +} + +var xxx_messageInfo_DTagParams proto.InternalMessageInfo + +// BioParams defines the parameters related to profile biography +type BioParams struct { + MaxLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=max_length,json=maxLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_length" yaml:"max_length"` +} + +func (m *BioParams) Reset() { *m = BioParams{} } +func (m *BioParams) String() string { return proto.CompactTextString(m) } +func (*BioParams) ProtoMessage() {} +func (*BioParams) Descriptor() ([]byte, []int) { + return fileDescriptor_25d12bc4496b54d5, []int{3} +} +func (m *BioParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BioParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BioParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BioParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_BioParams.Merge(m, src) +} +func (m *BioParams) XXX_Size() int { + return m.Size() +} +func (m *BioParams) XXX_DiscardUnknown() { + xxx_messageInfo_BioParams.DiscardUnknown(m) +} + +var xxx_messageInfo_BioParams proto.InternalMessageInfo + +// OracleParams defines the parameters related to the oracle +// that will be used to verify the ownership of a centralized +// application account by a Desmos profile +type OracleParams struct { + // ScriptID represents the ID of the oracle script to be called to verify the + // data + ScriptID uint64 `protobuf:"varint,1,opt,name=script_id,json=scriptId,proto3" json:"script_id,omitempty" yaml:"script_id"` + // AskCount represents the number of oracles to which ask to verify the data + AskCount uint64 `protobuf:"varint,2,opt,name=ask_count,json=askCount,proto3" json:"ask_count,omitempty" yaml:"ask_count"` + // MinCount represents the minimum count of oracles that should complete the + // verification successfully + MinCount uint64 `protobuf:"varint,3,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty" yaml:"min_count"` + // PrepareGas represents the amount of gas to be used during the preparation + // stage of the oracle script + PrepareGas uint64 `protobuf:"varint,4,opt,name=prepare_gas,json=prepareGas,proto3" json:"prepare_gas,omitempty" yaml:"prepare_gas"` + // ExecuteGas represents the amount of gas to be used during the execution of + // the oracle script + ExecuteGas uint64 `protobuf:"varint,5,opt,name=execute_gas,json=executeGas,proto3" json:"execute_gas,omitempty" yaml:"execute_gas"` + // FeeAmount represents the amount of fees to be payed in order to execute the + // oracle script + FeeAmount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=fee_amount,json=feeAmount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"fee_amount" yaml:"fee_amount"` +} + +func (m *OracleParams) Reset() { *m = OracleParams{} } +func (m *OracleParams) String() string { return proto.CompactTextString(m) } +func (*OracleParams) ProtoMessage() {} +func (*OracleParams) Descriptor() ([]byte, []int) { + return fileDescriptor_25d12bc4496b54d5, []int{4} +} +func (m *OracleParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleParams.Merge(m, src) +} +func (m *OracleParams) XXX_Size() int { + return m.Size() +} +func (m *OracleParams) XXX_DiscardUnknown() { + xxx_messageInfo_OracleParams.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleParams proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "desmos.profiles.legacy.v200.Params") + proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.legacy.v200.NicknameParams") + proto.RegisterType((*DTagParams)(nil), "desmos.profiles.legacy.v200.DTagParams") + proto.RegisterType((*BioParams)(nil), "desmos.profiles.legacy.v200.BioParams") + proto.RegisterType((*OracleParams)(nil), "desmos.profiles.legacy.v200.OracleParams") +} + +func init() { + proto.RegisterFile("desmos/profiles/legacy/v200/models_params.proto", fileDescriptor_25d12bc4496b54d5) +} + +var fileDescriptor_25d12bc4496b54d5 = []byte{ + // 707 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xd3, 0x4c, + 0x1c, 0xc5, 0x73, 0x71, 0xa3, 0x78, 0xd2, 0xef, 0x83, 0x5a, 0x05, 0x42, 0x2b, 0xd9, 0xd5, 0x2c, + 0x4a, 0x10, 0xaa, 0xdd, 0x86, 0x45, 0xa5, 0x4a, 0x2c, 0x70, 0x5b, 0xa1, 0x4a, 0x05, 0x8a, 0x61, + 0x51, 0xb1, 0x31, 0x63, 0x67, 0xea, 0x5a, 0xb1, 0x3d, 0x96, 0xc7, 0xa9, 0xd2, 0x15, 0x5b, 0x96, + 0x3c, 0x01, 0x62, 0x8d, 0x78, 0x90, 0x2e, 0xbb, 0x44, 0x2c, 0x0c, 0x4a, 0xdf, 0x20, 0x4f, 0x80, + 0xe6, 0x92, 0x4b, 0x2b, 0x14, 0x0a, 0x88, 0x55, 0x26, 0xf3, 0x9f, 0xf3, 0x3b, 0x33, 0xff, 0x63, + 0x8f, 0x81, 0xd5, 0xc1, 0x34, 0x26, 0xd4, 0x4a, 0x33, 0x72, 0x14, 0x46, 0x98, 0x5a, 0x11, 0x0e, + 0x90, 0x7f, 0x6a, 0x9d, 0xb4, 0xd7, 0xd7, 0xad, 0x98, 0x74, 0x70, 0x44, 0xdd, 0x14, 0x65, 0x28, + 0xa6, 0x66, 0x9a, 0x91, 0x9c, 0x68, 0xcb, 0x42, 0x60, 0x8e, 0x04, 0xa6, 0x10, 0x98, 0x4c, 0xb0, + 0xb4, 0x18, 0x90, 0x80, 0xf0, 0x75, 0x16, 0x1b, 0x09, 0xc9, 0x92, 0xee, 0x13, 0xee, 0xe1, 0x21, + 0x8a, 0xad, 0x93, 0x0d, 0x0f, 0xe7, 0x68, 0xc3, 0xf2, 0x49, 0x98, 0x88, 0x3a, 0x1c, 0x56, 0x40, + 0xed, 0x80, 0x7b, 0x68, 0x6f, 0x40, 0x3d, 0x09, 0xfd, 0x6e, 0x82, 0x62, 0xdc, 0x2c, 0xaf, 0x94, + 0x5b, 0x8d, 0xf6, 0x03, 0x73, 0x86, 0xa1, 0xf9, 0x4c, 0x2e, 0x16, 0x72, 0xfb, 0xce, 0x59, 0x61, + 0x94, 0x86,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xc8, 0x03, 0x7e, 0xa8, 0x00, 0x30, 0x09, + 0x50, 0x6b, 0x81, 0x5a, 0x86, 0x03, 0x17, 0xf7, 0xf9, 0xc1, 0x54, 0x7b, 0x61, 0xd2, 0x20, 0x31, + 0x0f, 0x9d, 0xb9, 0x0c, 0x07, 0xbb, 0x7d, 0x8d, 0x5c, 0x6a, 0x83, 0xd8, 0xe2, 0xc1, 0xef, 0x6d, + 0x71, 0x50, 0x18, 0xea, 0xd3, 0xd1, 0x99, 0x7f, 0xd9, 0x13, 0x72, 0xa9, 0x27, 0xd5, 0x3f, 0x36, + 0x1c, 0x35, 0xe0, 0x9a, 0x0d, 0xea, 0x01, 0x75, 0xfc, 0x1c, 0x5e, 0xc9, 0xa5, 0xfa, 0x0f, 0x73, + 0xf9, 0x5c, 0x05, 0xf3, 0xd3, 0x8f, 0xab, 0xf6, 0x08, 0xa8, 0xd4, 0xcf, 0xc2, 0x34, 0x77, 0xc3, + 0x0e, 0x0f, 0x47, 0xb1, 0x57, 0x06, 0x85, 0x51, 0x7f, 0xc9, 0x27, 0xf7, 0x76, 0x86, 0x85, 0x71, + 0x53, 0x70, 0xc7, 0xcb, 0xa0, 0x53, 0x17, 0xe3, 0xbd, 0x8e, 0xb6, 0x01, 0x54, 0x44, 0xbb, 0xae, + 0x4f, 0x7a, 0x49, 0xce, 0xd3, 0x52, 0xec, 0xc5, 0x89, 0x64, 0x5c, 0x82, 0x4e, 0x1d, 0xd1, 0xee, + 0x36, 0x1b, 0x32, 0x09, 0x8b, 0x42, 0x48, 0xaa, 0x57, 0x25, 0xe3, 0x12, 0x74, 0xea, 0x71, 0x98, + 0x08, 0xc9, 0x26, 0x68, 0xa4, 0x19, 0x4e, 0x51, 0x86, 0xdd, 0x00, 0x51, 0xfe, 0x4e, 0x2a, 0xf6, + 0xed, 0x61, 0x61, 0x68, 0x42, 0x34, 0x55, 0x84, 0x0e, 0x90, 0xff, 0x9e, 0x20, 0xca, 0x84, 0xb8, + 0x8f, 0xfd, 0x5e, 0x2e, 0x84, 0x73, 0x57, 0x85, 0x53, 0x45, 0xe8, 0x00, 0xf9, 0x8f, 0x09, 0xdf, + 0x02, 0x70, 0x84, 0xb1, 0x8b, 0x62, 0xbe, 0xcb, 0xda, 0x4a, 0xb5, 0xd5, 0x68, 0xdf, 0x35, 0x45, + 0xe3, 0x4d, 0x76, 0x95, 0x9a, 0xf2, 0x2a, 0x35, 0xb7, 0x49, 0x98, 0xd8, 0xbb, 0xf2, 0xa5, 0x97, + 0x11, 0x4c, 0xa4, 0xf0, 0xd3, 0x37, 0xa3, 0x75, 0x8d, 0x04, 0x19, 0x85, 0x3a, 0xea, 0x11, 0xc6, + 0x8f, 0xb9, 0x4e, 0xc4, 0x65, 0xbf, 0x38, 0x1b, 0xe8, 0xe5, 0xf3, 0x81, 0x5e, 0xfe, 0x3e, 0xd0, + 0xcb, 0xef, 0x2f, 0xf4, 0xd2, 0xf9, 0x85, 0x5e, 0xfa, 0x72, 0xa1, 0x97, 0x5e, 0x6f, 0x4e, 0x41, + 0xc5, 0xdd, 0xb4, 0x16, 0x21, 0x8f, 0x8e, 0xbe, 0x28, 0x27, 0x6d, 0xab, 0xff, 0xd3, 0xcf, 0x8a, + 0x57, 0xe3, 0xd7, 0xfe, 0xc3, 0x1f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xac, 0xba, 0xea, 0xc3, 0x7c, + 0x06, 0x00, 0x00, +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Oracle.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Bio.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.DTag.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Nickname.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NicknameParams) 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 *NicknameParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NicknameParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MaxLength.Size() + i -= size + if _, err := m.MaxLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.MinLength.Size() + i -= size + if _, err := m.MinLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DTagParams) 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 *DTagParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DTagParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MaxLength.Size() + i -= size + if _, err := m.MaxLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.MinLength.Size() + i -= size + if _, err := m.MinLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.RegEx) > 0 { + i -= len(m.RegEx) + copy(dAtA[i:], m.RegEx) + i = encodeVarintModelsParams(dAtA, i, uint64(len(m.RegEx))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BioParams) 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 *BioParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BioParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MaxLength.Size() + i -= size + if _, err := m.MaxLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} + +func (m *OracleParams) 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 *OracleParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FeeAmount) > 0 { + for iNdEx := len(m.FeeAmount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FeeAmount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.ExecuteGas != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.ExecuteGas)) + i-- + dAtA[i] = 0x28 + } + if m.PrepareGas != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.PrepareGas)) + i-- + dAtA[i] = 0x20 + } + if m.MinCount != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.MinCount)) + i-- + dAtA[i] = 0x18 + } + if m.AskCount != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.AskCount)) + i-- + dAtA[i] = 0x10 + } + if m.ScriptID != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.ScriptID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsParams(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Nickname.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.DTag.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.Bio.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.Oracle.Size() + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + +func (m *NicknameParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MinLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.MaxLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + +func (m *DTagParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RegEx) + if l > 0 { + n += 1 + l + sovModelsParams(uint64(l)) + } + l = m.MinLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.MaxLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + +func (m *BioParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MaxLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + +func (m *OracleParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ScriptID != 0 { + n += 1 + sovModelsParams(uint64(m.ScriptID)) + } + if m.AskCount != 0 { + n += 1 + sovModelsParams(uint64(m.AskCount)) + } + if m.MinCount != 0 { + n += 1 + sovModelsParams(uint64(m.MinCount)) + } + if m.PrepareGas != 0 { + n += 1 + sovModelsParams(uint64(m.PrepareGas)) + } + if m.ExecuteGas != 0 { + n += 1 + sovModelsParams(uint64(m.ExecuteGas)) + } + if len(m.FeeAmount) > 0 { + for _, e := range m.FeeAmount { + l = e.Size() + n += 1 + l + sovModelsParams(uint64(l)) + } + } + return n +} + +func sovModelsParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsParams(x uint64) (n int) { + return sovModelsParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowModelsParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nickname", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Nickname.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DTag", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DTag.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bio", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Bio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Oracle", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Oracle.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NicknameParams) 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 ErrIntOverflowModelsParams + } + 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: NicknameParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NicknameParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DTagParams) 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 ErrIntOverflowModelsParams + } + 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: DTagParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DTagParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegEx", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + 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 ErrInvalidLengthModelsParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RegEx = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BioParams) 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 ErrIntOverflowModelsParams + } + 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: BioParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BioParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleParams) 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 ErrIntOverflowModelsParams + } + 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: OracleParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OracleParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ScriptID", wireType) + } + m.ScriptID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ScriptID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AskCount", wireType) + } + m.AskCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AskCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) + } + m.MinCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PrepareGas", wireType) + } + m.PrepareGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PrepareGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecuteGas", wireType) + } + m.ExecuteGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExecuteGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeAmount = append(m.FeeAmount, types.Coin{}) + if err := m.FeeAmount[len(m.FeeAmount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsParams(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, ErrIntOverflowModelsParams + } + 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, ErrIntOverflowModelsParams + } + 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, ErrIntOverflowModelsParams + } + 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, ErrInvalidLengthModelsParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v231/store_test.go b/x/profiles/legacy/v231/store_test.go index 01f8bff8f9..f29ab28a21 100644 --- a/x/profiles/legacy/v231/store_test.go +++ b/x/profiles/legacy/v231/store_test.go @@ -1,7 +1,9 @@ package v231_test import ( - v100 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v100" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + v231 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v231" + "github.com/stretchr/testify/require" "testing" "time" @@ -15,17 +17,27 @@ import ( func TestStoreMigration(t *testing.T) { cdc, _ := app.MakeCodecs() profilesKey := sdk.NewKVStoreKey("profiles") - ctx := testutil.DefaultContext(profilesKey, sdk.NewTransientStoreKey("transient_test")) + transientKey := sdk.NewTransientStoreKey("profiles_transient") + ctx := testutil.DefaultContext(profilesKey, transientKey) + + /// setup params + params := v200.DefaultParams() + paramsSpace := paramstypes.NewSubspace(cdc, nil, profilesKey, transientKey, "profiles") + paramsSpace = paramsSpace.WithKeyTable(v200.ParamKeyTable()) + pairs := params.ParamSetPairs() + paramsSpace.SetParamSet(ctx, ¶ms) + store := ctx.KVStore(profilesKey) testCases := []struct { - name string - key []byte - oldValue []byte - newValue []byte + name string + key []byte + oldValue []byte + newValue []byte + expectedParams types.Params }{ { - name: "Application links migrated correctly", + name: "Store migration works correctly", key: types.UserApplicationLinkKey( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "twitter", @@ -58,15 +70,27 @@ func TestStoreMigration(t *testing.T) { time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), time.Date(2022, 3, 1, 00, 00, 00, 000, time.UTC), )), + expectedParams: types.DefaultParams(), }, - { - name: "Profiles params are migrated correctly", - key: v100.Params{ - Nickname: v100.NicknameParams{}, - DTag: v100.DTagParams{}, - Bio: v100.BioParams{}, - Oracle: v100.OracleParams{}, - }, - }, + } + + // Set all the old values to the store + for _, tc := range testCases { + store.Set(tc.key, tc.oldValue) + } + + // Run migrations + err := v231.MigrateStore(ctx, profilesKey, paramsSpace, cdc) + require.NoError(t, err) + + paramsSpace.GetParamSet(ctx, ¶ms) + + // Make sure the new values are set properly + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + require.Equal(t, tc.expectedParams, params) + require.Equal(t, tc.newValue, store.Get(tc.key)) + }) } } From dfe9ebaec50d8f83917fdd621889d6456bd47fe2 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Thu, 20 Jan 2022 20:15:48 +0100 Subject: [PATCH 007/112] fixed migration errors fixed some bugs in the expiration time calculation --- go.mod | 2 +- go.sum | 4 +- x/profiles/keeper/migrations.go | 4 +- x/profiles/keeper/migrations_test.go | 103 ---------------------- x/profiles/legacy/v200/models_params.go | 97 ++++++++++++++++++-- x/profiles/legacy/v210/store.go | 2 +- x/profiles/legacy/v230/codec.go | 2 +- x/profiles/legacy/v231/store.go | 34 +++++-- x/profiles/legacy/v231/store_test.go | 18 ++-- x/profiles/simulation/decoder.go | 8 +- x/profiles/simulation/decoder_test.go | 11 +++ x/profiles/simulation/params.go | 6 ++ x/profiles/types/models_app_links.go | 5 +- x/profiles/types/models_app_links_test.go | 4 +- x/profiles/types/models_chain_links.go | 2 +- x/profiles/types/models_params.go | 2 +- 16 files changed, 163 insertions(+), 141 deletions(-) delete mode 100644 x/profiles/keeper/migrations_test.go diff --git a/go.mod b/go.mod index 680de81f1d..71c951961d 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 -replace github.com/cosmos/cosmos-sdk => github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20211206072111-16bfceb83430 +replace github.com/cosmos/cosmos-sdk => github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20220120152131-faa2a9289a52 replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index 61cd799232..233df79966 100644 --- a/go.sum +++ b/go.sum @@ -268,8 +268,8 @@ github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20211206072111-16bfceb83430 h1:3UdGRNqZ6nD+SIEtsC2K1UqNPz1jHjdfMT2EHqL7aA4= -github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20211206072111-16bfceb83430/go.mod h1:Yd070TQ78qcMJmKn1/cOLEYBkn23d0Ra1mKW1goRSB4= +github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20220120152131-faa2a9289a52 h1:UFuUQeCzlKlRQh16McgNiVc8yXXCuqmHxLKgmasNGKA= +github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20220120152131-faa2a9289a52/go.mod h1:Yd070TQ78qcMJmKn1/cOLEYBkn23d0Ra1mKW1goRSB4= github.com/desmos-labs/ledger-desmos-go v0.11.2-0.20210814121638-5d87e392e8a9 h1:b77qmphsyX3+hjJraaqLyzjt9eKqbosy4LaYScPvTAs= github.com/desmos-labs/ledger-desmos-go v0.11.2-0.20210814121638-5d87e392e8a9/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= diff --git a/x/profiles/keeper/migrations.go b/x/profiles/keeper/migrations.go index 3d31964ddd..1e0b17994a 100644 --- a/x/profiles/keeper/migrations.go +++ b/x/profiles/keeper/migrations.go @@ -80,7 +80,9 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error { // Migrate4to5 migrates from version 4 to 5 func (m Migrator) Migrate4to5(ctx sdk.Context) error { - return v231.MigrateStore(ctx, m.keeper.StoreKey, m.keeper.paramSubspace, m.keeper.Cdc) + updatedParamSpace, err := v231.MigrateStore(ctx, m.keeper.StoreKey, m.keeper.paramSubspace, m.keeper.Cdc) + m.keeper.paramSubspace = updatedParamSpace + return err } func (m Migrator) migrateProfile(ctx sdk.Context, profile *types.Profile) error { diff --git a/x/profiles/keeper/migrations_test.go b/x/profiles/keeper/migrations_test.go deleted file mode 100644 index ce5cea064d..0000000000 --- a/x/profiles/keeper/migrations_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package keeper_test - -import ( - "time" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/desmos-labs/desmos/v2/testutil" - "github.com/desmos-labs/desmos/v2/x/profiles/keeper" - "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200" - "github.com/desmos-labs/desmos/v2/x/profiles/types" -) - -func (suite KeeperTestSuite) saveAppLinkV200(link v200.ApplicationLink) error { - if !suite.k.HasProfile(suite.ctx, link.User) { - return sdkerrors.Wrapf(types.ErrProfileNotFound, "a profile is required to link an application") - } - - // Get the keys - userApplicationLinkKey := types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username) - applicationLinkClientIDKey := types.ApplicationLinkClientIDKey(link.OracleRequest.ClientID) - - // Store the data - store := suite.ctx.KVStore(suite.k.StoreKey) - store.Set(userApplicationLinkKey, v200.MustMarshalApplicationLink(suite.k.Cdc, link)) - store.Set(applicationLinkClientIDKey, userApplicationLinkKey) - - return nil -} - -func (suite KeeperTestSuite) Test_Migrate4to5() { - suite.ctx = suite.ctx.WithBlockTime(time.Date(2022, 5, 0, 00, 00, 00, 000, time.UTC)) - ctx, _ := suite.ctx.CacheContext() - - suite.k.SetParams(ctx, types.NewParams( - types.DefaultNicknameParams(), - types.DefaultDTagParams(), - types.DefaultBioParams(), - types.DefaultOracleParams(), - types.NewAppLinksParams(time.Date(1, 1, 0, 00, 00, 00, 000, time.UTC)), - )) - - profile := testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") - suite.Require().NoError(suite.k.StoreProfile(ctx, profile)) - - v200Links := []v200.ApplicationLink{ - v200.NewApplicationLink( - "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", - v200.NewData("twitter", "twitteruser"), - v200.ApplicationLinkStateInitialized, - v200.NewOracleRequest( - 0, - 1, - v200.NewOracleRequestCallData("twitter", "calldata"), - "client_id", - ), - nil, - time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - ), - v200.NewApplicationLink( - "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", - v200.NewData("reddit", "reddituser"), - v200.ApplicationLinkStateInitialized, - v200.NewOracleRequest( - 0, - 1, - v200.NewOracleRequestCallData("reddit", "calldata"), - "client_id2", - ), - nil, - time.Date(2022, 5, 1, 00, 00, 00, 000, time.UTC), - ), - } - - expectedAppLink := types.NewApplicationLink( - "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", - types.NewData("reddit", "reddituser"), - types.ApplicationLinkStateInitialized, - types.NewOracleRequest( - 0, - 1, - types.NewOracleRequestCallData("reddit", "calldata"), - "client_id2", - ), - nil, - time.Date(2022, 5, 1, 00, 00, 00, 000, time.UTC), - time.Date(2023, 6, 1, 00, 00, 00, 000, time.UTC), - ) - - suite.ctx = ctx - for _, link := range v200Links { - err := suite.saveAppLinkV200(link) - suite.Require().NoError(err) - } - - migrator := keeper.NewMigrator(suite.k, suite.legacyAminoCdc, nil) - - err := migrator.Migrate4to5(suite.ctx) - suite.Require().NoError(err) - - migratedAppLinks := suite.k.GetApplicationLinks(suite.ctx) - - suite.Require().Equal([]types.ApplicationLink{expectedAppLink}, migratedAppLinks) -} diff --git a/x/profiles/legacy/v200/models_params.go b/x/profiles/legacy/v200/models_params.go index 763fb56bf6..43aadc1cec 100644 --- a/x/profiles/legacy/v200/models_params.go +++ b/x/profiles/legacy/v200/models_params.go @@ -1,7 +1,9 @@ package v200 import ( - "github.com/cosmos/cosmos-sdk/codec" + "fmt" + "strings" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/desmos-labs/desmos/v2/x/profiles/types" ) @@ -16,10 +18,10 @@ func ParamKeyTable() paramstypes.KeyTable { // of profile module's parameters. func (params *Params) ParamSetPairs() paramstypes.ParamSetPairs { return paramstypes.ParamSetPairs{ - paramstypes.NewParamSetPair(types.NicknameParamsKey, ¶ms.Nickname, types.ValidateNicknameParams), - paramstypes.NewParamSetPair(types.DTagParamsKey, ¶ms.DTag, types.ValidateDTagParams), - paramstypes.NewParamSetPair(types.BioParamsKey, ¶ms.Bio, types.ValidateBioParams), - paramstypes.NewParamSetPair(types.OracleParamsKey, ¶ms.Oracle, types.ValidateOracleParams), + paramstypes.NewParamSetPair(types.NicknameParamsKey, ¶ms.Nickname, ValidateNicknameParams), + paramstypes.NewParamSetPair(types.DTagParamsKey, ¶ms.DTag, ValidateDTagParams), + paramstypes.NewParamSetPair(types.BioParamsKey, ¶ms.Bio, ValidateBioParams), + paramstypes.NewParamSetPair(types.OracleParamsKey, ¶ms.Oracle, ValidateOracleParams), } } @@ -53,7 +55,86 @@ func DefaultParams() Params { } } -// MustMarshalAppLinksParams serializes the given application links params using the provided BinaryCodec -func MustMarshalAppLinksParams(cdc codec.BinaryCodec, params Params) []byte { - return cdc.MustMarshal(¶ms) +func ValidateNicknameParams(i interface{}) error { + params, areNicknameParams := i.(NicknameParams) + if !areNicknameParams { + return fmt.Errorf("invalid parameters type: %s", i) + } + + minLength := params.MinLength + if minLength.IsNil() || minLength.LT(types.DefaultMinNicknameLength) { + return fmt.Errorf("invalid minimum nickname length param: %s", minLength) + } + + // TODO make sense to cap this? I've done this thinking "what's the sense of having names higher that 1000 chars?" + maxLength := params.MaxLength + if maxLength.IsNil() || maxLength.IsNegative() || maxLength.GT(types.DefaultMaxNicknameLength) { + return fmt.Errorf("invalid max nickname length param: %s", maxLength) + } + + return nil +} + +func ValidateBioParams(i interface{}) error { + bioParams, isBioParams := i.(BioParams) + if !isBioParams { + return fmt.Errorf("invalid parameters type: %s", i) + } + + if bioParams.MaxLength.IsNegative() { + return fmt.Errorf("invalid max bio length param: %s", bioParams.MaxLength) + } + + return nil +} + +func ValidateDTagParams(i interface{}) error { + params, isDtagParams := i.(DTagParams) + if !isDtagParams { + return fmt.Errorf("invalid parameters type: %s", i) + } + + if len(strings.TrimSpace(params.RegEx)) == 0 { + return fmt.Errorf("empty dTag regEx param") + } + + if params.MinLength.IsNegative() || params.MinLength.LT(types.DefaultMinDTagLength) { + return fmt.Errorf("invalid minimum dTag length param: %s", params.MinLength) + } + + if params.MaxLength.IsNegative() { + return fmt.Errorf("invalid max dTag length param: %s", params.MaxLength) + } + + return nil +} + +func ValidateOracleParams(i interface{}) error { + params, isOracleParams := i.(OracleParams) + if !isOracleParams { + return fmt.Errorf("invalid parameters type: %s", i) + } + + if params.AskCount < params.MinCount { + return fmt.Errorf("invalid ask count: %d, min count: %d", params.AskCount, params.MinCount) + } + + if params.MinCount <= 0 { + return fmt.Errorf("invalid min count: %d", params.MinCount) + } + + if params.PrepareGas <= 0 { + return fmt.Errorf("invalid prepare gas: %d", params.PrepareGas) + } + + if params.ExecuteGas <= 0 { + return fmt.Errorf("invalid execute gas: %d", params.ExecuteGas) + } + + err := params.FeeAmount.Validate() + if err != nil { + return err + } + + return nil } diff --git a/x/profiles/legacy/v210/store.go b/x/profiles/legacy/v210/store.go index f317026988..cba6bc426d 100644 --- a/x/profiles/legacy/v210/store.go +++ b/x/profiles/legacy/v210/store.go @@ -2,9 +2,9 @@ package v210 import ( "encoding/hex" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - v200 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200" v230 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v230" "github.com/desmos-labs/desmos/v2/x/profiles/types" diff --git a/x/profiles/legacy/v230/codec.go b/x/profiles/legacy/v230/codec.go index 6dbc6cae75..40a506948e 100644 --- a/x/profiles/legacy/v230/codec.go +++ b/x/profiles/legacy/v230/codec.go @@ -1,7 +1,7 @@ package v230 import ( - types "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/codec/types" ) func RegisterInterfaces(registry types.InterfaceRegistry) { diff --git a/x/profiles/legacy/v231/store.go b/x/profiles/legacy/v231/store.go index af656ee95e..15200c2f25 100644 --- a/x/profiles/legacy/v231/store.go +++ b/x/profiles/legacy/v231/store.go @@ -14,17 +14,17 @@ import ( // migration includes: // - Add the AppLinkParams to the params set // - Added expiration time to all app links -func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, subspace paramstypes.Subspace, cdc codec.BinaryCodec) error { +func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, subspace paramstypes.Subspace, cdc codec.BinaryCodec) (paramstypes.Subspace, error) { store := ctx.KVStore(storeKey) - migrateParams(ctx, subspace) + updatedSubspace := migrateParams(ctx, subspace) err := migrateAppLinks(store, cdc) if err != nil { - return err + return paramstypes.Subspace{}, err } - return nil + return updatedSubspace, nil } func migrateAppLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { @@ -91,7 +91,27 @@ func migrateAppLinkResult(r *v200.Result) *types.Result { } // migrateParams add the AppLinksParams to the params set -func migrateParams(ctx sdk.Context, subspace paramstypes.Subspace) { - appLinkParams := types.DefaultAppLinksParams() - subspace.Set(ctx, types.AppLinksParamsKey, &appLinkParams) +func migrateParams(ctx sdk.Context, subspace paramstypes.Subspace) paramstypes.Subspace { + var params v200.Params + subspace.GetParamSet(ctx, ¶ms) + + newParams := types.NewParams( + types.NewNicknameParams(params.Nickname.MinLength, params.Nickname.MaxLength), + types.NewDTagParams(params.DTag.RegEx, params.DTag.MinLength, params.DTag.MaxLength), + types.NewBioParams(params.Bio.MaxLength), + types.NewOracleParams( + params.Oracle.ScriptID, + params.Oracle.AskCount, + params.Oracle.MinCount, + params.Oracle.PrepareGas, + params.Oracle.ExecuteGas, + params.Oracle.FeeAmount..., + ), + types.DefaultAppLinksParams(), + ) + + subspace = subspace.UpdateKeyTable(types.ParamKeyTable()) + subspace.SetParamSet(ctx, &newParams) + + return subspace } diff --git a/x/profiles/legacy/v231/store_test.go b/x/profiles/legacy/v231/store_test.go index f29ab28a21..16660d6124 100644 --- a/x/profiles/legacy/v231/store_test.go +++ b/x/profiles/legacy/v231/store_test.go @@ -15,16 +15,15 @@ import ( ) func TestStoreMigration(t *testing.T) { - cdc, _ := app.MakeCodecs() + cdc, legacyAminoCdc := app.MakeCodecs() profilesKey := sdk.NewKVStoreKey("profiles") transientKey := sdk.NewTransientStoreKey("profiles_transient") ctx := testutil.DefaultContext(profilesKey, transientKey) - /// setup params + /// setup legacy params params := v200.DefaultParams() - paramsSpace := paramstypes.NewSubspace(cdc, nil, profilesKey, transientKey, "profiles") + paramsSpace := paramstypes.NewSubspace(cdc, legacyAminoCdc, profilesKey, transientKey, "profiles") paramsSpace = paramsSpace.WithKeyTable(v200.ParamKeyTable()) - pairs := params.ParamSetPairs() paramsSpace.SetParamSet(ctx, ¶ms) store := ctx.KVStore(profilesKey) @@ -54,7 +53,7 @@ func TestStoreMigration(t *testing.T) { "client_id", ), v200.NewSuccessResult("76616c7565", "signature"), // The value should be HEX - time.Date(2022, 1, 0, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), )), newValue: types.MustMarshalApplicationLink(cdc, types.NewApplicationLink( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", @@ -68,7 +67,7 @@ func TestStoreMigration(t *testing.T) { ), types.NewSuccessResult("76616c7565", "signature"), // The value should be HEX time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2022, 3, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 4, 1, 00, 00, 00, 000, time.UTC), )), expectedParams: types.DefaultParams(), }, @@ -80,16 +79,17 @@ func TestStoreMigration(t *testing.T) { } // Run migrations - err := v231.MigrateStore(ctx, profilesKey, paramsSpace, cdc) + updateParamSpace, err := v231.MigrateStore(ctx, profilesKey, paramsSpace, cdc) require.NoError(t, err) - paramsSpace.GetParamSet(ctx, ¶ms) + var newParams types.Params + updateParamSpace.GetParamSet(ctx, &newParams) // Make sure the new values are set properly for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - require.Equal(t, tc.expectedParams, params) + require.Equal(t, tc.expectedParams, newParams) require.Equal(t, tc.newValue, store.Get(tc.key)) }) } diff --git a/x/profiles/simulation/decoder.go b/x/profiles/simulation/decoder.go index 5aa1685bf2..97259de718 100644 --- a/x/profiles/simulation/decoder.go +++ b/x/profiles/simulation/decoder.go @@ -7,7 +7,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" - "github.com/desmos-labs/desmos/v2/x/profiles/types" ) @@ -54,7 +53,12 @@ func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string { cdc.MustUnmarshal(kvB.Value, &applicationLinkB) return fmt.Sprintf("Application link A: %s\nApplication link B: %s\n", applicationLinkA.String(), applicationLinkB.String()) - + case bytes.HasPrefix(kvA.Key, types.ExpiringAppLinkTimePrefix): + var clientIDA, clientIDB string + clientIDA = string(kvA.Value) + clientIDB = string(kvB.Value) + return fmt.Sprintf("Client ID A: %s\nClient ID B: %s\n", + clientIDA, clientIDB) default: panic(fmt.Sprintf("unexpected %s key %X (%s)", types.ModuleName, kvA.Key, kvA.Key)) } diff --git a/x/profiles/simulation/decoder_test.go b/x/profiles/simulation/decoder_test.go index 5418918a19..8c09b42b01 100644 --- a/x/profiles/simulation/decoder_test.go +++ b/x/profiles/simulation/decoder_test.go @@ -3,6 +3,7 @@ package simulation_test import ( "fmt" "testing" + "time" sdk "github.com/cosmos/cosmos-sdk/types" @@ -42,6 +43,8 @@ func TestDecodeStore(t *testing.T) { "4e188d9c17150037d5199bbdb91ae1eb2a78a15aca04cb35530cccb81494b36e", ) + clientID := "client_id" + kvPairs := kv.Pairs{Pairs: []kv.Pair{ { Key: types.DTagStoreKey("AAkvohxhflhXsuyMg"), @@ -70,6 +73,13 @@ func TestDecodeStore(t *testing.T) { ), Value: cdc.MustMarshal(&userBlock), }, + { + Key: types.ApplicationLinkExpiringTimeKey( + time.Date(2022, 1, 1, 0, 0, 00, 000, time.UTC), + clientID, + ), + Value: []byte(clientID), + }, }} tests := []struct { @@ -80,6 +90,7 @@ func TestDecodeStore(t *testing.T) { {"DTag transfer request", fmt.Sprintf("RequestA: %s\nRequestB: %s\n", request, request)}, {"Relationship", fmt.Sprintf("Relationships A: %s\nRelationships B: %s\n", relationship, relationship)}, {"User block", fmt.Sprintf("User block A: %s\nUser block B: %s\n", userBlock, userBlock)}, + {"ClientID", fmt.Sprintf("Client ID A: %s\nClient ID B: %s\n", clientID, clientID)}, {"other", ""}, } diff --git a/x/profiles/simulation/params.go b/x/profiles/simulation/params.go index 231afc8584..9c9e6a2cb0 100644 --- a/x/profiles/simulation/params.go +++ b/x/profiles/simulation/params.go @@ -49,5 +49,11 @@ func ParamChanges(r *rand.Rand) []simtypes.ParamChange { ) }, ), + simulation.NewSimParamChange(types.ModuleName, string(types.AppLinksParamsKey), + func(r *rand.Rand) string { + params := RandomAppLinksParams(r) + return fmt.Sprintf(`"expiration_time":"%v"`, params.ExpirationTime) + }, + ), } } diff --git a/x/profiles/types/models_app_links.go b/x/profiles/types/models_app_links.go index 089f13af85..8482cdc0ac 100644 --- a/x/profiles/types/models_app_links.go +++ b/x/profiles/types/models_app_links.go @@ -28,8 +28,9 @@ func NewApplicationLink( // CalculateExpirationTime calculate the expiration time for an application link by adding the expirationTime parameter // to the app link creationTime func CalculateExpirationTime(creationTime time.Time, expirationTimeParam time.Time) time.Time { - y, m, d := expirationTimeParam.Date() - return creationTime.AddDate(y, int(m), d) + m := expirationTimeParam.Month() + result := creationTime.AddDate(0, int(m), 0) + return result } // Validate returns an error if the instance does not contain valid data diff --git a/x/profiles/types/models_app_links_test.go b/x/profiles/types/models_app_links_test.go index effc2eb966..6cebb93930 100644 --- a/x/profiles/types/models_app_links_test.go +++ b/x/profiles/types/models_app_links_test.go @@ -18,8 +18,8 @@ func TestCalculateExpirationTime(t *testing.T) { }{ { name: "calculate expiration time correctly", - creationTime: time.Date(2022, 1, 0, 00, 00, 00, 000, time.UTC), - expirationTimeParam: time.Date(0, 3, 0, 00, 00, 00, 000, time.UTC), + creationTime: time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + expirationTimeParam: time.Date(0, 3, 1, 00, 00, 00, 000, time.UTC), expectedExpirationTime: time.Date(2022, 4, 1, 0, 00, 00, 000, time.UTC), }, } diff --git a/x/profiles/types/models_chain_links.go b/x/profiles/types/models_chain_links.go index 69a443a348..21dbf2144b 100644 --- a/x/profiles/types/models_chain_links.go +++ b/x/profiles/types/models_chain_links.go @@ -8,7 +8,7 @@ import ( "time" "github.com/cosmos/cosmos-sdk/types/bech32" - signing "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/tendermint/tendermint/crypto/tmhash" "github.com/btcsuite/btcd/btcec" diff --git a/x/profiles/types/models_params.go b/x/profiles/types/models_params.go index 76bcd50429..5d70b05938 100644 --- a/x/profiles/types/models_params.go +++ b/x/profiles/types/models_params.go @@ -23,7 +23,7 @@ var ( DefaultMinDTagLength = sdk.NewInt(3) DefaultMaxDTagLength = sdk.NewInt(30) DefaultMaxBioLength = sdk.NewInt(1000) - DefaultAppLinksExpirationTime = time.Date(0, 3, 0, 00, 00, 00, 000, time.UTC) + DefaultAppLinksExpirationTime = time.Date(2022, 3, 1, 00, 00, 00, 000, time.UTC) ) // Parameters store keys From fd1a7dfdd12bca73f0e2bde38345d51d223200b3 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Fri, 21 Jan 2022 09:52:52 +0100 Subject: [PATCH 008/112] fixed params name in order to fix lint --- .../profiles/v1beta1/models_params.proto | 2 +- x/profiles/types/models_params.pb.go | 102 +++++++++--------- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/proto/desmos/profiles/v1beta1/models_params.proto b/proto/desmos/profiles/v1beta1/models_params.proto index 3e1d970ac6..0001c4c743 100644 --- a/proto/desmos/profiles/v1beta1/models_params.proto +++ b/proto/desmos/profiles/v1beta1/models_params.proto @@ -30,7 +30,7 @@ message Params { (gogoproto.moretags) = "yaml:\"oracle\"" ]; - AppLinksParams appLinks = 5 [ + AppLinksParams app_links = 5 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"app_links\"" ]; diff --git a/x/profiles/types/models_params.pb.go b/x/profiles/types/models_params.pb.go index 3087b55dcb..d598ede505 100644 --- a/x/profiles/types/models_params.pb.go +++ b/x/profiles/types/models_params.pb.go @@ -35,7 +35,7 @@ type Params struct { DTag DTagParams `protobuf:"bytes,2,opt,name=dtag,proto3" json:"dtag" yaml:"dtag"` Bio BioParams `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio" yaml:"bio"` Oracle OracleParams `protobuf:"bytes,4,opt,name=oracle,proto3" json:"oracle" yaml:"oracle"` - AppLinks AppLinksParams `protobuf:"bytes,5,opt,name=appLinks,proto3" json:"appLinks" yaml:"app_links"` + AppLinks AppLinksParams `protobuf:"bytes,5,opt,name=app_links,json=appLinks,proto3" json:"app_links" yaml:"app_links"` } func (m *Params) Reset() { *m = Params{} } @@ -296,57 +296,57 @@ func init() { } var fileDescriptor_a621950d5c07fbad = []byte{ - // 798 bytes of a gzipped FileDescriptorProto + // 800 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xeb, 0x44, - 0x18, 0xc7, 0x93, 0x3a, 0x8d, 0x92, 0xc9, 0xa1, 0xa5, 0x56, 0x69, 0x43, 0x91, 0xe2, 0x6a, 0x10, - 0x10, 0x09, 0xd5, 0x56, 0xca, 0x02, 0xa9, 0x12, 0x8b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x3c, 0x82, 0x05, 0x06, 0x3a, 0x25, 0x51, 0xef, 0x83, 0xda, 0x20, 0x43, 0x41, 0x7b, 0x4d, 0x90, - 0x3f, 0x5c, 0x49, 0x3e, 0xed, 0xa3, 0x40, 0x51, 0x3f, 0xe0, 0xd4, 0x69, 0x6e, 0xd4, 0xf8, 0xdc, - 0x2c, 0x37, 0x5a, 0x92, 0xce, 0x31, 0xd0, 0x11, 0x34, 0xfd, 0x2b, 0xa0, 0x79, 0x84, 0xb6, 0x35, - 0x01, 0x85, 0x2b, 0xa1, 0x36, 0xa1, 0x8a, 0xa9, 0xab, 0x48, 0x81, 0x64, 0x79, 0x84, 0x42, 0x87, - 0x23, 0xf4, 0x3e, 0xa8, 0xd3, 0x14, 0xf9, 0x21, 0x6e, 0xd7, 0x04, 0xec, 0xa3, 0x95, 0xb0, 0xef, - 0x84, 0x99, 0xe2, 0xbd, 0xa7, 0x78, 0xef, 0x48, 0x9e, 0x44, 0x40, 0x47, 0xb1, 0xf4, 0x9f, 0x40, - 0x03, 0x25, 0xc9, 0x05, 0x89, 0x47, 0xac, 0xbd, 0xfe, 0x42, 0x4d, 0x8f, 0x95, 0xa1, 0x22, 0xb7, - 0x15, 0xf9, 0x5d, 0x49, 0x46, 0x49, 0xe2, 0x86, 0x7c, 0x19, 0x3a, 0x25, 0xf2, 0xa8, 0xf6, 0xf3, - 0xaf, 0x46, 0x05, 0xe6, 0x55, 0xb0, 0xb1, 0xdc, 0x10, 0xdd, 0x03, 0x20, 0x22, 0xb1, 0x1b, 0xe2, - 0x38, 0xc8, 0xae, 0x44, 0x37, 0xdf, 0xd8, 0x27, 0x1c, 0xf8, 0x57, 0x6e, 0x7c, 0x1c, 0x90, 0xec, - 0x6a, 0xec, 0x99, 0x3e, 0x8d, 0x2c, 0xb5, 0x7d, 0xe4, 0xe7, 0x80, 0x0d, 0x46, 0x56, 0x76, 0x93, - 0x60, 0x66, 0x9e, 0xc7, 0xd9, 0x2c, 0x37, 0xb6, 0xa4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0xae, 0x0f, 0xad, 0xc9, 0xfc, 0xfd, 0x14, 0x49, 0x7a, 0x75, 0x11, 0xda, 0x67, - 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x19, 0x69, 0x42, 0x5f, 0x07, 0x00, 0x00, + 0x18, 0xc7, 0x93, 0x3a, 0x8d, 0xe2, 0xc9, 0xa1, 0x87, 0x63, 0x1d, 0x4e, 0x43, 0x91, 0xe2, 0x6a, + 0x10, 0x10, 0x09, 0xd5, 0x56, 0xca, 0x02, 0xa9, 0x12, 0x8b, 0xba, 0xad, 0xa0, 0xa2, 0x40, 0x65, + 0xb2, 0x42, 0x08, 0x6b, 0xec, 0x4c, 0xdc, 0x51, 0x6c, 0x8f, 0xe5, 0x71, 0xaa, 0x74, 0xd5, 0x2d, + 0xcb, 0x3e, 0x01, 0x62, 0x8d, 0x78, 0x0a, 0x56, 0x5d, 0x76, 0x89, 0x58, 0xb8, 0x28, 0x7d, 0x83, + 0x3c, 0x01, 0x9a, 0x8b, 0x9d, 0xa4, 0x52, 0xd4, 0x02, 0x3a, 0x2b, 0x8f, 0x67, 0xbe, 0xff, 0xef, + 0xbb, 0xcd, 0x05, 0x7c, 0x3a, 0xc4, 0x2c, 0xa6, 0xcc, 0x4e, 0x33, 0x3a, 0x22, 0x11, 0x66, 0xf6, + 0x65, 0xdf, 0xc7, 0x39, 0xea, 0xdb, 0x31, 0x1d, 0xe2, 0x88, 0x79, 0x29, 0xca, 0x50, 0xcc, 0xac, + 0x34, 0xa3, 0x39, 0x35, 0xb6, 0xa5, 0xb1, 0x55, 0x1a, 0x5b, 0xca, 0x78, 0xe7, 0x75, 0x48, 0x43, + 0x2a, 0x6c, 0x6c, 0x3e, 0x92, 0xe6, 0x3b, 0xdd, 0x80, 0x0a, 0xb6, 0x8f, 0x18, 0xae, 0xb8, 0x01, + 0x25, 0x89, 0x5a, 0x37, 0x43, 0x4a, 0xc3, 0x08, 0xdb, 0xe2, 0xcf, 0x9f, 0x8c, 0xec, 0x9c, 0xc4, + 0x98, 0xe5, 0x28, 0x4e, 0xa5, 0x01, 0xfc, 0x43, 0x03, 0xcd, 0x73, 0x11, 0x80, 0xf1, 0x23, 0x68, + 0x25, 0x24, 0x18, 0x27, 0x28, 0xc6, 0x9d, 0xfa, 0x6e, 0xbd, 0xd7, 0xde, 0xff, 0xc4, 0x5a, 0x13, + 0x8d, 0xf5, 0xad, 0x32, 0x94, 0x52, 0x67, 0xfb, 0xb6, 0x30, 0x6b, 0xf3, 0xc2, 0x7c, 0x79, 0x85, + 0xe2, 0xe8, 0x00, 0x96, 0x18, 0xe8, 0x56, 0x44, 0x63, 0x00, 0x1a, 0xc3, 0x1c, 0x85, 0x9d, 0x0d, + 0x41, 0xfe, 0x70, 0x2d, 0xf9, 0x78, 0x80, 0x42, 0x45, 0xfd, 0x80, 0x53, 0x67, 0x85, 0xd9, 0xe0, + 0x73, 0xf3, 0xc2, 0x6c, 0x4b, 0x3a, 0xc7, 0x40, 0x57, 0xd0, 0x8c, 0xaf, 0x80, 0xe6, 0x13, 0xda, + 0xd1, 0x04, 0x14, 0xae, 0x85, 0x3a, 0x84, 0x2a, 0xa6, 0xa1, 0x22, 0x05, 0x92, 0xe5, 0x13, 0x0a, + 0x5d, 0x8e, 0x30, 0x06, 0xa0, 0x49, 0x33, 0x14, 0x44, 0xb8, 0xd3, 0x10, 0xb0, 0x8f, 0xd6, 0xc2, + 0xbe, 0x13, 0x66, 0x8a, 0xf7, 0x9e, 0xe2, 0xbd, 0x23, 0x79, 0x12, 0x01, 0x5d, 0xc5, 0x32, 0x7e, + 0x02, 0x3a, 0x4a, 0x53, 0x2f, 0x22, 0xc9, 0x98, 0x75, 0x36, 0x9f, 0x28, 0xea, 0x61, 0x9a, 0x9e, + 0x71, 0x43, 0x85, 0xee, 0x28, 0xf4, 0xbb, 0x12, 0x5d, 0x71, 0xa0, 0xdb, 0x42, 0xca, 0xf2, 0xa0, + 0xf1, 0xf3, 0xaf, 0x66, 0x0d, 0x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0, 0xdb, 0x92, 0xe3, + 0xd3, 0xa1, 0xd1, 0x07, 0x3a, 0x62, 0x63, 0x2f, 0xa0, 0x93, 0x24, 0x17, 0xdd, 0x6a, 0x38, 0xaf, + 0x97, 0x4e, 0x40, 0xb9, 0xc4, 0x4f, 0x00, 0x1b, 0x1f, 0xf1, 0x21, 0x97, 0xf0, 0x56, 0x48, 0x89, + 0xf6, 0x58, 0x52, 0x2d, 0x41, 0xb7, 0x15, 0x93, 0x44, 0x4a, 0x3e, 0x07, 0xed, 0x34, 0xc3, 0x29, + 0xca, 0xb0, 0x17, 0x22, 0x26, 0xce, 0x7b, 0xc3, 0x79, 0x33, 0x2f, 0x4c, 0x43, 0x8a, 0x96, 0x16, + 0xa1, 0x0b, 0xd4, 0xdf, 0x97, 0x88, 0x71, 0x21, 0x9e, 0xe2, 0x60, 0x92, 0x4b, 0xe1, 0xe6, 0x63, + 0xe1, 0xd2, 0x22, 0x74, 0x81, 0xfa, 0xe3, 0xc2, 0x6b, 0x00, 0x46, 0x18, 0x7b, 0x28, 0x16, 0x51, + 0x36, 0x77, 0xb5, 0x5e, 0x7b, 0xff, 0x7d, 0x4b, 0x16, 0xde, 0xe2, 0x77, 0x77, 0x75, 0x07, 0x1c, + 0x51, 0x92, 0x38, 0x27, 0xea, 0xe4, 0xab, 0x16, 0x2c, 0xa4, 0xf0, 0xb7, 0x7b, 0xb3, 0xf7, 0x8c, + 0x0e, 0x72, 0x0a, 0x73, 0xf5, 0x11, 0xc6, 0x87, 0x42, 0xa7, 0xda, 0x75, 0x0d, 0xb6, 0x56, 0xef, + 0x18, 0x23, 0x04, 0x2f, 0xf1, 0x34, 0x25, 0x19, 0xca, 0x09, 0x4d, 0x3c, 0xfe, 0x38, 0xa8, 0xab, + 0x7f, 0xc7, 0x92, 0x2f, 0x87, 0x55, 0xbe, 0x1c, 0xd6, 0xa0, 0x7c, 0x39, 0x1c, 0xa8, 0xc2, 0x7b, + 0x53, 0x66, 0xbd, 0x02, 0x80, 0x37, 0xf7, 0x66, 0xdd, 0xdd, 0x5a, 0xcc, 0x72, 0xa1, 0x0c, 0xc0, + 0xf9, 0xfa, 0x76, 0xd6, 0xad, 0xdf, 0xcd, 0xba, 0xf5, 0xbf, 0x67, 0xdd, 0xfa, 0xcd, 0x43, 0xb7, + 0x76, 0xf7, 0xd0, 0xad, 0xfd, 0xf9, 0xd0, 0xad, 0xfd, 0xd0, 0x5f, 0xca, 0x4a, 0xde, 0x8f, 0x7b, + 0x11, 0xf2, 0x99, 0x1a, 0xdb, 0x97, 0xfb, 0xf6, 0x74, 0xf1, 0x80, 0x8a, 0x24, 0xfd, 0xa6, 0x08, + 0xed, 0xb3, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x75, 0x7c, 0xda, 0xbc, 0x60, 0x07, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { From 1328c822118c6cff3affe8fe59e21d8f53d12879 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Fri, 21 Jan 2022 11:54:40 +0100 Subject: [PATCH 009/112] - switched from time.Time to time.Duration for expiration_time params - fixed sims tests --- .../profiles/v1beta1/models_params.proto | 11 +- x/profiles/keeper/genesis_test.go | 8 +- x/profiles/keeper/keeper_params_test.go | 8 +- x/profiles/keeper/relay_app_links.go | 2 +- x/profiles/legacy/v231/store.go | 2 +- x/profiles/legacy/v231/store_test.go | 2 +- x/profiles/simulation/params.go | 2 +- x/profiles/simulation/utils.go | 3 +- x/profiles/types/models_app_links.go | 8 -- x/profiles/types/models_app_links_test.go | 24 ---- x/profiles/types/models_params.go | 8 +- x/profiles/types/models_params.pb.go | 110 +++++++++--------- x/profiles/types/models_params_test.go | 4 +- 13 files changed, 80 insertions(+), 112 deletions(-) diff --git a/proto/desmos/profiles/v1beta1/models_params.proto b/proto/desmos/profiles/v1beta1/models_params.proto index 0001c4c743..a7520707aa 100644 --- a/proto/desmos/profiles/v1beta1/models_params.proto +++ b/proto/desmos/profiles/v1beta1/models_params.proto @@ -3,7 +3,7 @@ package desmos.profiles.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; option go_package = "github.com/desmos-labs/desmos/v2/x/profiles/types"; @@ -126,9 +126,10 @@ message OracleParams { message AppLinksParams { option (gogoproto.goproto_getters) = false; - google.protobuf.Timestamp expiration_time = 1 [ - (gogoproto.stdtime) = true, - (gogoproto.moretags) = "yaml:\"expiration_time\"", - (gogoproto.nullable) = false + // ExpirationTime indicates the max amount of time before a link expires + google.protobuf.Duration expiration_time = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"expiration_time\"" ]; } \ No newline at end of file diff --git a/x/profiles/keeper/genesis_test.go b/x/profiles/keeper/genesis_test.go index 40ecc81d87..7afd9080c7 100644 --- a/x/profiles/keeper/genesis_test.go +++ b/x/profiles/keeper/genesis_test.go @@ -100,7 +100,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC)), + types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), ) suite.k.SetParams(ctx, params) suite.k.SetPort(ctx, "port-id") @@ -187,7 +187,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC)), + types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), ), "port-id", []types.ChainLink{ @@ -389,7 +389,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC)), + types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), ), "profiles-port-id", []types.ChainLink{ @@ -471,7 +471,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC)), + types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), ) suite.Require().Equal(params, suite.k.GetParams(ctx)) diff --git a/x/profiles/keeper/keeper_params_test.go b/x/profiles/keeper/keeper_params_test.go index 586a8cb39f..63eb47336d 100644 --- a/x/profiles/keeper/keeper_params_test.go +++ b/x/profiles/keeper/keeper_params_test.go @@ -2,8 +2,6 @@ package keeper_test import ( sdk "github.com/cosmos/cosmos-sdk/types" - "time" - "github.com/desmos-labs/desmos/v2/x/profiles/types" ) @@ -20,7 +18,7 @@ func (suite *KeeperTestSuite) TestKeeper_SetParams() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC)), + types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), ) suite.k.SetParams(suite.ctx, params) @@ -50,7 +48,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetParams() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC)), + types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), ) suite.k.SetParams(ctx, params) }, @@ -67,7 +65,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetParams() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC)), + types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), ), }, { diff --git a/x/profiles/keeper/relay_app_links.go b/x/profiles/keeper/relay_app_links.go index baf5086f5d..c86c0c7590 100644 --- a/x/profiles/keeper/relay_app_links.go +++ b/x/profiles/keeper/relay_app_links.go @@ -131,7 +131,7 @@ func (k Keeper) StartProfileConnection( ), nil, creationTime, - types.CalculateExpirationTime(creationTime, k.GetParams(ctx).AppLinks.ExpirationTime), + creationTime.Add(k.GetParams(ctx).AppLinks.ExpirationTime), )) if err != nil { diff --git a/x/profiles/legacy/v231/store.go b/x/profiles/legacy/v231/store.go index 15200c2f25..bb5861bd0c 100644 --- a/x/profiles/legacy/v231/store.go +++ b/x/profiles/legacy/v231/store.go @@ -55,7 +55,7 @@ func migrateAppLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { ), migrateAppLinkResult(legacyAppLink.Result), legacyAppLink.CreationTime, - types.CalculateExpirationTime(legacyAppLink.CreationTime, types.DefaultAppLinksParams().ExpirationTime), + legacyAppLink.CreationTime.Add(types.DefaultAppLinksParams().ExpirationTime), ) keys = append(keys, iterator.Key()) diff --git a/x/profiles/legacy/v231/store_test.go b/x/profiles/legacy/v231/store_test.go index 16660d6124..10c5c4dfb5 100644 --- a/x/profiles/legacy/v231/store_test.go +++ b/x/profiles/legacy/v231/store_test.go @@ -67,7 +67,7 @@ func TestStoreMigration(t *testing.T) { ), types.NewSuccessResult("76616c7565", "signature"), // The value should be HEX time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2022, 4, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 6, 18, 00, 00, 00, 000, time.UTC), )), expectedParams: types.DefaultParams(), }, diff --git a/x/profiles/simulation/params.go b/x/profiles/simulation/params.go index 9c9e6a2cb0..d11a866bb4 100644 --- a/x/profiles/simulation/params.go +++ b/x/profiles/simulation/params.go @@ -52,7 +52,7 @@ func ParamChanges(r *rand.Rand) []simtypes.ParamChange { simulation.NewSimParamChange(types.ModuleName, string(types.AppLinksParamsKey), func(r *rand.Rand) string { params := RandomAppLinksParams(r) - return fmt.Sprintf(`"expiration_time":"%v"`, params.ExpirationTime) + return fmt.Sprintf(`{"expiration_time":"%d"}`, params.ExpirationTime) }, ), } diff --git a/x/profiles/simulation/utils.go b/x/profiles/simulation/utils.go index 49b70926da..0e3194c717 100644 --- a/x/profiles/simulation/utils.go +++ b/x/profiles/simulation/utils.go @@ -175,7 +175,8 @@ func RandomOracleParams(r *rand.Rand) types.OracleParams { // RandomAppLinksParams return a random appLinks param func RandomAppLinksParams(r *rand.Rand) types.AppLinksParams { - return types.NewAppLinksParams(simtypes.RandTimestamp(r)) + randomDuration := time.Duration(simtypes.RandIntBetween(r, 60, 60*60*24*7*4*6)) * time.Second + return types.NewAppLinksParams(randomDuration) } // RandomRelationship picks and returns a random relationships from an array diff --git a/x/profiles/types/models_app_links.go b/x/profiles/types/models_app_links.go index 8482cdc0ac..4b50a1c8a9 100644 --- a/x/profiles/types/models_app_links.go +++ b/x/profiles/types/models_app_links.go @@ -25,14 +25,6 @@ func NewApplicationLink( } } -// CalculateExpirationTime calculate the expiration time for an application link by adding the expirationTime parameter -// to the app link creationTime -func CalculateExpirationTime(creationTime time.Time, expirationTimeParam time.Time) time.Time { - m := expirationTimeParam.Month() - result := creationTime.AddDate(0, int(m), 0) - return result -} - // Validate returns an error if the instance does not contain valid data func (l ApplicationLink) Validate() error { _, err := sdk.AccAddressFromBech32(l.User) diff --git a/x/profiles/types/models_app_links_test.go b/x/profiles/types/models_app_links_test.go index 6cebb93930..f13a5698db 100644 --- a/x/profiles/types/models_app_links_test.go +++ b/x/profiles/types/models_app_links_test.go @@ -9,30 +9,6 @@ import ( "github.com/desmos-labs/desmos/v2/x/profiles/types" ) -func TestCalculateExpirationTime(t *testing.T) { - testCases := []struct { - name string - creationTime time.Time - expirationTimeParam time.Time - expectedExpirationTime time.Time - }{ - { - name: "calculate expiration time correctly", - creationTime: time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), - expirationTimeParam: time.Date(0, 3, 1, 00, 00, 00, 000, time.UTC), - expectedExpirationTime: time.Date(2022, 4, 1, 0, 00, 00, 000, time.UTC), - }, - } - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - actualExpirationTime := types.CalculateExpirationTime(tc.creationTime, tc.expirationTimeParam) - require.Equal(t, tc.expectedExpirationTime, actualExpirationTime) - }) - } -} - func TestApplicationLink_Validate(t *testing.T) { testCases := []struct { name string diff --git a/x/profiles/types/models_params.go b/x/profiles/types/models_params.go index 5d70b05938..a4ea224080 100644 --- a/x/profiles/types/models_params.go +++ b/x/profiles/types/models_params.go @@ -23,7 +23,7 @@ var ( DefaultMinDTagLength = sdk.NewInt(3) DefaultMaxDTagLength = sdk.NewInt(30) DefaultMaxBioLength = sdk.NewInt(1000) - DefaultAppLinksExpirationTime = time.Date(2022, 3, 1, 00, 00, 00, 000, time.UTC) + DefaultAppLinksExpirationTime = time.Hour * 24 * 7 * 4 * 6 // This duration is equal to roughly 5.5 months time in minutes 241920 ) // Parameters store keys @@ -270,7 +270,7 @@ func ValidateOracleParams(i interface{}) error { // ___________________________________________________________________________________________________________________ -func NewAppLinksParams(expirationTime time.Time) AppLinksParams { +func NewAppLinksParams(expirationTime time.Duration) AppLinksParams { return AppLinksParams{ ExpirationTime: expirationTime, } @@ -286,8 +286,8 @@ func ValidateAppLinksParams(i interface{}) error { return fmt.Errorf("invalid parameters type: %s", i) } - if params.ExpirationTime.IsZero() { - return fmt.Errorf("invalid expiration time param: %s", params.ExpirationTime) + if params.ExpirationTime <= 0 { + return fmt.Errorf("expiration time param must be positive: %s", params.ExpirationTime) } return nil diff --git a/x/profiles/types/models_params.pb.go b/x/profiles/types/models_params.pb.go index d598ede505..eaadec2aa4 100644 --- a/x/profiles/types/models_params.pb.go +++ b/x/profiles/types/models_params.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "google.golang.org/protobuf/types/known/timestamppb" + _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" math_bits "math/bits" @@ -246,7 +246,7 @@ var xxx_messageInfo_OracleParams proto.InternalMessageInfo // AppLinksParams define the parameters related to the app links type AppLinksParams struct { - ExpirationTime time.Time `protobuf:"bytes,1,opt,name=expiration_time,json=expirationTime,proto3,stdtime" json:"expiration_time" yaml:"expiration_time"` + ExpirationTime time.Duration `protobuf:"bytes,1,opt,name=expiration_time,json=expirationTime,proto3,stdduration" json:"expiration_time" yaml:"expiration_time"` } func (m *AppLinksParams) Reset() { *m = AppLinksParams{} } @@ -296,57 +296,57 @@ func init() { } var fileDescriptor_a621950d5c07fbad = []byte{ - // 800 bytes of a gzipped FileDescriptorProto + // 797 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xeb, 0x44, - 0x18, 0xc7, 0x93, 0x3a, 0x8d, 0xe2, 0xc9, 0xa1, 0x87, 0x63, 0x1d, 0x4e, 0x43, 0x91, 0xe2, 0x6a, - 0x10, 0x10, 0x09, 0xd5, 0x56, 0xca, 0x02, 0xa9, 0x12, 0x8b, 0xba, 0xad, 0xa0, 0xa2, 0x40, 0x65, - 0xb2, 0x42, 0x08, 0x6b, 0xec, 0x4c, 0xdc, 0x51, 0x6c, 0x8f, 0xe5, 0x71, 0xaa, 0x74, 0xd5, 0x2d, - 0xcb, 0x3e, 0x01, 0x62, 0x8d, 0x78, 0x0a, 0x56, 0x5d, 0x76, 0x89, 0x58, 0xb8, 0x28, 0x7d, 0x83, - 0x3c, 0x01, 0x9a, 0x8b, 0x9d, 0xa4, 0x52, 0xd4, 0x02, 0x3a, 0x2b, 0x8f, 0x67, 0xbe, 0xff, 0xef, - 0xbb, 0xcd, 0x05, 0x7c, 0x3a, 0xc4, 0x2c, 0xa6, 0xcc, 0x4e, 0x33, 0x3a, 0x22, 0x11, 0x66, 0xf6, - 0x65, 0xdf, 0xc7, 0x39, 0xea, 0xdb, 0x31, 0x1d, 0xe2, 0x88, 0x79, 0x29, 0xca, 0x50, 0xcc, 0xac, - 0x34, 0xa3, 0x39, 0x35, 0xb6, 0xa5, 0xb1, 0x55, 0x1a, 0x5b, 0xca, 0x78, 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, 0xdf, 0x35, 0xf0, 0x62, 0xf9, - 0x38, 0x18, 0x5f, 0x00, 0x9d, 0x05, 0x19, 0x49, 0x73, 0x8f, 0x0c, 0x45, 0x73, 0x1a, 0xce, 0xee, - 0xac, 0x30, 0x5b, 0xdf, 0x8b, 0xc9, 0xd3, 0xe3, 0xc5, 0x76, 0xae, 0xcc, 0xa0, 0xdb, 0x92, 0xe3, - 0xd3, 0xa1, 0xd1, 0x07, 0x3a, 0x62, 0x63, 0x2f, 0xa0, 0x93, 0x24, 0x17, 0xdd, 0x6a, 0x38, 0xaf, - 0x97, 0x4e, 0x40, 0xb9, 0xc4, 0x4f, 0x00, 0x1b, 0x1f, 0xf1, 0x21, 0x97, 0xf0, 0x56, 0x48, 0x89, - 0xf6, 0x58, 0x52, 0x2d, 0x41, 0xb7, 0x15, 0x93, 0x44, 0x4a, 0x3e, 0x07, 0xed, 0x34, 0xc3, 0x29, - 0xca, 0xb0, 0x17, 0x22, 0x26, 0xce, 0x7b, 0xc3, 0x79, 0x33, 0x2f, 0x4c, 0x43, 0x8a, 0x96, 0x16, - 0xa1, 0x0b, 0xd4, 0xdf, 0x97, 0x88, 0x71, 0x21, 0x9e, 0xe2, 0x60, 0x92, 0x4b, 0xe1, 0xe6, 0x63, - 0xe1, 0xd2, 0x22, 0x74, 0x81, 0xfa, 0xe3, 0xc2, 0x6b, 0x00, 0x46, 0x18, 0x7b, 0x28, 0x16, 0x51, - 0x36, 0x77, 0xb5, 0x5e, 0x7b, 0xff, 0x7d, 0x4b, 0x16, 0xde, 0xe2, 0x77, 0x77, 0x75, 0x07, 0x1c, - 0x51, 0x92, 0x38, 0x27, 0xea, 0xe4, 0xab, 0x16, 0x2c, 0xa4, 0xf0, 0xb7, 0x7b, 0xb3, 0xf7, 0x8c, - 0x0e, 0x72, 0x0a, 0x73, 0xf5, 0x11, 0xc6, 0x87, 0x42, 0xa7, 0xda, 0x75, 0x0d, 0xb6, 0x56, 0xef, - 0x18, 0x23, 0x04, 0x2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 0xaf, 0xf5, 0xda, 0x87, 0xbb, 0x96, 0x2c, 0xbc, 0xc5, 0xaf, 0xee, 0xea, 0x0e, 0x38, 0xa1, 0x24, + 0x71, 0xce, 0xd4, 0xc9, 0x57, 0x2d, 0x58, 0x48, 0xe1, 0xaf, 0xf7, 0x66, 0xef, 0x19, 0x1d, 0xe4, + 0x14, 0xe6, 0xea, 0x23, 0x8c, 0x8f, 0x85, 0x4e, 0xb5, 0xeb, 0x3b, 0xb0, 0xb5, 0x7a, 0xc7, 0x18, + 0x23, 0xf0, 0x12, 0x4f, 0x53, 0x22, 0x9f, 0x04, 0x2f, 0x27, 0xd5, 0xd5, 0xbf, 0x6b, 0xc9, 0x87, + 0xc3, 0x2a, 0x1f, 0x0e, 0xeb, 0x54, 0x3d, 0x1c, 0x0e, 0x54, 0xd1, 0x6d, 0x97, 0x49, 0xaf, 0xe8, + 0xe1, 0x4f, 0xf7, 0x66, 0xdd, 0xdd, 0x5a, 0xcc, 0x0e, 0x48, 0x8c, 0xa5, 0x7f, 0xe7, 0xb3, 0xdb, + 0x59, 0xb7, 0x7e, 0x37, 0xeb, 0xd6, 0xff, 0x9a, 0x75, 0xeb, 0x3f, 0x3e, 0x74, 0x6b, 0x77, 0x0f, + 0xdd, 0xda, 0x1f, 0x0f, 0xdd, 0xda, 0xd7, 0xfd, 0xa5, 0xa4, 0xe4, 0xf5, 0x78, 0x10, 0x21, 0x9f, + 0xa9, 0xb1, 0x7d, 0x7d, 0x68, 0x4f, 0x17, 0xcf, 0xa7, 0xc8, 0xd1, 0x6f, 0x8a, 0xc8, 0x3e, 0xfc, + 0x3b, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x85, 0x43, 0x3d, 0x5e, 0x07, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -630,7 +630,7 @@ func (m *AppLinksParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime):]) + n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime):]) if err6 != nil { return 0, err6 } @@ -748,7 +748,7 @@ func (m *AppLinksParams) Size() (n int) { } var l int _ = l - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime) n += 1 + l + sovModelsParams(uint64(l)) return n } @@ -1558,7 +1558,7 @@ func (m *AppLinksParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/profiles/types/models_params_test.go b/x/profiles/types/models_params_test.go index 90463c3a73..eea9a2e610 100644 --- a/x/profiles/types/models_params_test.go +++ b/x/profiles/types/models_params_test.go @@ -73,7 +73,7 @@ func TestValidateParams(t *testing.T) { types.DefaultDTagParams(), types.DefaultBioParams(), types.DefaultOracleParams(), - types.NewAppLinksParams(time.Time{}), + types.NewAppLinksParams(time.Duration(0)), ), shouldErr: true, }, @@ -317,7 +317,7 @@ func TestValidateAppLinksParams(t *testing.T) { }{ { name: "invalid value returns error", - params: types.NewAppLinksParams(time.Time{}), + params: types.NewAppLinksParams(time.Duration(0)), shouldErr: true, }, { From 1ef5251119a436980273f8cc8b9227d31f6b4d00 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Fri, 21 Jan 2022 18:08:23 +0100 Subject: [PATCH 010/112] - added benchmark test for expired links deletion --- .../keeper_app_links_benchmarks_test.go | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 x/profiles/keeper/keeper_app_links_benchmarks_test.go diff --git a/x/profiles/keeper/keeper_app_links_benchmarks_test.go b/x/profiles/keeper/keeper_app_links_benchmarks_test.go new file mode 100644 index 0000000000..1454821c2d --- /dev/null +++ b/x/profiles/keeper/keeper_app_links_benchmarks_test.go @@ -0,0 +1,122 @@ +package keeper_test + +import ( + "math/rand" + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/desmos-labs/desmos/v2/app" + "github.com/desmos-labs/desmos/v2/testutil" + "github.com/desmos-labs/desmos/v2/x/profiles/keeper" + "github.com/desmos-labs/desmos/v2/x/profiles/types" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + db "github.com/tendermint/tm-db" +) + +func setupBenchTest() (authkeeper.AccountKeeper, keeper.Keeper, sdk.Context) { + // Define the store keys + keys := sdk.NewKVStoreKeys(types.StoreKey, authtypes.StoreKey, paramstypes.StoreKey) + tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + + storeKey := keys[types.StoreKey] + + // Create an in-memory db + memDB := db.NewMemDB() + ms := store.NewCommitMultiStore(memDB) + for _, key := range keys { + ms.MountStoreWithDB(key, sdk.StoreTypeIAVL, memDB) + } + for _, tKey := range tKeys { + ms.MountStoreWithDB(tKey, sdk.StoreTypeTransient, memDB) + } + for _, memKey := range memKeys { + ms.MountStoreWithDB(memKey, sdk.StoreTypeMemory, nil) + } + + if err := ms.LoadLatestVersion(); err != nil { + panic(err) + } + + ctx := sdk.NewContext(ms, tmproto.Header{ChainID: "test-chain-id"}, false, log.NewNopLogger()) + cdc, legacyAminoCdc := app.MakeCodecs() + + paramsKeeper := paramskeeper.NewKeeper( + cdc, legacyAminoCdc, keys[paramstypes.StoreKey], tKeys[paramstypes.TStoreKey], + ) + + ak := authkeeper.NewAccountKeeper( + cdc, + keys[authtypes.StoreKey], + paramsKeeper.Subspace(authtypes.ModuleName), + authtypes.ProtoBaseAccount, + app.GetMaccPerms(), + ) + + k := keeper.NewKeeper( + cdc, + storeKey, + paramsKeeper.Subspace(types.DefaultParamsSpace), + ak, + nil, + nil, + nil, + ) + + return ak, k, ctx +} + +func generateRandomAppLinks(r *rand.Rand, linkNum int) []types.ApplicationLink { + accounts := simtypes.RandomAccounts(r, r.Intn(linkNum)) + var appLinks []types.ApplicationLink + for _, account := range accounts { + link := types.NewApplicationLink( + account.Address.String(), + types.NewData(simtypes.RandStringOfLength(r, 5), simtypes.RandStringOfLength(r, 6)), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData(simtypes.RandStringOfLength(r, 5), simtypes.RandStringOfLength(r, 5)), + simtypes.RandStringOfLength(r, 10), + ), + nil, + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + ) + + appLinks = append(appLinks, link) + } + + return appLinks +} + +func BenchmarkKeeper_DeleteExpiredApplicationLinks(b *testing.B) { + r := rand.New(rand.NewSource(100)) + ak, k, ctx := setupBenchTest() + links := generateRandomAppLinks(r, 1) + ctx, _ = ctx.CacheContext() + + for _, link := range links { + ak.SetAccount(ctx, testutil.ProfileFromAddr(link.User)) + err := k.SaveApplicationLink(ctx, link) + require.NoError(b, err) + } + + b.Run("iterate and delete expired links", func(b *testing.B) { + for i := 0; i < b.N; i++ { + b.ReportAllocs() + k.DeleteExpiredApplicationLinks(ctx) + } + }) +} From 39449c691185c266dfed489e6bb5ad9793fca6ab Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 24 Jan 2022 11:15:21 +0100 Subject: [PATCH 011/112] fixed params migration added bench test workflow --- .github/workflows/bench.yml | 42 ++++++++++++++++++++++++++++ Makefile | 6 +++- go.mod | 2 +- go.sum | 11 ++------ x/profiles/keeper/migrations.go | 4 +-- x/profiles/legacy/v231/store.go | 41 +++++++++++++-------------- x/profiles/legacy/v231/store_test.go | 13 +++------ 7 files changed, 74 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/bench.yml diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml new file mode 100644 index 0000000000..91621df137 --- /dev/null +++ b/.github/workflows/bench.yml @@ -0,0 +1,42 @@ +name: Benchmarks +on: + pull_request: + push: + branches: + - master +env: + GO111MODULE: "on" +jobs: + Benchmarks: + runs-on: ubuntu-latest + steps: + - name: Setup Go 🧰 + uses: actions/setup-go@v2.1.5 + with: + go-version: 1.15 + + - name: Checkout 🛎️ + uses: actions/checkout@v2 + + - name: Go cache 💾 + uses: actions/cache@v2 + with: + path: ~/go/pkg + key: ${{ runner.os }}-go-pkg-${{ hashFiles('**/go.mod') }} + + - name: Restore benchstat 🪛 + uses: actions/cache@v2.1.7 + with: + path: ~/go/bin/benchstat + key: ${{ runner.os }}-benchstat + + - name: Restore base benchmark result 📝 + uses: actions/cache@v2 + with: + path: | + bench-master.txt + # Using base sha for PR or new commit hash for master/main push in benchmark result key. + key: ${{ runner.os }}-bench-${{ (github.event.pull_request.base.sha != github.event.after) && github.event.pull_request.base.sha || github.event.after }} + + - name: Benchmark 🧮 + run: REF_NAME=${GITHUB_REF##*/} make benchmark \ No newline at end of file diff --git a/Makefile b/Makefile index ca7861962d..648cabd872 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,8 @@ MOCKS_DIR = $(CURDIR)/tests/mocks HTTPS_GIT := https://github.com/desmos-labs/desmos.git DOCKER := $(shell which docker) DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf +BENCH_COUNT ?= 5 +REF_NAME ?= $(shell git symbolic-ref HEAD --short | tr / - 2>/dev/null) export GO111MODULE = on @@ -251,7 +253,9 @@ test-cover: .PHONY: test-cover benchmark: - @go test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION) + @go test -mod=readonly -bench=. -count=$(BENCH_COUNT) -run=^a ./... >bench-$(REF_NAME).txt + @test -s $(GOPATH)/bin/benchstat || GO111MODULE=off GOFLAGS= GOBIN=$(GOPATH)/bin go get -u golang.org/x/perf/cmd/benchstat + @test -e bench-master.txt && benchstat bench-master.txt bench-$(REF_NAME).txt || benchstat bench-$(REF_NAME).txt .PHONY: benchmark ############################################################################### diff --git a/go.mod b/go.mod index 71c951961d..680de81f1d 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 -replace github.com/cosmos/cosmos-sdk => github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20220120152131-faa2a9289a52 +replace github.com/cosmos/cosmos-sdk => github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20211206072111-16bfceb83430 replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index 233df79966..9871773e78 100644 --- a/go.sum +++ b/go.sum @@ -268,8 +268,8 @@ github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20220120152131-faa2a9289a52 h1:UFuUQeCzlKlRQh16McgNiVc8yXXCuqmHxLKgmasNGKA= -github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20220120152131-faa2a9289a52/go.mod h1:Yd070TQ78qcMJmKn1/cOLEYBkn23d0Ra1mKW1goRSB4= +github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20211206072111-16bfceb83430 h1:3UdGRNqZ6nD+SIEtsC2K1UqNPz1jHjdfMT2EHqL7aA4= +github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20211206072111-16bfceb83430/go.mod h1:Yd070TQ78qcMJmKn1/cOLEYBkn23d0Ra1mKW1goRSB4= github.com/desmos-labs/ledger-desmos-go v0.11.2-0.20210814121638-5d87e392e8a9 h1:b77qmphsyX3+hjJraaqLyzjt9eKqbosy4LaYScPvTAs= github.com/desmos-labs/ledger-desmos-go v0.11.2-0.20210814121638-5d87e392e8a9/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= @@ -402,7 +402,6 @@ github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -860,10 +859,7 @@ github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9 github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= @@ -1158,11 +1154,9 @@ golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1265,7 +1259,6 @@ golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211005001312-d4b1ae081e3b h1:SXy8Ld8oKlcogOvUAh0J5Pm5RKzgYBMMxLxt6n5XW50= golang.org/x/net v0.0.0-20211005001312-d4b1ae081e3b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= diff --git a/x/profiles/keeper/migrations.go b/x/profiles/keeper/migrations.go index 1e0b17994a..3d31964ddd 100644 --- a/x/profiles/keeper/migrations.go +++ b/x/profiles/keeper/migrations.go @@ -80,9 +80,7 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error { // Migrate4to5 migrates from version 4 to 5 func (m Migrator) Migrate4to5(ctx sdk.Context) error { - updatedParamSpace, err := v231.MigrateStore(ctx, m.keeper.StoreKey, m.keeper.paramSubspace, m.keeper.Cdc) - m.keeper.paramSubspace = updatedParamSpace - return err + return v231.MigrateStore(ctx, m.keeper.StoreKey, m.keeper.paramSubspace, m.keeper.Cdc) } func (m Migrator) migrateProfile(ctx sdk.Context, profile *types.Profile) error { diff --git a/x/profiles/legacy/v231/store.go b/x/profiles/legacy/v231/store.go index bb5861bd0c..22e8dd0f85 100644 --- a/x/profiles/legacy/v231/store.go +++ b/x/profiles/legacy/v231/store.go @@ -14,17 +14,17 @@ import ( // migration includes: // - Add the AppLinkParams to the params set // - Added expiration time to all app links -func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, subspace paramstypes.Subspace, cdc codec.BinaryCodec) (paramstypes.Subspace, error) { +func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, subspace paramstypes.Subspace, cdc codec.BinaryCodec) error { store := ctx.KVStore(storeKey) - updatedSubspace := migrateParams(ctx, subspace) + migrateParams(ctx, subspace) err := migrateAppLinks(store, cdc) if err != nil { - return paramstypes.Subspace{}, err + return err } - return updatedSubspace, nil + return nil } func migrateAppLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { @@ -91,27 +91,24 @@ func migrateAppLinkResult(r *v200.Result) *types.Result { } // migrateParams add the AppLinksParams to the params set -func migrateParams(ctx sdk.Context, subspace paramstypes.Subspace) paramstypes.Subspace { +func migrateParams(ctx sdk.Context, subspace paramstypes.Subspace) { var params v200.Params subspace.GetParamSet(ctx, ¶ms) - newParams := types.NewParams( - types.NewNicknameParams(params.Nickname.MinLength, params.Nickname.MaxLength), - types.NewDTagParams(params.DTag.RegEx, params.DTag.MinLength, params.DTag.MaxLength), - types.NewBioParams(params.Bio.MaxLength), - types.NewOracleParams( - params.Oracle.ScriptID, - params.Oracle.AskCount, - params.Oracle.MinCount, - params.Oracle.PrepareGas, - params.Oracle.ExecuteGas, - params.Oracle.FeeAmount..., - ), - types.DefaultAppLinksParams(), + nicknameParams := types.NewNicknameParams(params.Nickname.MinLength, params.Nickname.MaxLength) + dtagParams := types.NewDTagParams(params.DTag.RegEx, params.DTag.MinLength, params.DTag.MaxLength) + bioParams := types.NewBioParams(params.Bio.MaxLength) + oracleParams := types.NewOracleParams( + params.Oracle.ScriptID, + params.Oracle.AskCount, + params.Oracle.MinCount, + params.Oracle.PrepareGas, + params.Oracle.ExecuteGas, + params.Oracle.FeeAmount..., ) - subspace = subspace.UpdateKeyTable(types.ParamKeyTable()) - subspace.SetParamSet(ctx, &newParams) - - return subspace + subspace.Set(ctx, types.NicknameParamsKey, &nicknameParams) + subspace.Set(ctx, types.DTagParamsKey, &dtagParams) + subspace.Set(ctx, types.BioParamsKey, &bioParams) + subspace.Set(ctx, types.OracleParamsKey, &oracleParams) } diff --git a/x/profiles/legacy/v231/store_test.go b/x/profiles/legacy/v231/store_test.go index 10c5c4dfb5..0ca559e274 100644 --- a/x/profiles/legacy/v231/store_test.go +++ b/x/profiles/legacy/v231/store_test.go @@ -1,17 +1,17 @@ package v231_test import ( - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - v231 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v231" - "github.com/stretchr/testify/require" "testing" "time" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/desmos-labs/desmos/v2/app" v200 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200" + v231 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v231" "github.com/desmos-labs/desmos/v2/x/profiles/types" + "github.com/stretchr/testify/require" ) func TestStoreMigration(t *testing.T) { @@ -69,7 +69,6 @@ func TestStoreMigration(t *testing.T) { time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), time.Date(2022, 6, 18, 00, 00, 00, 000, time.UTC), )), - expectedParams: types.DefaultParams(), }, } @@ -79,17 +78,13 @@ func TestStoreMigration(t *testing.T) { } // Run migrations - updateParamSpace, err := v231.MigrateStore(ctx, profilesKey, paramsSpace, cdc) + err := v231.MigrateStore(ctx, profilesKey, paramsSpace, cdc) require.NoError(t, err) - var newParams types.Params - updateParamSpace.GetParamSet(ctx, &newParams) - // Make sure the new values are set properly for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - require.Equal(t, tc.expectedParams, newParams) require.Equal(t, tc.newValue, store.Get(tc.key)) }) } From 054e23073e5b69af504aaba090ea0ab5a40b8eba Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 24 Jan 2022 11:42:21 +0100 Subject: [PATCH 012/112] revert keeper's StoreKey and Cdc exports --- x/profiles/keeper/alias_functions.go | 44 +++++++++++----------- x/profiles/keeper/grpc_query.go | 20 +++++----- x/profiles/keeper/keeper.go | 14 +++---- x/profiles/keeper/keeper_app_links.go | 16 ++++---- x/profiles/keeper/keeper_blocks.go | 14 +++---- x/profiles/keeper/keeper_chain_links.go | 16 ++++---- x/profiles/keeper/keeper_dtag_transfers.go | 16 ++++---- x/profiles/keeper/keeper_ibc.go | 4 +- x/profiles/keeper/keeper_relationships.go | 12 +++--- x/profiles/keeper/migrations.go | 6 +-- x/profiles/keeper/msg_server_chain_link.go | 2 +- x/profiles/keeper/relay_chain_links.go | 6 +-- 12 files changed, 85 insertions(+), 85 deletions(-) diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go index 8928b010e5..578fbe8e05 100644 --- a/x/profiles/keeper/alias_functions.go +++ b/x/profiles/keeper/alias_functions.go @@ -47,13 +47,13 @@ func (k Keeper) HasProfile(ctx sdk.Context, user string) bool { func (k Keeper) IterateDTagTransferRequests( ctx sdk.Context, fn func(index int64, dTagTransferRequest types.DTagTransferRequest) (stop bool), ) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.DTagTransferRequestPrefix) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - request := types.MustUnmarshalDTagTransferRequest(k.Cdc, iterator.Value()) + request := types.MustUnmarshalDTagTransferRequest(k.cdc, iterator.Value()) stop := fn(i, request) if stop { break @@ -67,13 +67,13 @@ func (k Keeper) IterateDTagTransferRequests( func (k Keeper) IterateUserIncomingDTagTransferRequests( ctx sdk.Context, user string, fn func(index int64, dTagTransferRequest types.DTagTransferRequest) (stop bool), ) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.IncomingDTagTransferRequestsPrefix(user)) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - request := types.MustUnmarshalDTagTransferRequest(k.Cdc, iterator.Value()) + request := types.MustUnmarshalDTagTransferRequest(k.cdc, iterator.Value()) stop := fn(i, request) if stop { break @@ -86,7 +86,7 @@ func (k Keeper) IterateUserIncomingDTagTransferRequests( // IterateRelationships iterates through the relationships and perform the provided function func (k Keeper) IterateRelationships(ctx sdk.Context, fn func(index int64, relationship types.Relationship) (stop bool)) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.RelationshipsStorePrefix) defer iterator.Close() @@ -94,7 +94,7 @@ func (k Keeper) IterateRelationships(ctx sdk.Context, fn func(index int64, relat i := int64(0) for ; iterator.Valid(); iterator.Next() { - relationship := types.MustUnmarshalRelationship(k.Cdc, iterator.Value()) + relationship := types.MustUnmarshalRelationship(k.cdc, iterator.Value()) stop := fn(i, relationship) @@ -109,7 +109,7 @@ func (k Keeper) IterateRelationships(ctx sdk.Context, fn func(index int64, relat // IterateUserRelationships iterates through the relationships with the given user address // and performs the provided function func (k Keeper) IterateUserRelationships(ctx sdk.Context, user string, fn func(index int64, relationship types.Relationship) (stop bool)) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.UserRelationshipsPrefix(user)) defer iterator.Close() @@ -117,7 +117,7 @@ func (k Keeper) IterateUserRelationships(ctx sdk.Context, user string, fn func(i i := int64(0) for ; iterator.Valid(); iterator.Next() { - relationship := types.MustUnmarshalRelationship(k.Cdc, iterator.Value()) + relationship := types.MustUnmarshalRelationship(k.cdc, iterator.Value()) stop := fn(i, relationship) @@ -130,13 +130,13 @@ func (k Keeper) IterateUserRelationships(ctx sdk.Context, user string, fn func(i // IterateBlocks iterates through the list of user blocks and performs the given function func (k Keeper) IterateBlocks(ctx sdk.Context, fn func(index int64, block types.UserBlock) (stop bool)) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.UsersBlocksStorePrefix) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - block := types.MustUnmarshalUserBlock(k.Cdc, iterator.Value()) + block := types.MustUnmarshalUserBlock(k.cdc, iterator.Value()) stop := fn(i, block) if stop { break @@ -147,13 +147,13 @@ func (k Keeper) IterateBlocks(ctx sdk.Context, fn func(index int64, block types. // IterateUserBlocks iterates through the list of user blocks created by the specified user and performs the given function func (k Keeper) IterateUserBlocks(ctx sdk.Context, user string, fn func(index int64, block types.UserBlock) (stop bool)) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.BlockerPrefix(user)) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - block := types.MustUnmarshalUserBlock(k.Cdc, iterator.Value()) + block := types.MustUnmarshalUserBlock(k.cdc, iterator.Value()) stop := fn(i, block) if stop { break @@ -166,13 +166,13 @@ func (k Keeper) IterateUserBlocks(ctx sdk.Context, user string, fn func(index in // IterateApplicationLinks iterates through all the application links and performs the provided function func (k Keeper) IterateApplicationLinks(ctx sdk.Context, fn func(index int64, link types.ApplicationLink) (stop bool)) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.UserApplicationLinkPrefix) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - link := types.MustUnmarshalApplicationLink(k.Cdc, iterator.Value()) + link := types.MustUnmarshalApplicationLink(k.cdc, iterator.Value()) stop := fn(i, link) if stop { break @@ -184,13 +184,13 @@ func (k Keeper) IterateApplicationLinks(ctx sdk.Context, fn func(index int64, li // IterateUserApplicationLinks iterates through all the application links related to the given user // and performs the provided function func (k Keeper) IterateUserApplicationLinks(ctx sdk.Context, user string, fn func(index int64, link types.ApplicationLink) (stop bool)) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.UserApplicationLinksPrefix(user)) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - link := types.MustUnmarshalApplicationLink(k.Cdc, iterator.Value()) + link := types.MustUnmarshalApplicationLink(k.cdc, iterator.Value()) stop := fn(i, link) if stop { break @@ -213,7 +213,7 @@ func (k Keeper) GetApplicationLinks(ctx sdk.Context) []types.ApplicationLink { // IterateExpiringApplicationLinks iterates through all the expiring application links references. // The key will be skipped and deleted if the application link has already been deleted. func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index int64, link types.ApplicationLink) (stop bool)) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.ApplicationLinkExpiringTimePrefix(ctx.BlockTime())) defer iterator.Close() @@ -227,7 +227,7 @@ func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index i continue } applicationKey := store.Get(clientIDKey) - link := types.MustUnmarshalApplicationLink(k.Cdc, store.Get(applicationKey)) + link := types.MustUnmarshalApplicationLink(k.cdc, store.Get(applicationKey)) stop := fn(i, link) if stop { break @@ -240,13 +240,13 @@ func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index i // IterateChainLinks iterates through the chain links and perform the provided function func (k Keeper) IterateChainLinks(ctx sdk.Context, fn func(index int64, link types.ChainLink) (stop bool)) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.ChainLinksPrefix) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - link := types.MustUnmarshalChainLink(k.Cdc, iterator.Value()) + link := types.MustUnmarshalChainLink(k.cdc, iterator.Value()) stop := fn(i, link) if stop { break @@ -257,14 +257,14 @@ func (k Keeper) IterateChainLinks(ctx sdk.Context, fn func(index int64, link typ // IterateUserChainLinks iterates through all the chain links related to the given user and perform the provided function func (k Keeper) IterateUserChainLinks(ctx sdk.Context, user string, fn func(index int64, link types.ChainLink) (stop bool)) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.UserChainLinksPrefix(user)) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - link := types.MustUnmarshalChainLink(k.Cdc, iterator.Value()) + link := types.MustUnmarshalChainLink(k.cdc, iterator.Value()) stop := fn(i, link) if stop { diff --git a/x/profiles/keeper/grpc_query.go b/x/profiles/keeper/grpc_query.go index f0bff0241b..6a4d6753b4 100644 --- a/x/profiles/keeper/grpc_query.go +++ b/x/profiles/keeper/grpc_query.go @@ -63,13 +63,13 @@ func (k Keeper) IncomingDTagTransferRequests(ctx context.Context, request *types var requests []types.DTagTransferRequest // Get user requests prefix store - store := sdkCtx.KVStore(k.StoreKey) + store := sdkCtx.KVStore(k.storeKey) reqStore := prefix.NewStore(store, types.IncomingDTagTransferRequestsPrefix(request.Receiver)) // Get paginated user requests pageRes, err := query.Paginate(reqStore, request.Pagination, func(key []byte, value []byte) error { var req types.DTagTransferRequest - if err := k.Cdc.Unmarshal(value, &req); err != nil { + if err := k.cdc.Unmarshal(value, &req); err != nil { return status.Error(codes.Internal, err.Error()) } @@ -90,13 +90,13 @@ func (k Keeper) Relationships(ctx context.Context, request *types.QueryRelations var relationships []types.Relationship // Get user relationships prefix store - store := sdkCtx.KVStore(k.StoreKey) + store := sdkCtx.KVStore(k.storeKey) relsStore := prefix.NewStore(store, types.UserRelationshipsSubspacePrefix(request.User, request.SubspaceId)) // Get paginated user relationships pageRes, err := query.Paginate(relsStore, request.Pagination, func(key []byte, value []byte) error { var rel types.Relationship - if err := k.Cdc.Unmarshal(value, &rel); err != nil { + if err := k.cdc.Unmarshal(value, &rel); err != nil { return status.Error(codes.Internal, err.Error()) } @@ -117,13 +117,13 @@ func (k Keeper) Blocks(ctx context.Context, request *types.QueryBlocksRequest) ( var userblocks []types.UserBlock // Get user blocks prefix store - store := sdkCtx.KVStore(k.StoreKey) + store := sdkCtx.KVStore(k.storeKey) userBlocksStore := prefix.NewStore(store, types.BlockerSubspacePrefix(request.User, request.SubspaceId)) // Get paginated user blocks pageRes, err := query.Paginate(userBlocksStore, request.Pagination, func(key []byte, value []byte) error { var userBlock types.UserBlock - if err := k.Cdc.Unmarshal(value, &userBlock); err != nil { + if err := k.cdc.Unmarshal(value, &userBlock); err != nil { return status.Error(codes.Internal, err.Error()) } @@ -152,13 +152,13 @@ func (k Keeper) ChainLinks(ctx context.Context, request *types.QueryChainLinksRe var links []types.ChainLink // Get user chain links prefix store - store := sdkCtx.KVStore(k.StoreKey) + store := sdkCtx.KVStore(k.storeKey) linksStore := prefix.NewStore(store, types.UserChainLinksPrefix(request.User)) // Get paginated user chain links pageRes, err := query.Paginate(linksStore, request.Pagination, func(key []byte, value []byte) error { var link types.ChainLink - if err := k.Cdc.Unmarshal(value, &link); err != nil { + if err := k.cdc.Unmarshal(value, &link); err != nil { return status.Error(codes.Internal, err.Error()) } links = append(links, link) @@ -190,13 +190,13 @@ func (k Keeper) ApplicationLinks(ctx context.Context, request *types.QueryApplic var links []types.ApplicationLink // Get user links prefix store - store := sdkCtx.KVStore(k.StoreKey) + store := sdkCtx.KVStore(k.storeKey) linksStore := prefix.NewStore(store, types.UserApplicationLinksPrefix(request.User)) // Get paginated user links pageRes, err := query.Paginate(linksStore, request.Pagination, func(key []byte, value []byte) error { var link types.ApplicationLink - if err := k.Cdc.Unmarshal(value, &link); err != nil { + if err := k.cdc.Unmarshal(value, &link); err != nil { return status.Error(codes.Internal, err.Error()) } diff --git a/x/profiles/keeper/keeper.go b/x/profiles/keeper/keeper.go index f4f129f824..e8a36f4af0 100644 --- a/x/profiles/keeper/keeper.go +++ b/x/profiles/keeper/keeper.go @@ -19,8 +19,8 @@ import ( // Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine type Keeper struct { - StoreKey sdk.StoreKey - Cdc codec.BinaryCodec + storeKey sdk.StoreKey + cdc codec.BinaryCodec paramSubspace paramstypes.Subspace ak authkeeper.AccountKeeper @@ -50,8 +50,8 @@ func NewKeeper( } return Keeper{ - StoreKey: storeKey, - Cdc: cdc, + storeKey: storeKey, + cdc: cdc, paramSubspace: paramSpace, ak: ak, channelKeeper: channelKeeper, @@ -69,7 +69,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { // without checking if another profile with the same DTag already exists. // It assumes that the given profile has already been validated. func (k Keeper) storeProfileWithoutDTagCheck(ctx sdk.Context, profile *types.Profile) error { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) oldProfile, found, err := k.GetProfile(ctx, profile.GetAddress().String()) if err != nil { @@ -122,7 +122,7 @@ func (k Keeper) GetProfile(ctx sdk.Context, address string) (profile *types.Prof // GetAddressFromDTag returns the address associated to the given DTag or an empty string if it does not exists func (k Keeper) GetAddressFromDTag(ctx sdk.Context, dTag string) (addr string) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) bz := store.Get(types.DTagStoreKey(dTag)) if bz == nil { @@ -146,7 +146,7 @@ func (k Keeper) RemoveProfile(ctx sdk.Context, address string) error { } // Delete the DTag -> Address association - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) store.Delete(types.DTagStoreKey(profile.DTag)) // Delete all the blocks diff --git a/x/profiles/keeper/keeper_app_links.go b/x/profiles/keeper/keeper_app_links.go index c1f1d2df90..77a18de7b2 100644 --- a/x/profiles/keeper/keeper_app_links.go +++ b/x/profiles/keeper/keeper_app_links.go @@ -25,8 +25,8 @@ func (k Keeper) SaveApplicationLink(ctx sdk.Context, link types.ApplicationLink) applicationLinkExpiringTimeKey := types.ApplicationLinkExpiringTimeKey(link.ExpirationTime, link.OracleRequest.ClientID) // Store the data - store := ctx.KVStore(k.StoreKey) - store.Set(userApplicationLinkKey, types.MustMarshalApplicationLink(k.Cdc, link)) + store := ctx.KVStore(k.storeKey) + store.Set(userApplicationLinkKey, types.MustMarshalApplicationLink(k.cdc, link)) store.Set(applicationLinkClientIDKey, userApplicationLinkKey) store.Set(applicationLinkExpiringTimeKey, []byte(link.OracleRequest.ClientID)) @@ -45,7 +45,7 @@ func (k Keeper) SaveApplicationLink(ctx sdk.Context, link types.ApplicationLink) // GetApplicationLink returns the link for the given application and username. // If the link is not found returns an error instead. func (k Keeper) GetApplicationLink(ctx sdk.Context, user, application, username string) (types.ApplicationLink, bool, error) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) // Check to see if the key exists userApplicationLinkKey := types.UserApplicationLinkKey(user, application, username) @@ -54,7 +54,7 @@ func (k Keeper) GetApplicationLink(ctx sdk.Context, user, application, username } var link types.ApplicationLink - err := k.Cdc.Unmarshal(store.Get(userApplicationLinkKey), &link) + err := k.cdc.Unmarshal(store.Get(userApplicationLinkKey), &link) if err != nil { return types.ApplicationLink{}, false, err } @@ -65,7 +65,7 @@ func (k Keeper) GetApplicationLink(ctx sdk.Context, user, application, username // GetApplicationLinkByClientID returns the application link and user given a specific client id. // If the link is not found, returns false instead. func (k Keeper) GetApplicationLinkByClientID(ctx sdk.Context, clientID string) (types.ApplicationLink, bool, error) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) // Get the client request using the client id clientIDKey := types.ApplicationLinkClientIDKey(clientID) @@ -78,7 +78,7 @@ func (k Keeper) GetApplicationLinkByClientID(ctx sdk.Context, clientID string) ( // Read the link var link types.ApplicationLink - err := k.Cdc.Unmarshal(store.Get(applicationLinkKey), &link) + err := k.cdc.Unmarshal(store.Get(applicationLinkKey), &link) if err != nil { return types.ApplicationLink{}, true, sdkerrors.Wrap(err, "error while reading application link") } @@ -88,7 +88,7 @@ func (k Keeper) GetApplicationLinkByClientID(ctx sdk.Context, clientID string) ( // deleteApplicationLinkStoreKeys deletes all the store keys related to the given application link func (k Keeper) deleteApplicationLinkStoreKeys(ctx sdk.Context, link types.ApplicationLink) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) store.Delete(types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username)) store.Delete(types.ApplicationLinkClientIDKey(link.OracleRequest.ClientID)) store.Delete(types.ApplicationLinkExpiringTimeKey(link.ExpirationTime, link.OracleRequest.ClientID)) @@ -125,7 +125,7 @@ func (k Keeper) DeleteAllUserApplicationLinks(ctx sdk.Context, user string) { return false }) - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) for _, link := range links { store.Delete(types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username)) } diff --git a/x/profiles/keeper/keeper_blocks.go b/x/profiles/keeper/keeper_blocks.go index 8fd357493f..1ea6b0d4c6 100644 --- a/x/profiles/keeper/keeper_blocks.go +++ b/x/profiles/keeper/keeper_blocks.go @@ -21,14 +21,14 @@ func (k Keeper) SaveUserBlock(ctx sdk.Context, userBlock types.UserBlock) error return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "blocker and blocked cannot be the same user") } - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) key := types.UserBlockStoreKey(userBlock.Blocker, userBlock.Subspace, userBlock.Blocked) if store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "the user with address %s has already been blocked", userBlock.Blocked) } - store.Set(key, k.Cdc.MustMarshal(&userBlock)) + store.Set(key, k.cdc.MustMarshal(&userBlock)) return nil } @@ -44,14 +44,14 @@ func (k Keeper) GetUserBlocks(ctx sdk.Context, blocker string) []types.UserBlock // GetAllUsersBlocks returns a list of all the users blocks inside the given context. func (k Keeper) GetAllUsersBlocks(ctx sdk.Context) []types.UserBlock { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.UsersBlocksStorePrefix) defer iterator.Close() var usersBlocks []types.UserBlock for ; iterator.Valid(); iterator.Next() { - block := types.MustUnmarshalUserBlock(k.Cdc, iterator.Value()) + block := types.MustUnmarshalUserBlock(k.cdc, iterator.Value()) usersBlocks = append(usersBlocks, block) } @@ -67,7 +67,7 @@ func (k Keeper) IsUserBlocked(ctx sdk.Context, blocker, blocked string) bool { // If the provided subspace is empty, all subspaces will be checked func (k Keeper) HasUserBlocked(ctx sdk.Context, blocker, blocked, subspace string) bool { if subspace != "" { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) key := types.UserBlockStoreKey(blocker, subspace, blocked) return store.Has(key) @@ -85,7 +85,7 @@ func (k Keeper) HasUserBlocked(ctx sdk.Context, blocker, blocked, subspace strin // DeleteUserBlock allows to the specified blocker to unblock the given blocked user. func (k Keeper) DeleteUserBlock(ctx sdk.Context, blocker, blocked string, subspace string) error { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) key := types.UserBlockStoreKey(blocker, subspace, blocked) if !store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, @@ -103,7 +103,7 @@ func (k Keeper) DeleteAllUserBlocks(ctx sdk.Context, user string) { return false }) - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) for _, block := range blocks { store.Delete(types.UserBlockStoreKey(block.Blocker, block.Subspace, block.Blocked)) } diff --git a/x/profiles/keeper/keeper_chain_links.go b/x/profiles/keeper/keeper_chain_links.go index 58ec370b43..54a1384583 100644 --- a/x/profiles/keeper/keeper_chain_links.go +++ b/x/profiles/keeper/keeper_chain_links.go @@ -21,7 +21,7 @@ func (k Keeper) SaveChainLink(ctx sdk.Context, link types.ChainLink) error { } // Validate the source address - srcAddrData, err := types.UnpackAddressData(k.Cdc, link.Address) + srcAddrData, err := types.UnpackAddressData(k.cdc, link.Address) if err != nil { return err } @@ -32,7 +32,7 @@ func (k Keeper) SaveChainLink(ctx sdk.Context, link types.ChainLink) error { } // Verify the proof - err = link.Proof.Verify(k.Cdc, srcAddrData) + err = link.Proof.Verify(k.cdc, srcAddrData) if err != nil { return sdkerrors.Wrap(types.ErrInvalidProof, err.Error()) } @@ -43,28 +43,28 @@ func (k Keeper) SaveChainLink(ctx sdk.Context, link types.ChainLink) error { } // Set chain link -> address association - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) key := types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, target) - store.Set(key, types.MustMarshalChainLink(k.Cdc, link)) + store.Set(key, types.MustMarshalChainLink(k.cdc, link)) return nil } // GetChainLink returns the chain link for the given owner, chain name and target. // If such link does not exist, returns false instead. func (k Keeper) GetChainLink(ctx sdk.Context, owner, chainName, target string) (types.ChainLink, bool) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) key := types.ChainLinksStoreKey(owner, chainName, target) if !store.Has(key) { return types.ChainLink{}, false } - return types.MustUnmarshalChainLink(k.Cdc, store.Get(key)), true + return types.MustUnmarshalChainLink(k.cdc, store.Get(key)), true } // DeleteChainLink deletes the link associated with the given address and chain name func (k Keeper) DeleteChainLink(ctx sdk.Context, owner, chainName, target string) error { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) key := types.ChainLinksStoreKey(owner, chainName, target) if !store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, @@ -84,7 +84,7 @@ func (k Keeper) DeleteAllUserChainLinks(ctx sdk.Context, user string) { return false }) - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) for _, link := range links { address := link.Address.GetCachedValue().(types.AddressData) store.Delete(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, address.GetValue())) diff --git a/x/profiles/keeper/keeper_dtag_transfers.go b/x/profiles/keeper/keeper_dtag_transfers.go index 0ac41f1922..579cef65d2 100644 --- a/x/profiles/keeper/keeper_dtag_transfers.go +++ b/x/profiles/keeper/keeper_dtag_transfers.go @@ -16,7 +16,7 @@ func (k Keeper) SaveDTagTransferRequest(ctx sdk.Context, request types.DTagTrans return sdkerrors.Wrap(types.ErrProfileNotFound, "request receiver does not have a profile") } - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) key := types.DTagTransferRequestStoreKey(request.Sender, request.Receiver) if store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, @@ -24,7 +24,7 @@ func (k Keeper) SaveDTagTransferRequest(ctx sdk.Context, request types.DTagTrans request.Sender, request.Receiver) } - store.Set(key, k.Cdc.MustMarshal(&request)) + store.Set(key, k.cdc.MustMarshal(&request)) k.Logger(ctx).Info("DTag transfer request", "sender", request.Sender, "receiver", request.Receiver) return nil } @@ -32,14 +32,14 @@ func (k Keeper) SaveDTagTransferRequest(ctx sdk.Context, request types.DTagTrans // GetDTagTransferRequest retries the DTag transfer request made from the specified sender to the given receiver. // If the request was not found, returns false instead. func (k Keeper) GetDTagTransferRequest(ctx sdk.Context, sender, receiver string) (types.DTagTransferRequest, bool, error) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) key := types.DTagTransferRequestStoreKey(sender, receiver) if !store.Has(key) { return types.DTagTransferRequest{}, false, nil } var request types.DTagTransferRequest - err := k.Cdc.Unmarshal(store.Get(key), &request) + err := k.cdc.Unmarshal(store.Get(key), &request) if err != nil { return types.DTagTransferRequest{}, false, err } @@ -49,12 +49,12 @@ func (k Keeper) GetDTagTransferRequest(ctx sdk.Context, sender, receiver string) // GetDTagTransferRequests returns all the requests inside the given context func (k Keeper) GetDTagTransferRequests(ctx sdk.Context) (requests []types.DTagTransferRequest) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.DTagTransferRequestPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - request := types.MustUnmarshalDTagTransferRequest(k.Cdc, iterator.Value()) + request := types.MustUnmarshalDTagTransferRequest(k.cdc, iterator.Value()) requests = append(requests, request) } @@ -63,7 +63,7 @@ func (k Keeper) GetDTagTransferRequests(ctx sdk.Context) (requests []types.DTagT // DeleteDTagTransferRequest deletes the transfer request made from the sender towards the recipient func (k Keeper) DeleteDTagTransferRequest(ctx sdk.Context, sender, recipient string) error { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) key := types.DTagTransferRequestStoreKey(sender, recipient) if !store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "request from %s to %s not found", sender, recipient) @@ -81,7 +81,7 @@ func (k Keeper) DeleteAllUserIncomingDTagTransferRequests(ctx sdk.Context, recei return false }) - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) for _, request := range requests { store.Delete(types.DTagTransferRequestStoreKey(request.Sender, request.Receiver)) } diff --git a/x/profiles/keeper/keeper_ibc.go b/x/profiles/keeper/keeper_ibc.go index 158e937163..31ab82f743 100644 --- a/x/profiles/keeper/keeper_ibc.go +++ b/x/profiles/keeper/keeper_ibc.go @@ -38,13 +38,13 @@ func (k Keeper) BindPort(ctx sdk.Context, portID string) error { // GetPort returns the portID for the module. Used in ExportGenesis func (k Keeper) GetPort(ctx sdk.Context) string { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) return string(store.Get(types.IBCPortKey)) } // SetPort sets the portID for the module. Used in InitGenesis func (k Keeper) SetPort(ctx sdk.Context, portID string) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) store.Set(types.IBCPortKey, []byte(portID)) } diff --git a/x/profiles/keeper/keeper_relationships.go b/x/profiles/keeper/keeper_relationships.go index 98ed5f8c27..1ba9bc2e4d 100644 --- a/x/profiles/keeper/keeper_relationships.go +++ b/x/profiles/keeper/keeper_relationships.go @@ -20,27 +20,27 @@ func (k Keeper) SaveRelationship(ctx sdk.Context, relationship types.Relationshi return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "relationship creator and recipient cannot be the same user") } - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) key := types.RelationshipsStoreKey(relationship.Creator, relationship.Subspace, relationship.Recipient) if store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "relationship already exists with %s", relationship.Recipient) } - store.Set(key, types.MustMarshalRelationship(k.Cdc, relationship)) + store.Set(key, types.MustMarshalRelationship(k.cdc, relationship)) return nil } // GetRelationship returns the relationship existing between the provided creator and recipient inside the given subspace func (k Keeper) GetRelationship(ctx sdk.Context, creator, subspace, recipient string) (types.Relationship, bool) { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) key := types.RelationshipsStoreKey(creator, subspace, recipient) if !store.Has(key) { return types.Relationship{}, false } - return types.MustUnmarshalRelationship(k.Cdc, store.Get(key)), true + return types.MustUnmarshalRelationship(k.cdc, store.Get(key)), true } // GetUserRelationships allows to list all the stored relationships that involve the given user. @@ -65,7 +65,7 @@ func (k Keeper) GetAllRelationships(ctx sdk.Context) []types.Relationship { // RemoveRelationship allows to delete the relationship between the given user and his counterparty func (k Keeper) RemoveRelationship(ctx sdk.Context, relationship types.Relationship) error { - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) key := types.RelationshipsStoreKey(relationship.Creator, relationship.Subspace, relationship.Recipient) if !store.Has(key) { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, @@ -84,7 +84,7 @@ func (k Keeper) DeleteAllUserRelationships(ctx sdk.Context, user string) { return false }) - store := ctx.KVStore(k.StoreKey) + store := ctx.KVStore(k.storeKey) for _, relationship := range relationships { store.Delete(types.RelationshipsStoreKey(relationship.Creator, relationship.Subspace, relationship.Recipient)) } diff --git a/x/profiles/keeper/migrations.go b/x/profiles/keeper/migrations.go index 3d31964ddd..936172d76f 100644 --- a/x/profiles/keeper/migrations.go +++ b/x/profiles/keeper/migrations.go @@ -36,12 +36,12 @@ func NewMigrator(keeper Keeper, amino *codec.LegacyAmino, queryServer grpc.Serve // Migrate1to2 migrates from version 1 to 2. func (m Migrator) Migrate1to2(ctx sdk.Context) error { - return v200.MigrateStore(ctx, m.keeper.StoreKey, m.keeper.paramSubspace, m.keeper.Cdc, m.amino) + return v200.MigrateStore(ctx, m.keeper.storeKey, m.keeper.paramSubspace, m.keeper.cdc, m.amino) } // Migrate2to3 migrates from version 2 to 3. func (m Migrator) Migrate2to3(ctx sdk.Context) error { - return v210.MigrateStore(ctx, m.keeper.StoreKey, m.keeper.Cdc) + return v210.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc) } // Migrate3to4 migrates from version 3 to 4. @@ -80,7 +80,7 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error { // Migrate4to5 migrates from version 4 to 5 func (m Migrator) Migrate4to5(ctx sdk.Context) error { - return v231.MigrateStore(ctx, m.keeper.StoreKey, m.keeper.paramSubspace, m.keeper.Cdc) + return v231.MigrateStore(ctx, m.keeper.storeKey, m.keeper.paramSubspace, m.keeper.cdc) } func (m Migrator) migrateProfile(ctx sdk.Context, profile *types.Profile) error { diff --git a/x/profiles/keeper/msg_server_chain_link.go b/x/profiles/keeper/msg_server_chain_link.go index d6c2f200fb..1290f4d792 100644 --- a/x/profiles/keeper/msg_server_chain_link.go +++ b/x/profiles/keeper/msg_server_chain_link.go @@ -12,7 +12,7 @@ import ( func (k msgServer) LinkChainAccount(goCtx context.Context, msg *types.MsgLinkChainAccount) (*types.MsgLinkChainAccountResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - srcAddrData, err := types.UnpackAddressData(k.Cdc, msg.ChainAddress) + srcAddrData, err := types.UnpackAddressData(k.cdc, msg.ChainAddress) if err != nil { return nil, err } diff --git a/x/profiles/keeper/relay_chain_links.go b/x/profiles/keeper/relay_chain_links.go index dd0f46bc94..ce80aa86f5 100644 --- a/x/profiles/keeper/relay_chain_links.go +++ b/x/profiles/keeper/relay_chain_links.go @@ -21,7 +21,7 @@ func (k Keeper) OnRecvLinkChainAccountPacket( return packetAck, err } - srcAddrData, err := types.UnpackAddressData(k.Cdc, data.SourceAddress) + srcAddrData, err := types.UnpackAddressData(k.cdc, data.SourceAddress) if err != nil { return packetAck, err } @@ -40,7 +40,7 @@ func (k Keeper) OnRecvLinkChainAccountPacket( // Get the destination proof public key var pubKey cryptotypes.PubKey - err = k.Cdc.UnpackAny(data.DestinationProof.PubKey, &pubKey) + err = k.cdc.UnpackAny(data.DestinationProof.PubKey, &pubKey) if err != nil { return packetAck, sdkerrors.Wrap(sdkerrors.ErrInvalidType, "invalid public key type") } @@ -54,7 +54,7 @@ func (k Keeper) OnRecvLinkChainAccountPacket( // Verify the destination proof destAddrData := types.NewBech32Address(data.DestinationAddress, sdk.GetConfig().GetBech32AccountAddrPrefix()) - err = data.DestinationProof.Verify(k.Cdc, destAddrData) + err = data.DestinationProof.Verify(k.cdc, destAddrData) if err != nil { return packetAck, err } From 450d09179e5188eb854096524455fe9af64db3f3 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 24 Jan 2022 11:57:04 +0100 Subject: [PATCH 013/112] revert unwanted changes in chain links file --- x/profiles/types/models_chain_links.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/profiles/types/models_chain_links.go b/x/profiles/types/models_chain_links.go index 21dbf2144b..69a443a348 100644 --- a/x/profiles/types/models_chain_links.go +++ b/x/profiles/types/models_chain_links.go @@ -8,7 +8,7 @@ import ( "time" "github.com/cosmos/cosmos-sdk/types/bech32" - "github.com/cosmos/cosmos-sdk/types/tx/signing" + signing "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/tendermint/tendermint/crypto/tmhash" "github.com/btcsuite/btcd/btcec" From 7cd38b4175bb8fd1152bbc1b94d0a026f4b65400 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 24 Jan 2022 15:45:16 +0100 Subject: [PATCH 014/112] fixed params migration test added on-chain-upgrade test specs to on-chain-upgrade.yml --- .github/workflows/on-chain-upgrade.yml | 6 +-- x/profiles/keeper/migrations.go | 2 +- x/profiles/legacy/v231/store.go | 57 +++++++++++++++++++------- x/profiles/legacy/v231/store_test.go | 12 +++++- 4 files changed, 57 insertions(+), 20 deletions(-) diff --git a/.github/workflows/on-chain-upgrade.yml b/.github/workflows/on-chain-upgrade.yml index 4cf3ffd010..6f84487aec 100644 --- a/.github/workflows/on-chain-upgrade.yml +++ b/.github/workflows/on-chain-upgrade.yml @@ -22,9 +22,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 env: - GENESIS_DESMOS_VERSION: "v2.3.0-mainnet" - GENESIS_URL: "https://raw.githubusercontent.com/RiccardoM/desmos-states/master/desmos-mainnet-1160425.json" - UPGRADE_NAME: "v2.3.1" + GENESIS_DESMOS_VERSION: "v2.3.1" + GENESIS_URL: "https://raw.githubusercontent.com/bragaz/desmos-states/master/genesis-state-231.json" + UPGRADE_NAME: "v2.4.0" steps: - name: Checkout 🛎️ uses: actions/checkout@v2 diff --git a/x/profiles/keeper/migrations.go b/x/profiles/keeper/migrations.go index 936172d76f..2ad07aa46c 100644 --- a/x/profiles/keeper/migrations.go +++ b/x/profiles/keeper/migrations.go @@ -80,7 +80,7 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error { // Migrate4to5 migrates from version 4 to 5 func (m Migrator) Migrate4to5(ctx sdk.Context) error { - return v231.MigrateStore(ctx, m.keeper.storeKey, m.keeper.paramSubspace, m.keeper.cdc) + return v231.MigrateStore(ctx, m.keeper.storeKey, m.keeper.paramSubspace, m.keeper.cdc, m.amino) } func (m Migrator) migrateProfile(ctx sdk.Context, profile *types.Profile) error { diff --git a/x/profiles/legacy/v231/store.go b/x/profiles/legacy/v231/store.go index 22e8dd0f85..a40ceffad8 100644 --- a/x/profiles/legacy/v231/store.go +++ b/x/profiles/legacy/v231/store.go @@ -14,12 +14,16 @@ import ( // migration includes: // - Add the AppLinkParams to the params set // - Added expiration time to all app links -func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, subspace paramstypes.Subspace, cdc codec.BinaryCodec) error { +func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, subspace paramstypes.Subspace, cdc codec.BinaryCodec, + legacyAmino *codec.LegacyAmino) error { store := ctx.KVStore(storeKey) - migrateParams(ctx, subspace) + err := migrateParams(ctx, subspace, legacyAmino) + if err != nil { + return err + } - err := migrateAppLinks(store, cdc) + err = migrateAppLinks(store, cdc) if err != nil { return err } @@ -91,24 +95,47 @@ func migrateAppLinkResult(r *v200.Result) *types.Result { } // migrateParams add the AppLinksParams to the params set -func migrateParams(ctx sdk.Context, subspace paramstypes.Subspace) { - var params v200.Params - subspace.GetParamSet(ctx, ¶ms) +func migrateParams(ctx sdk.Context, subspace paramstypes.Subspace, legacyAmino *codec.LegacyAmino) error { + var v2NicknameParams v200.NicknameParams + err := legacyAmino.UnmarshalJSON(subspace.GetRaw(ctx, types.NicknameParamsKey), &v2NicknameParams) + if err != nil { + return err + } + + var v2DTagParams v200.DTagParams + err = legacyAmino.UnmarshalJSON(subspace.GetRaw(ctx, types.DTagParamsKey), &v2DTagParams) + if err != nil { + return err + } - nicknameParams := types.NewNicknameParams(params.Nickname.MinLength, params.Nickname.MaxLength) - dtagParams := types.NewDTagParams(params.DTag.RegEx, params.DTag.MinLength, params.DTag.MaxLength) - bioParams := types.NewBioParams(params.Bio.MaxLength) + var v2OracleParams v200.OracleParams + err = legacyAmino.UnmarshalJSON(subspace.GetRaw(ctx, types.OracleParamsKey), &v2OracleParams) + if err != nil { + return err + } + + var v2BioParams v200.BioParams + err = legacyAmino.UnmarshalJSON(subspace.GetRaw(ctx, types.BioParamsKey), &v2BioParams) + if err != nil { + return err + } + + nicknameParams := types.NewNicknameParams(v2NicknameParams.MinLength, v2NicknameParams.MaxLength) + dtagParams := types.NewDTagParams(v2DTagParams.RegEx, v2DTagParams.MinLength, v2DTagParams.MaxLength) + bioParams := types.NewBioParams(v2BioParams.MaxLength) oracleParams := types.NewOracleParams( - params.Oracle.ScriptID, - params.Oracle.AskCount, - params.Oracle.MinCount, - params.Oracle.PrepareGas, - params.Oracle.ExecuteGas, - params.Oracle.FeeAmount..., + v2OracleParams.ScriptID, + v2OracleParams.AskCount, + v2OracleParams.MinCount, + v2OracleParams.PrepareGas, + v2OracleParams.ExecuteGas, + v2OracleParams.FeeAmount..., ) subspace.Set(ctx, types.NicknameParamsKey, &nicknameParams) subspace.Set(ctx, types.DTagParamsKey, &dtagParams) subspace.Set(ctx, types.BioParamsKey, &bioParams) subspace.Set(ctx, types.OracleParamsKey, &oracleParams) + + return nil } diff --git a/x/profiles/legacy/v231/store_test.go b/x/profiles/legacy/v231/store_test.go index 0ca559e274..9ec1d27d15 100644 --- a/x/profiles/legacy/v231/store_test.go +++ b/x/profiles/legacy/v231/store_test.go @@ -69,6 +69,7 @@ func TestStoreMigration(t *testing.T) { time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), time.Date(2022, 6, 18, 00, 00, 00, 000, time.UTC), )), + expectedParams: types.DefaultParams(), }, } @@ -77,8 +78,16 @@ func TestStoreMigration(t *testing.T) { store.Set(tc.key, tc.oldValue) } + // set the new paramSpace for the migration + newParams := types.DefaultParams() + newParamSpace := paramstypes.NewSubspace(cdc, legacyAminoCdc, profilesKey, transientKey, "profiles") + newParamSpace = newParamSpace.WithKeyTable(types.ParamKeyTable()) + newParamSpace.SetParamSet(ctx, &newParams) + + newParamSpace.GetParamSet(ctx, &newParams) + // Run migrations - err := v231.MigrateStore(ctx, profilesKey, paramsSpace, cdc) + err := v231.MigrateStore(ctx, profilesKey, newParamSpace, cdc, legacyAminoCdc) require.NoError(t, err) // Make sure the new values are set properly @@ -86,6 +95,7 @@ func TestStoreMigration(t *testing.T) { tc := tc t.Run(tc.name, func(t *testing.T) { require.Equal(t, tc.newValue, store.Get(tc.key)) + require.Equal(t, tc.expectedParams, newParams) }) } } From ece318dff6657794d1c266908bb413e462ca9a51 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 24 Jan 2022 15:49:33 +0100 Subject: [PATCH 015/112] added changeset entry --- ...b743fe24a744181d1afee8015075d801dcaea4c9783ed128cca.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/entries/7d2f19ca69bf6b743fe24a744181d1afee8015075d801dcaea4c9783ed128cca.yaml diff --git a/.changeset/entries/7d2f19ca69bf6b743fe24a744181d1afee8015075d801dcaea4c9783ed128cca.yaml b/.changeset/entries/7d2f19ca69bf6b743fe24a744181d1afee8015075d801dcaea4c9783ed128cca.yaml new file mode 100644 index 0000000000..3ec1c17c0b --- /dev/null +++ b/.changeset/entries/7d2f19ca69bf6b743fe24a744181d1afee8015075d801dcaea4c9783ed128cca.yaml @@ -0,0 +1,6 @@ +type: feat +module: x/profiles +pull_request: 723 +description: Added ExpirationTime field to ApplicationLinks +backward_compatible: false +date: 2022-01-24T14:49:03.724641Z From f3f8ca32b3890bceaf2464cb7c1dd31dbcb19a8e Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 24 Jan 2022 16:58:29 +0100 Subject: [PATCH 016/112] edited genesis state link for on-chain-upgrade test --- .github/workflows/on-chain-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on-chain-upgrade.yml b/.github/workflows/on-chain-upgrade.yml index 6f84487aec..7f64b0b8ab 100644 --- a/.github/workflows/on-chain-upgrade.yml +++ b/.github/workflows/on-chain-upgrade.yml @@ -23,7 +23,7 @@ jobs: timeout-minutes: 30 env: GENESIS_DESMOS_VERSION: "v2.3.1" - GENESIS_URL: "https://raw.githubusercontent.com/bragaz/desmos-states/master/genesis-state-231.json" + GENESIS_URL: "https://raw.githubusercontent.com/RiccardoM/desmos-states/master/morpheus-apollo-2-3900000.json" UPGRADE_NAME: "v2.4.0" steps: - name: Checkout 🛎️ From 60b7917faa2c8dd2d1804454b6238ab384d6e648 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 24 Jan 2022 17:38:27 +0100 Subject: [PATCH 017/112] added some lines to IterateExpiringLinks test to cover a missing case --- x/profiles/keeper/alias_functions_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x/profiles/keeper/alias_functions_test.go b/x/profiles/keeper/alias_functions_test.go index 2b8be9ce73..6c112c9177 100644 --- a/x/profiles/keeper/alias_functions_test.go +++ b/x/profiles/keeper/alias_functions_test.go @@ -316,6 +316,14 @@ func (suite *KeeperTestSuite) TestKeeper_IterateExpiringApplicationLinks() { suite.Require().NoError(err) } + // save an expiration key referring to an already deleted AppLink to test lines 225-227 + clientID := "already_deleted" + applicationLinkExpiringTimeKey := types.ApplicationLinkExpiringTimeKey( + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), clientID, + ) + store := ctx.KVStore(suite.storeKey) + store.Set(applicationLinkExpiringTimeKey, []byte(clientID)) + var expiredLinks []types.ApplicationLink suite.k.IterateExpiringApplicationLinks(ctx, func(index int64, link types.ApplicationLink) (stop bool) { expiredLinks = append(expiredLinks, link) From 427a9f449b913bd0ddf593c2353925e1c4d52fab Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 10:14:44 +0100 Subject: [PATCH 018/112] updated on-chain-upgrade workflow with mainnet state --- .github/workflows/on-chain-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on-chain-upgrade.yml b/.github/workflows/on-chain-upgrade.yml index 7f64b0b8ab..30624fe86a 100644 --- a/.github/workflows/on-chain-upgrade.yml +++ b/.github/workflows/on-chain-upgrade.yml @@ -23,7 +23,7 @@ jobs: timeout-minutes: 30 env: GENESIS_DESMOS_VERSION: "v2.3.1" - GENESIS_URL: "https://raw.githubusercontent.com/RiccardoM/desmos-states/master/morpheus-apollo-2-3900000.json" + GENESIS_URL: "https://raw.githubusercontent.com/RiccardoM/desmos-states/master/desmos-mainnet-2028450.json" UPGRADE_NAME: "v2.4.0" steps: - name: Checkout 🛎️ From 5c64fbf9f14862b7cd47c9b8246bd9624ff47467 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 11:38:40 +0100 Subject: [PATCH 019/112] trying on-chain upgrade --- contrib/upgrade_testnet/submit_upgrade_proposal.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/upgrade_testnet/submit_upgrade_proposal.sh b/contrib/upgrade_testnet/submit_upgrade_proposal.sh index b25f5da34e..84e85933ec 100755 --- a/contrib/upgrade_testnet/submit_upgrade_proposal.sh +++ b/contrib/upgrade_testnet/submit_upgrade_proposal.sh @@ -29,6 +29,7 @@ echo "====> Chain is online. Ready to submit proposal" CHAIN_ID=$(curl -s $NODE/status | jq -r '.result.node_info.network') if [ -z "$CHAIN_ID" ]; then echo "Missing chain id" + docker logs desmosdnode0 exit 1 fi From c72eedf53b524cb903d3c2142a63fa832942926d Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 13:44:20 +0100 Subject: [PATCH 020/112] trying the fix for on-chain-upgrade test by adding a correct state export path --- .github/workflows/on-chain-upgrade.yml | 2 +- contrib/upgrade_testnet/submit_upgrade_proposal.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-chain-upgrade.yml b/.github/workflows/on-chain-upgrade.yml index 30624fe86a..07fbc9d6f1 100644 --- a/.github/workflows/on-chain-upgrade.yml +++ b/.github/workflows/on-chain-upgrade.yml @@ -23,7 +23,7 @@ jobs: timeout-minutes: 30 env: GENESIS_DESMOS_VERSION: "v2.3.1" - GENESIS_URL: "https://raw.githubusercontent.com/RiccardoM/desmos-states/master/desmos-mainnet-2028450.json" + GENESIS_URL: "https://raw.githubusercontent.com/RiccardoM/desmos-states/master/morpheus-apollo-2-3934000.json" UPGRADE_NAME: "v2.4.0" steps: - name: Checkout 🛎️ diff --git a/contrib/upgrade_testnet/submit_upgrade_proposal.sh b/contrib/upgrade_testnet/submit_upgrade_proposal.sh index 84e85933ec..48ee37a616 100755 --- a/contrib/upgrade_testnet/submit_upgrade_proposal.sh +++ b/contrib/upgrade_testnet/submit_upgrade_proposal.sh @@ -24,7 +24,11 @@ while [ ${CNT} -lt $ITER ]; do sleep $SLEEP done -echo "====> Chain is online. Ready to submit proposal" +if [ ITER == 20 ] + echo "====> Chain is still offline. Not ready to submit proposal" +else + echo "====> Chain is online. Ready to submit proposal" +fi CHAIN_ID=$(curl -s $NODE/status | jq -r '.result.node_info.network') if [ -z "$CHAIN_ID" ]; then From 3b0423bf347d26533f5eaadf3f7be04a9328cd1c Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 14:15:08 +0100 Subject: [PATCH 021/112] added missing BUILD_TAGS in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 28a98cd5ef..5381f8a8fd 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(MAKE) build + GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) build build-reproducible: go.sum $(DOCKER) rm latest-build || true From 95d129db92623da38c9fa7143c0f4c6f44400c56 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 14:18:12 +0100 Subject: [PATCH 022/112] fix last commit with BUILD_FLAGS in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5381f8a8fd..350856fe00 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) build + GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(BUILD_FLAGS) $(MAKE) build build-reproducible: go.sum $(DOCKER) rm latest-build || true From d0732e5dc983dbc404f203ac622c4b49c9e3033b Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 14:27:53 +0100 Subject: [PATCH 023/112] removed wrong flag from build-linux cmd --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 350856fe00..28a98cd5ef 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(BUILD_FLAGS) $(MAKE) build + GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(MAKE) build build-reproducible: go.sum $(DOCKER) rm latest-build || true From 19913bab24a3da463b27669bd5b4edf0578d6040 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 14:39:40 +0100 Subject: [PATCH 024/112] trying add the muslc directly in the build-linux cmd --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 28a98cd5ef..5381f8a8fd 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(MAKE) build + GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) build build-reproducible: go.sum $(DOCKER) rm latest-build || true From 677f675505b93044840dee545abc01faf9b95187 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 14:58:05 +0100 Subject: [PATCH 025/112] adding the static wasmvm library --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 5381f8a8fd..abd2c67bc4 100644 --- a/Makefile +++ b/Makefile @@ -88,6 +88,7 @@ endif ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) ldflags += -w -s endif +ldflags += -L "github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/" -l/lib/libwasmvm_muslc.a ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) From 4864180879d8095aaa22b8c17c0625dc861a559b Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 15:17:03 +0100 Subject: [PATCH 026/112] Revert "adding the static wasmvm library" This reverts commit 677f675505b93044840dee545abc01faf9b95187. --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index abd2c67bc4..5381f8a8fd 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,6 @@ endif ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) ldflags += -w -s endif -ldflags += -L "github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/" -l/lib/libwasmvm_muslc.a ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) From ead0d9830cab33a38be71127bd6f39a9be67e618 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 15:27:31 +0100 Subject: [PATCH 027/112] adding the static wasmvm library --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 5381f8a8fd..5d944cfa10 100644 --- a/Makefile +++ b/Makefile @@ -88,6 +88,8 @@ endif ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) ldflags += -w -s endif + +ldflags += -X "github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a" ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) From 7e007102fb55e256d4e77d44954f5c3e4704ee62 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 15:27:56 +0100 Subject: [PATCH 028/112] adding the static wasmvm library --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5d944cfa10..868680d7a5 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,7 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) ldflags += -w -s endif -ldflags += -X "github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a" +ldflags += -X 'github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a' ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) From 82fb64ea299b1f78fe6608196b77318fae1f601d Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 15:29:42 +0100 Subject: [PATCH 029/112] Revert "adding the static wasmvm library" This reverts commit 7e007102fb55e256d4e77d44954f5c3e4704ee62. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 868680d7a5..5d944cfa10 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,7 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) ldflags += -w -s endif -ldflags += -X 'github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a' +ldflags += -X "github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a" ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) From c017bf75b41c4357f635c0b152fad8d374f9f594 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 15:29:56 +0100 Subject: [PATCH 030/112] Revert "adding the static wasmvm library" This reverts commit ead0d9830cab33a38be71127bd6f39a9be67e618. --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 5d944cfa10..5381f8a8fd 100644 --- a/Makefile +++ b/Makefile @@ -88,8 +88,6 @@ endif ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) ldflags += -w -s endif - -ldflags += -X "github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a" ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) From 39a504b4e718ebb9ceb6c0a9bdfe86b99ca1bdc2 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 15:45:04 +0100 Subject: [PATCH 031/112] download the static library in start.sh add the link of the library inside makefile --- Makefile | 2 ++ contrib/upgrade_testnet/start.sh | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 5381f8a8fd..5b3c3713a9 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,8 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) BUILD_FLAGS += -trimpath endif +ldflags += -L/lib/ -llibwasmvm_muslc.a + # The below include contains the tools and runsim targets. include contrib/devtools/Makefile diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 78212311ef..e8b6fbb364 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -13,6 +13,12 @@ TESTNETDIR=$CONTRIBFOLDER/upgrade_testnet echo "===> Removing build folder" rm -r -f $BUILDDIR +# Downloading static libraries +echo "===> Downloading necessary static libraries" +wget -O /lib/libwasmvm_muslc.a https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a +echo "===> Checking static libraries" +sha256sum /lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 + # Create the 4 nodes folders with the correct denom echo "===> Creating $NODES nodes localnet" make setup-localnet COIN_DENOM="udaric" NODES=$NODES > /dev/null > /dev/null From 9d68bced68957758e707613355e3c7dcef95dc81 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 15:48:06 +0100 Subject: [PATCH 032/112] added sudo rights --- contrib/upgrade_testnet/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index e8b6fbb364..0f4c60af47 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -15,7 +15,7 @@ rm -r -f $BUILDDIR # Downloading static libraries echo "===> Downloading necessary static libraries" -wget -O /lib/libwasmvm_muslc.a https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a +sudo wget -O /lib/libwasmvm_muslc.a https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a echo "===> Checking static libraries" sha256sum /lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 From 4f2161f4a11781fa31e17ac4511aa9689feb354b Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 16:04:06 +0100 Subject: [PATCH 033/112] fixing static lib download --- contrib/upgrade_testnet/start.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 0f4c60af47..807ed54840 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -15,7 +15,8 @@ rm -r -f $BUILDDIR # Downloading static libraries echo "===> Downloading necessary static libraries" -sudo wget -O /lib/libwasmvm_muslc.a https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a +mkdir lib +sudo wget https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a -P lib/ echo "===> Checking static libraries" sha256sum /lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 From 356838cc0d2a435792af96b02aedcdb78e60a80a Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 25 Jan 2022 21:17:29 +0100 Subject: [PATCH 034/112] tried to link the wasmvm static library in makefile --- Makefile | 9 ++++++--- contrib/upgrade_testnet/start.sh | 7 ------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 5b3c3713a9..2254415cc5 100644 --- a/Makefile +++ b/Makefile @@ -90,6 +90,7 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) endif ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) +ldflags := -Llib BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' # check for nostrip option @@ -97,8 +98,6 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) BUILD_FLAGS += -trimpath endif -ldflags += -L/lib/ -llibwasmvm_muslc.a - # The below include contains the tools and runsim targets. include contrib/devtools/Makefile @@ -117,7 +116,11 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) build + # wget https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a -P lib/ + echo "===> Checking static libraries" + sha256sum lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 + GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) + build-reproducible: go.sum $(DOCKER) rm latest-build || true diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 807ed54840..78212311ef 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -13,13 +13,6 @@ TESTNETDIR=$CONTRIBFOLDER/upgrade_testnet echo "===> Removing build folder" rm -r -f $BUILDDIR -# Downloading static libraries -echo "===> Downloading necessary static libraries" -mkdir lib -sudo wget https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a -P lib/ -echo "===> Checking static libraries" -sha256sum /lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 - # Create the 4 nodes folders with the correct denom echo "===> Creating $NODES nodes localnet" make setup-localnet COIN_DENOM="udaric" NODES=$NODES > /dev/null > /dev/null From bb922e5e05bbbfcc3936b8731704b75976f506da Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 09:35:40 +0100 Subject: [PATCH 035/112] edit start.sh to handle the download and check of static libraries --- Makefile | 6 ++---- contrib/upgrade_testnet/start.sh | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 2254415cc5..f61e3bb90f 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ DOCKER := $(shell which docker) DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf BENCH_COUNT ?= 5 REF_NAME ?= $(shell git symbolic-ref HEAD --short | tr / - 2>/dev/null) +STATICLIBDIR = /contrib/lib export GO111MODULE = on @@ -90,7 +91,7 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) endif ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) -ldflags := -Llib +ldflags := -L contrib/lib #-llibwasmvm_muslc.a BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' # check for nostrip option @@ -116,9 +117,6 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum - # wget https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a -P lib/ - echo "===> Checking static libraries" - sha256sum lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 78212311ef..759c016117 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -8,6 +8,7 @@ UPGRADE_NAME=$4 BUILDDIR=$(pwd)/build CONTRIBFOLDER=$(pwd)/contrib TESTNETDIR=$CONTRIBFOLDER/upgrade_testnet +STATICLIBDIR=$CONTRIBFOLDER/lib # Remove the build folder echo "===> Removing build folder" @@ -32,6 +33,25 @@ make -C $CONTRIBFOLDER/images desmos-cosmovisor DESMOS_VERSION=$GENESIS_VERSION echo "===> Setting up the Docker compose file" sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\"|g" $TESTNETDIR/docker-compose.yml + +# Download and check of static libraries + +echo "===> Create static libraries dir" +if [[ -d "$STATICLIBDIR" ]] +then + echo "$STATICLIBDIR already exists" +else + mkdir $STATICLIBDIR +fi +echo "===> Download static libraries" +if [[ ! -f $STATICLIBDIR/libwasmvm_muslc.a ]] +then + wget https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a -P $STATICLIBDIR/ +fi + +echo "===> Checking static libraries" +sha256sum $STATICLIBDIR/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 + # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux > /dev/null From d0d8d6e475e86a8267506216f52faa00a5ae9950 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 09:42:55 +0100 Subject: [PATCH 036/112] removed wrong flag for linking static library --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index f61e3bb90f..b51835de67 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,6 @@ DOCKER := $(shell which docker) DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf BENCH_COUNT ?= 5 REF_NAME ?= $(shell git symbolic-ref HEAD --short | tr / - 2>/dev/null) -STATICLIBDIR = /contrib/lib export GO111MODULE = on @@ -91,7 +90,6 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) endif ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) -ldflags := -L contrib/lib #-llibwasmvm_muslc.a BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' # check for nostrip option From b12d853dbdf39dfdd8adcf12864778cff9247717 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 10:07:19 +0100 Subject: [PATCH 037/112] fixed building errors --- Makefile | 2 +- contrib/upgrade_testnet/start.sh | 5 ++--- contrib/upgrade_testnet/submit_upgrade_proposal.sh | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b51835de67..549b233a18 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) + GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(MAKE) build-reproducible: go.sum diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 759c016117..a6e6dd6808 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -38,9 +38,8 @@ sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\" echo "===> Create static libraries dir" if [[ -d "$STATICLIBDIR" ]] -then echo "$STATICLIBDIR already exists" -else +then mkdir $STATICLIBDIR fi echo "===> Download static libraries" @@ -54,7 +53,7 @@ sha256sum $STATICLIBDIR/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6 # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" -docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux > /dev/null +docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build BUILD_TAGS=muslc make build-linux > /dev/null # Copy the Desmos binary into the proper folders UPGRADE_FOLDER="$BUILDDIR/node0/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" diff --git a/contrib/upgrade_testnet/submit_upgrade_proposal.sh b/contrib/upgrade_testnet/submit_upgrade_proposal.sh index 48ee37a616..db06a015e3 100755 --- a/contrib/upgrade_testnet/submit_upgrade_proposal.sh +++ b/contrib/upgrade_testnet/submit_upgrade_proposal.sh @@ -26,7 +26,7 @@ done if [ ITER == 20 ] echo "====> Chain is still offline. Not ready to submit proposal" -else +then echo "====> Chain is online. Ready to submit proposal" fi From 287f3f31c2c0d712f40b1b13c82c0ff53d5cc9ab Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 10:14:20 +0100 Subject: [PATCH 038/112] Revert "fixed building errors" This reverts commit b12d853dbdf39dfdd8adcf12864778cff9247717. --- Makefile | 2 +- contrib/upgrade_testnet/start.sh | 5 +++-- contrib/upgrade_testnet/submit_upgrade_proposal.sh | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 549b233a18..b51835de67 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(MAKE) + GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) build-reproducible: go.sum diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index a6e6dd6808..759c016117 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -38,8 +38,9 @@ sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\" echo "===> Create static libraries dir" if [[ -d "$STATICLIBDIR" ]] - echo "$STATICLIBDIR already exists" then + echo "$STATICLIBDIR already exists" +else mkdir $STATICLIBDIR fi echo "===> Download static libraries" @@ -53,7 +54,7 @@ sha256sum $STATICLIBDIR/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6 # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" -docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build BUILD_TAGS=muslc make build-linux > /dev/null +docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux > /dev/null # Copy the Desmos binary into the proper folders UPGRADE_FOLDER="$BUILDDIR/node0/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" diff --git a/contrib/upgrade_testnet/submit_upgrade_proposal.sh b/contrib/upgrade_testnet/submit_upgrade_proposal.sh index db06a015e3..48ee37a616 100755 --- a/contrib/upgrade_testnet/submit_upgrade_proposal.sh +++ b/contrib/upgrade_testnet/submit_upgrade_proposal.sh @@ -26,7 +26,7 @@ done if [ ITER == 20 ] echo "====> Chain is still offline. Not ready to submit proposal" -then +else echo "====> Chain is online. Ready to submit proposal" fi From f8f4a5617278e3f373bdc0a9f9490fb325d753a1 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 10:14:20 +0100 Subject: [PATCH 039/112] Revert "removed wrong flag for linking static library" This reverts commit d0d8d6e475e86a8267506216f52faa00a5ae9950. --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index b51835de67..f61e3bb90f 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ DOCKER := $(shell which docker) DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf BENCH_COUNT ?= 5 REF_NAME ?= $(shell git symbolic-ref HEAD --short | tr / - 2>/dev/null) +STATICLIBDIR = /contrib/lib export GO111MODULE = on @@ -90,6 +91,7 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) endif ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) +ldflags := -L contrib/lib #-llibwasmvm_muslc.a BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' # check for nostrip option From 011a71d214aec415a674147c1556d6a67d658cff Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 10:14:20 +0100 Subject: [PATCH 040/112] Revert "edit start.sh to handle the download and check of static libraries" This reverts commit bb922e5e05bbbfcc3936b8731704b75976f506da. --- Makefile | 6 ++++-- contrib/upgrade_testnet/start.sh | 20 -------------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index f61e3bb90f..2254415cc5 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,6 @@ DOCKER := $(shell which docker) DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf BENCH_COUNT ?= 5 REF_NAME ?= $(shell git symbolic-ref HEAD --short | tr / - 2>/dev/null) -STATICLIBDIR = /contrib/lib export GO111MODULE = on @@ -91,7 +90,7 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) endif ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) -ldflags := -L contrib/lib #-llibwasmvm_muslc.a +ldflags := -Llib BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' # check for nostrip option @@ -117,6 +116,9 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum + # wget https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a -P lib/ + echo "===> Checking static libraries" + sha256sum lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 759c016117..78212311ef 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -8,7 +8,6 @@ UPGRADE_NAME=$4 BUILDDIR=$(pwd)/build CONTRIBFOLDER=$(pwd)/contrib TESTNETDIR=$CONTRIBFOLDER/upgrade_testnet -STATICLIBDIR=$CONTRIBFOLDER/lib # Remove the build folder echo "===> Removing build folder" @@ -33,25 +32,6 @@ make -C $CONTRIBFOLDER/images desmos-cosmovisor DESMOS_VERSION=$GENESIS_VERSION echo "===> Setting up the Docker compose file" sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\"|g" $TESTNETDIR/docker-compose.yml - -# Download and check of static libraries - -echo "===> Create static libraries dir" -if [[ -d "$STATICLIBDIR" ]] -then - echo "$STATICLIBDIR already exists" -else - mkdir $STATICLIBDIR -fi -echo "===> Download static libraries" -if [[ ! -f $STATICLIBDIR/libwasmvm_muslc.a ]] -then - wget https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a -P $STATICLIBDIR/ -fi - -echo "===> Checking static libraries" -sha256sum $STATICLIBDIR/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 - # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux > /dev/null From fbec69aad309558bef265dcf7f754a1f0005b28c Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 10:14:20 +0100 Subject: [PATCH 041/112] Revert "tried to link the wasmvm static library in makefile" This reverts commit 356838cc0d2a435792af96b02aedcdb78e60a80a. --- Makefile | 9 +++------ contrib/upgrade_testnet/start.sh | 7 +++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 2254415cc5..5b3c3713a9 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,6 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) endif ldflags += $(LDFLAGS) ldflags := $(strip $(ldflags)) -ldflags := -Llib BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' # check for nostrip option @@ -98,6 +97,8 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) BUILD_FLAGS += -trimpath endif +ldflags += -L/lib/ -llibwasmvm_muslc.a + # The below include contains the tools and runsim targets. include contrib/devtools/Makefile @@ -116,11 +117,7 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum - # wget https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a -P lib/ - echo "===> Checking static libraries" - sha256sum lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) - + GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) build build-reproducible: go.sum $(DOCKER) rm latest-build || true diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 78212311ef..807ed54840 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -13,6 +13,13 @@ TESTNETDIR=$CONTRIBFOLDER/upgrade_testnet echo "===> Removing build folder" rm -r -f $BUILDDIR +# Downloading static libraries +echo "===> Downloading necessary static libraries" +mkdir lib +sudo wget https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a -P lib/ +echo "===> Checking static libraries" +sha256sum /lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 + # Create the 4 nodes folders with the correct denom echo "===> Creating $NODES nodes localnet" make setup-localnet COIN_DENOM="udaric" NODES=$NODES > /dev/null > /dev/null From d3d1e9c2310cb73c69cbd5298a5d3da7f1cb68a7 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 10:17:50 +0100 Subject: [PATCH 042/112] removed wrong flag for linking static libraries --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 5b3c3713a9..5381f8a8fd 100644 --- a/Makefile +++ b/Makefile @@ -97,8 +97,6 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) BUILD_FLAGS += -trimpath endif -ldflags += -L/lib/ -llibwasmvm_muslc.a - # The below include contains the tools and runsim targets. include contrib/devtools/Makefile From 4a3893b2ee54e4af02097a4fd649cc567727a075 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 10:49:52 +0100 Subject: [PATCH 043/112] removed static lib download from start.sh --- contrib/upgrade_testnet/start.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 807ed54840..78212311ef 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -13,13 +13,6 @@ TESTNETDIR=$CONTRIBFOLDER/upgrade_testnet echo "===> Removing build folder" rm -r -f $BUILDDIR -# Downloading static libraries -echo "===> Downloading necessary static libraries" -mkdir lib -sudo wget https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a -P lib/ -echo "===> Checking static libraries" -sha256sum /lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 - # Create the 4 nodes folders with the correct denom echo "===> Creating $NODES nodes localnet" make setup-localnet COIN_DENOM="udaric" NODES=$NODES > /dev/null > /dev/null From 630db0066ea4c6df1c1fd56c9dfea02bc6f99ada Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 11:55:10 +0100 Subject: [PATCH 044/112] removed flag from build-linux cmd --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5381f8a8fd..28a98cd5ef 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) build + GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(MAKE) build build-reproducible: go.sum $(DOCKER) rm latest-build || true From 34255b6aaed11ad185b3fed97c9b1e15d66967d1 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 12:04:13 +0100 Subject: [PATCH 045/112] trying fix missing libraries errors in on-chain-upgrade test --- contrib/upgrade_testnet/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 78212311ef..b0a03b76ef 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -34,7 +34,7 @@ sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\" # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" -docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux > /dev/null +docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build BUILD_TAGS=muslc make build-linux > /dev/null # Copy the Desmos binary into the proper folders UPGRADE_FOLDER="$BUILDDIR/node0/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" From dad645e0ab688d3867119faa9ef8e210a10fbdfd Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 12:43:43 +0100 Subject: [PATCH 046/112] fixed error in submit_upgrade_proposal.sh removed flag in start.sh --- contrib/upgrade_testnet/start.sh | 2 +- contrib/upgrade_testnet/submit_upgrade_proposal.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index b0a03b76ef..78212311ef 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -34,7 +34,7 @@ sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\" # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" -docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build BUILD_TAGS=muslc make build-linux > /dev/null +docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux > /dev/null # Copy the Desmos binary into the proper folders UPGRADE_FOLDER="$BUILDDIR/node0/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" diff --git a/contrib/upgrade_testnet/submit_upgrade_proposal.sh b/contrib/upgrade_testnet/submit_upgrade_proposal.sh index 48ee37a616..db06a015e3 100755 --- a/contrib/upgrade_testnet/submit_upgrade_proposal.sh +++ b/contrib/upgrade_testnet/submit_upgrade_proposal.sh @@ -26,7 +26,7 @@ done if [ ITER == 20 ] echo "====> Chain is still offline. Not ready to submit proposal" -else +then echo "====> Chain is online. Ready to submit proposal" fi From 89949ed4d1391ef2c87a88d378b099641c9ea25c Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 13:23:02 +0100 Subject: [PATCH 047/112] readded muslc flag to build-linux --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 28a98cd5ef..5381f8a8fd 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(MAKE) build + GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) build build-reproducible: go.sum $(DOCKER) rm latest-build || true From ebb1059d61069a3f161e65667926b9c46fd38b21 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 13:49:46 +0100 Subject: [PATCH 048/112] updated upgradeHandler version to match that of subspace pr --- app/app.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index bc508d1fec..758102eb36 100644 --- a/app/app.go +++ b/app/app.go @@ -767,7 +767,7 @@ func (app *DesmosApp) RegisterTendermintService(clientCtx client.Context) { } func (app *DesmosApp) registerUpgradeHandlers() { - app.UpgradeKeeper.SetUpgradeHandler("v2.3.1", func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + app.UpgradeKeeper.SetUpgradeHandler("v3.0.0", func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { return app.mm.RunMigrations(ctx, app.configurator, fromVM) }) @@ -776,7 +776,7 @@ func (app *DesmosApp) registerUpgradeHandlers() { panic(err) } - if upgradeInfo.Name == "v2.3.1" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + if upgradeInfo.Name == "v3.0.0" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { storeUpgrades := storetypes.StoreUpgrades{} // Configure store loader that checks if version == upgradeHeight and applies store upgrades From e82bcc0ce81c29f1eb4004eab2b3dc3db68bcd53 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 26 Jan 2022 18:42:34 +0100 Subject: [PATCH 049/112] removed muslc from makefile build-linux --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5381f8a8fd..28a98cd5ef 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ BUILD_TARGETS := build install build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) build + GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(MAKE) build build-reproducible: go.sum $(DOCKER) rm latest-build || true From 373f1aa04af65aa563b82aecb6efae3cc9436ac7 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Thu, 27 Jan 2022 09:52:39 +0100 Subject: [PATCH 050/112] updated upgrade name in workflow --- .github/workflows/on-chain-upgrade.yml | 2 +- contrib/images/desmos-build/Dockerfile | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-chain-upgrade.yml b/.github/workflows/on-chain-upgrade.yml index 07fbc9d6f1..4664221957 100644 --- a/.github/workflows/on-chain-upgrade.yml +++ b/.github/workflows/on-chain-upgrade.yml @@ -24,7 +24,7 @@ jobs: env: GENESIS_DESMOS_VERSION: "v2.3.1" GENESIS_URL: "https://raw.githubusercontent.com/RiccardoM/desmos-states/master/morpheus-apollo-2-3934000.json" - UPGRADE_NAME: "v2.4.0" + UPGRADE_NAME: "v3.0.0" steps: - name: Checkout 🛎️ uses: actions/checkout@v2 diff --git a/contrib/images/desmos-build/Dockerfile b/contrib/images/desmos-build/Dockerfile index 00ef55b65c..f9f1706f81 100644 --- a/contrib/images/desmos-build/Dockerfile +++ b/contrib/images/desmos-build/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.15-alpine +FROM golang:1.17-alpine # Set up dependencies ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 @@ -12,6 +12,10 @@ USER ${UID}:${GID} ENV GOPATH /tmp/go ENV GOCACHE /tmp/.cache +# See https://github.com/CosmWasm/wasmvm/releases +ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a /lib/libwasmvm_muslc.a +RUN sha256sum /lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 + VOLUME [ "/desmos" ] WORKDIR /desmos From 15862ddd089cbb30d314b06e87fa81dad598ed83 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Thu, 27 Jan 2022 10:11:22 +0100 Subject: [PATCH 051/112] updated desmos-build Dockerfile to enable the usage of static library libwasmvm --- contrib/images/desmos-build/Dockerfile | 11 +++++++---- contrib/upgrade_testnet/start.sh | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/contrib/images/desmos-build/Dockerfile b/contrib/images/desmos-build/Dockerfile index f9f1706f81..a5b6c81ed7 100644 --- a/contrib/images/desmos-build/Dockerfile +++ b/contrib/images/desmos-build/Dockerfile @@ -1,7 +1,7 @@ -FROM golang:1.17-alpine +FROM golang:1.17.3-alpine # Set up dependencies -ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 +ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 ca-certificates build-base RUN apk add --no-cache $PACKAGES ARG UID=1000 @@ -12,11 +12,14 @@ USER ${UID}:${GID} ENV GOPATH /tmp/go ENV GOCACHE /tmp/.cache + +VOLUME [ "/desmos" ] +WORKDIR /desmos + # See https://github.com/CosmWasm/wasmvm/releases ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a /lib/libwasmvm_muslc.a RUN sha256sum /lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 -VOLUME [ "/desmos" ] -WORKDIR /desmos +RUN LEDGER_ENABLED=false BUILD_TAGS=muslc make build-linux CMD ["sh"] \ No newline at end of file diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 78212311ef..471e2bfe70 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -34,7 +34,7 @@ sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\" # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" -docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux > /dev/null +docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build > /dev/null # Copy the Desmos binary into the proper folders UPGRADE_FOLDER="$BUILDDIR/node0/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" From 13337d1793c2cb44e33c0779fed8dbed339b7602 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Thu, 27 Jan 2022 10:28:34 +0100 Subject: [PATCH 052/112] tried to edit start.sh make build command to enable precompiled library linking --- Makefile | 3 +++ contrib/images/desmos-build/Dockerfile | 4 +--- contrib/upgrade_testnet/start.sh | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 28a98cd5ef..e43e9a24f7 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,9 @@ build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(MAKE) build +build-linux-muslc: go.sum + GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) build + build-reproducible: go.sum $(DOCKER) rm latest-build || true $(DOCKER) run --volume=$(CURDIR):/sources:ro \ diff --git a/contrib/images/desmos-build/Dockerfile b/contrib/images/desmos-build/Dockerfile index a5b6c81ed7..4f4ad7e1e0 100644 --- a/contrib/images/desmos-build/Dockerfile +++ b/contrib/images/desmos-build/Dockerfile @@ -2,7 +2,7 @@ FROM golang:1.17.3-alpine # Set up dependencies ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 ca-certificates build-base -RUN apk add --no-cache $PACKAGES +RUN set -eux; apk add --no-cache $PACKAGES ARG UID=1000 ARG GID=1000 @@ -20,6 +20,4 @@ WORKDIR /desmos ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a /lib/libwasmvm_muslc.a RUN sha256sum /lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 -RUN LEDGER_ENABLED=false BUILD_TAGS=muslc make build-linux - CMD ["sh"] \ No newline at end of file diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 471e2bfe70..efaf51e94d 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -34,7 +34,7 @@ sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\" # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" -docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build > /dev/null +docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux-muslc > /dev/null # Copy the Desmos binary into the proper folders UPGRADE_FOLDER="$BUILDDIR/node0/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" From 0b7a2398ca849270881ce3d1fbdde12e3d894b99 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Thu, 27 Jan 2022 11:57:05 +0100 Subject: [PATCH 053/112] tried use another dockerfile with start.sh --- contrib/images/desmos-build/Dockerfile | 54 ++++++++++++++++----- contrib/images/desmos-cosmovisor/Dockerfile | 2 +- contrib/upgrade_testnet/start.sh | 2 +- 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/contrib/images/desmos-build/Dockerfile b/contrib/images/desmos-build/Dockerfile index 4f4ad7e1e0..e5f116ce34 100644 --- a/contrib/images/desmos-build/Dockerfile +++ b/contrib/images/desmos-build/Dockerfile @@ -1,23 +1,51 @@ -FROM golang:1.17.3-alpine +# To build the Desmos image, just run: +# > docker build -t desmos . +# +# Simple usage with a mounted data directory: +# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.desmos:/root/.desmos desmos desmos init +# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.desmos:/root/.desmos desmos desmos start +# +# If you want to run this container as a daemon, you can do so by executing +# > docker run -td -p 26657:26657 -p 26656:26656 -v ~/.desmos:/root/.desmos --name desmos desmos +# +# Once you have done so, you can enter the container shell by executing +# > docker exec -it desmos bash +# +# To exit the bash, just execute +# > exit +FROM golang:1.17.3-alpine AS build-env # Set up dependencies ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 ca-certificates build-base -RUN set -eux; apk add --no-cache $PACKAGES +RUN set -eux; apk add --no-cache $PACKAGES; -ARG UID=1000 -ARG GID=1000 -USER ${UID}:${GID} +# Set working directory for the build +WORKDIR /go/src/github.com/desmos-labs/desmos -# Fixes build errors. Required since Go 1.12 (https://github.com/golang/go/issues/26280#issuecomment-445294378) -ENV GOPATH /tmp/go -ENV GOCACHE /tmp/.cache - - -VOLUME [ "/desmos" ] -WORKDIR /desmos +# Add source files +COPY . . # See https://github.com/CosmWasm/wasmvm/releases ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a /lib/libwasmvm_muslc.a RUN sha256sum /lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 -CMD ["sh"] \ No newline at end of file +# force it to use static lib (from above) not standard libgo_cosmwasm.so file +RUN LEDGER_ENABLED=false BUILD_TAGS=muslc make build-linux + +# Final image +FROM alpine:edge + +# Install ca-certificates +RUN apk add --update ca-certificates +WORKDIR /root + +# Install bash +RUN apk add --no-cache bash + +# Copy over binaries from the build-env +COPY --from=build-env /go/src/github.com/desmos-labs/desmos/build/desmos /usr/bin/desmos + +EXPOSE 26656 26657 1317 9090 + +# Run desmos by default, omit entrypoint to ease using container with desmos +CMD ["desmos"] diff --git a/contrib/images/desmos-cosmovisor/Dockerfile b/contrib/images/desmos-cosmovisor/Dockerfile index 231d7032b0..7bea795700 100644 --- a/contrib/images/desmos-cosmovisor/Dockerfile +++ b/contrib/images/desmos-cosmovisor/Dockerfile @@ -1,5 +1,5 @@ ARG DESMOS_VERSION="v0.17.2" -FROM golang:1.17-alpine AS build-env +FROM golang:1.17.3-alpine AS build-env ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 RUN apk add --no-cache $PACKAGES diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index efaf51e94d..471e2bfe70 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -34,7 +34,7 @@ sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\" # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" -docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux-muslc > /dev/null +docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build > /dev/null # Copy the Desmos binary into the proper folders UPGRADE_FOLDER="$BUILDDIR/node0/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" From 189adf1387b8e8de5007e70c14f3708a2f4be719 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Thu, 27 Jan 2022 12:04:21 +0100 Subject: [PATCH 054/112] Revert "tried use another dockerfile with start.sh" This reverts commit 0b7a2398ca849270881ce3d1fbdde12e3d894b99. --- contrib/images/desmos-build/Dockerfile | 54 +++++---------------- contrib/images/desmos-cosmovisor/Dockerfile | 2 +- contrib/upgrade_testnet/start.sh | 2 +- 3 files changed, 15 insertions(+), 43 deletions(-) diff --git a/contrib/images/desmos-build/Dockerfile b/contrib/images/desmos-build/Dockerfile index e5f116ce34..4f4ad7e1e0 100644 --- a/contrib/images/desmos-build/Dockerfile +++ b/contrib/images/desmos-build/Dockerfile @@ -1,51 +1,23 @@ -# To build the Desmos image, just run: -# > docker build -t desmos . -# -# Simple usage with a mounted data directory: -# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.desmos:/root/.desmos desmos desmos init -# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.desmos:/root/.desmos desmos desmos start -# -# If you want to run this container as a daemon, you can do so by executing -# > docker run -td -p 26657:26657 -p 26656:26656 -v ~/.desmos:/root/.desmos --name desmos desmos -# -# Once you have done so, you can enter the container shell by executing -# > docker exec -it desmos bash -# -# To exit the bash, just execute -# > exit -FROM golang:1.17.3-alpine AS build-env +FROM golang:1.17.3-alpine # Set up dependencies ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 ca-certificates build-base -RUN set -eux; apk add --no-cache $PACKAGES; +RUN set -eux; apk add --no-cache $PACKAGES -# Set working directory for the build -WORKDIR /go/src/github.com/desmos-labs/desmos +ARG UID=1000 +ARG GID=1000 +USER ${UID}:${GID} -# Add source files -COPY . . +# Fixes build errors. Required since Go 1.12 (https://github.com/golang/go/issues/26280#issuecomment-445294378) +ENV GOPATH /tmp/go +ENV GOCACHE /tmp/.cache + + +VOLUME [ "/desmos" ] +WORKDIR /desmos # See https://github.com/CosmWasm/wasmvm/releases ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta5/libwasmvm_muslc.a /lib/libwasmvm_muslc.a RUN sha256sum /lib/libwasmvm_muslc.a | grep d16a2cab22c75dbe8af32265b9346c6266070bdcf9ed5aa9b7b39a7e32e25fe0 -# force it to use static lib (from above) not standard libgo_cosmwasm.so file -RUN LEDGER_ENABLED=false BUILD_TAGS=muslc make build-linux - -# Final image -FROM alpine:edge - -# Install ca-certificates -RUN apk add --update ca-certificates -WORKDIR /root - -# Install bash -RUN apk add --no-cache bash - -# Copy over binaries from the build-env -COPY --from=build-env /go/src/github.com/desmos-labs/desmos/build/desmos /usr/bin/desmos - -EXPOSE 26656 26657 1317 9090 - -# Run desmos by default, omit entrypoint to ease using container with desmos -CMD ["desmos"] +CMD ["sh"] \ No newline at end of file diff --git a/contrib/images/desmos-cosmovisor/Dockerfile b/contrib/images/desmos-cosmovisor/Dockerfile index 7bea795700..231d7032b0 100644 --- a/contrib/images/desmos-cosmovisor/Dockerfile +++ b/contrib/images/desmos-cosmovisor/Dockerfile @@ -1,5 +1,5 @@ ARG DESMOS_VERSION="v0.17.2" -FROM golang:1.17.3-alpine AS build-env +FROM golang:1.17-alpine AS build-env ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 RUN apk add --no-cache $PACKAGES diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 471e2bfe70..efaf51e94d 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -34,7 +34,7 @@ sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\" # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" -docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build > /dev/null +docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux-muslc > /dev/null # Copy the Desmos binary into the proper folders UPGRADE_FOLDER="$BUILDDIR/node0/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" From 8f8375ba90dbd1dbf69f627086bfaeda311296db Mon Sep 17 00:00:00 2001 From: Bax995 Date: Thu, 27 Jan 2022 15:02:59 +0100 Subject: [PATCH 055/112] trying the new configuration of start.sh --- Makefile | 3 --- contrib/upgrade_testnet/start.sh | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e43e9a24f7..28a98cd5ef 100644 --- a/Makefile +++ b/Makefile @@ -117,9 +117,6 @@ build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(MAKE) build -build-linux-muslc: go.sum - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) build - build-reproducible: go.sum $(DOCKER) rm latest-build || true $(DOCKER) run --volume=$(CURDIR):/sources:ro \ diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index efaf51e94d..fa6277f84b 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -34,7 +34,11 @@ sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\" # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" -docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux-muslc > /dev/null +docker build --platform x86_64 --tag on-chain-upgrade $(pwd) +docker run --rm -v "$BUILDDIR":mnt/out on-chain-upgrade /bin/cp /root/desmos /mnt/out + +#docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux > /dev/null + # Copy the Desmos binary into the proper folders UPGRADE_FOLDER="$BUILDDIR/node0/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" From 49f030d244aa28c1b8334fe744a3baf3961f4bc4 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Thu, 27 Jan 2022 15:47:58 +0100 Subject: [PATCH 056/112] trying the new configuration of start.sh --- contrib/upgrade_testnet/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index fa6277f84b..417825a96e 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -35,7 +35,7 @@ sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\" # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" docker build --platform x86_64 --tag on-chain-upgrade $(pwd) -docker run --rm -v "$BUILDDIR":mnt/out on-chain-upgrade /bin/cp /root/desmos /mnt/out +docker run --rm -v "$BUILDDIR":/mnt/out on-chain-upgrade /bin/cp /root/desmos /mnt/out #docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux > /dev/null From 449e218f62e370cafe59cf777eb011d8e09bbf7d Mon Sep 17 00:00:00 2001 From: Bax995 Date: Thu, 27 Jan 2022 16:09:35 +0100 Subject: [PATCH 057/112] edited wrong binary directory --- contrib/upgrade_testnet/start.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 417825a96e..2f5100c3a3 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -35,11 +35,10 @@ sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\" # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" docker build --platform x86_64 --tag on-chain-upgrade $(pwd) -docker run --rm -v "$BUILDDIR":/mnt/out on-chain-upgrade /bin/cp /root/desmos /mnt/out +docker run --rm -v "$BUILDDIR":/mnt/out on-chain-upgrade /bin/cp /usr/bin/desmos /mnt/out #docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux > /dev/null - # Copy the Desmos binary into the proper folders UPGRADE_FOLDER="$BUILDDIR/node0/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" if [ ! -d "$UPGRADE_FOLDER" ]; then From 833415c833609620038ed7012c4c6b98fae38e73 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Thu, 27 Jan 2022 16:36:02 +0100 Subject: [PATCH 058/112] fixing docker compose image version --- contrib/upgrade_testnet/docker-compose.yml | 8 ++++---- contrib/upgrade_testnet/start.sh | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/contrib/upgrade_testnet/docker-compose.yml b/contrib/upgrade_testnet/docker-compose.yml index f0f78338c7..955f5dd0f0 100644 --- a/contrib/upgrade_testnet/docker-compose.yml +++ b/contrib/upgrade_testnet/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: desmosnode0: container_name: desmosnode0 - image: "desmoslabs/desmos-cosmovisor:v2.3.0-mainnet" + image: "desmoslabs/desmos-cosmovisor:v2.3.1" command: "start --x-crisis-skip-assert-invariants" ports: - "26656-26657:26656-26657" @@ -19,7 +19,7 @@ services: desmosnode1: container_name: desmosnode1 - image: "desmoslabs/desmos-cosmovisor:v2.3.0-mainnet" + image: "desmoslabs/desmos-cosmovisor:v2.3.1" command: "start --x-crisis-skip-assert-invariants" ports: - "26666-26667:26656-26657" @@ -35,7 +35,7 @@ services: desmosnode2: container_name: desmosnode2 - image: "desmoslabs/desmos-cosmovisor:v2.3.0-mainnet" + image: "desmoslabs/desmos-cosmovisor:v2.3.1" command: "start --x-crisis-skip-assert-invariants" ports: - "26676-26677:26656-26657" @@ -51,7 +51,7 @@ services: desmosnode3: container_name: desmosnode3 - image: "desmoslabs/desmos-cosmovisor:v2.3.0-mainnet" + image: "desmoslabs/desmos-cosmovisor:v2.3.1" command: "start --x-crisis-skip-assert-invariants" ports: - "26686-26687:26656-26657" diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 2f5100c3a3..e5690a42de 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -37,8 +37,6 @@ echo "===> Building Desmos" docker build --platform x86_64 --tag on-chain-upgrade $(pwd) docker run --rm -v "$BUILDDIR":/mnt/out on-chain-upgrade /bin/cp /usr/bin/desmos /mnt/out -#docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux > /dev/null - # Copy the Desmos binary into the proper folders UPGRADE_FOLDER="$BUILDDIR/node0/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" if [ ! -d "$UPGRADE_FOLDER" ]; then From 5f800b8d98afa3f237edf667fb9dfeb14ff72b3f Mon Sep 17 00:00:00 2001 From: Bax995 Date: Fri, 28 Jan 2022 09:28:03 +0100 Subject: [PATCH 059/112] added a new build-linux-muslc to use with setup-localnet --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 28a98cd5ef..49d039f754 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,9 @@ build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(MAKE) build +build-linux-muslc: go.sum + GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) build + build-reproducible: go.sum $(DOCKER) rm latest-build || true $(DOCKER) run --volume=$(CURDIR):/sources:ro \ @@ -403,7 +406,7 @@ build-docker-desmosnode: $(MAKE) -C networks/local # Setups 4 folders representing each one the genesis state of a testnet node -setup-localnet: build-linux +setup-localnet: build-linux-muslc if ! [ -f build/node0/desmos/config/genesis.json ]; then $(BUILDDIR)/desmos testnet \ -o ./build --starting-ip-address 192.168.10.2 --keyring-backend=test \ --v=$(if $(NODES),$(NODES),4) \ From f4eef42d0232fb1421fe8d07df4a3f760d55bd40 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Fri, 28 Jan 2022 10:11:19 +0100 Subject: [PATCH 060/112] removed muslc from build-linux edited localnodes image name --- Makefile | 5 +---- contrib/upgrade_testnet/docker-compose.yml | 8 ++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 49d039f754..28a98cd5ef 100644 --- a/Makefile +++ b/Makefile @@ -117,9 +117,6 @@ build: BUILD_ARGS=-o $(BUILDDIR)/ build-linux: go.sum GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true $(MAKE) build -build-linux-muslc: go.sum - GOOS=linux GOARCH=amd64 LEDGER_ENABLED=true BUILD_TAGS=muslc $(MAKE) build - build-reproducible: go.sum $(DOCKER) rm latest-build || true $(DOCKER) run --volume=$(CURDIR):/sources:ro \ @@ -406,7 +403,7 @@ build-docker-desmosnode: $(MAKE) -C networks/local # Setups 4 folders representing each one the genesis state of a testnet node -setup-localnet: build-linux-muslc +setup-localnet: build-linux if ! [ -f build/node0/desmos/config/genesis.json ]; then $(BUILDDIR)/desmos testnet \ -o ./build --starting-ip-address 192.168.10.2 --keyring-backend=test \ --v=$(if $(NODES),$(NODES),4) \ diff --git a/contrib/upgrade_testnet/docker-compose.yml b/contrib/upgrade_testnet/docker-compose.yml index 955f5dd0f0..b71b99caf2 100644 --- a/contrib/upgrade_testnet/docker-compose.yml +++ b/contrib/upgrade_testnet/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: desmosnode0: container_name: desmosnode0 - image: "desmoslabs/desmos-cosmovisor:v2.3.1" + image: "desmoslabs/desmos-cosmovisor:v3.0.0" command: "start --x-crisis-skip-assert-invariants" ports: - "26656-26657:26656-26657" @@ -19,7 +19,7 @@ services: desmosnode1: container_name: desmosnode1 - image: "desmoslabs/desmos-cosmovisor:v2.3.1" + image: "desmoslabs/desmos-cosmovisor:v3.0.0" command: "start --x-crisis-skip-assert-invariants" ports: - "26666-26667:26656-26657" @@ -35,7 +35,7 @@ services: desmosnode2: container_name: desmosnode2 - image: "desmoslabs/desmos-cosmovisor:v2.3.1" + image: "desmoslabs/desmos-cosmovisor:v3.0.0" command: "start --x-crisis-skip-assert-invariants" ports: - "26676-26677:26656-26657" @@ -51,7 +51,7 @@ services: desmosnode3: container_name: desmosnode3 - image: "desmoslabs/desmos-cosmovisor:v2.3.1" + image: "desmoslabs/desmos-cosmovisor:v3.0.0" command: "start --x-crisis-skip-assert-invariants" ports: - "26686-26687:26656-26657" From 20fa0152cdaff62d1891d6c79f42ada5dc0b35ce Mon Sep 17 00:00:00 2001 From: Bax995 Date: Fri, 28 Jan 2022 10:26:24 +0100 Subject: [PATCH 061/112] edited coin denom in setup-localnet Makefile reverted image versions --- Makefile | 4 ++-- contrib/upgrade_testnet/docker-compose.yml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 28a98cd5ef..b53cf74955 100644 --- a/Makefile +++ b/Makefile @@ -407,8 +407,8 @@ setup-localnet: build-linux if ! [ -f build/node0/desmos/config/genesis.json ]; then $(BUILDDIR)/desmos testnet \ -o ./build --starting-ip-address 192.168.10.2 --keyring-backend=test \ --v=$(if $(NODES),$(NODES),4) \ - --gentx-coin-denom=$(if $(COIN_DENOM),$(COIN_DENOM),"stake") \ - --minimum-gas-prices="0.000006$(if $(COIN_DENOM),$(COIN_DENOM),"stake")"; fi + --gentx-coin-denom=$(if $(COIN_DENOM),$(COIN_DENOM),"udaric") \ + --minimum-gas-prices="0.000006$(if $(COIN_DENOM),$(COIN_DENOM),"udaric")"; fi # Starts a local 4-nodes testnet that should be used to test on-chain upgrades. # It requires 3 arguments to work: diff --git a/contrib/upgrade_testnet/docker-compose.yml b/contrib/upgrade_testnet/docker-compose.yml index b71b99caf2..955f5dd0f0 100644 --- a/contrib/upgrade_testnet/docker-compose.yml +++ b/contrib/upgrade_testnet/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: desmosnode0: container_name: desmosnode0 - image: "desmoslabs/desmos-cosmovisor:v3.0.0" + image: "desmoslabs/desmos-cosmovisor:v2.3.1" command: "start --x-crisis-skip-assert-invariants" ports: - "26656-26657:26656-26657" @@ -19,7 +19,7 @@ services: desmosnode1: container_name: desmosnode1 - image: "desmoslabs/desmos-cosmovisor:v3.0.0" + image: "desmoslabs/desmos-cosmovisor:v2.3.1" command: "start --x-crisis-skip-assert-invariants" ports: - "26666-26667:26656-26657" @@ -35,7 +35,7 @@ services: desmosnode2: container_name: desmosnode2 - image: "desmoslabs/desmos-cosmovisor:v3.0.0" + image: "desmoslabs/desmos-cosmovisor:v2.3.1" command: "start --x-crisis-skip-assert-invariants" ports: - "26676-26677:26656-26657" @@ -51,7 +51,7 @@ services: desmosnode3: container_name: desmosnode3 - image: "desmoslabs/desmos-cosmovisor:v3.0.0" + image: "desmoslabs/desmos-cosmovisor:v2.3.1" command: "start --x-crisis-skip-assert-invariants" ports: - "26686-26687:26656-26657" From beaf1dd27b259759f4208a74025842d384c63855 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 31 Jan 2022 10:46:34 +0100 Subject: [PATCH 062/112] review code and applied PR review suggestions --- x/profiles/keeper/alias_functions.go | 27 ++++++++++++++++------ x/profiles/keeper/alias_functions_test.go | 6 ++--- x/profiles/keeper/keeper_app_links_test.go | 2 +- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go index 578fbe8e05..491af96f2e 100644 --- a/x/profiles/keeper/alias_functions.go +++ b/x/profiles/keeper/alias_functions.go @@ -1,6 +1,8 @@ package keeper import ( + "bytes" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/desmos-labs/desmos/v2/x/profiles/types" @@ -212,28 +214,39 @@ func (k Keeper) GetApplicationLinks(ctx sdk.Context) []types.ApplicationLink { // IterateExpiringApplicationLinks iterates through all the expiring application links references. // The key will be skipped and deleted if the application link has already been deleted. -func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index int64, link types.ApplicationLink) (stop bool)) { +func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index int64, link types.ApplicationLink) (stop bool)) error { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.ApplicationLinkExpiringTimePrefix(ctx.BlockTime())) + iterator := sdk.KVStorePrefixIterator(store, types.ExpiringAppLinkTimePrefix) defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { + trimmedPrefixKey := bytes.TrimPrefix(iterator.Key(), types.ExpiringAppLinkTimePrefix) + expiringTime, err := sdk.ParseTimeBytes(bytes.TrimSuffix(trimmedPrefixKey, iterator.Value())) + if err != nil { + return err + } + // Skip if application link has been deleted already clientIDKey := types.ApplicationLinkClientIDKey(string(iterator.Value())) if !store.Has(clientIDKey) { store.Delete(iterator.Key()) continue } - applicationKey := store.Get(clientIDKey) - link := types.MustUnmarshalApplicationLink(k.cdc, store.Get(applicationKey)) - stop := fn(i, link) - if stop { - break + + if ctx.BlockTime().After(expiringTime) { + applicationKey := store.Get(clientIDKey) + link := types.MustUnmarshalApplicationLink(k.cdc, store.Get(applicationKey)) + stop := fn(i, link) + if stop { + break + } } i++ } + + return nil } // -------------------------------------------------------------------------------------------------------------------- diff --git a/x/profiles/keeper/alias_functions_test.go b/x/profiles/keeper/alias_functions_test.go index 6c112c9177..9cb4e00132 100644 --- a/x/profiles/keeper/alias_functions_test.go +++ b/x/profiles/keeper/alias_functions_test.go @@ -306,7 +306,7 @@ func (suite *KeeperTestSuite) TestKeeper_IterateExpiringApplicationLinks() { // ensure the expiring time is the same of the links suite.ctx = suite.ctx.WithBlockTime( - time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 6, 00, 00, 00, 000, time.UTC), ) ctx, _ := suite.ctx.CacheContext() @@ -316,7 +316,6 @@ func (suite *KeeperTestSuite) TestKeeper_IterateExpiringApplicationLinks() { suite.Require().NoError(err) } - // save an expiration key referring to an already deleted AppLink to test lines 225-227 clientID := "already_deleted" applicationLinkExpiringTimeKey := types.ApplicationLinkExpiringTimeKey( time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), clientID, @@ -325,11 +324,12 @@ func (suite *KeeperTestSuite) TestKeeper_IterateExpiringApplicationLinks() { store.Set(applicationLinkExpiringTimeKey, []byte(clientID)) var expiredLinks []types.ApplicationLink - suite.k.IterateExpiringApplicationLinks(ctx, func(index int64, link types.ApplicationLink) (stop bool) { + err := suite.k.IterateExpiringApplicationLinks(ctx, func(index int64, link types.ApplicationLink) (stop bool) { expiredLinks = append(expiredLinks, link) return index == 1 }) + suite.Require().NoError(err) suite.Require().Equal([]types.ApplicationLink{links[0], links[1]}, expiredLinks) } diff --git a/x/profiles/keeper/keeper_app_links_test.go b/x/profiles/keeper/keeper_app_links_test.go index a7f6d4e783..e9523b5f7f 100644 --- a/x/profiles/keeper/keeper_app_links_test.go +++ b/x/profiles/keeper/keeper_app_links_test.go @@ -501,7 +501,7 @@ func (suite *KeeperTestSuite) Test_DeleteExpiredApplicationLinks() { suite.Run(tc.name, func() { // ensure the expiring time is the same of the links suite.ctx = suite.ctx.WithBlockTime( - time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 2, 00, 00, 00, 000, time.UTC), ) ctx, _ := suite.ctx.CacheContext() if tc.store != nil { From c5a50e7b1f6f9ef08a033eb09446022ccf9b7cad Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 1 Feb 2022 14:44:47 +0100 Subject: [PATCH 063/112] reviewed how store test was written --- x/profiles/legacy/v231/store_test.go | 150 +++++++++++++++------------ 1 file changed, 85 insertions(+), 65 deletions(-) diff --git a/x/profiles/legacy/v231/store_test.go b/x/profiles/legacy/v231/store_test.go index 9ec1d27d15..d911c3b900 100644 --- a/x/profiles/legacy/v231/store_test.go +++ b/x/profiles/legacy/v231/store_test.go @@ -18,84 +18,104 @@ func TestStoreMigration(t *testing.T) { cdc, legacyAminoCdc := app.MakeCodecs() profilesKey := sdk.NewKVStoreKey("profiles") transientKey := sdk.NewTransientStoreKey("profiles_transient") - ctx := testutil.DefaultContext(profilesKey, transientKey) - - /// setup legacy params - params := v200.DefaultParams() - paramsSpace := paramstypes.NewSubspace(cdc, legacyAminoCdc, profilesKey, transientKey, "profiles") - paramsSpace = paramsSpace.WithKeyTable(v200.ParamKeyTable()) - paramsSpace.SetParamSet(ctx, ¶ms) - - store := ctx.KVStore(profilesKey) testCases := []struct { - name string - key []byte - oldValue []byte - newValue []byte - expectedParams types.Params + name string + store func(ctx sdk.Context) + shouldErr bool + check func(ctx sdk.Context, paramsSpace paramstypes.Subspace) }{ { - name: "Store migration works correctly", - key: types.UserApplicationLinkKey( - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "twitter", - "user", - ), - oldValue: v200.MustMarshalApplicationLink(cdc, v200.NewApplicationLink( - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - v200.NewData("twitter", "user"), - v200.AppLinkStateVerificationStarted, - v200.NewOracleRequest( - 1, - 1, - v200.NewOracleRequestCallData("twitter", "tweet-123456789"), - "client_id", - ), - v200.NewSuccessResult("76616c7565", "signature"), // The value should be HEX - time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), - )), - newValue: types.MustMarshalApplicationLink(cdc, types.NewApplicationLink( - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - types.NewData("twitter", "user"), - types.AppLinkStateVerificationStarted, - types.NewOracleRequest( - 1, - 1, - types.NewOracleRequestCallData("twitter", "tweet-123456789"), - "client_id", - ), - types.NewSuccessResult("76616c7565", "signature"), // The value should be HEX - time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2022, 6, 18, 00, 00, 00, 000, time.UTC), - )), - expectedParams: types.DefaultParams(), - }, - } + name: "valid data returns no error", + store: func(ctx sdk.Context) { + // setup legacy params + params := v200.DefaultParams() + paramsSpace := paramstypes.NewSubspace(cdc, legacyAminoCdc, profilesKey, transientKey, "profiles") + paramsSpace = paramsSpace.WithKeyTable(v200.ParamKeyTable()) + paramsSpace.SetParamSet(ctx, ¶ms) - // Set all the old values to the store - for _, tc := range testCases { - store.Set(tc.key, tc.oldValue) - } + store := ctx.KVStore(profilesKey) + + applicationLinkKey := types.UserApplicationLinkKey( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "twitter", + "user", + ) - // set the new paramSpace for the migration - newParams := types.DefaultParams() - newParamSpace := paramstypes.NewSubspace(cdc, legacyAminoCdc, profilesKey, transientKey, "profiles") - newParamSpace = newParamSpace.WithKeyTable(types.ParamKeyTable()) - newParamSpace.SetParamSet(ctx, &newParams) + applicationLinkBz := v200.MustMarshalApplicationLink(cdc, v200.NewApplicationLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + v200.NewData("twitter", "user"), + v200.AppLinkStateVerificationStarted, + v200.NewOracleRequest( + 1, + 1, + v200.NewOracleRequestCallData("twitter", "tweet-123456789"), + "client_id", + ), + v200.NewSuccessResult("76616c7565", "signature"), // The value should be HEX + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + )) - newParamSpace.GetParamSet(ctx, &newParams) + store.Set(applicationLinkKey, applicationLinkBz) + }, + check: func(ctx sdk.Context, paramSpace paramstypes.Subspace) { + store := ctx.KVStore(profilesKey) + applicationLinkKey := types.UserApplicationLinkKey( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "twitter", + "user", + ) - // Run migrations - err := v231.MigrateStore(ctx, profilesKey, newParamSpace, cdc, legacyAminoCdc) - require.NoError(t, err) + var expectedAppLink = types.NewApplicationLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + types.NewData("twitter", "user"), + types.AppLinkStateVerificationStarted, + types.NewOracleRequest( + 1, + 1, + types.NewOracleRequestCallData("twitter", "tweet-123456789"), + "client_id", + ), + types.NewSuccessResult("76616c7565", "signature"), // The value should be HEX + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 6, 18, 00, 00, 00, 000, time.UTC), + ) + + var storedAppLink types.ApplicationLink + cdc.MustUnmarshal(store.Get(applicationLinkKey), &storedAppLink) + require.Equal(t, expectedAppLink, storedAppLink) + + var storedParams types.Params + paramSpace.GetParamSet(ctx, &storedParams) + + require.Equal(t, types.DefaultParams(), storedParams) + }, + }, + } // Make sure the new values are set properly for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - require.Equal(t, tc.newValue, store.Get(tc.key)) - require.Equal(t, tc.expectedParams, newParams) + ctx := testutil.DefaultContext(profilesKey, transientKey) + if tc.store != nil { + tc.store(ctx) + } + + newParams := types.DefaultParams() + newParamSpace := paramstypes.NewSubspace(cdc, legacyAminoCdc, profilesKey, transientKey, "profiles") + newParamSpace = newParamSpace.WithKeyTable(types.ParamKeyTable()) + newParamSpace.SetParamSet(ctx, &newParams) + + err := v231.MigrateStore(ctx, profilesKey, newParamSpace, cdc, legacyAminoCdc) + if tc.shouldErr { + require.Error(t, err) + } else { + require.NoError(t, err) + if tc.check != nil { + tc.check(ctx, newParamSpace) + } + } }) } } From ca7a48b813da133ed73014d2991d03b0f2bdb754 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 1 Feb 2022 15:04:24 +0100 Subject: [PATCH 064/112] trying to bypass the use of setup-localnet and directly build the binaries for the localnet nodes inside start.sh --- contrib/upgrade_testnet/start.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index e5690a42de..753efbf92e 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -15,6 +15,18 @@ rm -r -f $BUILDDIR # Create the 4 nodes folders with the correct denom echo "===> Creating $NODES nodes localnet" +docker build --platform x86_64 --tag on-chain-upgrade $(pwd) +docker run --rm -v "$BUILDDIR":/mnt/out on-chain-upgrade /bin/cp /usr/bin/desmos /mnt/out + +if ! [ -f build/node0/desmos/config/genesis.json ]; +then + "$BUILDDIR"/desmos testnet \ + -o ./build --starting-ip-address 192.168.10.2 --keyring-backend=test \ + --v=$NODES \ + --gentx-coin-denom="udaric" \ + --minimum-gas-prices="0.000006udaric"\); +fi + make setup-localnet COIN_DENOM="udaric" NODES=$NODES > /dev/null > /dev/null # Run the Python script to setup the genesis From f5c76eaa0ae09d72d07260058639ee10d7767fe5 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 1 Feb 2022 15:23:07 +0100 Subject: [PATCH 065/112] try adding sudo before desmos testnet cmd --- contrib/upgrade_testnet/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 753efbf92e..fdbdebd1b3 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -20,7 +20,7 @@ docker run --rm -v "$BUILDDIR":/mnt/out on-chain-upgrade /bin/cp /usr/bin/desmos if ! [ -f build/node0/desmos/config/genesis.json ]; then - "$BUILDDIR"/desmos testnet \ + sudo "$BUILDDIR"/desmos testnet \ -o ./build --starting-ip-address 192.168.10.2 --keyring-backend=test \ --v=$NODES \ --gentx-coin-denom="udaric" \ From 90112131156b1324bac5ffb1ce91ba7374c24dbd Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 2 Feb 2022 11:16:27 +0100 Subject: [PATCH 066/112] applied pr reviewe suggestions added tests removed setup-localnet from start.sh script --- contrib/upgrade_testnet/start.sh | 2 -- .../submit_upgrade_proposal.sh | 10 ++++---- x/profiles/keeper/keeper_app_links.go | 9 ++++++++ x/profiles/keeper/keeper_app_links_test.go | 18 ++++++++++++--- x/profiles/legacy/v231/store_test.go | 2 +- x/profiles/simulation/decoder_test.go | 2 +- x/profiles/types/events.go | 23 ++++++++++--------- x/profiles/types/models_app_links.go | 4 ++++ x/profiles/types/models_app_links_test.go | 21 +++++++++++++++++ x/profiles/types/models_params.go | 9 ++++---- x/profiles/types/models_params_test.go | 4 ++-- 11 files changed, 76 insertions(+), 28 deletions(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index fdbdebd1b3..ee6e4274dc 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -27,8 +27,6 @@ then --minimum-gas-prices="0.000006udaric"\); fi -make setup-localnet COIN_DENOM="udaric" NODES=$NODES > /dev/null > /dev/null - # Run the Python script to setup the genesis echo "===> Setting up the genesis file" docker run --rm --user $UID:$GID \ diff --git a/contrib/upgrade_testnet/submit_upgrade_proposal.sh b/contrib/upgrade_testnet/submit_upgrade_proposal.sh index db06a015e3..8eca3282c6 100755 --- a/contrib/upgrade_testnet/submit_upgrade_proposal.sh +++ b/contrib/upgrade_testnet/submit_upgrade_proposal.sh @@ -24,12 +24,14 @@ while [ ${CNT} -lt $ITER ]; do sleep $SLEEP done -if [ ITER == 20 ] - echo "====> Chain is still offline. Not ready to submit proposal" -then - echo "====> Chain is online. Ready to submit proposal" +curr_block=$(curl -s $NODE/status | jq -r '.result.sync_info.latest_block_height') +if [ -z ${curr_block} ] ; then + echo "===> Failed to start the chain" + exit 1 fi +echo "====> Chain is online. Ready to submit proposal" + CHAIN_ID=$(curl -s $NODE/status | jq -r '.result.node_info.network') if [ -z "$CHAIN_ID" ]; then echo "Missing chain id" diff --git a/x/profiles/keeper/keeper_app_links.go b/x/profiles/keeper/keeper_app_links.go index 77a18de7b2..a05bb9365e 100644 --- a/x/profiles/keeper/keeper_app_links.go +++ b/x/profiles/keeper/keeper_app_links.go @@ -134,6 +134,15 @@ func (k Keeper) DeleteAllUserApplicationLinks(ctx sdk.Context, user string) { // DeleteExpiredApplicationLinks deletes all the expired application links in the given context func (k Keeper) DeleteExpiredApplicationLinks(ctx sdk.Context) { k.IterateExpiringApplicationLinks(ctx, func(_ int64, link types.ApplicationLink) (stop bool) { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeApplicationLinkDeleted, + sdk.NewAttribute(types.AttributeKeyUser, link.User), + sdk.NewAttribute(types.AttributeKeyApplicationName, link.Data.Application), + sdk.NewAttribute(types.AttributeKeyApplicationUsername, link.Data.Username), + sdk.NewAttribute(types.AttributeKeyApplicationLinkExpirationTime, link.ExpirationTime.String()), + ), + ) k.deleteApplicationLinkStoreKeys(ctx, link) return false }) diff --git a/x/profiles/keeper/keeper_app_links_test.go b/x/profiles/keeper/keeper_app_links_test.go index e9523b5f7f..6ee30c71dd 100644 --- a/x/profiles/keeper/keeper_app_links_test.go +++ b/x/profiles/keeper/keeper_app_links_test.go @@ -466,9 +466,9 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { func (suite *KeeperTestSuite) Test_DeleteExpiredApplicationLinks() { testCases := []struct { - name string - store func(store sdk.Context) - expectedAppLinksLen int + name string + store func(store sdk.Context) + expectedEmittedEvent sdk.Event }{ { name: "Expired links are deleted correctly", @@ -493,6 +493,16 @@ func (suite *KeeperTestSuite) Test_DeleteExpiredApplicationLinks() { err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) }, + expectedEmittedEvent: sdk.NewEvent( + types.EventTypeApplicationLinkDeleted, + sdk.NewAttribute(types.AttributeKeyUser, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + sdk.NewAttribute(types.AttributeKeyApplicationName, "twitter"), + sdk.NewAttribute(types.AttributeKeyApplicationUsername, "twitteruser"), + sdk.NewAttribute( + types.AttributeKeyApplicationLinkExpirationTime, + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC).String(), + ), + ), }, } @@ -508,9 +518,11 @@ func (suite *KeeperTestSuite) Test_DeleteExpiredApplicationLinks() { tc.store(ctx) } suite.k.DeleteExpiredApplicationLinks(ctx) + emittedEvents := ctx.EventManager().Events() appLinks := suite.k.GetApplicationLinks(ctx) suite.Require().Equal(0, len(appLinks)) + suite.Require().Equal(tc.expectedEmittedEvent, emittedEvents[1]) }) } } diff --git a/x/profiles/legacy/v231/store_test.go b/x/profiles/legacy/v231/store_test.go index d911c3b900..73ad86da78 100644 --- a/x/profiles/legacy/v231/store_test.go +++ b/x/profiles/legacy/v231/store_test.go @@ -78,7 +78,7 @@ func TestStoreMigration(t *testing.T) { ), types.NewSuccessResult("76616c7565", "signature"), // The value should be HEX time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2022, 6, 18, 00, 00, 00, 000, time.UTC), + time.Date(2022, 7, 2, 00, 00, 00, 000, time.UTC), ) var storedAppLink types.ApplicationLink diff --git a/x/profiles/simulation/decoder_test.go b/x/profiles/simulation/decoder_test.go index 8c09b42b01..6ef6ab5b78 100644 --- a/x/profiles/simulation/decoder_test.go +++ b/x/profiles/simulation/decoder_test.go @@ -90,7 +90,7 @@ func TestDecodeStore(t *testing.T) { {"DTag transfer request", fmt.Sprintf("RequestA: %s\nRequestB: %s\n", request, request)}, {"Relationship", fmt.Sprintf("Relationships A: %s\nRelationships B: %s\n", relationship, relationship)}, {"User block", fmt.Sprintf("User block A: %s\nUser block B: %s\n", userBlock, userBlock)}, - {"ClientID", fmt.Sprintf("Client ID A: %s\nClient ID B: %s\n", clientID, clientID)}, + {"Expiring Application link", fmt.Sprintf("Client ID A: %s\nClient ID B: %s\n", clientID, clientID)}, {"other", ""}, } diff --git a/x/profiles/types/events.go b/x/profiles/types/events.go index a88fbb83dd..cbcc65618b 100644 --- a/x/profiles/types/events.go +++ b/x/profiles/types/events.go @@ -51,15 +51,16 @@ const ( EventTypesApplicationLinkSaved = "application_link_saved" EventTypeApplicationLinkDeleted = "application_link_deleted" - AttributeKeyUser = "user" - AttributeKeyApplicationName = "application_name" - AttributeKeyApplicationUsername = "application_username" - AttributeKeyApplicationLinkCreationTime = "application_link_creation_time" - AttributeKeyOracleID = "oracle_id" - AttributeKeyClientID = "client_id" - AttributeKeyRequestID = "request_id" - AttributeKeyRequestKey = "request_key" - AttributeKeyResolveStatus = "resolve_status" - AttributeKeyAck = "acknowledgement" - AttributeKeyAckError = "error" + AttributeKeyUser = "user" + AttributeKeyApplicationName = "application_name" + AttributeKeyApplicationUsername = "application_username" + AttributeKeyApplicationLinkCreationTime = "application_link_creation_time" + AttributeKeyApplicationLinkExpirationTime = "application_link_expiration_time" + AttributeKeyOracleID = "oracle_id" + AttributeKeyClientID = "client_id" + AttributeKeyRequestID = "request_id" + AttributeKeyRequestKey = "request_key" + AttributeKeyResolveStatus = "resolve_status" + AttributeKeyAck = "acknowledgement" + AttributeKeyAckError = "error" ) diff --git a/x/profiles/types/models_app_links.go b/x/profiles/types/models_app_links.go index 4b50a1c8a9..b0601a74fe 100644 --- a/x/profiles/types/models_app_links.go +++ b/x/profiles/types/models_app_links.go @@ -57,6 +57,10 @@ func (l ApplicationLink) Validate() error { return fmt.Errorf("invalid expiration time: %s", l.ExpirationTime) } + if l.ExpirationTime.Before(l.CreationTime) { + return fmt.Errorf("expiration time: %s can't be before creation time: %s", l.ExpirationTime, l.CreationTime) + } + return nil } diff --git a/x/profiles/types/models_app_links_test.go b/x/profiles/types/models_app_links_test.go index f13a5698db..d5eba3a7e4 100644 --- a/x/profiles/types/models_app_links_test.go +++ b/x/profiles/types/models_app_links_test.go @@ -162,6 +162,27 @@ func TestApplicationLink_Validate(t *testing.T) { ), shouldErr: true, }, + { + name: "expiration time before creation time returns error", + link: types.NewApplicationLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + types.NewData("twitter", "twitteruser"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData( + "twitter", + "7B22757365726E616D65223A22526963636172646F4D222C22676973745F6964223A223732306530303732333930613930316262383065353966643630643766646564227D", + ), + "client_id", + ), + nil, + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), + ), + shouldErr: true, + }, { name: "valid link returns no error", link: types.NewApplicationLink( diff --git a/x/profiles/types/models_params.go b/x/profiles/types/models_params.go index a4ea224080..4cb9a5a9b0 100644 --- a/x/profiles/types/models_params.go +++ b/x/profiles/types/models_params.go @@ -12,7 +12,8 @@ import ( const ( // DefaultParamsSpace represents the default paramspace for the Params keeper - DefaultParamsSpace = ModuleName + DefaultParamsSpace = ModuleName + FourteenDaysCorrectionFactor = time.Hour * 24 * 14 // This value is the equivalent of 14 days in minutes ) // Default profile paramsModule @@ -23,7 +24,7 @@ var ( DefaultMinDTagLength = sdk.NewInt(3) DefaultMaxDTagLength = sdk.NewInt(30) DefaultMaxBioLength = sdk.NewInt(1000) - DefaultAppLinksExpirationTime = time.Hour * 24 * 7 * 4 * 6 // This duration is equal to roughly 5.5 months time in minutes 241920 + DefaultAppLinksExpirationTime = time.Hour*24*7*4*6 + FourteenDaysCorrectionFactor // This duration is equal to 5.9835 months time. Equivalent to 262080 minutes ) // Parameters store keys @@ -286,8 +287,8 @@ func ValidateAppLinksParams(i interface{}) error { return fmt.Errorf("invalid parameters type: %s", i) } - if params.ExpirationTime <= 0 { - return fmt.Errorf("expiration time param must be positive: %s", params.ExpirationTime) + if params.ExpirationTime <= FourteenDaysCorrectionFactor { + return fmt.Errorf("expiration time param must be not less than 14 days: %s", params.ExpirationTime) } return nil diff --git a/x/profiles/types/models_params_test.go b/x/profiles/types/models_params_test.go index eea9a2e610..08d244aa56 100644 --- a/x/profiles/types/models_params_test.go +++ b/x/profiles/types/models_params_test.go @@ -316,12 +316,12 @@ func TestValidateAppLinksParams(t *testing.T) { shouldErr bool }{ { - name: "invalid value returns error", + name: "time duration zero returns error", params: types.NewAppLinksParams(time.Duration(0)), shouldErr: true, }, { - name: "valid value returns no error", + name: "valid params return no error", params: types.DefaultAppLinksParams(), shouldErr: false, }, From 8ecde9dfc8500464cce4d721dd0b12bb559d88a0 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Wed, 2 Feb 2022 12:03:27 +0100 Subject: [PATCH 067/112] fixed sims tests --- x/profiles/simulation/utils.go | 2 +- x/profiles/types/models_params.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x/profiles/simulation/utils.go b/x/profiles/simulation/utils.go index 0e3194c717..ef7861b6c7 100644 --- a/x/profiles/simulation/utils.go +++ b/x/profiles/simulation/utils.go @@ -175,7 +175,7 @@ func RandomOracleParams(r *rand.Rand) types.OracleParams { // RandomAppLinksParams return a random appLinks param func RandomAppLinksParams(r *rand.Rand) types.AppLinksParams { - randomDuration := time.Duration(simtypes.RandIntBetween(r, 60, 60*60*24*7*4*6)) * time.Second + randomDuration := time.Duration(simtypes.RandIntBetween(r, 60*60*24*14, 60*60*24*7*4*6)) * time.Second return types.NewAppLinksParams(randomDuration) } diff --git a/x/profiles/types/models_params.go b/x/profiles/types/models_params.go index 4cb9a5a9b0..d482db6a89 100644 --- a/x/profiles/types/models_params.go +++ b/x/profiles/types/models_params.go @@ -287,7 +287,7 @@ func ValidateAppLinksParams(i interface{}) error { return fmt.Errorf("invalid parameters type: %s", i) } - if params.ExpirationTime <= FourteenDaysCorrectionFactor { + if params.ExpirationTime < FourteenDaysCorrectionFactor { return fmt.Errorf("expiration time param must be not less than 14 days: %s", params.ExpirationTime) } From 14a7559d3ec39c6809dea6febdafcd7a5ce07329 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Fri, 4 Feb 2022 09:40:11 +0100 Subject: [PATCH 068/112] try fix the start.sh cmd with review suggestions --- contrib/upgrade_testnet/start.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index ee6e4274dc..802567a00c 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -15,16 +15,16 @@ rm -r -f $BUILDDIR # Create the 4 nodes folders with the correct denom echo "===> Creating $NODES nodes localnet" -docker build --platform x86_64 --tag on-chain-upgrade $(pwd) -docker run --rm -v "$BUILDDIR":/mnt/out on-chain-upgrade /bin/cp /usr/bin/desmos /mnt/out +docker build --platform x86_64 --tag local-node-bin $(pwd) +docker run --rm --user $UID:$GID -v "$BUILDDIR":/mnt/out local-node-bin /bin/cp /usr/bin/desmos /mnt/out if ! [ -f build/node0/desmos/config/genesis.json ]; then - sudo "$BUILDDIR"/desmos testnet \ + "$BUILDDIR"/desmos testnet \ -o ./build --starting-ip-address 192.168.10.2 --keyring-backend=test \ - --v=$NODES \ - --gentx-coin-denom="udaric" \ - --minimum-gas-prices="0.000006udaric"\); + --v=$(if $(NODES),$(NODES),4) fi \ + --gentx-coin-denom=$(if $(COIN_DENOM),$(COIN_DENOM),"udaric") fi \ + --minimum-gas-prices="0.000006$(if $(COIN_DENOM),$(COIN_DENOM),"udaric")\); fi fi # Run the Python script to setup the genesis From a71adad8978c5afe784d9dc1d281b8a88ac155de Mon Sep 17 00:00:00 2001 From: Bax995 Date: Fri, 4 Feb 2022 09:49:22 +0100 Subject: [PATCH 069/112] fixed missing " closure in start.sh --- contrib/upgrade_testnet/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 802567a00c..370a4ce1ae 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -24,7 +24,7 @@ then -o ./build --starting-ip-address 192.168.10.2 --keyring-backend=test \ --v=$(if $(NODES),$(NODES),4) fi \ --gentx-coin-denom=$(if $(COIN_DENOM),$(COIN_DENOM),"udaric") fi \ - --minimum-gas-prices="0.000006$(if $(COIN_DENOM),$(COIN_DENOM),"udaric")\); fi + --minimum-gas-prices="0.000006$(if $(COIN_DENOM),$(COIN_DENOM),"udaric" fi)"; fi # Run the Python script to setup the genesis From 0609d8b5c954d321faf4061ea1f1889db43a8951 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Fri, 4 Feb 2022 14:46:04 +0100 Subject: [PATCH 070/112] fix errors in start.sh --- contrib/upgrade_testnet/start.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 370a4ce1ae..1065651f87 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -16,15 +16,16 @@ rm -r -f $BUILDDIR # Create the 4 nodes folders with the correct denom echo "===> Creating $NODES nodes localnet" docker build --platform x86_64 --tag local-node-bin $(pwd) -docker run --rm --user $UID:$GID -v "$BUILDDIR":/mnt/out local-node-bin /bin/cp /usr/bin/desmos /mnt/out +docker run --rm --user $UID:$GID \ + -v "$BUILDDIR":/desmos:Z local-node-bin /bin/cp /usr/bin/desmos /desmos:Z if ! [ -f build/node0/desmos/config/genesis.json ]; then "$BUILDDIR"/desmos testnet \ -o ./build --starting-ip-address 192.168.10.2 --keyring-backend=test \ - --v=$(if $(NODES),$(NODES),4) fi \ - --gentx-coin-denom=$(if $(COIN_DENOM),$(COIN_DENOM),"udaric") fi \ - --minimum-gas-prices="0.000006$(if $(COIN_DENOM),$(COIN_DENOM),"udaric" fi)"; + --v=$NODES \ + --gentx-coin-denom=$COIN_DENOM \ + --minimum-gas-prices="0.000006$COIN_DENOM"; fi # Run the Python script to setup the genesis From ae4c4a0ffec131256b2c92c058865e3216be8f9c Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 7 Feb 2022 10:02:37 +0100 Subject: [PATCH 071/112] test script without UID to force root --- contrib/upgrade_testnet/start.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 1065651f87..29ab262128 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -16,8 +16,7 @@ rm -r -f $BUILDDIR # Create the 4 nodes folders with the correct denom echo "===> Creating $NODES nodes localnet" docker build --platform x86_64 --tag local-node-bin $(pwd) -docker run --rm --user $UID:$GID \ - -v "$BUILDDIR":/desmos:Z local-node-bin /bin/cp /usr/bin/desmos /desmos:Z +docker run --rm -v "$BUILDDIR":/desmos:Z local-node-bin /bin/cp /usr/bin/desmos /desmos:Z if ! [ -f build/node0/desmos/config/genesis.json ]; then @@ -30,7 +29,7 @@ fi # Run the Python script to setup the genesis echo "===> Setting up the genesis file" -docker run --rm --user $UID:$GID \ +docker run --rm \ -v $TESTNETDIR:/usr/src/app \ -v $BUILDDIR:/desmos:Z \ desmoslabs/desmos-python python setup_genesis.py /desmos $NODES $GENESIS_URL > /dev/null From 621434ebb27dfbb2bf24e5c41b52df9ee7740deb Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 7 Feb 2022 10:57:45 +0100 Subject: [PATCH 072/112] fixing dir in docker run cmd in start.sh --- contrib/upgrade_testnet/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 29ab262128..c92a913a0a 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -16,7 +16,7 @@ rm -r -f $BUILDDIR # Create the 4 nodes folders with the correct denom echo "===> Creating $NODES nodes localnet" docker build --platform x86_64 --tag local-node-bin $(pwd) -docker run --rm -v "$BUILDDIR":/desmos:Z local-node-bin /bin/cp /usr/bin/desmos /desmos:Z +docker run --rm -v "$BUILDDIR":/desmos local-node-bin /bin/cp /usr/bin/desmos /desmos if ! [ -f build/node0/desmos/config/genesis.json ]; then From bf4e66b14f27e284b7c21b994333b386d156d892 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 7 Feb 2022 11:22:46 +0100 Subject: [PATCH 073/112] added chmod +x to solve permission denied errors --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b53cf74955..203a1b640c 100644 --- a/Makefile +++ b/Makefile @@ -416,7 +416,7 @@ setup-localnet: build-linux # 2. GENESIS_URL, which represents the URL from where to download the testnet genesis status # 3. UPGRADE_NAME, which represents the name of the upgrade to perform upgrade-testnet-start: upgrade-testnet-stop - $(CURDIR)/contrib/upgrade_testnet/start.sh 4 $(GENESIS_VERSION) $(GENESIS_URL) $(UPGRADE_NAME) + chmod +x $(CURDIR)/contrib/upgrade_testnet/start.sh 4 $(GENESIS_VERSION) $(GENESIS_URL) $(UPGRADE_NAME) # Stops the 4-nodes testnet that should be used to test on-chain upgrades. upgrade-testnet-stop: From 51838d88a369285d1baedd357dc9ee8ab6b96efe Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 7 Feb 2022 11:26:37 +0100 Subject: [PATCH 074/112] added chmod +x to solve permission denied errors --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 203a1b640c..cb3e2fec30 100644 --- a/Makefile +++ b/Makefile @@ -416,7 +416,7 @@ setup-localnet: build-linux # 2. GENESIS_URL, which represents the URL from where to download the testnet genesis status # 3. UPGRADE_NAME, which represents the name of the upgrade to perform upgrade-testnet-start: upgrade-testnet-stop - chmod +x $(CURDIR)/contrib/upgrade_testnet/start.sh 4 $(GENESIS_VERSION) $(GENESIS_URL) $(UPGRADE_NAME) + sudo chmod +x $(CURDIR)/contrib/upgrade_testnet/start.sh 4 $(GENESIS_VERSION) $(GENESIS_URL) $(UPGRADE_NAME) # Stops the 4-nodes testnet that should be used to test on-chain upgrades. upgrade-testnet-stop: From e401ca9855559a9fb9dd582dcb080ed534867048 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 7 Feb 2022 11:30:40 +0100 Subject: [PATCH 075/112] added chmod +x in upgrade-testnet-start --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cb3e2fec30..9d5810e84a 100644 --- a/Makefile +++ b/Makefile @@ -416,7 +416,8 @@ setup-localnet: build-linux # 2. GENESIS_URL, which represents the URL from where to download the testnet genesis status # 3. UPGRADE_NAME, which represents the name of the upgrade to perform upgrade-testnet-start: upgrade-testnet-stop - sudo chmod +x $(CURDIR)/contrib/upgrade_testnet/start.sh 4 $(GENESIS_VERSION) $(GENESIS_URL) $(UPGRADE_NAME) + chmod +x $(CURDIR)/contrib/upgrade_testnet/start.sh + $(CURDIR)/contrib/upgrade_testnet/start.sh 4 $(GENESIS_VERSION) $(GENESIS_URL) $(UPGRADE_NAME) # Stops the 4-nodes testnet that should be used to test on-chain upgrades. upgrade-testnet-stop: From 1ade38aab9b5c267186b66e79514dcfaa347f0ef Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 7 Feb 2022 11:36:34 +0100 Subject: [PATCH 076/112] trying adding sudo to start.sh --- contrib/upgrade_testnet/start.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index c92a913a0a..7ea4239ff1 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -20,7 +20,7 @@ docker run --rm -v "$BUILDDIR":/desmos local-node-bin /bin/cp /usr/bin/desmos /d if ! [ -f build/node0/desmos/config/genesis.json ]; then - "$BUILDDIR"/desmos testnet \ + sudo "$BUILDDIR"/desmos testnet \ -o ./build --starting-ip-address 192.168.10.2 --keyring-backend=test \ --v=$NODES \ --gentx-coin-denom=$COIN_DENOM \ @@ -54,8 +54,8 @@ if [ ! -d "$UPGRADE_FOLDER" ]; then for ((i = 0; i < $NODES; i++)); do echo "====> Node $i" - mkdir -p "$BUILDDIR/node$i/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" - cp "$BUILDDIR/desmos" "$BUILDDIR/node$i/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin/desmos" + sudo mkdir -p "$BUILDDIR/node$i/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" + sudo cp "$BUILDDIR/desmos" "$BUILDDIR/node$i/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin/desmos" done fi From 3191ec1f487ca33a918b958be121e099ce1f6c72 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 7 Feb 2022 12:21:39 +0100 Subject: [PATCH 077/112] fixed coin denom checks --- Makefile | 1 - contrib/upgrade_testnet/start.sh | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9d5810e84a..b53cf74955 100644 --- a/Makefile +++ b/Makefile @@ -416,7 +416,6 @@ setup-localnet: build-linux # 2. GENESIS_URL, which represents the URL from where to download the testnet genesis status # 3. UPGRADE_NAME, which represents the name of the upgrade to perform upgrade-testnet-start: upgrade-testnet-stop - chmod +x $(CURDIR)/contrib/upgrade_testnet/start.sh $(CURDIR)/contrib/upgrade_testnet/start.sh 4 $(GENESIS_VERSION) $(GENESIS_URL) $(UPGRADE_NAME) # Stops the 4-nodes testnet that should be used to test on-chain upgrades. diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 7ea4239ff1..478b3722c8 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -20,11 +20,15 @@ docker run --rm -v "$BUILDDIR":/desmos local-node-bin /bin/cp /usr/bin/desmos /d if ! [ -f build/node0/desmos/config/genesis.json ]; then + if [ -z "$COIN_DENOM" ] + then + COIN_DENOM="udaric" + fi sudo "$BUILDDIR"/desmos testnet \ -o ./build --starting-ip-address 192.168.10.2 --keyring-backend=test \ --v=$NODES \ - --gentx-coin-denom=$COIN_DENOM \ - --minimum-gas-prices="0.000006$COIN_DENOM"; + --gentx-coin-denom=$COIN_DENOM \ + --minimum-gas-prices="0.000006$COIN_DENOM" fi # Run the Python script to setup the genesis From 24eaccdbcf988473e14bf28b9b3cba052d501302 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 7 Feb 2022 14:58:30 +0100 Subject: [PATCH 078/112] edited docker desmos build directory --- contrib/upgrade_testnet/start.sh | 2 +- contrib/upgrade_testnet/submit_upgrade_proposal.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 478b3722c8..e06debb599 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -49,7 +49,7 @@ sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\" # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" docker build --platform x86_64 --tag on-chain-upgrade $(pwd) -docker run --rm -v "$BUILDDIR":/mnt/out on-chain-upgrade /bin/cp /usr/bin/desmos /mnt/out +docker run --rm -v "$BUILDDIR":/desmos on-chain-upgrade /bin/cp /usr/bin/desmos /desmos # Copy the Desmos binary into the proper folders UPGRADE_FOLDER="$BUILDDIR/node0/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" diff --git a/contrib/upgrade_testnet/submit_upgrade_proposal.sh b/contrib/upgrade_testnet/submit_upgrade_proposal.sh index 8eca3282c6..838837fb5f 100755 --- a/contrib/upgrade_testnet/submit_upgrade_proposal.sh +++ b/contrib/upgrade_testnet/submit_upgrade_proposal.sh @@ -24,6 +24,9 @@ while [ ${CNT} -lt $ITER ]; do sleep $SLEEP done +docker logs desmosdnode0 +docker logs desmosdnode1 + curr_block=$(curl -s $NODE/status | jq -r '.result.sync_info.latest_block_height') if [ -z ${curr_block} ] ; then echo "===> Failed to start the chain" @@ -35,7 +38,6 @@ echo "====> Chain is online. Ready to submit proposal" CHAIN_ID=$(curl -s $NODE/status | jq -r '.result.node_info.network') if [ -z "$CHAIN_ID" ]; then echo "Missing chain id" - docker logs desmosdnode0 exit 1 fi From c4292a7513280964de43623ffec8affba7fc157c Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 7 Feb 2022 15:24:08 +0100 Subject: [PATCH 079/112] added containers logs --- contrib/upgrade_testnet/start.sh | 2 +- contrib/upgrade_testnet/submit_upgrade_proposal.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index e06debb599..8eb400f0fd 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -13,7 +13,7 @@ TESTNETDIR=$CONTRIBFOLDER/upgrade_testnet echo "===> Removing build folder" rm -r -f $BUILDDIR -# Create the 4 nodes folders with the correct denom +# Setups 4 folders representing each one the genesis state of a testnet node echo "===> Creating $NODES nodes localnet" docker build --platform x86_64 --tag local-node-bin $(pwd) docker run --rm -v "$BUILDDIR":/desmos local-node-bin /bin/cp /usr/bin/desmos /desmos diff --git a/contrib/upgrade_testnet/submit_upgrade_proposal.sh b/contrib/upgrade_testnet/submit_upgrade_proposal.sh index 838837fb5f..4f36c1b325 100755 --- a/contrib/upgrade_testnet/submit_upgrade_proposal.sh +++ b/contrib/upgrade_testnet/submit_upgrade_proposal.sh @@ -24,8 +24,8 @@ while [ ${CNT} -lt $ITER ]; do sleep $SLEEP done -docker logs desmosdnode0 -docker logs desmosdnode1 +docker logs desmosnode0 +docker logs desmosnode1 curr_block=$(curl -s $NODE/status | jq -r '.result.sync_info.latest_block_height') if [ -z ${curr_block} ] ; then From 3ece86684d2ddcc8923ecc23678451e488b941b1 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 7 Feb 2022 16:38:22 +0100 Subject: [PATCH 080/112] prepend sudo to cosmovisor wrapper.sh script --- contrib/images/desmos-cosmovisor/wrapper.sh | 2 +- contrib/upgrade_testnet/submit_upgrade_proposal.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/images/desmos-cosmovisor/wrapper.sh b/contrib/images/desmos-cosmovisor/wrapper.sh index 084728023a..a63af796ee 100644 --- a/contrib/images/desmos-cosmovisor/wrapper.sh +++ b/contrib/images/desmos-cosmovisor/wrapper.sh @@ -15,7 +15,7 @@ export DAEMON_RESTART_AFTER_UPGRADE=true # Setup Cosmovisor COSMOVISOR_GENESIS="$DESMOSDHOME/cosmovisor/genesis/bin" if [ ! -d "$COSMOVISOR_GENESIS" ]; then - mkdir -p $COSMOVISOR_GENESIS + sudo mkdir -p $COSMOVISOR_GENESIS cp $(which desmos) "$COSMOVISOR_GENESIS/desmos" fi diff --git a/contrib/upgrade_testnet/submit_upgrade_proposal.sh b/contrib/upgrade_testnet/submit_upgrade_proposal.sh index 4f36c1b325..a074f9d326 100755 --- a/contrib/upgrade_testnet/submit_upgrade_proposal.sh +++ b/contrib/upgrade_testnet/submit_upgrade_proposal.sh @@ -25,7 +25,6 @@ while [ ${CNT} -lt $ITER ]; do done docker logs desmosnode0 -docker logs desmosnode1 curr_block=$(curl -s $NODE/status | jq -r '.result.sync_info.latest_block_height') if [ -z ${curr_block} ] ; then From 84bc6489ec7473afca4fc09df3941e88f2afd7c2 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Mon, 7 Feb 2022 17:14:27 +0100 Subject: [PATCH 081/112] trying to remove uid e gid to force root use --- contrib/images/desmos-cosmovisor/Dockerfile | 6 +++--- contrib/images/desmos-cosmovisor/wrapper.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/images/desmos-cosmovisor/Dockerfile b/contrib/images/desmos-cosmovisor/Dockerfile index 231d7032b0..18a4716c1f 100644 --- a/contrib/images/desmos-cosmovisor/Dockerfile +++ b/contrib/images/desmos-cosmovisor/Dockerfile @@ -18,9 +18,9 @@ FROM desmoslabs/desmos:$DESMOS_VERSION # Copy over binaries from the build-env COPY --from=build-env /go/src/github.com/cosmos/cosmos-sdk/cosmovisor/cosmovisor /usr/bin/cosmovisor -ARG UID=1000 -ARG GID=1000 -USER ${UID}:${GID} +#ARG UID=1000 +#ARG GID=1000 +#USER ${UID}:${GID} COPY wrapper.sh /usr/bin/wrapper.sh ENTRYPOINT ["bash", "/usr/bin/wrapper.sh"] diff --git a/contrib/images/desmos-cosmovisor/wrapper.sh b/contrib/images/desmos-cosmovisor/wrapper.sh index a63af796ee..084728023a 100644 --- a/contrib/images/desmos-cosmovisor/wrapper.sh +++ b/contrib/images/desmos-cosmovisor/wrapper.sh @@ -15,7 +15,7 @@ export DAEMON_RESTART_AFTER_UPGRADE=true # Setup Cosmovisor COSMOVISOR_GENESIS="$DESMOSDHOME/cosmovisor/genesis/bin" if [ ! -d "$COSMOVISOR_GENESIS" ]; then - sudo mkdir -p $COSMOVISOR_GENESIS + mkdir -p $COSMOVISOR_GENESIS cp $(which desmos) "$COSMOVISOR_GENESIS/desmos" fi From 56859a84b0b2980de4f26ee48a5c34a93a17fd3c Mon Sep 17 00:00:00 2001 From: Bax995 Date: Thu, 10 Feb 2022 09:42:16 +0100 Subject: [PATCH 082/112] updated on-chain-upgrade.yml workflow exported state --- .github/workflows/on-chain-upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on-chain-upgrade.yml b/.github/workflows/on-chain-upgrade.yml index 4664221957..4b0d430719 100644 --- a/.github/workflows/on-chain-upgrade.yml +++ b/.github/workflows/on-chain-upgrade.yml @@ -23,7 +23,7 @@ jobs: timeout-minutes: 30 env: GENESIS_DESMOS_VERSION: "v2.3.1" - GENESIS_URL: "https://raw.githubusercontent.com/RiccardoM/desmos-states/master/morpheus-apollo-2-3934000.json" + GENESIS_URL: "https://raw.githubusercontent.com/RiccardoM/desmos-states/master/morpheus-apollo-2-4133030.json" UPGRADE_NAME: "v3.0.0" steps: - name: Checkout 🛎️ From efa4026052cd24fb76a20c9467d6f47d1104e36c Mon Sep 17 00:00:00 2001 From: Bax995 Date: Thu, 17 Feb 2022 09:38:47 +0000 Subject: [PATCH 083/112] pulled master and fixed conflicts --- x/profiles/keeper/keeper_app_links_benchmarks_test.go | 1 + x/profiles/keeper/migrations.go | 6 ------ x/profiles/simulation/decoder_test.go | 4 ++-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/x/profiles/keeper/keeper_app_links_benchmarks_test.go b/x/profiles/keeper/keeper_app_links_benchmarks_test.go index 1454821c2d..db29e0d824 100644 --- a/x/profiles/keeper/keeper_app_links_benchmarks_test.go +++ b/x/profiles/keeper/keeper_app_links_benchmarks_test.go @@ -71,6 +71,7 @@ func setupBenchTest() (authkeeper.AccountKeeper, keeper.Keeper, sdk.Context) { nil, nil, nil, + nil, ) return ak, k, ctx diff --git a/x/profiles/keeper/migrations.go b/x/profiles/keeper/migrations.go index 8ca704a5e2..17cd0fbd30 100644 --- a/x/profiles/keeper/migrations.go +++ b/x/profiles/keeper/migrations.go @@ -7,7 +7,6 @@ import ( v043 "github.com/cosmos/cosmos-sdk/x/auth/legacy/v043" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" - v231 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v231" "github.com/desmos-labs/desmos/v2/x/profiles/types" "github.com/gogo/protobuf/grpc" @@ -78,11 +77,6 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error { return iterErr } -// Migrate4to5 migrates from version 4 to 5 -func (m Migrator) Migrate4to5(ctx sdk.Context) error { - return v231.MigrateStore(ctx, m.keeper.storeKey, m.keeper.paramSubspace, m.keeper.cdc, m.amino) -} - func (m Migrator) migrateProfile(ctx sdk.Context, profile *types.Profile) error { // Do not migrate those profiles that are not based on a VestingAccount vestingAcc, ok := profile.GetAccount().(exported.VestingAccount) diff --git a/x/profiles/simulation/decoder_test.go b/x/profiles/simulation/decoder_test.go index 540cdc99a1..b6d7f7182a 100644 --- a/x/profiles/simulation/decoder_test.go +++ b/x/profiles/simulation/decoder_test.go @@ -88,8 +88,8 @@ func TestDecodeStore(t *testing.T) { }{ {"DTags", fmt.Sprintf("DTagAddressA: %s\nDTagAddressB: %s\n", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns")}, {"DTag transfer request", fmt.Sprintf("RequestA: %s\nRequestB: %s\n", request, request)}, - {"Relationship", fmt.Sprintf("Relationships A: %s\nRelationships B: %s\n", relationship, relationship)}, - {"User block", fmt.Sprintf("User block A: %s\nUser block B: %s\n", userBlock, userBlock)}, + {"Relationship", fmt.Sprintf("Relationships A: %s\nRelationships B: %s\n", &relationship, &relationship)}, + {"User block", fmt.Sprintf("User block A: %s\nUser block B: %s\n", &userBlock, &userBlock)}, {"Expiring Application link", fmt.Sprintf("Client ID A: %s\nClient ID B: %s\n", clientID, clientID)}, {"other", ""}, } From 664d1265cc0b2508b0bb558b38c6f6e479a5b6a9 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Thu, 17 Feb 2022 09:49:12 +0000 Subject: [PATCH 084/112] use udsm as default coin denom instead of udaric removed udsm -> udaric replacement in python script --- contrib/upgrade_testnet/setup_genesis.py | 4 ++-- contrib/upgrade_testnet/start.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/upgrade_testnet/setup_genesis.py b/contrib/upgrade_testnet/setup_genesis.py index 8aeaa7b944..3de302af6b 100644 --- a/contrib/upgrade_testnet/setup_genesis.py +++ b/contrib/upgrade_testnet/setup_genesis.py @@ -198,7 +198,7 @@ chain_state['app_state']['gov']['deposit_params']['max_deposit_period'] = '120s' chain_state['app_state']['gov']['voting_params']['voting_period'] = '120s' - chain_state['app_state']['gov']['deposit_params']['min_deposit'] = [{'amount': '10000000', 'denom': 'udaric'}] + chain_state['app_state']['gov']['deposit_params']['min_deposit'] = [{'amount': '10000000', 'denom': 'udsm'}] # ------------------------------- # --- Clear the validators list @@ -209,7 +209,7 @@ # --- Write the file out.write(json.dumps(chain_state)) - os.system(f"sed -i 's/udsm/udaric/g' {output_file}") + #os.system(f"sed -i 's/udsm/udaric/g' {output_file}") nodes_amount = args[1] for i in range(0, int(nodes_amount)): diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 8eb400f0fd..0e1fb7ae07 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -22,7 +22,7 @@ if ! [ -f build/node0/desmos/config/genesis.json ]; then if [ -z "$COIN_DENOM" ] then - COIN_DENOM="udaric" + COIN_DENOM="udsm" fi sudo "$BUILDDIR"/desmos testnet \ -o ./build --starting-ip-address 192.168.10.2 --keyring-backend=test \ From 57154d2e536e298ae28c3b8f3c44c99ff460c303 Mon Sep 17 00:00:00 2001 From: Bax995 Date: Tue, 22 Feb 2022 16:44:12 +0000 Subject: [PATCH 085/112] fixed conflicts with master branch --- x/profiles/keeper/migrations.go | 2 +- .../legacy/{v200 => v2}/model_app_links.go | 2 +- .../{v200 => v2}/models_app_links.pb.go | 24 +- .../legacy/{v200 => v2}/models_params.go | 2 +- .../legacy/{v200 => v2}/models_params.pb.go | 16 +- x/profiles/legacy/v231/store.go | 141 -------- x/profiles/legacy/v231/store_test.go | 121 ------- x/profiles/legacy/v3/store.go | 125 ++++++- x/profiles/legacy/v3/store_test.go | 78 ++++- x/profiles/types/models_app_links.pb.go | 174 ++++++---- x/profiles/types/models_params.pb.go | 312 +++++++++++++++--- x/subspaces/client/cli/cli_test.go | 1 + 12 files changed, 598 insertions(+), 400 deletions(-) rename x/profiles/legacy/{v200 => v2}/model_app_links.go (99%) rename x/profiles/legacy/{v200 => v2}/models_app_links.pb.go (98%) rename x/profiles/legacy/{v200 => v2}/models_params.go (99%) rename x/profiles/legacy/{v200 => v2}/models_params.pb.go (99%) delete mode 100644 x/profiles/legacy/v231/store.go delete mode 100644 x/profiles/legacy/v231/store_test.go diff --git a/x/profiles/keeper/migrations.go b/x/profiles/keeper/migrations.go index 19f6d4b19e..17b9ab8091 100644 --- a/x/profiles/keeper/migrations.go +++ b/x/profiles/keeper/migrations.go @@ -28,5 +28,5 @@ func NewMigrator(keeper Keeper, amino *codec.LegacyAmino, queryServer grpc.Serve // Migrate4to5 migrates from version 4 to 5. func (m Migrator) Migrate4to5(ctx sdk.Context) error { - return v3.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc) + return v3.MigrateStore(ctx, m.keeper.storeKey, m.keeper.paramSubspace, m.keeper.cdc, m.amino) } diff --git a/x/profiles/legacy/v200/model_app_links.go b/x/profiles/legacy/v2/model_app_links.go similarity index 99% rename from x/profiles/legacy/v200/model_app_links.go rename to x/profiles/legacy/v2/model_app_links.go index 0295c28f7c..15d1ef0a6d 100644 --- a/x/profiles/legacy/v200/model_app_links.go +++ b/x/profiles/legacy/v2/model_app_links.go @@ -1,4 +1,4 @@ -package v200 +package v2 import ( "time" diff --git a/x/profiles/legacy/v200/models_app_links.pb.go b/x/profiles/legacy/v2/models_app_links.pb.go similarity index 98% rename from x/profiles/legacy/v200/models_app_links.pb.go rename to x/profiles/legacy/v2/models_app_links.pb.go index d06695d2d4..24642b4cc3 100644 --- a/x/profiles/legacy/v200/models_app_links.pb.go +++ b/x/profiles/legacy/v2/models_app_links.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/legacy/v200/models_app_links.proto +// source: desmos/profiles/legacy/v2/models_app_links.proto -package v200 +package v2 import ( fmt "fmt" @@ -75,7 +75,7 @@ type ApplicationLink struct { // Data contains the details of this specific link Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data" yaml:"data"` // State of the link - State ApplicationLinkState `protobuf:"varint,3,opt,name=state,proto3,enum=desmos.profiles.legacy.v200.ApplicationLinkState" json:"state,omitempty" yaml:"state"` + State ApplicationLinkState `protobuf:"varint,3,opt,name=state,proto3,enum=desmos.profiles.legacy.v2.ApplicationLinkState" json:"state,omitempty" yaml:"state"` // OracleRequest represents the request that has been made to the oracle OracleRequest OracleRequest `protobuf:"bytes,4,opt,name=oracle_request,json=oracleRequest,proto3" json:"oracle_request" yaml:"oracle_request"` // Data coming from the result of the verification. @@ -436,18 +436,18 @@ func (m *Result_Failed) XXX_DiscardUnknown() { var xxx_messageInfo_Result_Failed proto.InternalMessageInfo func init() { - proto.RegisterEnum("desmos.profiles.legacy.v200.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) - proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.legacy.v200.ApplicationLink") - proto.RegisterType((*Data)(nil), "desmos.profiles.legacy.v200.Data") - proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.legacy.v200.OracleRequest") - proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.legacy.v200.OracleRequest.CallData") - proto.RegisterType((*Result)(nil), "desmos.profiles.legacy.v200.Result") - proto.RegisterType((*Result_Success)(nil), "desmos.profiles.legacy.v200.Result.Success") - proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.legacy.v200.Result.Failed") + proto.RegisterEnum("desmos.profiles.legacy.v2.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) + proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.legacy.v2.ApplicationLink") + proto.RegisterType((*Data)(nil), "desmos.profiles.legacy.v2.Data") + proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.legacy.v2.OracleRequest") + proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.legacy.v2.OracleRequest.CallData") + proto.RegisterType((*Result)(nil), "desmos.profiles.legacy.v2.Result") + proto.RegisterType((*Result_Success)(nil), "desmos.profiles.legacy.v2.Result.Success") + proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.legacy.v2.Result.Failed") } func init() { - proto.RegisterFile("desmos/profiles/legacy/v200/models_app_links.proto", fileDescriptor_5df3c995b2a7b875) + proto.RegisterFile("desmos/profiles/legacy/v2/models_app_links.proto", fileDescriptor_5df3c995b2a7b875) } var fileDescriptor_5df3c995b2a7b875 = []byte{ diff --git a/x/profiles/legacy/v200/models_params.go b/x/profiles/legacy/v2/models_params.go similarity index 99% rename from x/profiles/legacy/v200/models_params.go rename to x/profiles/legacy/v2/models_params.go index 43aadc1cec..e850ae7a24 100644 --- a/x/profiles/legacy/v200/models_params.go +++ b/x/profiles/legacy/v2/models_params.go @@ -1,4 +1,4 @@ -package v200 +package v2 import ( "fmt" diff --git a/x/profiles/legacy/v200/models_params.pb.go b/x/profiles/legacy/v2/models_params.pb.go similarity index 99% rename from x/profiles/legacy/v200/models_params.pb.go rename to x/profiles/legacy/v2/models_params.pb.go index 1ee3c0a65b..cc89d12fdd 100644 --- a/x/profiles/legacy/v200/models_params.pb.go +++ b/x/profiles/legacy/v2/models_params.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/legacy/v200/models_params.proto +// source: desmos/profiles/legacy/v2/models_params.proto -package v200 +package v2 import ( fmt "fmt" @@ -240,15 +240,15 @@ func (m *OracleParams) XXX_DiscardUnknown() { var xxx_messageInfo_OracleParams proto.InternalMessageInfo func init() { - proto.RegisterType((*Params)(nil), "desmos.profiles.legacy.v200.Params") - proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.legacy.v200.NicknameParams") - proto.RegisterType((*DTagParams)(nil), "desmos.profiles.legacy.v200.DTagParams") - proto.RegisterType((*BioParams)(nil), "desmos.profiles.legacy.v200.BioParams") - proto.RegisterType((*OracleParams)(nil), "desmos.profiles.legacy.v200.OracleParams") + proto.RegisterType((*Params)(nil), "desmos.profiles.legacy.v2.Params") + proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.legacy.v2.NicknameParams") + proto.RegisterType((*DTagParams)(nil), "desmos.profiles.legacy.v2.DTagParams") + proto.RegisterType((*BioParams)(nil), "desmos.profiles.legacy.v2.BioParams") + proto.RegisterType((*OracleParams)(nil), "desmos.profiles.legacy.v2.OracleParams") } func init() { - proto.RegisterFile("desmos/profiles/legacy/v200/models_params.proto", fileDescriptor_25d12bc4496b54d5) + proto.RegisterFile("desmos/profiles/legacy/v2/models_params.proto", fileDescriptor_25d12bc4496b54d5) } var fileDescriptor_25d12bc4496b54d5 = []byte{ diff --git a/x/profiles/legacy/v231/store.go b/x/profiles/legacy/v231/store.go deleted file mode 100644 index a40ceffad8..0000000000 --- a/x/profiles/legacy/v231/store.go +++ /dev/null @@ -1,141 +0,0 @@ -package v231 - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - v200 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200" - "github.com/desmos-labs/desmos/v2/x/profiles/types" -) - -// MigrateStore performs in-place store migrations from v2.3.1 to v2.4.0 The -// migration includes: -// - Add the AppLinkParams to the params set -// - Added expiration time to all app links -func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, subspace paramstypes.Subspace, cdc codec.BinaryCodec, - legacyAmino *codec.LegacyAmino) error { - store := ctx.KVStore(storeKey) - - err := migrateParams(ctx, subspace, legacyAmino) - if err != nil { - return err - } - - err = migrateAppLinks(store, cdc) - if err != nil { - return err - } - - return nil -} - -func migrateAppLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { - iterator := sdk.KVStorePrefixIterator(store, types.UserApplicationLinkPrefix) - defer iterator.Close() - - var keys [][]byte - var newLinks []types.ApplicationLink - for ; iterator.Valid(); iterator.Next() { - var legacyAppLink v200.ApplicationLink - err := cdc.Unmarshal(iterator.Value(), &legacyAppLink) - if err != nil { - return err - } - - link := types.NewApplicationLink( - legacyAppLink.User, - types.NewData(legacyAppLink.Data.Application, legacyAppLink.Data.Username), - types.ApplicationLinkState(legacyAppLink.State), - types.NewOracleRequest( - legacyAppLink.OracleRequest.ID, - legacyAppLink.OracleRequest.OracleScriptID, - types.NewOracleRequestCallData( - legacyAppLink.OracleRequest.CallData.Application, - legacyAppLink.OracleRequest.CallData.CallData, - ), - legacyAppLink.OracleRequest.ClientID, - ), - migrateAppLinkResult(legacyAppLink.Result), - legacyAppLink.CreationTime, - legacyAppLink.CreationTime.Add(types.DefaultAppLinksParams().ExpirationTime), - ) - - keys = append(keys, iterator.Key()) - newLinks = append(newLinks, link) - - store.Delete(iterator.Key()) - } - - for index, link := range newLinks { - store.Set(keys[index], types.MustMarshalApplicationLink(cdc, link)) - store.Set( - types.ApplicationLinkExpiringTimeKey(link.ExpirationTime, link.OracleRequest.ClientID), - []byte(link.OracleRequest.ClientID), - ) - } - - return nil -} - -func migrateAppLinkResult(r *v200.Result) *types.Result { - if r == nil { - return nil - } - - switch result := (r.Sum).(type) { - case *v200.Result_Success_: - return types.NewSuccessResult(result.Success.Value, result.Success.Signature) - case *v200.Result_Failed_: - return types.NewErrorResult(result.Failed.Error) - default: - panic(fmt.Errorf("invalid result type")) - } -} - -// migrateParams add the AppLinksParams to the params set -func migrateParams(ctx sdk.Context, subspace paramstypes.Subspace, legacyAmino *codec.LegacyAmino) error { - var v2NicknameParams v200.NicknameParams - err := legacyAmino.UnmarshalJSON(subspace.GetRaw(ctx, types.NicknameParamsKey), &v2NicknameParams) - if err != nil { - return err - } - - var v2DTagParams v200.DTagParams - err = legacyAmino.UnmarshalJSON(subspace.GetRaw(ctx, types.DTagParamsKey), &v2DTagParams) - if err != nil { - return err - } - - var v2OracleParams v200.OracleParams - err = legacyAmino.UnmarshalJSON(subspace.GetRaw(ctx, types.OracleParamsKey), &v2OracleParams) - if err != nil { - return err - } - - var v2BioParams v200.BioParams - err = legacyAmino.UnmarshalJSON(subspace.GetRaw(ctx, types.BioParamsKey), &v2BioParams) - if err != nil { - return err - } - - nicknameParams := types.NewNicknameParams(v2NicknameParams.MinLength, v2NicknameParams.MaxLength) - dtagParams := types.NewDTagParams(v2DTagParams.RegEx, v2DTagParams.MinLength, v2DTagParams.MaxLength) - bioParams := types.NewBioParams(v2BioParams.MaxLength) - oracleParams := types.NewOracleParams( - v2OracleParams.ScriptID, - v2OracleParams.AskCount, - v2OracleParams.MinCount, - v2OracleParams.PrepareGas, - v2OracleParams.ExecuteGas, - v2OracleParams.FeeAmount..., - ) - - subspace.Set(ctx, types.NicknameParamsKey, &nicknameParams) - subspace.Set(ctx, types.DTagParamsKey, &dtagParams) - subspace.Set(ctx, types.BioParamsKey, &bioParams) - subspace.Set(ctx, types.OracleParamsKey, &oracleParams) - - return nil -} diff --git a/x/profiles/legacy/v231/store_test.go b/x/profiles/legacy/v231/store_test.go deleted file mode 100644 index 73ad86da78..0000000000 --- a/x/profiles/legacy/v231/store_test.go +++ /dev/null @@ -1,121 +0,0 @@ -package v231_test - -import ( - "testing" - "time" - - "github.com/cosmos/cosmos-sdk/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/desmos-labs/desmos/v2/app" - v200 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200" - v231 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v231" - "github.com/desmos-labs/desmos/v2/x/profiles/types" - "github.com/stretchr/testify/require" -) - -func TestStoreMigration(t *testing.T) { - cdc, legacyAminoCdc := app.MakeCodecs() - profilesKey := sdk.NewKVStoreKey("profiles") - transientKey := sdk.NewTransientStoreKey("profiles_transient") - - testCases := []struct { - name string - store func(ctx sdk.Context) - shouldErr bool - check func(ctx sdk.Context, paramsSpace paramstypes.Subspace) - }{ - { - name: "valid data returns no error", - store: func(ctx sdk.Context) { - // setup legacy params - params := v200.DefaultParams() - paramsSpace := paramstypes.NewSubspace(cdc, legacyAminoCdc, profilesKey, transientKey, "profiles") - paramsSpace = paramsSpace.WithKeyTable(v200.ParamKeyTable()) - paramsSpace.SetParamSet(ctx, ¶ms) - - store := ctx.KVStore(profilesKey) - - applicationLinkKey := types.UserApplicationLinkKey( - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "twitter", - "user", - ) - - applicationLinkBz := v200.MustMarshalApplicationLink(cdc, v200.NewApplicationLink( - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - v200.NewData("twitter", "user"), - v200.AppLinkStateVerificationStarted, - v200.NewOracleRequest( - 1, - 1, - v200.NewOracleRequestCallData("twitter", "tweet-123456789"), - "client_id", - ), - v200.NewSuccessResult("76616c7565", "signature"), // The value should be HEX - time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), - )) - - store.Set(applicationLinkKey, applicationLinkBz) - }, - check: func(ctx sdk.Context, paramSpace paramstypes.Subspace) { - store := ctx.KVStore(profilesKey) - applicationLinkKey := types.UserApplicationLinkKey( - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "twitter", - "user", - ) - - var expectedAppLink = types.NewApplicationLink( - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - types.NewData("twitter", "user"), - types.AppLinkStateVerificationStarted, - types.NewOracleRequest( - 1, - 1, - types.NewOracleRequestCallData("twitter", "tweet-123456789"), - "client_id", - ), - types.NewSuccessResult("76616c7565", "signature"), // The value should be HEX - time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2022, 7, 2, 00, 00, 00, 000, time.UTC), - ) - - var storedAppLink types.ApplicationLink - cdc.MustUnmarshal(store.Get(applicationLinkKey), &storedAppLink) - require.Equal(t, expectedAppLink, storedAppLink) - - var storedParams types.Params - paramSpace.GetParamSet(ctx, &storedParams) - - require.Equal(t, types.DefaultParams(), storedParams) - }, - }, - } - - // Make sure the new values are set properly - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - ctx := testutil.DefaultContext(profilesKey, transientKey) - if tc.store != nil { - tc.store(ctx) - } - - newParams := types.DefaultParams() - newParamSpace := paramstypes.NewSubspace(cdc, legacyAminoCdc, profilesKey, transientKey, "profiles") - newParamSpace = newParamSpace.WithKeyTable(types.ParamKeyTable()) - newParamSpace.SetParamSet(ctx, &newParams) - - err := v231.MigrateStore(ctx, profilesKey, newParamSpace, cdc, legacyAminoCdc) - if tc.shouldErr { - require.Error(t, err) - } else { - require.NoError(t, err) - if tc.check != nil { - tc.check(ctx, newParamSpace) - } - } - }) - } -} diff --git a/x/profiles/legacy/v3/store.go b/x/profiles/legacy/v3/store.go index 668093e0d9..264368a5f9 100644 --- a/x/profiles/legacy/v3/store.go +++ b/x/profiles/legacy/v3/store.go @@ -1,10 +1,11 @@ package v300 import ( + "fmt" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" subspacestypes "github.com/desmos-labs/desmos/v2/x/subspaces/types" v2 "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v2" @@ -16,7 +17,8 @@ import ( // // - replace all relationship subspace id from string to uint64 // - replace all user blocks subspace id from string to uint64 -func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, cdc codec.BinaryCodec) error { +func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, subspace paramstypes.Subspace, cdc codec.BinaryCodec, + legacyAmino *codec.LegacyAmino) error { store := ctx.KVStore(storeKey) err := migrateUserBlocks(store, cdc) @@ -29,6 +31,16 @@ func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, cdc codec.BinaryCodec) return err } + err = migrateParams(ctx, subspace, legacyAmino) + if err != nil { + return err + } + + err = migrateAppLinks(store, cdc) + if err != nil { + return err + } + return nil } @@ -123,3 +135,112 @@ func migrateRelationships(store sdk.KVStore, cdc codec.BinaryCodec) error { return nil } + +func migrateAppLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { + iterator := sdk.KVStorePrefixIterator(store, types.UserApplicationLinkPrefix) + defer iterator.Close() + + var keys [][]byte + var newLinks []types.ApplicationLink + for ; iterator.Valid(); iterator.Next() { + var legacyAppLink v2.ApplicationLink + err := cdc.Unmarshal(iterator.Value(), &legacyAppLink) + if err != nil { + return err + } + + link := types.NewApplicationLink( + legacyAppLink.User, + types.NewData(legacyAppLink.Data.Application, legacyAppLink.Data.Username), + types.ApplicationLinkState(legacyAppLink.State), + types.NewOracleRequest( + legacyAppLink.OracleRequest.ID, + legacyAppLink.OracleRequest.OracleScriptID, + types.NewOracleRequestCallData( + legacyAppLink.OracleRequest.CallData.Application, + legacyAppLink.OracleRequest.CallData.CallData, + ), + legacyAppLink.OracleRequest.ClientID, + ), + migrateAppLinkResult(legacyAppLink.Result), + legacyAppLink.CreationTime, + legacyAppLink.CreationTime.Add(types.DefaultAppLinksParams().ExpirationTime), + ) + + keys = append(keys, iterator.Key()) + newLinks = append(newLinks, link) + + store.Delete(iterator.Key()) + } + + for index, link := range newLinks { + store.Set(keys[index], types.MustMarshalApplicationLink(cdc, link)) + store.Set( + types.ApplicationLinkExpiringTimeKey(link.ExpirationTime, link.OracleRequest.ClientID), + []byte(link.OracleRequest.ClientID), + ) + } + + return nil +} + +func migrateAppLinkResult(r *v2.Result) *types.Result { + if r == nil { + return nil + } + + switch result := (r.Sum).(type) { + case *v2.Result_Success_: + return types.NewSuccessResult(result.Success.Value, result.Success.Signature) + case *v2.Result_Failed_: + return types.NewErrorResult(result.Failed.Error) + default: + panic(fmt.Errorf("invalid result type")) + } +} + +// migrateParams add the AppLinksParams to the params set +func migrateParams(ctx sdk.Context, subspace paramstypes.Subspace, legacyAmino *codec.LegacyAmino) error { + var v2NicknameParams v2.NicknameParams + err := legacyAmino.UnmarshalJSON(subspace.GetRaw(ctx, types.NicknameParamsKey), &v2NicknameParams) + if err != nil { + return err + } + + var v2DTagParams v2.DTagParams + err = legacyAmino.UnmarshalJSON(subspace.GetRaw(ctx, types.DTagParamsKey), &v2DTagParams) + if err != nil { + return err + } + + var v2OracleParams v2.OracleParams + err = legacyAmino.UnmarshalJSON(subspace.GetRaw(ctx, types.OracleParamsKey), &v2OracleParams) + if err != nil { + return err + } + + var v2BioParams v2.BioParams + err = legacyAmino.UnmarshalJSON(subspace.GetRaw(ctx, types.BioParamsKey), &v2BioParams) + if err != nil { + return err + } + + nicknameParams := types.NewNicknameParams(v2NicknameParams.MinLength, v2NicknameParams.MaxLength) + dtagParams := types.NewDTagParams(v2DTagParams.RegEx, v2DTagParams.MinLength, v2DTagParams.MaxLength) + bioParams := types.NewBioParams(v2BioParams.MaxLength) + oracleParams := types.NewOracleParams( + v2OracleParams.ScriptID, + v2OracleParams.AskCount, + v2OracleParams.MinCount, + v2OracleParams.PrepareGas, + v2OracleParams.ExecuteGas, + v2OracleParams.FeeAmount..., + ) + + subspace.Set(ctx, types.NicknameParamsKey, &nicknameParams) + subspace.Set(ctx, types.DTagParamsKey, &dtagParams) + subspace.Set(ctx, types.BioParamsKey, &bioParams) + subspace.Set(ctx, types.OracleParamsKey, &oracleParams) + + return nil +} diff --git a/x/profiles/legacy/v3/store_test.go b/x/profiles/legacy/v3/store_test.go index 804f23d871..eaf129bb85 100644 --- a/x/profiles/legacy/v3/store_test.go +++ b/x/profiles/legacy/v3/store_test.go @@ -1,7 +1,9 @@ package v300_test import ( + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "testing" + "time" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" @@ -14,19 +16,49 @@ import ( ) func TestMigrateStore(t *testing.T) { - cdc, _ := app.MakeCodecs() + cdc, legacyAminoCdc := app.MakeCodecs() storeKey := sdk.NewKVStoreKey(types.StoreKey) + transientKey := sdk.NewTransientStoreKey("profiles_transient") + testCases := []struct { name string store func(ctx sdk.Context) shouldErr bool - check func(ctx sdk.Context) + check func(ctx sdk.Context, paramsSpace paramstypes.Subspace) }{ { name: "valid data returns no error", store: func(ctx sdk.Context) { + // setup legacy params + params := v2.DefaultParams() + paramsSpace := paramstypes.NewSubspace(cdc, legacyAminoCdc, storeKey, transientKey, "profiles") + paramsSpace = paramsSpace.WithKeyTable(v2.ParamKeyTable()) + paramsSpace.SetParamSet(ctx, ¶ms) + store := ctx.KVStore(storeKey) + applicationLinkKey := types.UserApplicationLinkKey( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "twitter", + "user", + ) + + applicationLinkBz := v2.MustMarshalApplicationLink(cdc, v2.NewApplicationLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + v2.NewData("twitter", "user"), + v2.AppLinkStateVerificationStarted, + v2.NewOracleRequest( + 1, + 1, + v2.NewOracleRequestCallData("twitter", "tweet-123456789"), + "client_id", + ), + v2.NewSuccessResult("76616c7565", "signature"), // The value should be HEX + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + )) + + store.Set(applicationLinkKey, applicationLinkBz) + block := v2.UserBlock{ Blocker: "blocker", Blocked: "blocked", @@ -45,9 +77,34 @@ func TestMigrateStore(t *testing.T) { store.Set(append(types.RelationshipsStorePrefix, 0x01), relBz) }, shouldErr: false, - check: func(ctx sdk.Context) { + check: func(ctx sdk.Context, paramSpace paramstypes.Subspace) { store := ctx.KVStore(storeKey) + expectedApplicationLinkKey := types.UserApplicationLinkKey( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "twitter", + "user", + ) + + expectedAppLink := types.NewApplicationLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + types.NewData("twitter", "user"), + types.AppLinkStateVerificationStarted, + types.NewOracleRequest( + 1, + 1, + types.NewOracleRequestCallData("twitter", "tweet-123456789"), + "client_id", + ), + types.NewSuccessResult("76616c7565", "signature"), // The value should be HEX + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 7, 2, 00, 00, 00, 000, time.UTC), + ) + + var storedAppLink types.ApplicationLink + cdc.MustUnmarshal(store.Get(expectedApplicationLinkKey), &storedAppLink) + require.Equal(t, expectedAppLink, storedAppLink) + oldBlockKey := v2.UserBlockStoreKey("blocker", "", "blocked") require.False(t, store.Has(oldBlockKey)) @@ -69,6 +126,10 @@ func TestMigrateStore(t *testing.T) { var storedRelationship types.Relationship cdc.MustUnmarshal(store.Get(expectedRelationshipKey), &storedRelationship) require.Equal(t, expectedRelationship, storedRelationship) + + var storedParams types.Params + paramSpace.GetParamSet(ctx, &storedParams) + require.Equal(t, types.DefaultParams(), storedParams) }, }, } @@ -76,18 +137,23 @@ func TestMigrateStore(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - ctx := testutil.DefaultContext(storeKey, sdk.NewTransientStoreKey("test")) + ctx := testutil.DefaultContext(storeKey, transientKey) if tc.store != nil { tc.store(ctx) } - err := v3.MigrateStore(ctx, storeKey, cdc) + newParams := types.DefaultParams() + newParamSpace := paramstypes.NewSubspace(cdc, legacyAminoCdc, storeKey, transientKey, "profiles") + newParamSpace = newParamSpace.WithKeyTable(types.ParamKeyTable()) + newParamSpace.SetParamSet(ctx, &newParams) + + err := v3.MigrateStore(ctx, storeKey, newParamSpace, cdc, legacyAminoCdc) if tc.shouldErr { require.Error(t, err) } else { require.NoError(t, err) if tc.check != nil { - tc.check(ctx) + tc.check(ctx, newParamSpace) } } }) diff --git a/x/profiles/types/models_app_links.pb.go b/x/profiles/types/models_app_links.pb.go index 47c67c961b..127286eb39 100644 --- a/x/profiles/types/models_app_links.pb.go +++ b/x/profiles/types/models_app_links.pb.go @@ -83,6 +83,8 @@ type ApplicationLink struct { Result *Result `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty" yaml:"result"` // CreationTime represents the time in which the link was created CreationTime time.Time `protobuf:"bytes,6,opt,name=creation_time,json=creationTime,proto3,stdtime" json:"creation_time" yaml:"creation_time"` + // ExpirationTime represents the time in which the link will expire + ExpirationTime time.Time `protobuf:"bytes,7,opt,name=expiration_time,json=expirationTime,proto3,stdtime" json:"expiration_time" yaml:"expiration_time"` } func (m *ApplicationLink) Reset() { *m = ApplicationLink{} } @@ -451,67 +453,69 @@ func init() { } var fileDescriptor_e02d86ea3253bfd9 = []byte{ - // 960 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xbf, 0x6f, 0xdb, 0x46, - 0x18, 0x15, 0x25, 0x5a, 0xb1, 0xce, 0xb1, 0xad, 0x9e, 0xdd, 0x56, 0x20, 0x10, 0x91, 0xa6, 0x8b, - 0xc2, 0x49, 0x11, 0x12, 0x91, 0x97, 0xc2, 0x45, 0x0b, 0x88, 0x12, 0x8d, 0xb0,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 0x7d, - 0xc0, 0xa7, 0x81, 0xcd, 0x45, 0xf7, 0x57, 0x11, 0x94, 0xd9, 0x2a, 0xc3, 0xef, 0xc0, 0xad, 0x30, - 0xb6, 0x6d, 0x12, 0x86, 0xd4, 0xc3, 0x5a, 0x43, 0x5e, 0xbe, 0xf7, 0x4a, 0x8f, 0x21, 0x1f, 0x16, - 0x50, 0x4e, 0x82, 0xdf, 0x80, 0xf2, 0x19, 0x76, 0x3d, 0xe2, 0x64, 0xcf, 0xc6, 0xce, 0x3b, 0xe8, - 0x87, 0x14, 0xf8, 0xb0, 0x80, 0x32, 0x8a, 0xe0, 0x83, 0x5b, 0x99, 0x24, 0xfc, 0x12, 0xac, 0x9c, - 0x63, 0x2f, 0x26, 0xd9, 0x24, 0xe6, 0xde, 0x03, 0x7a, 0x2c, 0x23, 0x56, 0x86, 0x0d, 0x50, 0x09, - 0xdd, 0xfe, 0x10, 0x47, 0x71, 0x40, 0x6e, 0xde, 0x7e, 0x5a, 0x92, 0xd1, 0x0c, 0x36, 0xbb, 0xb8, - 0x70, 0x00, 0xca, 0xcc, 0x44, 0xda, 0x8f, 0x04, 0x81, 0x1f, 0xdc, 0xec, 0x47, 0x8f, 0x65, 0xc4, - 0xca, 0x33, 0xee, 0xec, 0x4b, 0x5b, 0x01, 0xa5, 0x30, 0x1e, 0xdc, 0xfb, 0xb3, 0x04, 0xb6, 0x17, - 0x3d, 0x66, 0xf0, 0x09, 0x50, 0x9a, 0xdd, 0xee, 0x91, 0xd1, 0x6a, 0x9a, 0x46, 0xe7, 0xd8, 0x3a, - 0x32, 0x8e, 0x1f, 0x59, 0x3d, 0xb3, 0x69, 0xea, 0x96, 0x71, 0x6c, 0x98, 0x46, 0xf3, 0xc8, 0x78, - 0xaa, 0xb7, 0xad, 0x93, 0xe3, 0x5e, 0x57, 0x6f, 0x19, 0x87, 0x86, 0xde, 0xae, 0x16, 0x84, 0xdd, - 0x8b, 0x4b, 0x49, 0x5c, 0xa4, 0x66, 0x0c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1, 0x25, 0x48, 0xd2, 0xf6, 0x07, 0x00, 0x00, + // 988 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x3d, 0x6f, 0xdb, 0x46, + 0x18, 0xd6, 0x07, 0xad, 0x58, 0xe7, 0xd8, 0x56, 0xcf, 0x6e, 0x2a, 0x10, 0x88, 0x48, 0xd3, 0x45, + 0xe1, 0xa4, 0x08, 0x89, 0xd8, 0x4b, 0xe1, 0xa2, 0x05, 0x44, 0x89, 0x46, 0xd8, 0xb8, 0xb6, 0x71, + 0xa2, 0x13, 0x20, 0x0b, 0x71, 0x26, 0xcf, 0xea, 0x21, 0x94, 0xc8, 0xf2, 0xc3, 0x48, 0x5a, 0x74, + 0x0f, 0x3c, 0xe5, 0x0f, 0x18, 0x08, 0xd0, 0x3f, 0xd1, 0xad, 0x43, 0x97, 0x8c, 0xe9, 0xd6, 0x89, + 0x2d, 0xe4, 0xa5, 0xb3, 0x7e, 0x41, 0xc1, 0x3b, 0xd2, 0x92, 0x63, 0x2b, 0x0e, 0xd0, 0x8d, 0xba, + 0xf7, 0xf9, 0x78, 0xef, 0x9e, 0xf7, 0x0e, 0x02, 0xf7, 0x5c, 0x12, 0x0d, 0xfc, 0x48, 0x0b, 0x42, + 0xff, 0x98, 0x7a, 0x24, 0xd2, 0x4e, 0xb6, 0xb4, 0x81, 0xef, 0x12, 0x2f, 0xb2, 0x71, 0x10, 0xd8, + 0x1e, 0x1d, 0x3e, 0x8f, 0xd4, 0x20, 0xf4, 0x63, 0x1f, 0x42, 0x0e, 0x55, 0x0b, 0xa8, 0x7a, 0xb2, + 0x25, 0xae, 0xf6, 0xfd, 0xbe, 0xcf, 0xca, 0x5a, 0xf6, 0xc5, 0x91, 0xa2, 0xd4, 0xf7, 0xfd, 0xbe, + 0x47, 0x34, 0xf6, 0xeb, 0x28, 0x39, 0xd6, 0x62, 0x3a, 0x20, 0x51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x96, 0x67, 0x49, 0x65, 0xef, 0xa7, 0xbb, 0x9f, 0xc4, 0xa2, 0xf0, 0xea, 0xd7, 0x56, + 0x49, 0x7f, 0xfc, 0x76, 0xd4, 0x2a, 0xbf, 0x1b, 0xb5, 0xca, 0xff, 0x8c, 0x5a, 0xe5, 0xd7, 0xe7, + 0xad, 0xd2, 0xbb, 0xf3, 0x56, 0xe9, 0xaf, 0xf3, 0x56, 0xe9, 0xd9, 0xc3, 0x3e, 0x8d, 0x7f, 0x48, + 0x8e, 0x54, 0xc7, 0x1f, 0x68, 0x7c, 0xa0, 0x1f, 0x78, 0xf8, 0x28, 0xca, 0xbf, 0xb5, 0x93, 0x4d, + 0xed, 0xc5, 0xe4, 0xff, 0x43, 0xfc, 0x32, 0x20, 0xd1, 0x51, 0x8d, 0x3d, 0xef, 0x5b, 0xff, 0x05, + 0x00, 0x00, 0xff, 0xff, 0x66, 0x54, 0x60, 0x5c, 0x5f, 0x08, 0x00, 0x00, } func (this *ApplicationLink) Equal(that interface{}) bool { @@ -551,6 +555,9 @@ func (this *ApplicationLink) Equal(that interface{}) bool { if !this.CreationTime.Equal(that1.CreationTime) { return false } + if !this.ExpirationTime.Equal(that1.ExpirationTime) { + return false + } return true } func (this *Data) Equal(that interface{}) bool { @@ -789,13 +796,21 @@ func (m *ApplicationLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime):]) if err1 != nil { return 0, err1 } i -= n1 i = encodeVarintModelsAppLinks(dAtA, i, uint64(n1)) i-- + dAtA[i] = 0x3a + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintModelsAppLinks(dAtA, i, uint64(n2)) + i-- dAtA[i] = 0x32 if m.Result != nil { { @@ -1143,6 +1158,8 @@ func (m *ApplicationLink) Size() (n int) { } l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime) n += 1 + l + sovModelsAppLinks(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime) + n += 1 + l + sovModelsAppLinks(uint64(l)) return n } @@ -1488,6 +1505,39 @@ func (m *ApplicationLink) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) diff --git a/x/profiles/types/models_params.pb.go b/x/profiles/types/models_params.pb.go index df3a9fd935..06a66455e2 100644 --- a/x/profiles/types/models_params.pb.go +++ b/x/profiles/types/models_params.pb.go @@ -9,15 +9,19 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -31,6 +35,7 @@ type Params struct { DTag DTagParams `protobuf:"bytes,2,opt,name=dtag,proto3" json:"dtag" yaml:"dtag"` Bio BioParams `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio" yaml:"bio"` Oracle OracleParams `protobuf:"bytes,4,opt,name=oracle,proto3" json:"oracle" yaml:"oracle"` + AppLinks AppLinksParams `protobuf:"bytes,5,opt,name=app_links,json=appLinks,proto3" json:"app_links" yaml:"app_links"` } func (m *Params) Reset() { *m = Params{} } @@ -239,12 +244,52 @@ func (m *OracleParams) XXX_DiscardUnknown() { var xxx_messageInfo_OracleParams proto.InternalMessageInfo +// AppLinksParams define the parameters related to the app links +type AppLinksParams struct { + // ExpirationTime indicates the max amount of time before a link expires + ExpirationTime time.Duration `protobuf:"bytes,1,opt,name=expiration_time,json=expirationTime,proto3,stdduration" json:"expiration_time" yaml:"expiration_time"` +} + +func (m *AppLinksParams) Reset() { *m = AppLinksParams{} } +func (m *AppLinksParams) String() string { return proto.CompactTextString(m) } +func (*AppLinksParams) ProtoMessage() {} +func (*AppLinksParams) Descriptor() ([]byte, []int) { + return fileDescriptor_924c89959f3aa975, []int{5} +} +func (m *AppLinksParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AppLinksParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AppLinksParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AppLinksParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_AppLinksParams.Merge(m, src) +} +func (m *AppLinksParams) XXX_Size() int { + return m.Size() +} +func (m *AppLinksParams) XXX_DiscardUnknown() { + xxx_messageInfo_AppLinksParams.DiscardUnknown(m) +} + +var xxx_messageInfo_AppLinksParams proto.InternalMessageInfo + func init() { proto.RegisterType((*Params)(nil), "desmos.profiles.v3.Params") proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.v3.NicknameParams") proto.RegisterType((*DTagParams)(nil), "desmos.profiles.v3.DTagParams") proto.RegisterType((*BioParams)(nil), "desmos.profiles.v3.BioParams") proto.RegisterType((*OracleParams)(nil), "desmos.profiles.v3.OracleParams") + proto.RegisterType((*AppLinksParams)(nil), "desmos.profiles.v3.AppLinksParams") } func init() { @@ -252,51 +297,58 @@ func init() { } var fileDescriptor_924c89959f3aa975 = []byte{ - // 697 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xd3, 0x4c, - 0x14, 0xc7, 0x93, 0xd8, 0x8d, 0xe2, 0x49, 0xbf, 0x0f, 0x6a, 0x15, 0x08, 0x45, 0xd8, 0xd1, 0x2c, - 0xaa, 0x6c, 0x6a, 0x2b, 0xed, 0x02, 0xa9, 0x12, 0x0b, 0x9c, 0x56, 0xa8, 0xe2, 0xd2, 0xca, 0x20, - 0x21, 0xb1, 0xb1, 0xc6, 0xce, 0xd4, 0xb5, 0x12, 0x7b, 0x2c, 0x8f, 0x13, 0xa5, 0x2b, 0xb6, 0x2c, - 0x79, 0x02, 0xc4, 0x1a, 0xf1, 0x20, 0x5d, 0xa1, 0x2e, 0x11, 0x0b, 0x83, 0xd2, 0x37, 0xc8, 0x13, - 0xa0, 0xb9, 0xe4, 0xd2, 0x12, 0x89, 0x02, 0x62, 0x95, 0xe3, 0x39, 0xe7, 0xff, 0x3b, 0x33, 0xe7, - 0x6f, 0x4f, 0xc0, 0x66, 0x17, 0xd3, 0x98, 0x50, 0x3b, 0xcd, 0xc8, 0x71, 0xd4, 0xc7, 0xd4, 0x1e, - 0xee, 0xd8, 0x31, 0xe9, 0xe2, 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6, 0xfa, 0xc8, 0xa7, 0x32, 0xb6, 0x87, 0xdb, - 0xf6, 0x68, 0xfe, 0x07, 0xc1, 0x7b, 0xf8, 0x55, 0x7e, 0x99, 0xef, 0xfc, 0x08, 0x00, 0x00, 0xff, - 0xff, 0x3a, 0x47, 0xc7, 0xf1, 0x40, 0x06, 0x00, 0x00, + // 801 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcd, 0x6e, 0xeb, 0x44, + 0x14, 0xc7, 0x93, 0x3a, 0x8d, 0xe2, 0xc9, 0xa5, 0x97, 0x6b, 0x5d, 0x2e, 0xb9, 0x17, 0x61, 0x47, + 0xb3, 0xa8, 0xb2, 0xa9, 0xad, 0xb4, 0x0b, 0xa4, 0x4a, 0x2c, 0xea, 0xb4, 0x42, 0x15, 0x85, 0x56, + 0xa6, 0x12, 0x82, 0x8d, 0x35, 0x76, 0x26, 0xee, 0x28, 0xb6, 0xc7, 0xf2, 0x38, 0x51, 0xba, 0x81, + 0x2d, 0x4b, 0x96, 0xac, 0x10, 0x5b, 0x10, 0x0f, 0xd2, 0x65, 0x97, 0x88, 0x85, 0x8b, 0xd2, 0x37, + 0xc8, 0x13, 0xa0, 0xf9, 0x70, 0x3e, 0x4a, 0x11, 0x05, 0x74, 0x57, 0x1e, 0xcf, 0x39, 0xff, 0xdf, + 0x39, 0x73, 0xce, 0x7c, 0x80, 0xdd, 0x21, 0x66, 0x09, 0x65, 0x4e, 0x96, 0xd3, 0x11, 0x89, 0x31, + 0x73, 0xa6, 0x07, 0x4e, 0x42, 0x87, 0x38, 0x66, 0x7e, 0x86, 0x72, 0x94, 0x30, 0x3b, 0xcb, 0x69, + 0x41, 0x0d, 0x43, 0xfa, 0xd9, 0x95, 0x9f, 0x3d, 0x3d, 0x78, 0xf3, 0x32, 0xa2, 0x11, 0x15, 0x66, + 0x87, 0x8f, 0xa4, 0xe7, 0x1b, 0x33, 0xa4, 0x82, 0x18, 0x20, 0x86, 0x9d, 0x69, 0x3f, 0xc0, 0x05, + 0xea, 0x3b, 0x21, 0x25, 0x69, 0x65, 0x8f, 0x28, 0x8d, 0x62, 0xec, 0x88, 0xbf, 0x60, 0x32, 0x72, + 0x86, 0x93, 0x1c, 0x15, 0x84, 0x2a, 0x3b, 0xfc, 0x59, 0x03, 0xcd, 0x0b, 0x11, 0xda, 0xf8, 0x12, + 0xb4, 0x52, 0x12, 0x8e, 0x53, 0x94, 0xe0, 0x4e, 0xbd, 0x5b, 0xef, 0xb5, 0xf7, 0xa1, 0xfd, 0xd7, + 0x3c, 0xec, 0xcf, 0x95, 0x8f, 0x54, 0xb9, 0xef, 0xdf, 0x94, 0x56, 0x6d, 0x51, 0x5a, 0xcf, 0xaf, + 0x51, 0x12, 0x1f, 0xc2, 0x8a, 0x00, 0xbd, 0x25, 0xcc, 0x38, 0x07, 0x8d, 0x61, 0x81, 0xa2, 0xce, + 0x96, 0x80, 0x9a, 0x8f, 0x41, 0x8f, 0x2f, 0x51, 0xa4, 0x80, 0x1f, 0x70, 0xe0, 0xbc, 0xb4, 0x1a, + 0x7c, 0x6e, 0x51, 0x5a, 0x6d, 0x09, 0xe6, 0x04, 0xe8, 0x09, 0x90, 0x31, 0x00, 0x5a, 0x40, 0x68, + 0x47, 0x13, 0xbc, 0x0f, 0x1f, 0xe3, 0xb9, 0x84, 0x2a, 0x9c, 0xa1, 0xf2, 0x03, 0x12, 0x13, 0x10, + 0x0a, 0x3d, 0xae, 0x36, 0xce, 0x41, 0x93, 0xe6, 0x28, 0x8c, 0x71, 0xa7, 0x21, 0x38, 0xdd, 0xc7, + 0x38, 0xe7, 0xc2, 0x43, 0xa1, 0xde, 0x53, 0xa8, 0x77, 0x24, 0x4a, 0xaa, 0xa1, 0xa7, 0x30, 0xc6, + 0x57, 0x40, 0x47, 0x59, 0xe6, 0xc7, 0x24, 0x1d, 0xb3, 0xce, 0xf6, 0xdf, 0x17, 0x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0xde, 0xfc, 0x7e, 0x41, 0x96, 0x37, + 0xfc, 0x6b, 0x5b, 0xbe, 0x0f, 0x76, 0xf5, 0x3e, 0xd8, 0xc7, 0xea, 0x7d, 0x70, 0xa1, 0xca, 0xee, + 0x55, 0xb5, 0xe8, 0x0d, 0x3d, 0xfc, 0xe1, 0xce, 0xaa, 0x7b, 0x3b, 0xab, 0xd9, 0x4b, 0x92, 0x60, + 0x19, 0xdf, 0xfd, 0xf4, 0x66, 0x6e, 0xd6, 0x6f, 0xe7, 0x66, 0xfd, 0x8f, 0xb9, 0x59, 0xff, 0xfe, + 0xde, 0xac, 0xdd, 0xde, 0x9b, 0xb5, 0xdf, 0xee, 0xcd, 0xda, 0xd7, 0xfd, 0xb5, 0x45, 0xc9, 0x9b, + 0x71, 0x2f, 0x46, 0x01, 0x53, 0x63, 0x67, 0xba, 0xef, 0xcc, 0x56, 0x6f, 0xa3, 0x58, 0x63, 0xd0, + 0x14, 0x99, 0x1d, 0xfc, 0x19, 0x00, 0x00, 0xff, 0xff, 0xb4, 0x2e, 0xbc, 0x3d, 0x3b, 0x07, 0x00, + 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -319,6 +371,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.AppLinks.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a { size, err := m.Oracle.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -550,6 +612,37 @@ func (m *OracleParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *AppLinksParams) 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 *AppLinksParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AppLinksParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintModelsParams(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintModelsParams(dAtA []byte, offset int, v uint64) int { offset -= sovModelsParams(v) base := offset @@ -575,6 +668,8 @@ func (m *Params) Size() (n int) { n += 1 + l + sovModelsParams(uint64(l)) l = m.Oracle.Size() n += 1 + l + sovModelsParams(uint64(l)) + l = m.AppLinks.Size() + n += 1 + l + sovModelsParams(uint64(l)) return n } @@ -649,6 +744,17 @@ func (m *OracleParams) Size() (n int) { return n } +func (m *AppLinksParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime) + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + func sovModelsParams(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -816,6 +922,39 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppLinks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AppLinks.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipModelsParams(dAtA[iNdEx:]) @@ -1363,6 +1502,89 @@ func (m *OracleParams) Unmarshal(dAtA []byte) error { } return nil } +func (m *AppLinksParams) 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 ErrIntOverflowModelsParams + } + 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: AppLinksParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AppLinksParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipModelsParams(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/subspaces/client/cli/cli_test.go b/x/subspaces/client/cli/cli_test.go index 3708a27eda..d318bbd9d5 100644 --- a/x/subspaces/client/cli/cli_test.go +++ b/x/subspaces/client/cli/cli_test.go @@ -359,6 +359,7 @@ func (s *IntegrationTestSuite) TestCmdQueryUserPermissions() { expResponse: types.QueryUserPermissionsResponse{ Permissions: types.PermissionManageGroups, Details: []types.PermissionDetail{ + types.NewPermissionDetailGroup(0, types.PermissionNothing), types.NewPermissionDetailGroup(1, types.PermissionManageGroups), }, }, From 13bd8e4419f382bec26db36240314352a605d2d4 Mon Sep 17 00:00:00 2001 From: bragaz Date: Tue, 22 Feb 2022 16:45:04 +0000 Subject: [PATCH 086/112] Updated Swagger definition --- client/docs/swagger-ui/swagger.yaml | 70 +++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 1b24679a28..698974c679 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -121,6 +121,12 @@ paths: title: >- CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: >- + ExpirationTime represents the time in which the link will + expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -449,6 +455,12 @@ paths: title: >- CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: >- + ExpirationTime represents the time in which the link + will expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -856,6 +868,12 @@ paths: title: >- CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: >- + ExpirationTime represents the time in which the link will + expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -3231,6 +3249,17 @@ paths: OracleParams defines the parameters related to the oracle that will be used to verify the ownership of a centralized application account by a Desmos profile + app_links: + type: object + properties: + expiration_time: + type: string + title: >- + ExpirationTime indicates the max amount of time before + a link expires + title: >- + AppLinksParams define the parameters related to the app + links title: Params contains the parameters for the profiles module description: >- QueryParamsResponse is the response type for the Query/Params RPC @@ -5245,6 +5274,13 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + desmos.profiles.v3.AppLinksParams: + type: object + properties: + expiration_time: + type: string + title: ExpirationTime indicates the max amount of time before a link expires + title: AppLinksParams define the parameters related to the app links desmos.profiles.v3.ApplicationLink: type: object properties: @@ -5338,6 +5374,10 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: ExpirationTime represents the time in which the link will expire title: ApplicationLink contains the data of a link to a centralized application desmos.profiles.v3.ApplicationLinkState: type: string @@ -6175,6 +6215,15 @@ definitions: OracleParams defines the parameters related to the oracle that will be used to verify the ownership of a centralized application account by a Desmos profile + app_links: + type: object + properties: + expiration_time: + type: string + title: >- + ExpirationTime indicates the max amount of time before a link + expires + title: AppLinksParams define the parameters related to the app links title: Params contains the parameters for the profiles module desmos.profiles.v3.Proof: type: object @@ -6613,6 +6662,10 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: ExpirationTime represents the time in which the link will expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -6725,6 +6778,10 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: ExpirationTime represents the time in which the link will expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -7588,6 +7645,15 @@ definitions: OracleParams defines the parameters related to the oracle that will be used to verify the ownership of a centralized application account by a Desmos profile + app_links: + type: object + properties: + expiration_time: + type: string + title: >- + ExpirationTime indicates the max amount of time before a link + expires + title: AppLinksParams define the parameters related to the app links title: Params contains the parameters for the profiles module description: QueryParamsResponse is the response type for the Query/Params RPC method. desmos.profiles.v3.QueryProfileResponse: @@ -7901,6 +7967,10 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: ExpirationTime represents the time in which the link will expire title: >- ApplicationLink contains the data of a link to a centralized application From eaa927990b0c5b14fb3826e4a0534f159ed26f73 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Wed, 23 Mar 2022 14:58:24 +0000 Subject: [PATCH 087/112] merged master --- .../profiles/legacy/v200/models_params.proto | 2 +- proto/desmos/profiles/v2/models_params.proto | 2 +- x/profiles/client/cli/cli_app_links_test.go | 4 +- x/profiles/client/cli/cli_test.go | 2 +- x/profiles/keeper/grpc_query_test.go | 18 +- x/profiles/keeper/keeper_app_links.go | 21 +- .../keeper_app_links_benchmarks_test.go | 9 +- x/profiles/keeper/keeper_app_links_test.go | 6 +- x/profiles/legacy/v4/store_test.go | 6 +- x/profiles/simulation/decoder_test.go | 1 + x/profiles/simulation/utils.go | 22 -- x/profiles/types/events.go | 44 +-- x/profiles/types/keys.go | 2 + x/profiles/types/models_app_links.pb.go | 175 ++++++---- x/profiles/types/models_params.pb.go | 312 +++++++++++++++--- 15 files changed, 447 insertions(+), 179 deletions(-) diff --git a/proto/desmos/profiles/legacy/v200/models_params.proto b/proto/desmos/profiles/legacy/v200/models_params.proto index c98a54696f..614f0e9070 100644 --- a/proto/desmos/profiles/legacy/v200/models_params.proto +++ b/proto/desmos/profiles/legacy/v200/models_params.proto @@ -22,7 +22,7 @@ message Params { ]; BioParams bio = 3 - [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"bio\"" ]; + [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"bio\"" ]; OracleParams oracle = 4 [ (gogoproto.nullable) = false, diff --git a/proto/desmos/profiles/v2/models_params.proto b/proto/desmos/profiles/v2/models_params.proto index ec2c655774..83abdbea6e 100644 --- a/proto/desmos/profiles/v2/models_params.proto +++ b/proto/desmos/profiles/v2/models_params.proto @@ -128,7 +128,7 @@ message AppLinksParams { // ExpirationTime indicates the max amount of time before a link expires google.protobuf.Duration expiration_time = 1 [ - (gogoproto.nullable) = false, + (gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"expiration_time\"" ]; diff --git a/x/profiles/client/cli/cli_app_links_test.go b/x/profiles/client/cli/cli_app_links_test.go index 8229d2bc26..9ea03eaa7a 100644 --- a/x/profiles/client/cli/cli_app_links_test.go +++ b/x/profiles/client/cli/cli_app_links_test.go @@ -42,7 +42,7 @@ func (s *IntegrationTestSuite) TestCmdQueryApplicationsLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(9999, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, @@ -79,7 +79,7 @@ func (s *IntegrationTestSuite) TestCmdQueryApplicationsLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(9999, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, diff --git a/x/profiles/client/cli/cli_test.go b/x/profiles/client/cli/cli_test.go index 7c051d6e54..826cfa59a1 100644 --- a/x/profiles/client/cli/cli_test.go +++ b/x/profiles/client/cli/cli_test.go @@ -129,7 +129,7 @@ func (s *IntegrationTestSuite) SetupSuite() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(9999, 1, 1, 00, 00, 00, 000, time.UTC), ), } diff --git a/x/profiles/keeper/grpc_query_test.go b/x/profiles/keeper/grpc_query_test.go index 99f7acf675..e38a8ce87a 100644 --- a/x/profiles/keeper/grpc_query_test.go +++ b/x/profiles/keeper/grpc_query_test.go @@ -555,6 +555,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -574,6 +575,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), )) }, @@ -600,6 +602,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, @@ -626,6 +629,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -645,6 +649,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), )) }, @@ -671,6 +676,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, @@ -697,7 +703,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -717,7 +723,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), )) }, @@ -742,6 +748,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), types.NewApplicationLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", @@ -758,7 +765,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, @@ -785,7 +792,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -805,6 +812,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), )) }, @@ -831,7 +839,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, diff --git a/x/profiles/keeper/keeper_app_links.go b/x/profiles/keeper/keeper_app_links.go index 7f1f3ca845..5c5dc9a55d 100644 --- a/x/profiles/keeper/keeper_app_links.go +++ b/x/profiles/keeper/keeper_app_links.go @@ -100,9 +100,19 @@ func (k Keeper) DeleteApplicationLink(ctx sdk.Context, appLink types.Application store := ctx.KVStore(k.storeKey) store.Delete(types.UserApplicationLinkKey(appLink.User, appLink.Data.Application, appLink.Data.Username)) store.Delete(types.ApplicationLinkClientIDKey(appLink.OracleRequest.ClientID)) - store.Delete(types.ApplicationLinkExpiringTimeKey(link.ExpirationTime, link.OracleRequest.ClientID)) + store.Delete(types.ApplicationLinkExpiringTimeKey(appLink.ExpirationTime, appLink.OracleRequest.ClientID)) k.AfterApplicationLinkDeleted(ctx, appLink) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeApplicationLinkDeleted, + sdk.NewAttribute(types.AttributeKeyUser, appLink.User), + sdk.NewAttribute(types.AttributeKeyApplicationName, appLink.Data.Application), + sdk.NewAttribute(types.AttributeKeyApplicationUsername, appLink.Data.Username), + sdk.NewAttribute(types.AttributeKeyApplicationLinkExpirationTime, appLink.ExpirationTime.String()), + ), + ) } // DeleteAllUserApplicationLinks delete all the applications links associated with the given user @@ -121,15 +131,6 @@ func (k Keeper) DeleteAllUserApplicationLinks(ctx sdk.Context, user string) { // DeleteExpiredApplicationLinks deletes all the expired application links in the given context func (k Keeper) DeleteExpiredApplicationLinks(ctx sdk.Context) { k.IterateExpiringApplicationLinks(ctx, func(_ int64, link types.ApplicationLink) (stop bool) { - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeApplicationLinkDeleted, - sdk.NewAttribute(types.AttributeKeyUser, link.User), - sdk.NewAttribute(types.AttributeKeyApplicationName, link.Data.Application), - sdk.NewAttribute(types.AttributeKeyApplicationUsername, link.Data.Username), - sdk.NewAttribute(types.AttributeKeyApplicationLinkExpirationTime, link.ExpirationTime.String()), - ), - ) k.DeleteApplicationLink(ctx, link) return false }) diff --git a/x/profiles/keeper/keeper_app_links_benchmarks_test.go b/x/profiles/keeper/keeper_app_links_benchmarks_test.go index db29e0d824..3d82459ecf 100644 --- a/x/profiles/keeper/keeper_app_links_benchmarks_test.go +++ b/x/profiles/keeper/keeper_app_links_benchmarks_test.go @@ -13,14 +13,15 @@ import ( capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/desmos-labs/desmos/v2/app" - "github.com/desmos-labs/desmos/v2/testutil" - "github.com/desmos-labs/desmos/v2/x/profiles/keeper" - "github.com/desmos-labs/desmos/v2/x/profiles/types" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/libs/log" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" db "github.com/tendermint/tm-db" + + "github.com/desmos-labs/desmos/v3/app" + "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/x/profiles/keeper" + "github.com/desmos-labs/desmos/v3/x/profiles/types" ) func setupBenchTest() (authkeeper.AccountKeeper, keeper.Keeper, sdk.Context) { diff --git a/x/profiles/keeper/keeper_app_links_test.go b/x/profiles/keeper/keeper_app_links_test.go index 01225ee9c2..0389f022fe 100644 --- a/x/profiles/keeper/keeper_app_links_test.go +++ b/x/profiles/keeper/keeper_app_links_test.go @@ -361,6 +361,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), check: func(ctx sdk.Context) { suite.Require().True(suite.k.HasApplicationLink(ctx, @@ -405,6 +406,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), check: func(ctx sdk.Context) { suite.Require().True(suite.k.HasApplicationLink(ctx, @@ -449,6 +451,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), check: func(ctx sdk.Context) { suite.Require().True(suite.k.HasApplicationLink(ctx, @@ -493,6 +496,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), check: func(ctx sdk.Context) { suite.Require().False(suite.k.HasApplicationLink(ctx, @@ -545,7 +549,7 @@ func (suite *KeeperTestSuite) Test_DeleteExpiredApplicationLinks() { time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) - suite.Require().NoError(suite.k.StoreProfile(ctx, testutil.ProfileFromAddr(address))) + suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(address))) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) }, diff --git a/x/profiles/legacy/v4/store_test.go b/x/profiles/legacy/v4/store_test.go index 37469ba57b..57b6be4b72 100644 --- a/x/profiles/legacy/v4/store_test.go +++ b/x/profiles/legacy/v4/store_test.go @@ -193,8 +193,9 @@ func TestMigrateStore(t *testing.T) { profilestypes.NewOracleRequestCallData("twitter", "calldata"), "client_id", ), - Result: nil, - CreationTime: time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + Result: nil, + CreationTime: time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + ExpirationTime: time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), }), ) @@ -225,6 +226,7 @@ func TestMigrateStore(t *testing.T) { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), stored) // Check the application link client id diff --git a/x/profiles/simulation/decoder_test.go b/x/profiles/simulation/decoder_test.go index 8d869d71e6..e698b08436 100644 --- a/x/profiles/simulation/decoder_test.go +++ b/x/profiles/simulation/decoder_test.go @@ -43,6 +43,7 @@ func TestDecodeStore(t *testing.T) { types.OracleRequest{}, nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ) kvPairs := kv.Pairs{Pairs: []kv.Pair{ diff --git a/x/profiles/simulation/utils.go b/x/profiles/simulation/utils.go index 110757f693..e82f9cfe51 100644 --- a/x/profiles/simulation/utils.go +++ b/x/profiles/simulation/utils.go @@ -178,25 +178,3 @@ func RandomAppLinksParams(r *rand.Rand) types.AppLinksParams { randomDuration := time.Duration(simtypes.RandIntBetween(r, 60*60*24*14, 60*60*24*7*4*6)) * time.Second return types.NewAppLinksParams(randomDuration) } - -// RandomRelationship picks and returns a random relationships from an array -func RandomRelationship(r *rand.Rand, relationships []types.Relationship) types.Relationship { - idx := r.Intn(len(relationships)) - return relationships[idx] -} - -// RandomSubspace returns a random post subspace from the above random subspaces -func RandomSubspace(_ *rand.Rand) string { - return "" -} - -// RandomUserBlock picks and returns a random user block from an array -func RandomUserBlock(r *rand.Rand, userBlocks []types.UserBlock) types.UserBlock { - idx := r.Intn(len(userBlocks)) - return userBlocks[idx] -} - -// RandomDTagTransferRequests returns a new random DTag transfer request from the ones given -func RandomDTagTransferRequests(r *rand.Rand, requests []types.DTagTransferRequest) types.DTagTransferRequest { - return requests[r.Intn(len(requests))-1] -} diff --git a/x/profiles/types/events.go b/x/profiles/types/events.go index 82e3b2ed1c..1bb9adf45c 100644 --- a/x/profiles/types/events.go +++ b/x/profiles/types/events.go @@ -18,30 +18,30 @@ const ( EventTypesApplicationLinkSaved = "application_link_saved" EventTypeApplicationLinkDeleted = "application_link_deleted" - AttributeKeyProfileDTag = "profile_dtag" - AttributeKeyProfileCreator = "profile_creator" - AttributeKeyProfileCreationTime = "profile_creation_time" - AttributeKeyRequestReceiver = "request_receiver" - AttributeKeyRequestSender = "request_sender" - AttributeKeyDTagToTrade = "dtag_to_trade" - AttributeKeyNewDTag = "new_dtag" - AttributeKeyChainLinkSourceAddress = "chain_link_account_target" - AttributeKeyChainLinkDestinationAddress = "chain_link_account_owner" - AttributeKeyChainLinkSourceChainName = "chain_link_source_chain_name" - AttributeKeyChainLinkCreationTime = "chain_link_creation_time" + AttributeKeyProfileDTag = "profile_dtag" + AttributeKeyProfileCreator = "profile_creator" + AttributeKeyProfileCreationTime = "profile_creation_time" + AttributeKeyRequestReceiver = "request_receiver" + AttributeKeyRequestSender = "request_sender" + AttributeKeyDTagToTrade = "dtag_to_trade" + AttributeKeyNewDTag = "new_dtag" + AttributeKeyChainLinkSourceAddress = "chain_link_account_target" + AttributeKeyChainLinkDestinationAddress = "chain_link_account_owner" + AttributeKeyChainLinkSourceChainName = "chain_link_source_chain_name" + AttributeKeyChainLinkCreationTime = "chain_link_creation_time" AttributeKeyApplicationLinkExpirationTime = "application_link_expiration_time" - AttributeKeyAckSuccess = "success" - AttributeKeyUser = "user" - AttributeKeyApplicationName = "application_name" - AttributeKeyApplicationUsername = "application_username" - AttributeKeyApplicationLinkCreationTime = "application_link_creation_time" - AttributeKeyOracleID = "oracle_id" - AttributeKeyClientID = "client_id" - AttributeKeyRequestID = "request_id" + AttributeKeyAckSuccess = "success" + AttributeKeyUser = "user" + AttributeKeyApplicationName = "application_name" + AttributeKeyApplicationUsername = "application_username" + AttributeKeyApplicationLinkCreationTime = "application_link_creation_time" + AttributeKeyOracleID = "oracle_id" + AttributeKeyClientID = "client_id" + AttributeKeyRequestID = "request_id" AttributeKeyRequestKey = "request_key" - AttributeKeyResolveStatus = "resolve_status" - AttributeKeyAck = "acknowledgement" - AttributeKeyAckError = "error" + AttributeKeyResolveStatus = "resolve_status" + AttributeKeyAck = "acknowledgement" + AttributeKeyAckError = "error" AttributeValueCategory = ModuleName ) diff --git a/x/profiles/types/keys.go b/x/profiles/types/keys.go index f33b144553..ffc744e719 100644 --- a/x/profiles/types/keys.go +++ b/x/profiles/types/keys.go @@ -3,6 +3,8 @@ package types import ( "strings" "time" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // DONTCOVER diff --git a/x/profiles/types/models_app_links.pb.go b/x/profiles/types/models_app_links.pb.go index ee15d849a3..dd68190e17 100644 --- a/x/profiles/types/models_app_links.pb.go +++ b/x/profiles/types/models_app_links.pb.go @@ -83,6 +83,8 @@ type ApplicationLink struct { Result *Result `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty" yaml:"result"` // CreationTime represents the time in which the link was created CreationTime time.Time `protobuf:"bytes,6,opt,name=creation_time,json=creationTime,proto3,stdtime" json:"creation_time" yaml:"creation_time"` + // ExpirationTime represents the time in which the link will expire + ExpirationTime time.Time `protobuf:"bytes,7,opt,name=expiration_time,json=expirationTime,proto3,stdtime" json:"expiration_time" yaml:"expiration_time"` } func (m *ApplicationLink) Reset() { *m = ApplicationLink{} } @@ -451,68 +453,69 @@ func init() { } var fileDescriptor_c4a613de86d4edc0 = []byte{ - // 961 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6e, 0xdb, 0x46, - 0x17, 0x15, 0x25, 0x5a, 0x91, 0xc6, 0xb1, 0xad, 0x6f, 0xec, 0xaf, 0x15, 0x08, 0x44, 0xa4, 0xe9, - 0xa2, 0x70, 0x52, 0x84, 0x44, 0x94, 0x4d, 0xe1, 0xa2, 0x05, 0x44, 0x89, 0x46, 0xd8, 0xb8, 0x96, - 0x30, 0xa2, 0x13, 0x20, 0x1b, 0x62, 0x4c, 0x8e, 0x55, 0x22, 0x94, 0xa8, 0xf2, 0xc7, 0x68, 0x5a, - 0x74, 0x1f, 0x78, 0x95, 0x17, 0x30, 0x10, 0xa0, 0x2f, 0xd1, 0x5d, 0x17, 0xdd, 0x64, 0x99, 0x65, - 0x57, 0x6c, 0x21, 0x6f, 0xb2, 0xd6, 0x13, 0x14, 0x9c, 0x21, 0x25, 0xb9, 0x96, 0x92, 0x00, 0xdd, - 0x51, 0x73, 0xcf, 0x39, 0xf7, 0xcc, 0x3d, 0x17, 0x23, 0x70, 0xd7, 0x21, 0xe1, 0xd0, 0x0f, 0xd5, - 0x71, 0xe0, 0x9f, 0xb9, 0x1e, 0x09, 0xd5, 0xf3, 0xa6, 0x3a, 0xf4, 0x1d, 0xe2, 0x85, 0x16, 0x1e, - 0x8f, 0x2d, 0xcf, 0x1d, 0x3d, 0x0f, 0x95, 0x71, 0xe0, 0x47, 0x3e, 0x84, 0x0c, 0xaa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, 0x4a, 0xd2, 0x2a, 0xa9, 0xf4, 0xfd, 0x74, 0xba, 0x71, 0x24, - 0xf0, 0x2f, 0x7f, 0x6d, 0x14, 0xb4, 0xc7, 0x6f, 0x26, 0x0d, 0xee, 0xed, 0xa4, 0xc1, 0xfd, 0x3d, - 0x69, 0x70, 0xaf, 0xae, 0x1a, 0x85, 0xb7, 0x57, 0x8d, 0xc2, 0x9f, 0x57, 0x8d, 0xc2, 0xb3, 0x07, - 0x03, 0x37, 0xfa, 0x3e, 0x3e, 0x55, 0x6c, 0x7f, 0xa8, 0xb2, 0x85, 0xbe, 0xef, 0xe1, 0xd3, 0x30, - 0xfb, 0x56, 0xcf, 0x1f, 0xaa, 0x3f, 0xce, 0xff, 0xd6, 0xa3, 0x17, 0x63, 0x12, 0x9e, 0x96, 0xe9, - 0xd3, 0xfe, 0xf0, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xe3, 0x75, 0x91, 0xf6, 0x07, 0x00, - 0x00, + // 988 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x3d, 0x6f, 0xdb, 0x46, + 0x18, 0xd6, 0x07, 0x2d, 0x5b, 0xe7, 0xd8, 0x56, 0xcf, 0x6e, 0x2a, 0x10, 0x88, 0x48, 0xd3, 0x45, + 0xe1, 0xa4, 0x08, 0x89, 0x28, 0x4b, 0xe1, 0xa2, 0x05, 0x44, 0x89, 0x46, 0xd8, 0xb8, 0xb6, 0x71, + 0xa2, 0x13, 0x20, 0x0b, 0x71, 0x26, 0xcf, 0xea, 0x21, 0x94, 0xc8, 0xf2, 0xc3, 0x48, 0x5a, 0x74, + 0x0f, 0x3c, 0xe5, 0x0f, 0x18, 0x08, 0xd0, 0x3f, 0xd1, 0xad, 0x43, 0x97, 0x8c, 0xe9, 0xd6, 0x89, + 0x2d, 0xe4, 0xa5, 0xb3, 0x7e, 0x41, 0xc1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, 0xaf, 0x37, 0x26, + 0xa9, 0x74, 0x8b, 0xeb, 0x31, 0x01, 0x05, 0x71, 0x21, 0x38, 0x00, 0xcb, 0x7e, 0x88, 0x1d, 0x8f, + 0xd8, 0x21, 0xf9, 0x31, 0x21, 0x51, 0xdc, 0x14, 0x58, 0x7b, 0xeb, 0x57, 0x49, 0xef, 0x31, 0x24, + 0xe2, 0x40, 0xfd, 0x4e, 0xde, 0xe7, 0xa7, 0x5c, 0xf7, 0xa2, 0x8c, 0x82, 0x96, 0xfc, 0x59, 0x34, + 0x34, 0x40, 0x2d, 0x24, 0x51, 0xe2, 0xc5, 0xcd, 0x39, 0x66, 0x20, 0x5e, 0x65, 0x80, 0x18, 0x42, + 0xff, 0x64, 0x92, 0x4a, 0x4b, 0x5c, 0x95, 0x73, 0x14, 0x94, 0x93, 0x21, 0x06, 0x4b, 0x4e, 0x48, + 0xd8, 0xee, 0xec, 0x2c, 0x99, 0x66, 0x2d, 0x57, 0xe3, 0xb1, 0xa9, 0x45, 0x6c, 0xaa, 0x55, 0xc4, + 0xa6, 0xcb, 0x79, 0x9f, 0x6b, 0x5c, 0xf1, 0x02, 0x5d, 0x79, 0xfd, 0xb7, 0x54, 0x46, 0xb7, 0x8a, + 0xb5, 0x8c, 0x04, 0x07, 0x60, 0x85, 0xbc, 0x08, 0x68, 0x38, 0x63, 0x32, 0x7f, 0xa3, 0x89, 0x92, + 0x9b, 0xdc, 0xe6, 0x26, 0xef, 0x09, 0x70, 0x9b, 0xe5, 0xe9, 0x6a, 0x46, 0xdc, 0x5a, 0x78, 0xf5, + 0x46, 0x2a, 0xfd, 0xfb, 0x46, 0x2a, 0x2b, 0x3f, 0x03, 0x21, 0x8b, 0x1e, 0x7e, 0x05, 0x16, 0xf1, + 0x34, 0xbe, 0x7c, 0x9c, 0x6e, 0x4f, 0x52, 0x09, 0x72, 0xd9, 0x99, 0xa2, 0x82, 0x66, 0xa1, 0x50, + 0x03, 0x0b, 0xd9, 0x90, 0x8d, 0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03, + 0x99, 0xdb, 0xc5, 0x7a, 0xdf, 0xea, 0x20, 0xcb, 0xe8, 0x35, 0xca, 0xe7, 0xaa, 0xe7, 0x6a, 0x4f, + 0x48, 0x48, 0x8f, 0x72, 0x8b, 0x7e, 0x8c, 0xc3, 0x98, 0xb8, 0x70, 0x1f, 0xdc, 0xfd, 0x18, 0x55, + 0x03, 0xa1, 0x3d, 0xd4, 0xa8, 0x88, 0xeb, 0x27, 0xa7, 0xf2, 0x9d, 0xeb, 0x34, 0x8d, 0xec, 0xd0, + 0x3e, 0xba, 0xcf, 0x83, 0x6e, 0xd7, 0xe8, 0xf7, 0x1b, 0xd5, 0x1b, 0xfa, 0xcc, 0x47, 0xe4, 0x3b, + 0x20, 0x5f, 0xa3, 0x6a, 0x99, 0xdf, 0x1b, 0x3d, 0x7b, 0xef, 0xc0, 0x6a, 0x08, 0xe2, 0xe7, 0x27, + 0xa7, 0xb2, 0x7c, 0x9d, 0x54, 0xf6, 0x7e, 0xba, 0x7b, 0x49, 0x2c, 0x0a, 0xaf, 0x7e, 0x6d, 0x95, + 0xf4, 0xc7, 0x6f, 0xc7, 0xad, 0xf2, 0xbb, 0x71, 0xab, 0xfc, 0xcf, 0xb8, 0x55, 0x7e, 0x7d, 0xd6, + 0x2a, 0xbd, 0x3b, 0x6b, 0x95, 0xfe, 0x3a, 0x6b, 0x95, 0x9e, 0x3d, 0x18, 0xd0, 0xf8, 0x87, 0xe4, + 0x50, 0x75, 0xfc, 0xa1, 0xc6, 0x07, 0xfa, 0xbe, 0x87, 0x0f, 0xa3, 0xfc, 0x5b, 0x3b, 0x7e, 0xa8, + 0xbd, 0x98, 0xfe, 0x7f, 0x88, 0x5f, 0x06, 0x24, 0x3a, 0xac, 0xb1, 0xe7, 0xfd, 0xe1, 0x7f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x51, 0x95, 0xd0, 0x72, 0x5f, 0x08, 0x00, 0x00, } func (this *ApplicationLink) Equal(that interface{}) bool { @@ -552,6 +555,9 @@ func (this *ApplicationLink) Equal(that interface{}) bool { if !this.CreationTime.Equal(that1.CreationTime) { return false } + if !this.ExpirationTime.Equal(that1.ExpirationTime) { + return false + } return true } func (this *Data) Equal(that interface{}) bool { @@ -790,13 +796,21 @@ func (m *ApplicationLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime):]) if err1 != nil { return 0, err1 } i -= n1 i = encodeVarintModelsAppLinks(dAtA, i, uint64(n1)) i-- + dAtA[i] = 0x3a + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintModelsAppLinks(dAtA, i, uint64(n2)) + i-- dAtA[i] = 0x32 if m.Result != nil { { @@ -1144,6 +1158,8 @@ func (m *ApplicationLink) Size() (n int) { } l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime) n += 1 + l + sovModelsAppLinks(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime) + n += 1 + l + sovModelsAppLinks(uint64(l)) return n } @@ -1489,6 +1505,39 @@ func (m *ApplicationLink) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) diff --git a/x/profiles/types/models_params.pb.go b/x/profiles/types/models_params.pb.go index 032ce17dd9..334a728481 100644 --- a/x/profiles/types/models_params.pb.go +++ b/x/profiles/types/models_params.pb.go @@ -9,15 +9,19 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -31,6 +35,7 @@ type Params struct { DTag DTagParams `protobuf:"bytes,2,opt,name=dtag,proto3" json:"dtag" yaml:"dtag"` Bio BioParams `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio" yaml:"bio"` Oracle OracleParams `protobuf:"bytes,4,opt,name=oracle,proto3" json:"oracle" yaml:"oracle"` + AppLinks AppLinksParams `protobuf:"bytes,5,opt,name=app_links,json=appLinks,proto3" json:"app_links" yaml:"app_links"` } func (m *Params) Reset() { *m = Params{} } @@ -239,12 +244,52 @@ func (m *OracleParams) XXX_DiscardUnknown() { var xxx_messageInfo_OracleParams proto.InternalMessageInfo +// AppLinksParams define the parameters related to the app links +type AppLinksParams struct { + // ExpirationTime indicates the max amount of time before a link expires + ExpirationTime time.Duration `protobuf:"bytes,1,opt,name=expiration_time,json=expirationTime,proto3,stdduration" json:"expiration_time" yaml:"expiration_time"` +} + +func (m *AppLinksParams) Reset() { *m = AppLinksParams{} } +func (m *AppLinksParams) String() string { return proto.CompactTextString(m) } +func (*AppLinksParams) ProtoMessage() {} +func (*AppLinksParams) Descriptor() ([]byte, []int) { + return fileDescriptor_1b093f5fee9c9f7d, []int{5} +} +func (m *AppLinksParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AppLinksParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AppLinksParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AppLinksParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_AppLinksParams.Merge(m, src) +} +func (m *AppLinksParams) XXX_Size() int { + return m.Size() +} +func (m *AppLinksParams) XXX_DiscardUnknown() { + xxx_messageInfo_AppLinksParams.DiscardUnknown(m) +} + +var xxx_messageInfo_AppLinksParams proto.InternalMessageInfo + func init() { proto.RegisterType((*Params)(nil), "desmos.profiles.v2.Params") proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.v2.NicknameParams") proto.RegisterType((*DTagParams)(nil), "desmos.profiles.v2.DTagParams") proto.RegisterType((*BioParams)(nil), "desmos.profiles.v2.BioParams") proto.RegisterType((*OracleParams)(nil), "desmos.profiles.v2.OracleParams") + proto.RegisterType((*AppLinksParams)(nil), "desmos.profiles.v2.AppLinksParams") } func init() { @@ -252,51 +297,58 @@ func init() { } var fileDescriptor_1b093f5fee9c9f7d = []byte{ - // 697 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xd3, 0x4c, - 0x14, 0xc7, 0x93, 0xd8, 0x8d, 0xe2, 0x49, 0xbf, 0x0f, 0x6a, 0x15, 0x08, 0x45, 0xd8, 0xd1,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, 0x89, 0x09, 0xdf, 0x00, 0x70, 0x84, 0xb1, 0x87, 0x62, 0xbe, 0xcb, 0x6a, 0x53, - 0x69, 0xd5, 0x3b, 0x77, 0x2d, 0x31, 0x78, 0x8b, 0x5d, 0x93, 0x96, 0xbc, 0x26, 0xad, 0x2e, 0x89, - 0x12, 0x67, 0x4f, 0x7e, 0xf4, 0xd2, 0x82, 0x85, 0x14, 0x7e, 0xfc, 0x66, 0xb6, 0xae, 0xe1, 0x20, - 0xa3, 0x50, 0x57, 0x3b, 0xc2, 0xf8, 0x11, 0xd7, 0x09, 0xbb, 0x9c, 0x27, 0xa7, 0x13, 0xa3, 0x7c, - 0x36, 0x31, 0xca, 0xdf, 0x27, 0x46, 0xf9, 0xdd, 0xb9, 0x51, 0x3a, 0x3b, 0x37, 0x4a, 0x5f, 0xce, - 0x8d, 0xd2, 0xeb, 0xf6, 0x12, 0x54, 0x5c, 0x49, 0x5b, 0x03, 0xe4, 0x53, 0x19, 0xdb, 0xa3, 0x6d, - 0x7b, 0xbc, 0xf8, 0x83, 0xe0, 0x3d, 0xfc, 0x2a, 0xbf, 0xcc, 0xb7, 0x7f, 0x04, 0x00, 0x00, 0xff, - 0xff, 0xdd, 0xfd, 0x66, 0x6f, 0x40, 0x06, 0x00, 0x00, + // 802 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0xc7, 0x93, 0x3a, 0x8d, 0xe2, 0xc9, 0xd2, 0x65, 0xad, 0x65, 0xc9, 0x2e, 0xc2, 0x8e, 0xe6, + 0xb0, 0xca, 0x65, 0x6d, 0x25, 0x3d, 0x20, 0x55, 0xe2, 0x50, 0xa7, 0x15, 0xaa, 0x28, 0xb4, 0x32, + 0x95, 0x10, 0x5c, 0xac, 0xb1, 0x33, 0x71, 0x47, 0xb1, 0x3d, 0x96, 0xc7, 0x89, 0x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, 0x1e, 0x5d, 0xa0, 0x48, 0x01, 0x3f, 0xe0, 0xc0, 0x45, 0x69, 0x35, + 0xf8, 0xdc, 0xb2, 0xb4, 0xda, 0x12, 0xcc, 0x09, 0xd0, 0x13, 0x20, 0x63, 0x08, 0xb4, 0x80, 0xd0, + 0x8e, 0x26, 0x78, 0x1f, 0x3e, 0xc4, 0x73, 0x09, 0x55, 0x38, 0x43, 0xe5, 0x07, 0x24, 0x26, 0x20, + 0x14, 0x7a, 0x5c, 0x6d, 0x9c, 0x81, 0x26, 0xcd, 0x51, 0x18, 0xe3, 0x4e, 0x43, 0x70, 0xba, 0x0f, + 0x71, 0xce, 0x84, 0x87, 0x42, 0xbd, 0xa7, 0x50, 0xef, 0x48, 0x94, 0x54, 0x43, 0x4f, 0x61, 0x8c, + 0xaf, 0x80, 0x8e, 0xb2, 0xcc, 0x8f, 0x49, 0x3a, 0x61, 0x9d, 0xdd, 0xbf, 0x2f, 0xe0, 0x61, 0x96, + 0x9d, 0x72, 0x1f, 0x45, 0xed, 0x28, 0xea, 0xbb, 0x92, 0xba, 0x42, 0x40, 0xaf, 0x85, 0x94, 0xe7, + 0x41, 0xe3, 0xbb, 0x9f, 0xac, 0x1a, 0x2c, 0xeb, 0x60, 0x6f, 0xbb, 0xfa, 0x46, 0x00, 0x40, 0x42, + 0x52, 0x3f, 0xc6, 0x69, 0x54, 0x5c, 0x8a, 0xae, 0x3d, 0x71, 0x87, 0x1c, 0xf8, 0x7b, 0x69, 0xbd, + 0x8e, 0x48, 0x71, 0x39, 0x0d, 0xec, 0x90, 0x26, 0x8e, 0xda, 0x25, 0xf2, 0xf3, 0x86, 0x8d, 0x26, + 0x4e, 0x71, 0x95, 0x61, 0x66, 0x9f, 0xa4, 0xc5, 0xb2, 0xb4, 0x9e, 0xc9, 0xd0, 0x6b, 0x12, 0xf4, + 0xf4, 0x84, 0xa4, 0xa7, 0x62, 0x2c, 0x62, 0xa0, 0x79, 0x15, 0x63, 0xe7, 0x7f, 0x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x00, 0xff, 0xff, 0x9a, 0xa3, 0xc1, 0x2d, 0x3b, 0x07, + 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -319,6 +371,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.AppLinks.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a { size, err := m.Oracle.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -550,6 +612,37 @@ func (m *OracleParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *AppLinksParams) 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 *AppLinksParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AppLinksParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintModelsParams(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintModelsParams(dAtA []byte, offset int, v uint64) int { offset -= sovModelsParams(v) base := offset @@ -575,6 +668,8 @@ func (m *Params) Size() (n int) { n += 1 + l + sovModelsParams(uint64(l)) l = m.Oracle.Size() n += 1 + l + sovModelsParams(uint64(l)) + l = m.AppLinks.Size() + n += 1 + l + sovModelsParams(uint64(l)) return n } @@ -649,6 +744,17 @@ func (m *OracleParams) Size() (n int) { return n } +func (m *AppLinksParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime) + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + func sovModelsParams(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -816,6 +922,39 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppLinks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AppLinks.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipModelsParams(dAtA[iNdEx:]) @@ -1363,6 +1502,89 @@ func (m *OracleParams) Unmarshal(dAtA []byte) error { } return nil } +func (m *AppLinksParams) 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 ErrIntOverflowModelsParams + } + 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: AppLinksParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AppLinksParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipModelsParams(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From d4d395311c1d2cc438b04d734e84ffd3d9c66655 Mon Sep 17 00:00:00 2001 From: bragaz Date: Tue, 12 Apr 2022 15:13:44 +0200 Subject: [PATCH 088/112] fixed broken tests merged with master solved conflicts --- x/profiles/keeper/grpc_query_test.go | 8 ++++++++ x/profiles/keeper/keeper_app_links_benchmarks_test.go | 1 + x/profiles/types/keys.go | 8 ++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/x/profiles/keeper/grpc_query_test.go b/x/profiles/keeper/grpc_query_test.go index d5382b4b20..77a9c63da5 100644 --- a/x/profiles/keeper/grpc_query_test.go +++ b/x/profiles/keeper/grpc_query_test.go @@ -1082,6 +1082,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) @@ -1105,6 +1106,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) }, @@ -1146,6 +1148,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) @@ -1169,6 +1172,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) @@ -1192,6 +1196,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) }, @@ -1233,6 +1238,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) @@ -1256,6 +1262,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) @@ -1279,6 +1286,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) }, diff --git a/x/profiles/keeper/keeper_app_links_benchmarks_test.go b/x/profiles/keeper/keeper_app_links_benchmarks_test.go index 3d82459ecf..2d906aa376 100644 --- a/x/profiles/keeper/keeper_app_links_benchmarks_test.go +++ b/x/profiles/keeper/keeper_app_links_benchmarks_test.go @@ -66,6 +66,7 @@ func setupBenchTest() (authkeeper.AccountKeeper, keeper.Keeper, sdk.Context) { k := keeper.NewKeeper( cdc, + legacyAminoCdc, storeKey, paramsKeeper.Subspace(types.DefaultParamsSpace), ak, diff --git a/x/profiles/types/keys.go b/x/profiles/types/keys.go index 098c9e36f6..969bd43b56 100644 --- a/x/profiles/types/keys.go +++ b/x/profiles/types/keys.go @@ -47,9 +47,9 @@ var ( ApplicationLinkPrefix = []byte{0x13} ApplicationLinkClientIDPrefix = []byte{0x14} - ChainLinkChainPrefix = []byte{0x15} - ApplicationLinkAppPrefix = []byte{0x16} - ExpiringAppLinkTimePrefix = []byte{0x17} + ChainLinkChainPrefix = []byte{0x15} + ApplicationLinkAppPrefix = []byte{0x16} + ExpiringAppLinkTimePrefix = []byte{0x17} ) // DTagStoreKey turns a DTag into the key used to store the address associated with it into the store @@ -164,4 +164,4 @@ func ApplicationLinkExpiringTimePrefix(expirationTime time.Time) []byte { // of the application link associated with the given clientID func ApplicationLinkExpiringTimeKey(expirationTime time.Time, clientID string) []byte { return append(ApplicationLinkExpiringTimePrefix(expirationTime), []byte(clientID)...) -} \ No newline at end of file +} From c17af26f6d011c0cd0f3d0963dc36cc404c89e82 Mon Sep 17 00:00:00 2001 From: bragaz Date: Tue, 12 Apr 2022 13:14:51 +0000 Subject: [PATCH 089/112] Updated Swagger definition --- client/docs/swagger-ui/swagger.yaml | 60 +++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 6d97753a80..6c0701299a 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -125,6 +125,12 @@ paths: title: >- CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: >- + ExpirationTime represents the time in which the link + will expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -555,6 +561,12 @@ paths: title: >- CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: >- + ExpirationTime represents the time in which the link will + expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -2781,6 +2793,17 @@ paths: OracleParams defines the parameters related to the oracle that will be used to verify the ownership of a centralized application account by a Desmos profile + app_links: + type: object + properties: + expiration_time: + type: string + title: >- + ExpirationTime indicates the max amount of time before + a link expires + title: >- + AppLinksParams define the parameters related to the app + links title: Params contains the parameters for the profiles module description: >- QueryParamsResponse is the response type for the Query/Params RPC @@ -4823,6 +4846,13 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + desmos.profiles.v2.AppLinksParams: + type: object + properties: + expiration_time: + type: string + title: ExpirationTime indicates the max amount of time before a link expires + title: AppLinksParams define the parameters related to the app links desmos.profiles.v2.ApplicationLink: type: object properties: @@ -4916,6 +4946,10 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: ExpirationTime represents the time in which the link will expire title: ApplicationLink contains the data of a link to a centralized application desmos.profiles.v2.ApplicationLinkState: type: string @@ -5753,6 +5787,15 @@ definitions: OracleParams defines the parameters related to the oracle that will be used to verify the ownership of a centralized application account by a Desmos profile + app_links: + type: object + properties: + expiration_time: + type: string + title: >- + ExpirationTime indicates the max amount of time before a link + expires + title: AppLinksParams define the parameters related to the app links title: Params contains the parameters for the profiles module desmos.profiles.v2.Proof: type: object @@ -6191,6 +6234,10 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: ExpirationTime represents the time in which the link will expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -6366,6 +6413,10 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: ExpirationTime represents the time in which the link will expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -7226,6 +7277,15 @@ definitions: OracleParams defines the parameters related to the oracle that will be used to verify the ownership of a centralized application account by a Desmos profile + app_links: + type: object + properties: + expiration_time: + type: string + title: >- + ExpirationTime indicates the max amount of time before a link + expires + title: AppLinksParams define the parameters related to the app links title: Params contains the parameters for the profiles module description: QueryParamsResponse is the response type for the Query/Params RPC method. desmos.profiles.v2.QueryProfileResponse: From d0bbd8ec9e0e7da37ce8b3f858c4ee9548a4f16d Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 8 Jul 2022 07:57:01 +0200 Subject: [PATCH 090/112] revert: add benchmark tests Signed-off-by: Riccardo Montagnin --- .github/workflows/bench.yml | 42 ------------------------------------- Makefile | 6 +----- 2 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 .github/workflows/bench.yml diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml deleted file mode 100644 index 91621df137..0000000000 --- a/.github/workflows/bench.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Benchmarks -on: - pull_request: - push: - branches: - - master -env: - GO111MODULE: "on" -jobs: - Benchmarks: - runs-on: ubuntu-latest - steps: - - name: Setup Go 🧰 - uses: actions/setup-go@v2.1.5 - with: - go-version: 1.15 - - - name: Checkout 🛎️ - uses: actions/checkout@v2 - - - name: Go cache 💾 - uses: actions/cache@v2 - with: - path: ~/go/pkg - key: ${{ runner.os }}-go-pkg-${{ hashFiles('**/go.mod') }} - - - name: Restore benchstat 🪛 - uses: actions/cache@v2.1.7 - with: - path: ~/go/bin/benchstat - key: ${{ runner.os }}-benchstat - - - name: Restore base benchmark result 📝 - uses: actions/cache@v2 - with: - path: | - bench-master.txt - # Using base sha for PR or new commit hash for master/main push in benchmark result key. - key: ${{ runner.os }}-bench-${{ (github.event.pull_request.base.sha != github.event.after) && github.event.pull_request.base.sha || github.event.after }} - - - name: Benchmark 🧮 - run: REF_NAME=${GITHUB_REF##*/} make benchmark \ No newline at end of file diff --git a/Makefile b/Makefile index ddbdb16610..07f989a0da 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,6 @@ MOCKS_DIR = $(CURDIR)/tests/mocks HTTPS_GIT := https://github.com/desmos-labs/desmos.git DOCKER := $(shell which docker) DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf -BENCH_COUNT ?= 5 -REF_NAME ?= $(shell git symbolic-ref HEAD --short | tr / - 2>/dev/null) export GO111MODULE = on @@ -276,9 +274,7 @@ test-cover: .PHONY: test-cover benchmark: - @go test -mod=readonly -bench=. -count=$(BENCH_COUNT) -run=^a ./... >bench-$(REF_NAME).txt - @test -s $(GOPATH)/bin/benchstat || GO111MODULE=off GOFLAGS= GOBIN=$(GOPATH)/bin go get -u golang.org/x/perf/cmd/benchstat - @test -e bench-master.txt && benchstat bench-master.txt bench-$(REF_NAME).txt || benchstat bench-$(REF_NAME).txt + @go test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION) .PHONY: benchmark ############################################################################### From e52239177721369fce0b2638b675e10a51570ca8 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 8 Jul 2022 07:57:27 +0200 Subject: [PATCH 091/112] revert: change denom name Signed-off-by: Riccardo Montagnin --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 07f989a0da..90150435f9 100644 --- a/Makefile +++ b/Makefile @@ -425,8 +425,8 @@ setup-localnet: build-linux if ! [ -f build/node0/desmos/config/genesis.json ]; then $(BUILDDIR)/desmos testnet \ -o ./build --starting-ip-address 192.168.10.2 --keyring-backend=test \ --v=$(if $(NODES),$(NODES),4) \ - --gentx-coin-denom=$(if $(COIN_DENOM),$(COIN_DENOM),"udaric") \ - --minimum-gas-prices="0.000006$(if $(COIN_DENOM),$(COIN_DENOM),"udaric")"; fi + --gentx-coin-denom=$(if $(COIN_DENOM),$(COIN_DENOM),"stake") \ + --minimum-gas-prices="0.000006$(if $(COIN_DENOM),$(COIN_DENOM),"stake")"; fi # Starts a local 4-nodes testnet that should be used to test on-chain upgrades. # It requires 3 arguments to work: From f8e13ce5c0a4605e41fb119cbf9fe22f6b5b9be2 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 8 Jul 2022 07:58:16 +0200 Subject: [PATCH 092/112] revert: cosmovisor Dockerfile changes Signed-off-by: Riccardo Montagnin --- contrib/images/desmos-cosmovisor/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/images/desmos-cosmovisor/Dockerfile b/contrib/images/desmos-cosmovisor/Dockerfile index 18a4716c1f..231d7032b0 100644 --- a/contrib/images/desmos-cosmovisor/Dockerfile +++ b/contrib/images/desmos-cosmovisor/Dockerfile @@ -18,9 +18,9 @@ FROM desmoslabs/desmos:$DESMOS_VERSION # Copy over binaries from the build-env COPY --from=build-env /go/src/github.com/cosmos/cosmos-sdk/cosmovisor/cosmovisor /usr/bin/cosmovisor -#ARG UID=1000 -#ARG GID=1000 -#USER ${UID}:${GID} +ARG UID=1000 +ARG GID=1000 +USER ${UID}:${GID} COPY wrapper.sh /usr/bin/wrapper.sh ENTRYPOINT ["bash", "/usr/bin/wrapper.sh"] From bb4ba3e28ffb5d76afea770f6d22367b1e7ab3b8 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 8 Jul 2022 07:59:17 +0200 Subject: [PATCH 093/112] removed useless logs from within the submit_upgrade_proposal script Signed-off-by: Riccardo Montagnin --- contrib/upgrade_testnet/submit_upgrade_proposal.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/contrib/upgrade_testnet/submit_upgrade_proposal.sh b/contrib/upgrade_testnet/submit_upgrade_proposal.sh index 519e362cbe..bc99dc842f 100755 --- a/contrib/upgrade_testnet/submit_upgrade_proposal.sh +++ b/contrib/upgrade_testnet/submit_upgrade_proposal.sh @@ -25,8 +25,6 @@ while [ ${CNT} -lt $ITER ]; do sleep $SLEEP done -docker logs desmosnode0 - curr_block=$(curl -s $NODE/status | jq -r '.result.sync_info.latest_block_height') if [ -z ${curr_block} ] ; then echo "===> Failed to start the chain" From 84bfaac85df189db2c15eb0b50fb824297f27103 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 8 Jul 2022 08:09:30 +0200 Subject: [PATCH 094/112] updated Proto files Signed-off-by: Riccardo Montagnin --- client/docs/config.json | 2 +- client/docs/swagger-ui/swagger.yaml | 96 +- .../desmos/profiles/v2/models_app_links.proto | 2 +- proto/desmos/profiles/v2/models_params.proto | 2 +- proto/desmos/profiles/v2/models_profile.proto | 3 +- .../profiles/{v2 => v3}/client/cli.proto | 8 +- .../desmos/profiles/{v2 => v3}/genesis.proto | 34 +- .../v200 => v3}/models_app_links.proto | 4 +- .../{v2 => v3}/models_chain_links.proto | 2 +- .../{v2 => v3}/models_dtag_requests.proto | 4 +- .../profiles/{v2 => v3}/models_packets.proto | 10 +- .../{legacy/v200 => v3}/models_params.proto | 22 +- proto/desmos/profiles/v3/models_profile.proto | 59 + .../profiles/{v2 => v3}/msg_server.proto | 14 +- .../profiles/{v2 => v3}/msgs_app_links.proto | 4 +- .../{v2 => v3}/msgs_chain_links.proto | 8 +- .../{v2 => v3}/msgs_dtag_requests.proto | 6 +- .../profiles/{v2 => v3}/msgs_profile.proto | 6 +- proto/desmos/profiles/{v2 => v3}/query.proto | 28 +- .../profiles/{v2 => v3}/query_app_links.proto | 4 +- .../{v2 => v3}/query_chain_links.proto | 4 +- .../{v2 => v3}/query_dtag_requests.proto | 6 +- .../profiles/{v2 => v3}/query_params.proto | 6 +- .../profiles/{v2 => v3}/query_profile.proto | 2 +- x/posts/legacy/v2/models.pb.go | 2 +- x/profiles/client/utils/cli.pb.go | 34 +- x/profiles/legacy/v5/models_app_links.pb.go | 2342 +++++++++++++++++ x/profiles/legacy/v5/models_params.pb.go | 1671 ++++++++++++ x/profiles/legacy/v5/models_profile.pb.go | 826 ++++++ x/profiles/types/codec.go | 4 +- x/profiles/types/genesis.pb.go | 166 +- x/profiles/types/models_app_links.pb.go | 160 +- x/profiles/types/models_chain_links.pb.go | 106 +- x/profiles/types/models_dtag_requests.pb.go | 54 +- x/profiles/types/models_packets.pb.go | 48 +- x/profiles/types/models_params.pb.go | 338 ++- x/profiles/types/models_profile.pb.go | 79 +- x/profiles/types/msg_server.pb.go | 98 +- x/profiles/types/msgs_app_links.pb.go | 68 +- x/profiles/types/msgs_chain_links.pb.go | 62 +- x/profiles/types/msgs_dtag_requests.pb.go | 88 +- x/profiles/types/msgs_profile.pb.go | 74 +- x/profiles/types/query.pb.go | 92 +- x/profiles/types/query.pb.gw.go | 18 +- x/profiles/types/query_app_links.pb.go | 100 +- x/profiles/types/query_chain_links.pb.go | 82 +- x/profiles/types/query_dtag_requests.pb.go | 64 +- x/profiles/types/query_params.pb.go | 28 +- x/profiles/types/query_profile.pb.go | 56 +- 49 files changed, 6054 insertions(+), 942 deletions(-) rename proto/desmos/profiles/{v2 => v3}/client/cli.proto (84%) rename proto/desmos/profiles/{v2 => v3}/genesis.proto (60%) rename proto/desmos/profiles/{legacy/v200 => v3}/models_app_links.proto (97%) rename proto/desmos/profiles/{v2 => v3}/models_chain_links.proto (99%) rename proto/desmos/profiles/{v2 => v3}/models_dtag_requests.proto (92%) rename proto/desmos/profiles/{v2 => v3}/models_packets.proto (87%) rename proto/desmos/profiles/{legacy/v200 => v3}/models_params.proto (84%) create mode 100644 proto/desmos/profiles/v3/models_profile.proto rename proto/desmos/profiles/{v2 => v3}/msg_server.proto (86%) rename proto/desmos/profiles/{v2 => v3}/msgs_app_links.proto (97%) rename proto/desmos/profiles/{v2 => v3}/msgs_chain_links.proto (91%) rename proto/desmos/profiles/{v2 => v3}/msgs_dtag_requests.proto (96%) rename proto/desmos/profiles/{v2 => v3}/msgs_profile.proto (91%) rename proto/desmos/profiles/{v2 => v3}/query.proto (74%) rename proto/desmos/profiles/{v2 => v3}/query_app_links.proto (97%) rename proto/desmos/profiles/{v2 => v3}/query_chain_links.proto (96%) rename proto/desmos/profiles/{v2 => v3}/query_dtag_requests.proto (89%) rename proto/desmos/profiles/{v2 => v3}/query_params.proto (78%) rename proto/desmos/profiles/{v2 => v3}/query_profile.proto (96%) create mode 100644 x/profiles/legacy/v5/models_app_links.pb.go create mode 100644 x/profiles/legacy/v5/models_params.pb.go create mode 100644 x/profiles/legacy/v5/models_profile.pb.go diff --git a/client/docs/config.json b/client/docs/config.json index bbd19672e5..de4b6ca98b 100644 --- a/client/docs/config.json +++ b/client/docs/config.json @@ -7,7 +7,7 @@ }, "apis": [ { - "url": "./tmp-swagger-gen/desmos/profiles/v2/query.swagger.json", + "url": "./tmp-swagger-gen/desmos/profiles/v3/query.swagger.json", "operationIds": { "rename": { "Params": "ProfilesParams" diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 0afdf4e7bf..20dc34cf6d 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -4,7 +4,7 @@ info: description: A REST interface for state queries version: 3.0.0 paths: - /desmos/profiles/v2/app-links: + /desmos/profiles/v3/app-links: get: summary: >- ApplicationLinks queries the applications links associated to the given @@ -125,12 +125,6 @@ paths: title: >- CreationTime represents the time in which the link was created - expiration_time: - type: string - format: date-time - title: >- - ExpirationTime represents the time in which the link - will expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -444,7 +438,7 @@ paths: format: boolean tags: - Query - '/desmos/profiles/v2/app-links/clients/{client_id}': + '/desmos/profiles/v3/app-links/clients/{client_id}': get: summary: |- ApplicationLinkByClientID queries a single application link for a given @@ -561,12 +555,6 @@ paths: title: >- CreationTime represents the time in which the link was created - expiration_time: - type: string - format: date-time - title: >- - ExpirationTime represents the time in which the link will - expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -774,7 +762,7 @@ paths: type: string tags: - Query - /desmos/profiles/v2/app-links/owners: + /desmos/profiles/v3/app-links/owners: get: summary: |- ApplicationLinkOwners queries for the owners of applications links, @@ -1102,7 +1090,7 @@ paths: format: boolean tags: - Query - /desmos/profiles/v2/chain-links: + /desmos/profiles/v3/chain-links: get: summary: |- ChainLinks queries the chain links associated to the given user, if @@ -2011,7 +1999,7 @@ paths: format: boolean tags: - Query - /desmos/profiles/v2/chain-links/owners: + /desmos/profiles/v3/chain-links/owners: get: summary: >- ChainLinkOwners queries for the owners of chain links, optionally @@ -2341,7 +2329,7 @@ paths: format: boolean tags: - Query - /desmos/profiles/v2/dtag-transfer-requests: + /desmos/profiles/v3/dtag-transfer-requests: get: summary: >- IncomingDTagTransferRequests queries all the DTag transfers requests @@ -2679,7 +2667,7 @@ paths: format: boolean tags: - Query - /desmos/profiles/v2/params: + /desmos/profiles/v3/params: get: summary: Params queries the profiles module params operationId: ProfilesParams @@ -2999,7 +2987,7 @@ paths: } tags: - Query - '/desmos/profiles/v2/profiles/{user}': + '/desmos/profiles/v3/profiles/{user}': get: summary: >- Profile queries the profile of a specific user given their DTag or @@ -11568,14 +11556,14 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. - desmos.profiles.v2.AppLinksParams: + desmos.profiles.v3.AppLinksParams: type: object properties: expiration_time: type: string title: ExpirationTime indicates the max amount of time before a link expires title: AppLinksParams define the parameters related to the app links - desmos.profiles.v2.ApplicationLink: + desmos.profiles.v3.ApplicationLink: type: object properties: user: @@ -11668,12 +11656,8 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created - expiration_time: - type: string - format: date-time - title: ExpirationTime represents the time in which the link will expire title: ApplicationLink contains the data of a link to a centralized application - desmos.profiles.v2.ApplicationLinkState: + desmos.profiles.v3.ApplicationLinkState: type: string enum: - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED @@ -11692,20 +11676,20 @@ definitions: title: |- ApplicationLinkState defines if an application link is in the following states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT - desmos.profiles.v2.BioParams: + desmos.profiles.v3.BioParams: type: object properties: max_length: type: string format: byte title: BioParams defines the parameters related to profile biography - desmos.profiles.v2.ChainConfig: + desmos.profiles.v3.ChainConfig: type: object properties: name: type: string description: ChainConfig contains the data of the chain with which the link is made. - desmos.profiles.v2.ChainLink: + desmos.profiles.v3.ChainLink: type: object properties: user: @@ -12240,7 +12224,7 @@ definitions: title: |- ChainLink contains the data representing either an inter- or cross- chain link - desmos.profiles.v2.DTagParams: + desmos.profiles.v3.DTagParams: type: object properties: reg_ex: @@ -12252,7 +12236,7 @@ definitions: type: string format: byte title: DTagParams defines the parameters related to profile DTags - desmos.profiles.v2.DTagTransferRequest: + desmos.profiles.v3.DTagTransferRequest: type: object properties: dtag_to_trade: @@ -12273,7 +12257,7 @@ definitions: give to the sender their DTag title: DTagTransferRequest represent a DTag transfer request between two users - desmos.profiles.v2.Data: + desmos.profiles.v3.Data: type: object properties: application: @@ -12285,7 +12269,7 @@ definitions: title: |- Data contains the data associated to a specific user of a generic centralized application - desmos.profiles.v2.NicknameParams: + desmos.profiles.v3.NicknameParams: type: object properties: min_length: @@ -12295,7 +12279,7 @@ definitions: type: string format: byte title: NicknameParams defines the parameters related to the profiles nicknames - desmos.profiles.v2.OracleParams: + desmos.profiles.v3.OracleParams: type: object properties: script_id: @@ -12359,7 +12343,7 @@ definitions: OracleParams defines the parameters related to the oracle that will be used to verify the ownership of a centralized application account by a Desmos profile - desmos.profiles.v2.OracleRequest: + desmos.profiles.v3.OracleRequest: type: object properties: id: @@ -12392,7 +12376,7 @@ definitions: title: |- OracleRequest represents a generic oracle request used to verify the ownership of a centralized application account - desmos.profiles.v2.OracleRequest.CallData: + desmos.profiles.v3.OracleRequest.CallData: type: object properties: application: @@ -12408,7 +12392,7 @@ definitions: title: |- CallData contains the data sent to a single oracle request in order to verify the ownership of a centralized application by a Desmos profile - desmos.profiles.v2.Params: + desmos.profiles.v3.Params: type: object properties: nickname: @@ -12519,7 +12503,7 @@ definitions: expires title: AppLinksParams define the parameters related to the app links title: Params contains the parameters for the profiles module - desmos.profiles.v2.Proof: + desmos.profiles.v3.Proof: type: object properties: pub_key: @@ -12856,7 +12840,7 @@ definitions: title: |- Proof contains all the data used to verify a signature when linking an account to a profile - desmos.profiles.v2.QueryApplicationLinkByClientIDResponse: + desmos.profiles.v3.QueryApplicationLinkByClientIDResponse: type: object properties: link: @@ -12956,17 +12940,13 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created - expiration_time: - type: string - format: date-time - title: ExpirationTime represents the time in which the link will expire title: >- ApplicationLink contains the data of a link to a centralized application title: |- QueryApplicationLinkByClientIDResponse contains the data returned by the request allowing to get an application link using a client id - desmos.profiles.v2.QueryApplicationLinkOwnersResponse: + desmos.profiles.v3.QueryApplicationLinkOwnersResponse: type: object properties: owners: @@ -13017,7 +12997,7 @@ definitions: request allowing to get application link owners. - desmos.profiles.v2.QueryApplicationLinkOwnersResponse.ApplicationLinkOwnerDetails: + desmos.profiles.v3.QueryApplicationLinkOwnersResponse.ApplicationLinkOwnerDetails: type: object properties: user: @@ -13029,7 +13009,7 @@ definitions: title: |- ApplicationLinkOwnerDetails contains the details of a single application link owner - desmos.profiles.v2.QueryApplicationLinksResponse: + desmos.profiles.v3.QueryApplicationLinksResponse: type: object properties: links: @@ -13135,10 +13115,6 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created - expiration_time: - type: string - format: date-time - title: ExpirationTime represents the time in which the link will expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -13171,7 +13147,7 @@ definitions: title: |- QueryApplicationLinksResponse represents the response to the query used to get the application links for a specific user - desmos.profiles.v2.QueryChainLinkOwnersResponse: + desmos.profiles.v3.QueryChainLinkOwnersResponse: type: object properties: owners: @@ -13218,7 +13194,7 @@ definitions: description: |- QueryChainLinkOwnersResponse contains the data returned by the request allowing to get chain link owners. - desmos.profiles.v2.QueryChainLinkOwnersResponse.ChainLinkOwnerDetails: + desmos.profiles.v3.QueryChainLinkOwnersResponse.ChainLinkOwnerDetails: type: object properties: user: @@ -13228,7 +13204,7 @@ definitions: target: type: string title: ChainLinkOwnerDetails contains the details of a single chain link owner - desmos.profiles.v2.QueryChainLinksResponse: + desmos.profiles.v3.QueryChainLinksResponse: type: object properties: links: @@ -13831,7 +13807,7 @@ definitions: description: |- QueryChainLinksResponse is the response type for the Query/ChainLinks RPC method. - desmos.profiles.v2.QueryIncomingDTagTransferRequestsResponse: + desmos.profiles.v3.QueryIncomingDTagTransferRequestsResponse: type: object properties: requests: @@ -13895,7 +13871,7 @@ definitions: description: |- QueryIncomingDTagTransferRequestsResponse is the response type for the Query/IncomingDTagTransferRequests RPC method. - desmos.profiles.v2.QueryParamsResponse: + desmos.profiles.v3.QueryParamsResponse: type: object properties: params: @@ -14010,7 +13986,7 @@ definitions: title: AppLinksParams define the parameters related to the app links title: Params contains the parameters for the profiles module description: QueryParamsResponse is the response type for the Query/Params RPC method. - desmos.profiles.v2.QueryProfileResponse: + desmos.profiles.v3.QueryProfileResponse: type: object properties: profile: @@ -14175,7 +14151,7 @@ definitions: description: >- QueryProfileResponse is the response type for the Query/Profile RPC method. - desmos.profiles.v2.Result: + desmos.profiles.v3.Result: type: object properties: success: @@ -14196,7 +14172,7 @@ definitions: type: string title: Error that is associated with the failure title: Result represents a verification result - desmos.profiles.v2.Result.Failed: + desmos.profiles.v3.Result.Failed: type: object properties: error: @@ -14205,7 +14181,7 @@ definitions: title: |- Failed is the result of an application link that has not been verified successfully - desmos.profiles.v2.Result.Success: + desmos.profiles.v3.Result.Success: type: object properties: value: diff --git a/proto/desmos/profiles/v2/models_app_links.proto b/proto/desmos/profiles/v2/models_app_links.proto index bfb00ed074..4648a0eacb 100644 --- a/proto/desmos/profiles/v2/models_app_links.proto +++ b/proto/desmos/profiles/v2/models_app_links.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package desmos.profiles.v2; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/desmos/profiles/v2/models_params.proto b/proto/desmos/profiles/v2/models_params.proto index 0d381e992b..f3390b72c9 100644 --- a/proto/desmos/profiles/v2/models_params.proto +++ b/proto/desmos/profiles/v2/models_params.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "google/protobuf/duration.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5"; // Params contains the parameters for the profiles module message Params { diff --git a/proto/desmos/profiles/v2/models_profile.proto b/proto/desmos/profiles/v2/models_profile.proto index 812e4c0179..8814045e33 100644 --- a/proto/desmos/profiles/v2/models_profile.proto +++ b/proto/desmos/profiles/v2/models_profile.proto @@ -5,9 +5,8 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5"; // -------------------------------------------------------------------------------------------------------------------- diff --git a/proto/desmos/profiles/v2/client/cli.proto b/proto/desmos/profiles/v3/client/cli.proto similarity index 84% rename from proto/desmos/profiles/v2/client/cli.proto rename to proto/desmos/profiles/v3/client/cli.proto index 8a68178971..4934552c74 100644 --- a/proto/desmos/profiles/v2/client/cli.proto +++ b/proto/desmos/profiles/v3/client/cli.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package desmos.profiles.v2.client; +package desmos.profiles.v3.client; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; +import "desmos/profiles/v3/models_chain_links.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/client/utils"; @@ -23,11 +23,11 @@ message ChainLinkJSON { ]; // Proof contains the ownership proof of the external chain address - desmos.profiles.v2.Proof proof = 2 + desmos.profiles.v3.Proof proof = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"proof\"" ]; // ChainConfig contains the configuration of the external chain - desmos.profiles.v2.ChainConfig chain_config = 3 [ + desmos.profiles.v3.ChainConfig chain_config = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"chain_config\"" ]; diff --git a/proto/desmos/profiles/v2/genesis.proto b/proto/desmos/profiles/v3/genesis.proto similarity index 60% rename from proto/desmos/profiles/v2/genesis.proto rename to proto/desmos/profiles/v3/genesis.proto index 7c1b49e393..829eb728f2 100644 --- a/proto/desmos/profiles/v2/genesis.proto +++ b/proto/desmos/profiles/v3/genesis.proto @@ -1,12 +1,12 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; -import "desmos/profiles/v2/models_params.proto"; -import "desmos/profiles/v2/models_profile.proto"; -import "desmos/profiles/v2/models_dtag_requests.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; -import "desmos/profiles/v2/models_app_links.proto"; +import "desmos/profiles/v3/models_params.proto"; +import "desmos/profiles/v3/models_profile.proto"; +import "desmos/profiles/v3/models_dtag_requests.proto"; +import "desmos/profiles/v3/models_chain_links.proto"; +import "desmos/profiles/v3/models_app_links.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; @@ -14,29 +14,29 @@ option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; message GenesisState { option (gogoproto.goproto_getters) = false; - repeated desmos.profiles.v2.DTagTransferRequest dtag_transfer_requests = 1 [ + repeated desmos.profiles.v3.DTagTransferRequest dtag_transfer_requests = 1 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"dtag_transfer_requests\"", (gogoproto.customname) = "DTagTransferRequests" ]; - desmos.profiles.v2.Params params = 2 [ + repeated desmos.profiles.v3.ChainLink chain_links = 2 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"params\"" + (gogoproto.moretags) = "yaml:\"chain_links\"" ]; - string ibc_port_id = 3 [ - (gogoproto.moretags) = "yaml:\"ibc_port_id\"", - (gogoproto.customname) = "IBCPortID" + repeated ApplicationLink application_links = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"application_links\"" ]; - repeated desmos.profiles.v2.ChainLink chain_links = 4 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"chain_links\"" + string ibc_port_id = 4 [ + (gogoproto.moretags) = "yaml:\"ibc_port_id\"", + (gogoproto.customname) = "IBCPortID" ]; - repeated ApplicationLink application_links = 5 [ + desmos.profiles.v3.Params params = 5 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"application_links\"" + (gogoproto.moretags) = "yaml:\"params\"" ]; } diff --git a/proto/desmos/profiles/legacy/v200/models_app_links.proto b/proto/desmos/profiles/v3/models_app_links.proto similarity index 97% rename from proto/desmos/profiles/legacy/v200/models_app_links.proto rename to proto/desmos/profiles/v3/models_app_links.proto index 5fdf2659f9..c21c5c32f6 100644 --- a/proto/desmos/profiles/legacy/v200/models_app_links.proto +++ b/proto/desmos/profiles/v3/models_app_links.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package desmos.profiles.legacy.v200; +package desmos.profiles.v3; -option go_package = "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/desmos/profiles/v2/models_chain_links.proto b/proto/desmos/profiles/v3/models_chain_links.proto similarity index 99% rename from proto/desmos/profiles/v2/models_chain_links.proto rename to proto/desmos/profiles/v3/models_chain_links.proto index fad482e3ba..12190a2a28 100644 --- a/proto/desmos/profiles/v2/models_chain_links.proto +++ b/proto/desmos/profiles/v3/models_chain_links.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; diff --git a/proto/desmos/profiles/v2/models_dtag_requests.proto b/proto/desmos/profiles/v3/models_dtag_requests.proto similarity index 92% rename from proto/desmos/profiles/v2/models_dtag_requests.proto rename to proto/desmos/profiles/v3/models_dtag_requests.proto index af6c57722c..f54849a688 100644 --- a/proto/desmos/profiles/v2/models_dtag_requests.proto +++ b/proto/desmos/profiles/v3/models_dtag_requests.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; +import "desmos/profiles/v3/models_chain_links.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; diff --git a/proto/desmos/profiles/v2/models_packets.proto b/proto/desmos/profiles/v3/models_packets.proto similarity index 87% rename from proto/desmos/profiles/v2/models_packets.proto rename to proto/desmos/profiles/v3/models_packets.proto index 8a7971270c..fbd83f4ac1 100644 --- a/proto/desmos/profiles/v2/models_packets.proto +++ b/proto/desmos/profiles/v3/models_packets.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; +import "desmos/profiles/v3/models_chain_links.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; @@ -21,13 +21,13 @@ message LinkChainAccountPacketData { ]; // SourceProof represents the proof of ownership of the source address - desmos.profiles.v2.Proof source_proof = 2 [ + desmos.profiles.v3.Proof source_proof = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"source_proof\"" ]; // SourceChainConfig contains the details of the source chain - desmos.profiles.v2.ChainConfig source_chain_config = 3 [ + desmos.profiles.v3.ChainConfig source_chain_config = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"source_chain_config\"" ]; @@ -38,7 +38,7 @@ message LinkChainAccountPacketData { [ (gogoproto.moretags) = "yaml:\"destination_address\"" ]; // DestinationProof contains the proof of ownership of the DestinationAddress - desmos.profiles.v2.Proof destination_proof = 5 [ + desmos.profiles.v3.Proof destination_proof = 5 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"destination_proof\"" ]; diff --git a/proto/desmos/profiles/legacy/v200/models_params.proto b/proto/desmos/profiles/v3/models_params.proto similarity index 84% rename from proto/desmos/profiles/legacy/v200/models_params.proto rename to proto/desmos/profiles/v3/models_params.proto index 614f0e9070..4b916960a8 100644 --- a/proto/desmos/profiles/legacy/v200/models_params.proto +++ b/proto/desmos/profiles/v3/models_params.proto @@ -1,10 +1,11 @@ syntax = "proto3"; -package desmos.profiles.legacy.v200; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/duration.proto"; -option go_package = "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; // Params contains the parameters for the profiles module message Params { @@ -28,6 +29,11 @@ message Params { (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"oracle\"" ]; + + AppLinksParams app_links = 5 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"app_links\"" + ]; } // NicknameParams defines the parameters related to the profiles nicknames @@ -115,3 +121,15 @@ message OracleParams { (gogoproto.moretags) = "yaml:\"fee_amount\"" ]; } + +// AppLinksParams define the parameters related to the app links +message AppLinksParams { + option (gogoproto.goproto_getters) = false; + + // ExpirationTime indicates the max amount of time before a link expires + google.protobuf.Duration expiration_time = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"expiration_time\"" + ]; +} \ No newline at end of file diff --git a/proto/desmos/profiles/v3/models_profile.proto b/proto/desmos/profiles/v3/models_profile.proto new file mode 100644 index 0000000000..addb2aa829 --- /dev/null +++ b/proto/desmos/profiles/v3/models_profile.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; +package desmos.profiles.v3; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; + +// -------------------------------------------------------------------------------------------------------------------- + +// Profile represents a generic first on Desmos, containing the information of a +// single user +message Profile { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // Account represents the base Cosmos account associated with this profile + google.protobuf.Any account = 1 + [ (cosmos_proto.accepts_interface) = "AccountI" ]; + + // DTag represents the unique tag of this profile + string dtag = 2 [ + (gogoproto.moretags) = "yaml:\"dtag\"", + (gogoproto.customname) = "DTag" + ]; + + // Nickname contains the custom human readable name of the profile + string nickname = 3 [ (gogoproto.moretags) = "yaml:\"nickname\"" ]; + + // Bio contains the biography of the profile + string bio = 4 [ (gogoproto.moretags) = "yaml:\"bio\"" ]; + + // Pictures contains the data about the pictures associated with he profile + Pictures pictures = 5 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"pictures\"" + ]; + + // CreationTime represents the time in which the profile has been created + google.protobuf.Timestamp creation_date = 6 [ + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"creation_date\"", + (gogoproto.nullable) = false + ]; +} + +// Pictures contains the data of a user profile's related pictures +message Pictures { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // Profile contains the URL to the profile picture + string profile = 1 [ (gogoproto.moretags) = "yaml:\"profile\"" ]; + + // Cover contains the URL to the cover picture + string cover = 2 [ (gogoproto.moretags) = "yaml:\"cover\"" ]; +} \ No newline at end of file diff --git a/proto/desmos/profiles/v2/msg_server.proto b/proto/desmos/profiles/v3/msg_server.proto similarity index 86% rename from proto/desmos/profiles/v2/msg_server.proto rename to proto/desmos/profiles/v3/msg_server.proto index 6025c84e63..0fd65a8446 100644 --- a/proto/desmos/profiles/v2/msg_server.proto +++ b/proto/desmos/profiles/v3/msg_server.proto @@ -1,15 +1,15 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_profile.proto"; -import "desmos/profiles/v2/models_dtag_requests.proto"; -import "desmos/profiles/v2/msgs_profile.proto"; -import "desmos/profiles/v2/msgs_dtag_requests.proto"; -import "desmos/profiles/v2/msgs_chain_links.proto"; -import "desmos/profiles/v2/msgs_app_links.proto"; +import "desmos/profiles/v3/models_profile.proto"; +import "desmos/profiles/v3/models_dtag_requests.proto"; +import "desmos/profiles/v3/msgs_profile.proto"; +import "desmos/profiles/v3/msgs_dtag_requests.proto"; +import "desmos/profiles/v3/msgs_chain_links.proto"; +import "desmos/profiles/v3/msgs_app_links.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; diff --git a/proto/desmos/profiles/v2/msgs_app_links.proto b/proto/desmos/profiles/v3/msgs_app_links.proto similarity index 97% rename from proto/desmos/profiles/v2/msgs_app_links.proto rename to proto/desmos/profiles/v3/msgs_app_links.proto index 4a01969e01..d44669fea6 100644 --- a/proto/desmos/profiles/v2/msgs_app_links.proto +++ b/proto/desmos/profiles/v3/msgs_app_links.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; -import "desmos/profiles/v2/models_app_links.proto"; +import "desmos/profiles/v3/models_app_links.proto"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; diff --git a/proto/desmos/profiles/v2/msgs_chain_links.proto b/proto/desmos/profiles/v3/msgs_chain_links.proto similarity index 91% rename from proto/desmos/profiles/v2/msgs_chain_links.proto rename to proto/desmos/profiles/v3/msgs_chain_links.proto index c8cabe6dc6..845a6e1cab 100644 --- a/proto/desmos/profiles/v2/msgs_chain_links.proto +++ b/proto/desmos/profiles/v3/msgs_chain_links.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; +import "desmos/profiles/v3/models_chain_links.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; @@ -18,13 +18,13 @@ message MsgLinkChainAccount { ]; // Proof contains the proof of ownership of the external chain address - desmos.profiles.v2.Proof proof = 2 [ + desmos.profiles.v3.Proof proof = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"source_proof\"" ]; // ChainConfig contains the configuration of the external chain - desmos.profiles.v2.ChainConfig chain_config = 3 [ + desmos.profiles.v3.ChainConfig chain_config = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"source_chain_config\"" ]; diff --git a/proto/desmos/profiles/v2/msgs_dtag_requests.proto b/proto/desmos/profiles/v3/msgs_dtag_requests.proto similarity index 96% rename from proto/desmos/profiles/v2/msgs_dtag_requests.proto rename to proto/desmos/profiles/v3/msgs_dtag_requests.proto index dfee30ffdf..097878477a 100644 --- a/proto/desmos/profiles/v2/msgs_dtag_requests.proto +++ b/proto/desmos/profiles/v3/msgs_dtag_requests.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_profile.proto"; -import "desmos/profiles/v2/models_dtag_requests.proto"; +import "desmos/profiles/v3/models_profile.proto"; +import "desmos/profiles/v3/models_dtag_requests.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; diff --git a/proto/desmos/profiles/v2/msgs_profile.proto b/proto/desmos/profiles/v3/msgs_profile.proto similarity index 91% rename from proto/desmos/profiles/v2/msgs_profile.proto rename to proto/desmos/profiles/v3/msgs_profile.proto index a804790472..fdd0e2db8e 100644 --- a/proto/desmos/profiles/v2/msgs_profile.proto +++ b/proto/desmos/profiles/v3/msgs_profile.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_profile.proto"; -import "desmos/profiles/v2/models_dtag_requests.proto"; +import "desmos/profiles/v3/models_profile.proto"; +import "desmos/profiles/v3/models_dtag_requests.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; diff --git a/proto/desmos/profiles/v2/query.proto b/proto/desmos/profiles/v3/query.proto similarity index 74% rename from proto/desmos/profiles/v2/query.proto rename to proto/desmos/profiles/v3/query.proto index 529a4099f4..86e61a5ab5 100644 --- a/proto/desmos/profiles/v2/query.proto +++ b/proto/desmos/profiles/v3/query.proto @@ -1,14 +1,14 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; -import "desmos/profiles/v2/query_profile.proto"; -import "desmos/profiles/v2/query_dtag_requests.proto"; -import "desmos/profiles/v2/query_params.proto"; -import "desmos/profiles/v2/query_chain_links.proto"; -import "desmos/profiles/v2/query_app_links.proto"; +import "desmos/profiles/v3/query_profile.proto"; +import "desmos/profiles/v3/query_dtag_requests.proto"; +import "desmos/profiles/v3/query_params.proto"; +import "desmos/profiles/v3/query_chain_links.proto"; +import "desmos/profiles/v3/query_app_links.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; @@ -20,34 +20,34 @@ service Query { // If the queried user does not have a profile, the returned response will // contain a null profile. rpc Profile(QueryProfileRequest) returns (QueryProfileResponse) { - option (google.api.http).get = "/desmos/profiles/v2/profiles/{user}"; + option (google.api.http).get = "/desmos/profiles/v3/profiles/{user}"; } // IncomingDTagTransferRequests queries all the DTag transfers requests that // have been made towards the user with the given address rpc IncomingDTagTransferRequests(QueryIncomingDTagTransferRequestsRequest) returns (QueryIncomingDTagTransferRequestsResponse) { - option (google.api.http).get = "/desmos/profiles/v2/dtag-transfer-requests"; + option (google.api.http).get = "/desmos/profiles/v3/dtag-transfer-requests"; } // ChainLinks queries the chain links associated to the given user, if // provided. Otherwise it queries all the chain links stored. rpc ChainLinks(QueryChainLinksRequest) returns (QueryChainLinksResponse) { - option (google.api.http).get = "/desmos/profiles/v2/chain-links"; + option (google.api.http).get = "/desmos/profiles/v3/chain-links"; } // ChainLinkOwners queries for the owners of chain links, optionally searching // for a specific chain name and external address rpc ChainLinkOwners(QueryChainLinkOwnersRequest) returns (QueryChainLinkOwnersResponse) { - option (google.api.http).get = "/desmos/profiles/v2/chain-links/owners"; + option (google.api.http).get = "/desmos/profiles/v3/chain-links/owners"; } // ApplicationLinks queries the applications links associated to the given // user, if provided. Otherwise, it queries all the application links stored. rpc ApplicationLinks(QueryApplicationLinksRequest) returns (QueryApplicationLinksResponse) { - option (google.api.http).get = "/desmos/profiles/v2/app-links"; + option (google.api.http).get = "/desmos/profiles/v3/app-links"; } // ApplicationLinkByClientID queries a single application link for a given @@ -55,18 +55,18 @@ service Query { rpc ApplicationLinkByClientID(QueryApplicationLinkByClientIDRequest) returns (QueryApplicationLinkByClientIDResponse) { option (google.api.http).get = - "/desmos/profiles/v2/app-links/clients/{client_id}"; + "/desmos/profiles/v3/app-links/clients/{client_id}"; } // ApplicationLinkOwners queries for the owners of applications links, // optionally searching for a specific application and username. rpc ApplicationLinkOwners(QueryApplicationLinkOwnersRequest) returns (QueryApplicationLinkOwnersResponse) { - option (google.api.http).get = "/desmos/profiles/v2/app-links/owners"; + option (google.api.http).get = "/desmos/profiles/v3/app-links/owners"; } // Params queries the profiles module params rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/desmos/profiles/v2/params"; + option (google.api.http).get = "/desmos/profiles/v3/params"; } } diff --git a/proto/desmos/profiles/v2/query_app_links.proto b/proto/desmos/profiles/v3/query_app_links.proto similarity index 97% rename from proto/desmos/profiles/v2/query_app_links.proto rename to proto/desmos/profiles/v3/query_app_links.proto index bd8c3f63a0..5cd88542c6 100644 --- a/proto/desmos/profiles/v2/query_app_links.proto +++ b/proto/desmos/profiles/v3/query_app_links.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; -import "desmos/profiles/v2/models_app_links.proto"; +import "desmos/profiles/v3/models_app_links.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; diff --git a/proto/desmos/profiles/v2/query_chain_links.proto b/proto/desmos/profiles/v3/query_chain_links.proto similarity index 96% rename from proto/desmos/profiles/v2/query_chain_links.proto rename to proto/desmos/profiles/v3/query_chain_links.proto index 370d978779..12f9dc869b 100644 --- a/proto/desmos/profiles/v2/query_chain_links.proto +++ b/proto/desmos/profiles/v3/query_chain_links.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; +import "desmos/profiles/v3/models_chain_links.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; diff --git a/proto/desmos/profiles/v2/query_dtag_requests.proto b/proto/desmos/profiles/v3/query_dtag_requests.proto similarity index 89% rename from proto/desmos/profiles/v2/query_dtag_requests.proto rename to proto/desmos/profiles/v3/query_dtag_requests.proto index 9d33588959..8351b9491f 100644 --- a/proto/desmos/profiles/v2/query_dtag_requests.proto +++ b/proto/desmos/profiles/v3/query_dtag_requests.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; -import "desmos/profiles/v2/models_dtag_requests.proto"; +import "desmos/profiles/v3/models_dtag_requests.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; @@ -29,7 +29,7 @@ message QueryIncomingDTagTransferRequestsRequest { message QueryIncomingDTagTransferRequestsResponse { // Requests represent the list of all the DTag transfer requests made towards // the user - repeated desmos.profiles.v2.DTagTransferRequest requests = 1 + repeated desmos.profiles.v3.DTagTransferRequest requests = 1 [ (gogoproto.nullable) = false ]; // Pagination defines the pagination response diff --git a/proto/desmos/profiles/v2/query_params.proto b/proto/desmos/profiles/v3/query_params.proto similarity index 78% rename from proto/desmos/profiles/v2/query_params.proto rename to proto/desmos/profiles/v3/query_params.proto index bd3a4023d4..dc712e08ad 100644 --- a/proto/desmos/profiles/v2/query_params.proto +++ b/proto/desmos/profiles/v3/query_params.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; -import "desmos/profiles/v2/models_params.proto"; +import "desmos/profiles/v3/models_params.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; @@ -15,5 +15,5 @@ message QueryParamsRequest {} // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { - desmos.profiles.v2.Params params = 1 [ (gogoproto.nullable) = false ]; + desmos.profiles.v3.Params params = 1 [ (gogoproto.nullable) = false ]; } \ No newline at end of file diff --git a/proto/desmos/profiles/v2/query_profile.proto b/proto/desmos/profiles/v3/query_profile.proto similarity index 96% rename from proto/desmos/profiles/v2/query_profile.proto rename to proto/desmos/profiles/v3/query_profile.proto index cdcd2a48d1..501a23266e 100644 --- a/proto/desmos/profiles/v2/query_profile.proto +++ b/proto/desmos/profiles/v3/query_profile.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; diff --git a/x/posts/legacy/v2/models.pb.go b/x/posts/legacy/v2/models.pb.go index b93b270e34..a87bc4ebc4 100644 --- a/x/posts/legacy/v2/models.pb.go +++ b/x/posts/legacy/v2/models.pb.go @@ -523,7 +523,7 @@ type Attachment struct { SectionID uint32 `protobuf:"varint,2,opt,name=section_id,json=sectionId,proto3" json:"section_id,omitempty"` // Id of the post to which this attachment should be connected PostID uint64 `protobuf:"varint,3,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` - // If of this attachment + // Id of this attachment ID uint32 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"` // Content of the attachment Content *types.Any `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` diff --git a/x/profiles/client/utils/cli.pb.go b/x/profiles/client/utils/cli.pb.go index 07db785ce8..c0a2a81458 100644 --- a/x/profiles/client/utils/cli.pb.go +++ b/x/profiles/client/utils/cli.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/client/cli.proto +// source: desmos/profiles/v3/client/cli.proto package utils @@ -43,7 +43,7 @@ func (m *ChainLinkJSON) Reset() { *m = ChainLinkJSON{} } func (m *ChainLinkJSON) String() string { return proto.CompactTextString(m) } func (*ChainLinkJSON) ProtoMessage() {} func (*ChainLinkJSON) Descriptor() ([]byte, []int) { - return fileDescriptor_953cf0366775bd6d, []int{0} + return fileDescriptor_8dd0252be1e0ade7, []int{0} } func (m *ChainLinkJSON) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -94,18 +94,18 @@ func (m *ChainLinkJSON) GetChainConfig() types1.ChainConfig { } func init() { - proto.RegisterType((*ChainLinkJSON)(nil), "desmos.profiles.v2.client.ChainLinkJSON") + proto.RegisterType((*ChainLinkJSON)(nil), "desmos.profiles.v3.client.ChainLinkJSON") } func init() { - proto.RegisterFile("desmos/profiles/v2/client/cli.proto", fileDescriptor_953cf0366775bd6d) + proto.RegisterFile("desmos/profiles/v3/client/cli.proto", fileDescriptor_8dd0252be1e0ade7) } -var fileDescriptor_953cf0366775bd6d = []byte{ +var fileDescriptor_8dd0252be1e0ade7 = []byte{ // 384 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xbb, 0x4e, 0xf3, 0x30, 0x14, 0x80, 0x93, 0xfe, 0xfa, 0x2f, 0x4a, 0xfb, 0x33, 0x84, 0x0e, 0x6d, 0x91, 0x12, 0x08, 0x0b, - 0x12, 0xaa, 0x2d, 0x15, 0x06, 0xd4, 0xad, 0x29, 0x2c, 0x08, 0x71, 0x09, 0x1b, 0x4b, 0xe4, 0x5c, + 0x12, 0xaa, 0x2d, 0x51, 0x06, 0xd4, 0xad, 0x29, 0x2c, 0x08, 0x71, 0x09, 0x1b, 0x4b, 0xe4, 0x5c, 0x6b, 0xd5, 0x89, 0xa3, 0x38, 0xad, 0xe8, 0x5b, 0x30, 0x30, 0x30, 0xf6, 0x21, 0x78, 0x88, 0x8a, 0xa9, 0x23, 0x53, 0x85, 0xda, 0x85, 0xb9, 0x4f, 0x80, 0x62, 0x27, 0x2a, 0x42, 0x9d, 0x72, 0x9c, 0xf3, 0x9d, 0xcf, 0xe7, 0x1c, 0x59, 0x39, 0xf4, 0x7c, 0x16, 0x51, 0x06, 0x93, 0x94, 0x06, 0x98, @@ -116,17 +116,17 @@ var fileDescriptor_953cf0366775bd6d = []byte{ 0x48, 0xc5, 0xa1, 0x48, 0x1d, 0x6f, 0x69, 0x36, 0xa2, 0x9e, 0x4f, 0x98, 0xed, 0x0e, 0x10, 0x8e, 0x6d, 0x82, 0xe3, 0x61, 0x01, 0x1b, 0xcf, 0x15, 0xe5, 0x7f, 0x3f, 0xff, 0x7b, 0x85, 0xe3, 0xe1, 0xe5, 0xfd, 0xcd, 0xb5, 0x7a, 0xa7, 0xfc, 0x45, 0x9e, 0x97, 0xfa, 0x8c, 0x35, 0xe4, 0x7d, 0xf9, - 0xa8, 0xda, 0xa9, 0x03, 0xd1, 0x0c, 0x28, 0x9b, 0x01, 0xbd, 0x78, 0x62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x09, 0x8a, 0x48, 0xd7, 0x28, 0x70, 0xe3, 0xed, 0xb5, 0x5d, 0xed, 0x89, 0xf8, 0x1c, 0x65, + 0xc8, 0x2a, 0x3d, 0xea, 0x85, 0xf2, 0x3b, 0x49, 0x29, 0x0d, 0x1a, 0x15, 0x2e, 0x6c, 0x82, 0x2d, + 0x9b, 0xba, 0xcd, 0x01, 0xb3, 0x3e, 0x5b, 0xe8, 0xd2, 0x7a, 0xa1, 0xd7, 0x84, 0x99, 0x57, 0x19, + 0x96, 0xa8, 0x56, 0x6d, 0xa5, 0x26, 0x06, 0x70, 0x69, 0x1c, 0xe0, 0xb0, 0xf1, 0x8b, 0xdb, 0xf4, + 0x6d, 0x36, 0x3e, 0x52, 0x9f, 0x63, 0xe6, 0x5e, 0xe1, 0xdc, 0x15, 0xce, 0xef, 0x0a, 0xc3, 0xaa, + 0xba, 0x1b, 0xb2, 0xfb, 0xef, 0x65, 0xaa, 0xcb, 0x9f, 0x53, 0x5d, 0x36, 0xad, 0xd9, 0x52, 0x93, + 0xe7, 0x4b, 0x4d, 0xfe, 0x58, 0x6a, 0xf2, 0xd3, 0x4a, 0x93, 0xe6, 0x2b, 0x4d, 0x7a, 0x5f, 0x69, + 0xd2, 0xc3, 0x59, 0x88, 0xb3, 0xc1, 0xc8, 0x01, 0x2e, 0x8d, 0xa0, 0xb8, 0xb8, 0x4d, 0x90, 0xc3, + 0x8a, 0x18, 0x8e, 0x4f, 0xe1, 0xe3, 0x66, 0xf3, 0xc5, 0x1b, 0x19, 0x65, 0x98, 0x30, 0xe7, 0x0f, + 0xdf, 0x5f, 0xe7, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x46, 0x97, 0xab, 0x39, 0x4d, 0x02, 0x00, 0x00, } func (this *ChainLinkJSON) Equal(that interface{}) bool { diff --git a/x/profiles/legacy/v5/models_app_links.pb.go b/x/profiles/legacy/v5/models_app_links.pb.go new file mode 100644 index 0000000000..6133b3d1e6 --- /dev/null +++ b/x/profiles/legacy/v5/models_app_links.pb.go @@ -0,0 +1,2342 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v2/models_app_links.proto + +package v5 + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// ApplicationLinkState defines if an application link is in the following +// states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT +type ApplicationLinkState int32 + +const ( + // A link has just been initialized + ApplicationLinkStateInitialized ApplicationLinkState = 0 + // A link has just started being verified + AppLinkStateVerificationStarted ApplicationLinkState = 1 + // A link has errored during the verification process + AppLinkStateVerificationError ApplicationLinkState = 2 + // A link has being verified successfully + AppLinkStateVerificationSuccess ApplicationLinkState = 3 + // A link has timed out while waiting for the verification + AppLinkStateVerificationTimedOut ApplicationLinkState = 4 +) + +var ApplicationLinkState_name = map[int32]string{ + 0: "APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED", + 1: "APPLICATION_LINK_STATE_VERIFICATION_STARTED", + 2: "APPLICATION_LINK_STATE_VERIFICATION_ERROR", + 3: "APPLICATION_LINK_STATE_VERIFICATION_SUCCESS", + 4: "APPLICATION_LINK_STATE_TIMED_OUT", +} + +var ApplicationLinkState_value = map[string]int32{ + "APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED": 0, + "APPLICATION_LINK_STATE_VERIFICATION_STARTED": 1, + "APPLICATION_LINK_STATE_VERIFICATION_ERROR": 2, + "APPLICATION_LINK_STATE_VERIFICATION_SUCCESS": 3, + "APPLICATION_LINK_STATE_TIMED_OUT": 4, +} + +func (x ApplicationLinkState) String() string { + return proto.EnumName(ApplicationLinkState_name, int32(x)) +} + +func (ApplicationLinkState) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{0} +} + +// ApplicationLink contains the data of a link to a centralized application +type ApplicationLink struct { + // User to which the link is associated + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty" yaml:"user"` + // Data contains the details of this specific link + Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data" yaml:"data"` + // State of the link + State ApplicationLinkState `protobuf:"varint,3,opt,name=state,proto3,enum=desmos.profiles.v2.ApplicationLinkState" json:"state,omitempty" yaml:"state"` + // OracleRequest represents the request that has been made to the oracle + OracleRequest OracleRequest `protobuf:"bytes,4,opt,name=oracle_request,json=oracleRequest,proto3" json:"oracle_request" yaml:"oracle_request"` + // Data coming from the result of the verification. + // Only available when the state is STATE_SUCCESS + Result *Result `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty" yaml:"result"` + // CreationTime represents the time in which the link was created + CreationTime time.Time `protobuf:"bytes,6,opt,name=creation_time,json=creationTime,proto3,stdtime" json:"creation_time" yaml:"creation_time"` + // ExpirationTime represents the time in which the link will expire + ExpirationTime time.Time `protobuf:"bytes,7,opt,name=expiration_time,json=expirationTime,proto3,stdtime" json:"expiration_time" yaml:"expiration_time"` +} + +func (m *ApplicationLink) Reset() { *m = ApplicationLink{} } +func (m *ApplicationLink) String() string { return proto.CompactTextString(m) } +func (*ApplicationLink) ProtoMessage() {} +func (*ApplicationLink) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{0} +} +func (m *ApplicationLink) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ApplicationLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ApplicationLink.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ApplicationLink) XXX_Merge(src proto.Message) { + xxx_messageInfo_ApplicationLink.Merge(m, src) +} +func (m *ApplicationLink) XXX_Size() int { + return m.Size() +} +func (m *ApplicationLink) XXX_DiscardUnknown() { + xxx_messageInfo_ApplicationLink.DiscardUnknown(m) +} + +var xxx_messageInfo_ApplicationLink proto.InternalMessageInfo + +// Data contains the data associated to a specific user of a +// generic centralized application +type Data struct { + // The application name (eg. Twitter, GitHub, etc) + Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty" yaml:"application"` + // Username on the application (eg. Twitter tag, GitHub profile, etc) + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty" yaml:"username"` +} + +func (m *Data) Reset() { *m = Data{} } +func (m *Data) String() string { return proto.CompactTextString(m) } +func (*Data) ProtoMessage() {} +func (*Data) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{1} +} +func (m *Data) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Data.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Data) XXX_Merge(src proto.Message) { + xxx_messageInfo_Data.Merge(m, src) +} +func (m *Data) XXX_Size() int { + return m.Size() +} +func (m *Data) XXX_DiscardUnknown() { + xxx_messageInfo_Data.DiscardUnknown(m) +} + +var xxx_messageInfo_Data proto.InternalMessageInfo + +// OracleRequest represents a generic oracle request used to +// verify the ownership of a centralized application account +type OracleRequest struct { + // ID is the ID of the request + ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` + // OracleScriptID is ID of an oracle script + OracleScriptID uint64 `protobuf:"varint,2,opt,name=oracle_script_id,json=oracleScriptId,proto3" json:"oracle_script_id,omitempty" yaml:"oracle_script_id"` + // CallData contains the data used to perform the oracle request + CallData OracleRequest_CallData `protobuf:"bytes,3,opt,name=call_data,json=callData,proto3" json:"call_data" yaml:"call_data"` + // ClientID represents the ID of the client that has called the oracle script + ClientID string `protobuf:"bytes,4,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` +} + +func (m *OracleRequest) Reset() { *m = OracleRequest{} } +func (m *OracleRequest) String() string { return proto.CompactTextString(m) } +func (*OracleRequest) ProtoMessage() {} +func (*OracleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{2} +} +func (m *OracleRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleRequest.Merge(m, src) +} +func (m *OracleRequest) XXX_Size() int { + return m.Size() +} +func (m *OracleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_OracleRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleRequest proto.InternalMessageInfo + +// CallData contains the data sent to a single oracle request in order to +// verify the ownership of a centralized application by a Desmos profile +type OracleRequest_CallData struct { + // The application for which the ownership should be verified + Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty" yaml:"application"` + // The hex encoded call data that should be used to verify the application + // account ownership + CallData string `protobuf:"bytes,2,opt,name=call_data,json=callData,proto3" json:"call_data,omitempty" yaml:"call_data"` +} + +func (m *OracleRequest_CallData) Reset() { *m = OracleRequest_CallData{} } +func (m *OracleRequest_CallData) String() string { return proto.CompactTextString(m) } +func (*OracleRequest_CallData) ProtoMessage() {} +func (*OracleRequest_CallData) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{2, 0} +} +func (m *OracleRequest_CallData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleRequest_CallData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleRequest_CallData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleRequest_CallData) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleRequest_CallData.Merge(m, src) +} +func (m *OracleRequest_CallData) XXX_Size() int { + return m.Size() +} +func (m *OracleRequest_CallData) XXX_DiscardUnknown() { + xxx_messageInfo_OracleRequest_CallData.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleRequest_CallData proto.InternalMessageInfo + +func (m *OracleRequest_CallData) GetApplication() string { + if m != nil { + return m.Application + } + return "" +} + +func (m *OracleRequest_CallData) GetCallData() string { + if m != nil { + return m.CallData + } + return "" +} + +// Result represents a verification result +type Result struct { + // sum is the oneof that specifies whether this represents a success or + // failure result + // + // Types that are valid to be assigned to Sum: + // *Result_Success_ + // *Result_Failed_ + Sum isResult_Sum `protobuf_oneof:"sum"` +} + +func (m *Result) Reset() { *m = Result{} } +func (m *Result) String() string { return proto.CompactTextString(m) } +func (*Result) ProtoMessage() {} +func (*Result) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{3} +} +func (m *Result) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result.Merge(m, src) +} +func (m *Result) XXX_Size() int { + return m.Size() +} +func (m *Result) XXX_DiscardUnknown() { + xxx_messageInfo_Result.DiscardUnknown(m) +} + +var xxx_messageInfo_Result proto.InternalMessageInfo + +type isResult_Sum interface { + isResult_Sum() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type Result_Success_ struct { + Success *Result_Success `protobuf:"bytes,1,opt,name=success,proto3,oneof" json:"success,omitempty"` +} +type Result_Failed_ struct { + Failed *Result_Failed `protobuf:"bytes,2,opt,name=failed,proto3,oneof" json:"failed,omitempty"` +} + +func (*Result_Success_) isResult_Sum() {} +func (*Result_Failed_) isResult_Sum() {} + +func (m *Result) GetSum() isResult_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *Result) GetSuccess() *Result_Success { + if x, ok := m.GetSum().(*Result_Success_); ok { + return x.Success + } + return nil +} + +func (m *Result) GetFailed() *Result_Failed { + if x, ok := m.GetSum().(*Result_Failed_); ok { + return x.Failed + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Result) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Result_Success_)(nil), + (*Result_Failed_)(nil), + } +} + +// Success is the result of an application link that has been successfully +// verified +type Result_Success struct { + // Hex-encoded value that has be signed by the profile + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" yaml:"value"` + // Hex-encoded signature that has been produced by signing the value + Signature string `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" yaml:"signature"` +} + +func (m *Result_Success) Reset() { *m = Result_Success{} } +func (m *Result_Success) String() string { return proto.CompactTextString(m) } +func (*Result_Success) ProtoMessage() {} +func (*Result_Success) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{3, 0} +} +func (m *Result_Success) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result_Success) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result_Success.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result_Success) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result_Success.Merge(m, src) +} +func (m *Result_Success) XXX_Size() int { + return m.Size() +} +func (m *Result_Success) XXX_DiscardUnknown() { + xxx_messageInfo_Result_Success.DiscardUnknown(m) +} + +var xxx_messageInfo_Result_Success proto.InternalMessageInfo + +// Failed is the result of an application link that has not been verified +// successfully +type Result_Failed struct { + // Error that is associated with the failure + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty" yaml:"error"` +} + +func (m *Result_Failed) Reset() { *m = Result_Failed{} } +func (m *Result_Failed) String() string { return proto.CompactTextString(m) } +func (*Result_Failed) ProtoMessage() {} +func (*Result_Failed) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{3, 1} +} +func (m *Result_Failed) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result_Failed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result_Failed.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result_Failed) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result_Failed.Merge(m, src) +} +func (m *Result_Failed) XXX_Size() int { + return m.Size() +} +func (m *Result_Failed) XXX_DiscardUnknown() { + xxx_messageInfo_Result_Failed.DiscardUnknown(m) +} + +var xxx_messageInfo_Result_Failed proto.InternalMessageInfo + +func init() { + proto.RegisterEnum("desmos.profiles.v2.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) + proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.v2.ApplicationLink") + proto.RegisterType((*Data)(nil), "desmos.profiles.v2.Data") + proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.v2.OracleRequest") + proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.v2.OracleRequest.CallData") + proto.RegisterType((*Result)(nil), "desmos.profiles.v2.Result") + proto.RegisterType((*Result_Success)(nil), "desmos.profiles.v2.Result.Success") + proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.v2.Result.Failed") +} + +func init() { + proto.RegisterFile("desmos/profiles/v2/models_app_links.proto", fileDescriptor_c4a613de86d4edc0) +} + +var fileDescriptor_c4a613de86d4edc0 = []byte{ + // 992 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x6f, 0xdb, 0x36, + 0x18, 0xf6, 0x87, 0xe2, 0xc4, 0x4c, 0x93, 0x78, 0x4c, 0xd6, 0x19, 0x02, 0x6a, 0x29, 0xca, 0x30, + 0xa4, 0x1d, 0x2a, 0x61, 0xde, 0x0a, 0x0c, 0x19, 0x36, 0xc0, 0xb2, 0x15, 0x54, 0x5b, 0x16, 0x07, + 0xb4, 0xd2, 0x02, 0xbd, 0x08, 0x8c, 0xc4, 0x78, 0x44, 0x65, 0xcb, 0xd3, 0x47, 0xd0, 0x6e, 0xd8, + 0xbd, 0xc8, 0xa9, 0x7f, 0x20, 0x40, 0x81, 0xfd, 0x89, 0xdd, 0x76, 0xd8, 0xa5, 0xc7, 0xee, 0xb6, + 0x93, 0x36, 0x38, 0x97, 0x9d, 0xfd, 0x0b, 0x06, 0x91, 0x52, 0xec, 0x34, 0x71, 0x53, 0x60, 0x37, + 0x99, 0xef, 0xf3, 0xf1, 0x92, 0xcf, 0x4b, 0xc2, 0xe0, 0xae, 0x4b, 0xc2, 0x81, 0x1f, 0x6a, 0xa3, + 0xc0, 0x3f, 0xa6, 0x1e, 0x09, 0xb5, 0x93, 0xa6, 0x36, 0xf0, 0x5d, 0xe2, 0x85, 0x36, 0x1e, 0x8d, + 0x6c, 0x8f, 0x0e, 0x9f, 0x86, 0xea, 0x28, 0xf0, 0x23, 0x1f, 0x42, 0x0e, 0x55, 0x73, 0xa8, 0x7a, + 0xd2, 0x14, 0x37, 0xfa, 0x7e, 0xdf, 0x67, 0x65, 0x2d, 0xfd, 0xe2, 0x48, 0x51, 0xea, 0xfb, 0x7e, + 0xdf, 0x23, 0x1a, 0xfb, 0x75, 0x14, 0x1f, 0x6b, 0x11, 0x1d, 0x90, 0x30, 0xc2, 0x83, 0x11, 0x07, + 0x28, 0x7f, 0x0a, 0x60, 0xad, 0x35, 0x1a, 0x79, 0xd4, 0xc1, 0x11, 0xf5, 0x87, 0x7b, 0x74, 0xf8, + 0x14, 0x6e, 0x01, 0x21, 0x0e, 0x49, 0x50, 0x2f, 0xca, 0xc5, 0xed, 0xaa, 0xbe, 0x36, 0x49, 0xa4, + 0xe5, 0xe7, 0x78, 0xe0, 0xed, 0x28, 0xe9, 0xaa, 0x82, 0x58, 0x11, 0xb6, 0x80, 0xe0, 0xe2, 0x08, + 0xd7, 0x4b, 0x72, 0x71, 0x7b, 0xb9, 0x59, 0x57, 0xaf, 0xb6, 0xa4, 0x76, 0x70, 0x84, 0xf5, 0xf5, + 0xd7, 0x89, 0x54, 0x98, 0x4a, 0xa4, 0x1c, 0x05, 0x31, 0x2a, 0x3c, 0x00, 0x0b, 0x61, 0x84, 0x23, + 0x52, 0x2f, 0xcb, 0xc5, 0xed, 0xd5, 0xe6, 0xf6, 0x75, 0x1a, 0x6f, 0xf5, 0xd6, 0x4b, 0xf1, 0x7a, + 0x6d, 0x92, 0x48, 0xb7, 0xb8, 0x1e, 0x13, 0x50, 0x10, 0x17, 0x82, 0x7d, 0xb0, 0xea, 0x07, 0xd8, + 0xf1, 0x88, 0x1d, 0x90, 0x1f, 0x63, 0x12, 0x46, 0x75, 0x81, 0xb5, 0xb7, 0x79, 0x9d, 0x74, 0x97, + 0x21, 0x11, 0x07, 0xea, 0x77, 0xb2, 0x3e, 0x3f, 0xe4, 0xba, 0x97, 0x65, 0x14, 0xb4, 0xe2, 0xcf, + 0xa2, 0xa1, 0x01, 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x0f, 0xdb, 0x6d, 0xa3, 0xd7, 0xab, 0x95, 0x6f, 0xe8, 0x33, 0x1b, 0x91, + 0x6f, 0x81, 0x3c, 0x47, 0xd5, 0x32, 0xbf, 0x37, 0x3a, 0x76, 0xf7, 0xd0, 0xaa, 0x09, 0xe2, 0xc7, + 0xa7, 0x67, 0xb2, 0x3c, 0x4f, 0x2a, 0x7d, 0x3f, 0xdd, 0x6e, 0x1c, 0x89, 0xc2, 0x8b, 0x5f, 0x1b, + 0x05, 0xbd, 0xfb, 0x7a, 0xdc, 0x28, 0xbe, 0x19, 0x37, 0x8a, 0xff, 0x8c, 0x1b, 0xc5, 0x97, 0xe7, + 0x8d, 0xc2, 0x9b, 0xf3, 0x46, 0xe1, 0xaf, 0xf3, 0x46, 0xe1, 0xc9, 0x83, 0x3e, 0x8d, 0x7e, 0x88, + 0x8f, 0x54, 0xc7, 0x1f, 0x68, 0x7c, 0xa0, 0xef, 0x7b, 0xf8, 0x28, 0xcc, 0xbe, 0xb5, 0x93, 0x2f, + 0xb4, 0x67, 0xd3, 0xff, 0x0f, 0x1e, 0xe9, 0x63, 0xe7, 0xb9, 0x76, 0xf2, 0xe0, 0xa8, 0xc2, 0x9e, + 0xf8, 0xcf, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x5c, 0x77, 0xfd, 0x63, 0x08, 0x00, 0x00, +} + +func (this *ApplicationLink) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ApplicationLink) + if !ok { + that2, ok := that.(ApplicationLink) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.User != that1.User { + return false + } + if !this.Data.Equal(&that1.Data) { + return false + } + if this.State != that1.State { + return false + } + if !this.OracleRequest.Equal(&that1.OracleRequest) { + return false + } + if !this.Result.Equal(that1.Result) { + return false + } + if !this.CreationTime.Equal(that1.CreationTime) { + return false + } + if !this.ExpirationTime.Equal(that1.ExpirationTime) { + return false + } + return true +} +func (this *Data) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Data) + if !ok { + that2, ok := that.(Data) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Application != that1.Application { + return false + } + if this.Username != that1.Username { + return false + } + return true +} +func (this *OracleRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*OracleRequest) + if !ok { + that2, ok := that.(OracleRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ID != that1.ID { + return false + } + if this.OracleScriptID != that1.OracleScriptID { + return false + } + if !this.CallData.Equal(&that1.CallData) { + return false + } + if this.ClientID != that1.ClientID { + return false + } + return true +} +func (this *OracleRequest_CallData) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*OracleRequest_CallData) + if !ok { + that2, ok := that.(OracleRequest_CallData) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Application != that1.Application { + return false + } + if this.CallData != that1.CallData { + return false + } + return true +} +func (this *Result) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result) + if !ok { + that2, ok := that.(Result) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if that1.Sum == nil { + if this.Sum != nil { + return false + } + } else if this.Sum == nil { + return false + } else if !this.Sum.Equal(that1.Sum) { + return false + } + return true +} +func (this *Result_Success_) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Success_) + if !ok { + that2, ok := that.(Result_Success_) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Success.Equal(that1.Success) { + return false + } + return true +} +func (this *Result_Failed_) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Failed_) + if !ok { + that2, ok := that.(Result_Failed_) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Failed.Equal(that1.Failed) { + return false + } + return true +} +func (this *Result_Success) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Success) + if !ok { + that2, ok := that.(Result_Success) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Value != that1.Value { + return false + } + if this.Signature != that1.Signature { + return false + } + return true +} +func (this *Result_Failed) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Failed) + if !ok { + that2, ok := that.(Result_Failed) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Error != that1.Error { + return false + } + return true +} +func (m *ApplicationLink) 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 *ApplicationLink) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ApplicationLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintModelsAppLinks(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x3a + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintModelsAppLinks(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x32 + if m.Result != nil { + { + size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + { + size, err := m.OracleRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.State != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Data) 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 *Data) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x12 + } + if len(m.Application) > 0 { + i -= len(m.Application) + copy(dAtA[i:], m.Application) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Application))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OracleRequest) 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 *OracleRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ClientID) > 0 { + i -= len(m.ClientID) + copy(dAtA[i:], m.ClientID) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.ClientID))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.CallData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.OracleScriptID != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.OracleScriptID)) + i-- + dAtA[i] = 0x10 + } + if m.ID != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *OracleRequest_CallData) 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 *OracleRequest_CallData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleRequest_CallData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CallData) > 0 { + i -= len(m.CallData) + copy(dAtA[i:], m.CallData) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.CallData))) + i-- + dAtA[i] = 0x12 + } + if len(m.Application) > 0 { + i -= len(m.Application) + copy(dAtA[i:], m.Application) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Application))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Result) 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 *Result) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Result_Success_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Success_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Success != nil { + { + size, err := m.Success.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Result_Failed_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Failed_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Failed != nil { + { + size, err := m.Failed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Result_Success) 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 *Result_Success) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Success) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x12 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Result_Failed) 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 *Result_Failed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Failed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsAppLinks(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsAppLinks(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ApplicationLink) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.User) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = m.Data.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + if m.State != 0 { + n += 1 + sovModelsAppLinks(uint64(m.State)) + } + l = m.OracleRequest.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + if m.Result != nil { + l = m.Result.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime) + n += 1 + l + sovModelsAppLinks(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime) + n += 1 + l + sovModelsAppLinks(uint64(l)) + return n +} + +func (m *Data) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Application) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.Username) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *OracleRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ID != 0 { + n += 1 + sovModelsAppLinks(uint64(m.ID)) + } + if m.OracleScriptID != 0 { + n += 1 + sovModelsAppLinks(uint64(m.OracleScriptID)) + } + l = m.CallData.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + l = len(m.ClientID) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *OracleRequest_CallData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Application) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.CallData) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *Result) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *Result_Success_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success != nil { + l = m.Success.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} +func (m *Result_Failed_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Failed != nil { + l = m.Failed.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} +func (m *Result_Success) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *Result_Failed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Error) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func sovModelsAppLinks(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsAppLinks(x uint64) (n int) { + return sovModelsAppLinks(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ApplicationLink) 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 ErrIntOverflowModelsAppLinks + } + 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: ApplicationLink: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ApplicationLink: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.User = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= ApplicationLinkState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OracleRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Result == nil { + m.Result = &Result{} + } + if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Data) 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 ErrIntOverflowModelsAppLinks + } + 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: Data: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Data: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Application = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleRequest) 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 ErrIntOverflowModelsAppLinks + } + 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: OracleRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OracleRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleScriptID", wireType) + } + m.OracleScriptID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OracleScriptID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CallData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleRequest_CallData) 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 ErrIntOverflowModelsAppLinks + } + 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: CallData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CallData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Application = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallData", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CallData = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result) 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 ErrIntOverflowModelsAppLinks + } + 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: Result: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Result: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Result_Success{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Result_Success_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Result_Failed{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Result_Failed_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result_Success) 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 ErrIntOverflowModelsAppLinks + } + 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: Success: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Success: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result_Failed) 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 ErrIntOverflowModelsAppLinks + } + 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: Failed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Failed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsAppLinks(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, ErrIntOverflowModelsAppLinks + } + 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, ErrIntOverflowModelsAppLinks + } + 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, ErrIntOverflowModelsAppLinks + } + 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, ErrInvalidLengthModelsAppLinks + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsAppLinks + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsAppLinks + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsAppLinks = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsAppLinks = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsAppLinks = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v5/models_params.pb.go b/x/profiles/legacy/v5/models_params.pb.go new file mode 100644 index 0000000000..0b9a90a629 --- /dev/null +++ b/x/profiles/legacy/v5/models_params.pb.go @@ -0,0 +1,1671 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v2/models_params.proto + +package v5 + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/durationpb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// Params contains the parameters for the profiles module +type Params struct { + Nickname NicknameParams `protobuf:"bytes,1,opt,name=nickname,proto3" json:"nickname" yaml:"nickname"` + DTag DTagParams `protobuf:"bytes,2,opt,name=dtag,proto3" json:"dtag" yaml:"dtag"` + Bio BioParams `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio" yaml:"bio"` + Oracle OracleParams `protobuf:"bytes,4,opt,name=oracle,proto3" json:"oracle" yaml:"oracle"` + AppLinks AppLinksParams `protobuf:"bytes,5,opt,name=app_links,json=appLinks,proto3" json:"app_links" yaml:"app_links"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_1b093f5fee9c9f7d, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +// NicknameParams defines the parameters related to the profiles nicknames +type NicknameParams struct { + MinLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=min_length,json=minLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_length" yaml:"min_length"` + MaxLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=max_length,json=maxLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_length" yaml:"max_length"` +} + +func (m *NicknameParams) Reset() { *m = NicknameParams{} } +func (m *NicknameParams) String() string { return proto.CompactTextString(m) } +func (*NicknameParams) ProtoMessage() {} +func (*NicknameParams) Descriptor() ([]byte, []int) { + return fileDescriptor_1b093f5fee9c9f7d, []int{1} +} +func (m *NicknameParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NicknameParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NicknameParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NicknameParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_NicknameParams.Merge(m, src) +} +func (m *NicknameParams) XXX_Size() int { + return m.Size() +} +func (m *NicknameParams) XXX_DiscardUnknown() { + xxx_messageInfo_NicknameParams.DiscardUnknown(m) +} + +var xxx_messageInfo_NicknameParams proto.InternalMessageInfo + +// DTagParams defines the parameters related to profile DTags +type DTagParams struct { + RegEx string `protobuf:"bytes,1,opt,name=reg_ex,json=regEx,proto3" json:"reg_ex,omitempty" yaml:"reg_ex"` + MinLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=min_length,json=minLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_length" yaml:"min_length"` + MaxLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=max_length,json=maxLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_length" yaml:"max_length"` +} + +func (m *DTagParams) Reset() { *m = DTagParams{} } +func (m *DTagParams) String() string { return proto.CompactTextString(m) } +func (*DTagParams) ProtoMessage() {} +func (*DTagParams) Descriptor() ([]byte, []int) { + return fileDescriptor_1b093f5fee9c9f7d, []int{2} +} +func (m *DTagParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DTagParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DTagParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DTagParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_DTagParams.Merge(m, src) +} +func (m *DTagParams) XXX_Size() int { + return m.Size() +} +func (m *DTagParams) XXX_DiscardUnknown() { + xxx_messageInfo_DTagParams.DiscardUnknown(m) +} + +var xxx_messageInfo_DTagParams proto.InternalMessageInfo + +// BioParams defines the parameters related to profile biography +type BioParams struct { + MaxLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=max_length,json=maxLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_length" yaml:"max_length"` +} + +func (m *BioParams) Reset() { *m = BioParams{} } +func (m *BioParams) String() string { return proto.CompactTextString(m) } +func (*BioParams) ProtoMessage() {} +func (*BioParams) Descriptor() ([]byte, []int) { + return fileDescriptor_1b093f5fee9c9f7d, []int{3} +} +func (m *BioParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BioParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BioParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BioParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_BioParams.Merge(m, src) +} +func (m *BioParams) XXX_Size() int { + return m.Size() +} +func (m *BioParams) XXX_DiscardUnknown() { + xxx_messageInfo_BioParams.DiscardUnknown(m) +} + +var xxx_messageInfo_BioParams proto.InternalMessageInfo + +// OracleParams defines the parameters related to the oracle +// that will be used to verify the ownership of a centralized +// application account by a Desmos profile +type OracleParams struct { + // ScriptID represents the ID of the oracle script to be called to verify the + // data + ScriptID uint64 `protobuf:"varint,1,opt,name=script_id,json=scriptId,proto3" json:"script_id,omitempty" yaml:"script_id"` + // AskCount represents the number of oracles to which ask to verify the data + AskCount uint64 `protobuf:"varint,2,opt,name=ask_count,json=askCount,proto3" json:"ask_count,omitempty" yaml:"ask_count"` + // MinCount represents the minimum count of oracles that should complete the + // verification successfully + MinCount uint64 `protobuf:"varint,3,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty" yaml:"min_count"` + // PrepareGas represents the amount of gas to be used during the preparation + // stage of the oracle script + PrepareGas uint64 `protobuf:"varint,4,opt,name=prepare_gas,json=prepareGas,proto3" json:"prepare_gas,omitempty" yaml:"prepare_gas"` + // ExecuteGas represents the amount of gas to be used during the execution of + // the oracle script + ExecuteGas uint64 `protobuf:"varint,5,opt,name=execute_gas,json=executeGas,proto3" json:"execute_gas,omitempty" yaml:"execute_gas"` + // FeeAmount represents the amount of fees to be payed in order to execute the + // oracle script + FeeAmount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=fee_amount,json=feeAmount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"fee_amount" yaml:"fee_amount"` +} + +func (m *OracleParams) Reset() { *m = OracleParams{} } +func (m *OracleParams) String() string { return proto.CompactTextString(m) } +func (*OracleParams) ProtoMessage() {} +func (*OracleParams) Descriptor() ([]byte, []int) { + return fileDescriptor_1b093f5fee9c9f7d, []int{4} +} +func (m *OracleParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleParams.Merge(m, src) +} +func (m *OracleParams) XXX_Size() int { + return m.Size() +} +func (m *OracleParams) XXX_DiscardUnknown() { + xxx_messageInfo_OracleParams.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleParams proto.InternalMessageInfo + +// AppLinksParams define the parameters related to the app links +type AppLinksParams struct { + // ExpirationTime indicates the max amount of time before a link expires + ExpirationTime time.Duration `protobuf:"bytes,1,opt,name=expiration_time,json=expirationTime,proto3,stdduration" json:"expiration_time" yaml:"expiration_time"` +} + +func (m *AppLinksParams) Reset() { *m = AppLinksParams{} } +func (m *AppLinksParams) String() string { return proto.CompactTextString(m) } +func (*AppLinksParams) ProtoMessage() {} +func (*AppLinksParams) Descriptor() ([]byte, []int) { + return fileDescriptor_1b093f5fee9c9f7d, []int{5} +} +func (m *AppLinksParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AppLinksParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AppLinksParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AppLinksParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_AppLinksParams.Merge(m, src) +} +func (m *AppLinksParams) XXX_Size() int { + return m.Size() +} +func (m *AppLinksParams) XXX_DiscardUnknown() { + xxx_messageInfo_AppLinksParams.DiscardUnknown(m) +} + +var xxx_messageInfo_AppLinksParams proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "desmos.profiles.v2.Params") + proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.v2.NicknameParams") + proto.RegisterType((*DTagParams)(nil), "desmos.profiles.v2.DTagParams") + proto.RegisterType((*BioParams)(nil), "desmos.profiles.v2.BioParams") + proto.RegisterType((*OracleParams)(nil), "desmos.profiles.v2.OracleParams") + proto.RegisterType((*AppLinksParams)(nil), "desmos.profiles.v2.AppLinksParams") +} + +func init() { + proto.RegisterFile("desmos/profiles/v2/models_params.proto", fileDescriptor_1b093f5fee9c9f7d) +} + +var fileDescriptor_1b093f5fee9c9f7d = []byte{ + // 807 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00,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9e, 0x8b, 0xd0, 0xc6, 0x17, + 0xa0, 0x95, 0x92, 0x70, 0x92, 0xa2, 0x04, 0x77, 0xea, 0xdd, 0x7a, 0xaf, 0xdd, 0x87, 0xf6, 0x9f, + 0xf3, 0xb0, 0x3f, 0x53, 0x3e, 0x52, 0xe5, 0xbe, 0x7b, 0x5d, 0x5a, 0xb5, 0x65, 0x69, 0x3d, 0xbd, + 0x42, 0x49, 0x7c, 0x08, 0x2b, 0x02, 0xf4, 0x56, 0x30, 0x63, 0x08, 0x1a, 0xa3, 0x02, 0x45, 0x9d, + 0x1d, 0x01, 0x35, 0x1f, 0x82, 0x1e, 0x5f, 0xa0, 0x48, 0x01, 0xdf, 0xe3, 0xc0, 0x45, 0x69, 0x35, + 0xf8, 0xdc, 0xb2, 0xb4, 0xda, 0x12, 0xcc, 0x09, 0xd0, 0x13, 0x20, 0x63, 0x00, 0xb4, 0x80, 0xd0, + 0x8e, 0x26, 0x78, 0xef, 0x3f, 0xc4, 0x73, 0x09, 0x55, 0x38, 0x43, 0xe5, 0x07, 0x24, 0x26, 0x20, + 0x14, 0x7a, 0x5c, 0x6d, 0x0c, 0x41, 0x93, 0xe6, 0x28, 0x8c, 0x71, 0xa7, 0x21, 0x38, 0xdd, 0x87, + 0x38, 0x43, 0xe1, 0xa1, 0x50, 0xef, 0x28, 0xd4, 0x5b, 0x12, 0x25, 0xd5, 0xd0, 0x53, 0x18, 0xe3, + 0x4b, 0xa0, 0xa3, 0x2c, 0xf3, 0x63, 0x92, 0x4e, 0x58, 0x67, 0xf7, 0xaf, 0x0b, 0x78, 0x94, 0x65, + 0x67, 0xdc, 0x47, 0x51, 0x3b, 0x8a, 0xfa, 0xb6, 0xa4, 0xae, 0x10, 0xd0, 0x6b, 0x21, 0xe5, 0x79, + 0xd8, 0xf8, 0xf6, 0x47, 0xab, 0x06, 0xcb, 0x3a, 0xd8, 0xdb, 0xae, 0xbe, 0x11, 0x00, 0x90, 0x90, + 0xd4, 0x8f, 0x71, 0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, 0x82, + 0x65, 0x7c, 0x77, 0x78, 0xbd, 0x30, 0xeb, 0x37, 0x0b, 0xb3, 0xfe, 0xfb, 0xc2, 0xac, 0x7f, 0x77, + 0x67, 0xd6, 0x6e, 0xee, 0xcc, 0xda, 0xaf, 0x77, 0x66, 0xed, 0xab, 0x83, 0x8d, 0x45, 0xc9, 0x9b, + 0xf1, 0x4d, 0x8c, 0x02, 0xa6, 0xc6, 0xce, 0xec, 0x43, 0x67, 0xbe, 0x7e, 0x1b, 0x63, 0x1c, 0xa1, + 0xf0, 0xca, 0x99, 0x1d, 0x04, 0x4d, 0x91, 0xdd, 0x07, 0x7f, 0x04, 0x00, 0x00, 0xff, 0xff, 0x4a, + 0xc3, 0xd0, 0xd4, 0x3f, 0x07, 0x00, 0x00, +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.AppLinks.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size, err := m.Oracle.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Bio.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.DTag.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Nickname.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NicknameParams) 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 *NicknameParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NicknameParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MaxLength.Size() + i -= size + if _, err := m.MaxLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.MinLength.Size() + i -= size + if _, err := m.MinLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DTagParams) 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 *DTagParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DTagParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MaxLength.Size() + i -= size + if _, err := m.MaxLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.MinLength.Size() + i -= size + if _, err := m.MinLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.RegEx) > 0 { + i -= len(m.RegEx) + copy(dAtA[i:], m.RegEx) + i = encodeVarintModelsParams(dAtA, i, uint64(len(m.RegEx))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BioParams) 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 *BioParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BioParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MaxLength.Size() + i -= size + if _, err := m.MaxLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} + +func (m *OracleParams) 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 *OracleParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FeeAmount) > 0 { + for iNdEx := len(m.FeeAmount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FeeAmount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.ExecuteGas != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.ExecuteGas)) + i-- + dAtA[i] = 0x28 + } + if m.PrepareGas != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.PrepareGas)) + i-- + dAtA[i] = 0x20 + } + if m.MinCount != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.MinCount)) + i-- + dAtA[i] = 0x18 + } + if m.AskCount != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.AskCount)) + i-- + dAtA[i] = 0x10 + } + if m.ScriptID != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.ScriptID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AppLinksParams) 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 *AppLinksParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AppLinksParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintModelsParams(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintModelsParams(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Nickname.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.DTag.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.Bio.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.Oracle.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.AppLinks.Size() + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + +func (m *NicknameParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MinLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.MaxLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + +func (m *DTagParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RegEx) + if l > 0 { + n += 1 + l + sovModelsParams(uint64(l)) + } + l = m.MinLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.MaxLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + +func (m *BioParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MaxLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + +func (m *OracleParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ScriptID != 0 { + n += 1 + sovModelsParams(uint64(m.ScriptID)) + } + if m.AskCount != 0 { + n += 1 + sovModelsParams(uint64(m.AskCount)) + } + if m.MinCount != 0 { + n += 1 + sovModelsParams(uint64(m.MinCount)) + } + if m.PrepareGas != 0 { + n += 1 + sovModelsParams(uint64(m.PrepareGas)) + } + if m.ExecuteGas != 0 { + n += 1 + sovModelsParams(uint64(m.ExecuteGas)) + } + if len(m.FeeAmount) > 0 { + for _, e := range m.FeeAmount { + l = e.Size() + n += 1 + l + sovModelsParams(uint64(l)) + } + } + return n +} + +func (m *AppLinksParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime) + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + +func sovModelsParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsParams(x uint64) (n int) { + return sovModelsParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowModelsParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nickname", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Nickname.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DTag", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DTag.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bio", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Bio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Oracle", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Oracle.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppLinks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AppLinks.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NicknameParams) 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 ErrIntOverflowModelsParams + } + 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: NicknameParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NicknameParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DTagParams) 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 ErrIntOverflowModelsParams + } + 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: DTagParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DTagParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegEx", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + 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 ErrInvalidLengthModelsParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RegEx = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BioParams) 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 ErrIntOverflowModelsParams + } + 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: BioParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BioParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleParams) 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 ErrIntOverflowModelsParams + } + 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: OracleParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OracleParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ScriptID", wireType) + } + m.ScriptID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ScriptID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AskCount", wireType) + } + m.AskCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AskCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) + } + m.MinCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PrepareGas", wireType) + } + m.PrepareGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PrepareGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecuteGas", wireType) + } + m.ExecuteGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExecuteGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeAmount = append(m.FeeAmount, types.Coin{}) + if err := m.FeeAmount[len(m.FeeAmount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AppLinksParams) 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 ErrIntOverflowModelsParams + } + 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: AppLinksParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AppLinksParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsParams(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, ErrIntOverflowModelsParams + } + 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, ErrIntOverflowModelsParams + } + 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, ErrIntOverflowModelsParams + } + 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, ErrInvalidLengthModelsParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v5/models_profile.pb.go b/x/profiles/legacy/v5/models_profile.pb.go new file mode 100644 index 0000000000..67703d69e2 --- /dev/null +++ b/x/profiles/legacy/v5/models_profile.pb.go @@ -0,0 +1,826 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v2/models_profile.proto + +package v5 + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/regen-network/cosmos-proto" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// Profile represents a generic first on Desmos, containing the information of a +// single user +type Profile struct { + // Account represents the base Cosmos account associated with this profile + Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + // DTag represents the unique tag of this profile + DTag string `protobuf:"bytes,2,opt,name=dtag,proto3" json:"dtag,omitempty" yaml:"dtag"` + // Nickname contains the custom human readable name of the profile + Nickname string `protobuf:"bytes,3,opt,name=nickname,proto3" json:"nickname,omitempty" yaml:"nickname"` + // Bio contains the biography of the profile + Bio string `protobuf:"bytes,4,opt,name=bio,proto3" json:"bio,omitempty" yaml:"bio"` + // Pictures contains the data about the pictures associated with he profile + Pictures Pictures `protobuf:"bytes,5,opt,name=pictures,proto3" json:"pictures" yaml:"pictures"` + // CreationTime represents the time in which the profile has been created + CreationDate time.Time `protobuf:"bytes,6,opt,name=creation_date,json=creationDate,proto3,stdtime" json:"creation_date" yaml:"creation_date"` +} + +func (m *Profile) Reset() { *m = Profile{} } +func (*Profile) ProtoMessage() {} +func (*Profile) Descriptor() ([]byte, []int) { + return fileDescriptor_089dd63594c4b06b, []int{0} +} +func (m *Profile) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Profile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Profile.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Profile) XXX_Merge(src proto.Message) { + xxx_messageInfo_Profile.Merge(m, src) +} +func (m *Profile) XXX_Size() int { + return m.Size() +} +func (m *Profile) XXX_DiscardUnknown() { + xxx_messageInfo_Profile.DiscardUnknown(m) +} + +var xxx_messageInfo_Profile proto.InternalMessageInfo + +// Pictures contains the data of a user profile's related pictures +type Pictures struct { + // Profile contains the URL to the profile picture + Profile string `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty" yaml:"profile"` + // Cover contains the URL to the cover picture + Cover string `protobuf:"bytes,2,opt,name=cover,proto3" json:"cover,omitempty" yaml:"cover"` +} + +func (m *Pictures) Reset() { *m = Pictures{} } +func (m *Pictures) String() string { return proto.CompactTextString(m) } +func (*Pictures) ProtoMessage() {} +func (*Pictures) Descriptor() ([]byte, []int) { + return fileDescriptor_089dd63594c4b06b, []int{1} +} +func (m *Pictures) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Pictures) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Pictures.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Pictures) XXX_Merge(src proto.Message) { + xxx_messageInfo_Pictures.Merge(m, src) +} +func (m *Pictures) XXX_Size() int { + return m.Size() +} +func (m *Pictures) XXX_DiscardUnknown() { + xxx_messageInfo_Pictures.DiscardUnknown(m) +} + +var xxx_messageInfo_Pictures proto.InternalMessageInfo + +func (m *Pictures) GetProfile() string { + if m != nil { + return m.Profile + } + return "" +} + +func (m *Pictures) GetCover() string { + if m != nil { + return m.Cover + } + return "" +} + +func init() { + proto.RegisterType((*Profile)(nil), "desmos.profiles.v2.Profile") + proto.RegisterType((*Pictures)(nil), "desmos.profiles.v2.Pictures") +} + +func init() { + proto.RegisterFile("desmos/profiles/v2/models_profile.proto", fileDescriptor_089dd63594c4b06b) +} + +var fileDescriptor_089dd63594c4b06b = []byte{ + // 485 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0xb1, 0x6e, 0xd3, 0x40, + 0x1c, 0xc6, 0x6d, 0x92, 0x36, 0xee, 0x35, 0x14, 0x74, 0x44, 0xaa, 0x89, 0x90, 0x2f, 0xba, 0x01, + 0x2a, 0x41, 0x7d, 0x52, 0xa0, 0x4b, 0xc4, 0x52, 0xab, 0x0b, 0x13, 0xc5, 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c, 0xbf, 0x2b, 0x64, 0x7a, 0xef, 0xaf, 0xd6, + 0x8e, 0x79, 0xbd, 0x76, 0xcc, 0x3f, 0x6b, 0xc7, 0xbc, 0xd8, 0x38, 0xc6, 0xf5, 0xc6, 0x31, 0x7e, + 0x6d, 0x1c, 0xe3, 0xe3, 0x51, 0x14, 0x8b, 0x4f, 0x8b, 0xc0, 0x0d, 0x79, 0x4a, 0x64, 0x7b, 0x87, + 0x09, 0x0d, 0x0a, 0x75, 0x26, 0xe5, 0x1b, 0xf2, 0xf5, 0xf6, 0xaf, 0x4e, 0x58, 0x44, 0xc3, 0x25, + 0x29, 0x8f, 0x82, 0xed, 0xb6, 0x8a, 0xd7, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x28, 0x8e, 0x0e, + 0x1f, 0xf9, 0x02, 0x00, 0x00, +} + +func (this *Pictures) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Pictures) + if !ok { + that2, ok := that.(Pictures) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Profile != that1.Profile { + return false + } + if this.Cover != that1.Cover { + return false + } + return true +} +func (m *Profile) 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 *Profile) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Profile) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationDate):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintModelsProfile(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x32 + { + size, err := m.Pictures.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsProfile(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.Bio) > 0 { + i -= len(m.Bio) + copy(dAtA[i:], m.Bio) + i = encodeVarintModelsProfile(dAtA, i, uint64(len(m.Bio))) + i-- + dAtA[i] = 0x22 + } + if len(m.Nickname) > 0 { + i -= len(m.Nickname) + copy(dAtA[i:], m.Nickname) + i = encodeVarintModelsProfile(dAtA, i, uint64(len(m.Nickname))) + i-- + dAtA[i] = 0x1a + } + if len(m.DTag) > 0 { + i -= len(m.DTag) + copy(dAtA[i:], m.DTag) + i = encodeVarintModelsProfile(dAtA, i, uint64(len(m.DTag))) + i-- + dAtA[i] = 0x12 + } + if m.Account != nil { + { + size, err := m.Account.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsProfile(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Pictures) 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 *Pictures) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Pictures) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cover) > 0 { + i -= len(m.Cover) + copy(dAtA[i:], m.Cover) + i = encodeVarintModelsProfile(dAtA, i, uint64(len(m.Cover))) + i-- + dAtA[i] = 0x12 + } + if len(m.Profile) > 0 { + i -= len(m.Profile) + copy(dAtA[i:], m.Profile) + i = encodeVarintModelsProfile(dAtA, i, uint64(len(m.Profile))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsProfile(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsProfile(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Profile) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Account != nil { + l = m.Account.Size() + n += 1 + l + sovModelsProfile(uint64(l)) + } + l = len(m.DTag) + if l > 0 { + n += 1 + l + sovModelsProfile(uint64(l)) + } + l = len(m.Nickname) + if l > 0 { + n += 1 + l + sovModelsProfile(uint64(l)) + } + l = len(m.Bio) + if l > 0 { + n += 1 + l + sovModelsProfile(uint64(l)) + } + l = m.Pictures.Size() + n += 1 + l + sovModelsProfile(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationDate) + n += 1 + l + sovModelsProfile(uint64(l)) + return n +} + +func (m *Pictures) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Profile) + if l > 0 { + n += 1 + l + sovModelsProfile(uint64(l)) + } + l = len(m.Cover) + if l > 0 { + n += 1 + l + sovModelsProfile(uint64(l)) + } + return n +} + +func sovModelsProfile(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsProfile(x uint64) (n int) { + return sovModelsProfile(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Profile) 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 ErrIntOverflowModelsProfile + } + 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: Profile: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Profile: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Account == nil { + m.Account = &types.Any{} + } + if err := m.Account.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DTag", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + 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 ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DTag = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nickname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + 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 ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nickname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bio", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + 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 ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bio = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pictures", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Pictures.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreationDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsProfile(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsProfile + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Pictures) 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 ErrIntOverflowModelsProfile + } + 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: Pictures: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Pictures: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Profile", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + 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 ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Profile = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cover", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + 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 ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cover = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsProfile(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsProfile + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsProfile(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, ErrIntOverflowModelsProfile + } + 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, ErrIntOverflowModelsProfile + } + 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, ErrIntOverflowModelsProfile + } + 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, ErrInvalidLengthModelsProfile + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsProfile + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsProfile + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsProfile = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsProfile = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsProfile = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/types/codec.go b/x/profiles/types/codec.go index 0db463c013..3833d1566a 100644 --- a/x/profiles/types/codec.go +++ b/x/profiles/types/codec.go @@ -40,14 +40,14 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations((*exported.VestingAccount)(nil), &Profile{}) registry.RegisterImplementations((*authtypes.GenesisAccount)(nil), &Profile{}) registry.RegisterInterface( - "desmos.profiles.v2.AddressData", + "desmos.profiles.v3.AddressData", (*AddressData)(nil), &Bech32Address{}, &Base58Address{}, &HexAddress{}, ) registry.RegisterInterface( - "desmos.profiles.v2.Signature", + "desmos.profiles.v3.Signature", (*SignatureData)(nil), &SingleSignatureData{}, &MultiSignatureData{}, diff --git a/x/profiles/types/genesis.pb.go b/x/profiles/types/genesis.pb.go index c576b9f79b..3bc417f368 100644 --- a/x/profiles/types/genesis.pb.go +++ b/x/profiles/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/genesis.proto +// source: desmos/profiles/v3/genesis.proto package types @@ -26,17 +26,17 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the profiles module's genesis state. type GenesisState struct { DTagTransferRequests []DTagTransferRequest `protobuf:"bytes,1,rep,name=dtag_transfer_requests,json=dtagTransferRequests,proto3" json:"dtag_transfer_requests" yaml:"dtag_transfer_requests"` - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params" yaml:"params"` - IBCPortID string `protobuf:"bytes,3,opt,name=ibc_port_id,json=ibcPortId,proto3" json:"ibc_port_id,omitempty" yaml:"ibc_port_id"` - ChainLinks []ChainLink `protobuf:"bytes,4,rep,name=chain_links,json=chainLinks,proto3" json:"chain_links" yaml:"chain_links"` - ApplicationLinks []ApplicationLink `protobuf:"bytes,5,rep,name=application_links,json=applicationLinks,proto3" json:"application_links" yaml:"application_links"` + ChainLinks []ChainLink `protobuf:"bytes,2,rep,name=chain_links,json=chainLinks,proto3" json:"chain_links" yaml:"chain_links"` + ApplicationLinks []ApplicationLink `protobuf:"bytes,3,rep,name=application_links,json=applicationLinks,proto3" json:"application_links" yaml:"application_links"` + IBCPortID string `protobuf:"bytes,4,opt,name=ibc_port_id,json=ibcPortId,proto3" json:"ibc_port_id,omitempty" yaml:"ibc_port_id"` + Params Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params" yaml:"params"` } func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_be71125223ae0fd1, []int{0} + return fileDescriptor_bd22d098f73f0a1c, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -66,42 +66,42 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo func init() { - proto.RegisterType((*GenesisState)(nil), "desmos.profiles.v2.GenesisState") + proto.RegisterType((*GenesisState)(nil), "desmos.profiles.v3.GenesisState") } -func init() { proto.RegisterFile("desmos/profiles/v2/genesis.proto", fileDescriptor_be71125223ae0fd1) } +func init() { proto.RegisterFile("desmos/profiles/v3/genesis.proto", fileDescriptor_bd22d098f73f0a1c) } -var fileDescriptor_be71125223ae0fd1 = []byte{ - // 463 bytes of a gzipped FileDescriptorProto +var fileDescriptor_bd22d098f73f0a1c = []byte{ + // 462 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xcf, 0x6a, 0xd4, 0x40, 0x1c, 0xc7, 0x13, 0xbb, 0x16, 0x36, 0xab, 0xa0, 0x61, 0x95, 0x10, 0x68, 0x12, 0x52, 0xb0, 0x2b, - 0xd2, 0x04, 0x57, 0x4f, 0x05, 0x0f, 0x66, 0x0b, 0xb2, 0xe8, 0xa1, 0xc4, 0x9e, 0x7a, 0x09, 0x93, - 0x64, 0x9a, 0x0e, 0x4d, 0x32, 0xe3, 0xcc, 0x74, 0xb1, 0x6f, 0xe0, 0x51, 0xf0, 0xea, 0xc1, 0xc7, - 0xe9, 0xb1, 0x47, 0x4f, 0x41, 0xb2, 0x6f, 0xb0, 0x4f, 0x20, 0x9b, 0x99, 0xd8, 0xe8, 0x66, 0xbd, - 0x85, 0xfc, 0x3e, 0xdf, 0x3f, 0x7c, 0x19, 0xcd, 0x49, 0x21, 0x2b, 0x30, 0xf3, 0x09, 0xc5, 0xe7, - 0x28, 0x87, 0xcc, 0x5f, 0x4c, 0xfd, 0x0c, 0x96, 0x90, 0x21, 0xe6, 0x11, 0x8a, 0x39, 0xd6, 0x75, - 0x41, 0x78, 0x2d, 0xe1, 0x2d, 0xa6, 0xe6, 0x38, 0xc3, 0x19, 0x6e, 0xce, 0xfe, 0xfa, 0x4b, 0x90, - 0xe6, 0xb3, 0x1e, 0xaf, 0x02, 0xa7, 0x30, 0x67, 0x11, 0x01, 0x14, 0x14, 0xd2, 0xd1, 0x3c, 0xf8, - 0x0f, 0x27, 0x7e, 0x49, 0xf0, 0x70, 0x3b, 0x98, 0x72, 0x90, 0x45, 0x14, 0x7e, 0xba, 0x82, 0x8c, - 0xb7, 0xbe, 0x2f, 0xb6, 0xe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GenesisState) Marshal() (dAtA []byte, err error) { @@ -124,6 +124,23 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.IBCPortID) > 0 { + i -= len(m.IBCPortID) + copy(dAtA[i:], m.IBCPortID) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.IBCPortID))) + i-- + dAtA[i] = 0x22 + } if len(m.ApplicationLinks) > 0 { for iNdEx := len(m.ApplicationLinks) - 1; iNdEx >= 0; iNdEx-- { { @@ -135,7 +152,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x1a } } if len(m.ChainLinks) > 0 { @@ -149,26 +166,9 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 - } - } - if len(m.IBCPortID) > 0 { - i -= len(m.IBCPortID) - copy(dAtA[i:], m.IBCPortID) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.IBCPortID))) - i-- - dAtA[i] = 0x1a - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + dAtA[i] = 0x12 } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x12 if len(m.DTagTransferRequests) > 0 { for iNdEx := len(m.DTagTransferRequests) - 1; iNdEx >= 0; iNdEx-- { { @@ -209,12 +209,6 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = len(m.IBCPortID) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } if len(m.ChainLinks) > 0 { for _, e := range m.ChainLinks { l = e.Size() @@ -227,6 +221,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + l = len(m.IBCPortID) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } @@ -301,7 +301,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainLinks", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -328,15 +328,16 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ChainLinks = append(m.ChainLinks, ChainLink{}) + if err := m.ChainLinks[len(m.ChainLinks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IBCPortID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ApplicationLinks", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -346,29 +347,31 @@ func (m *GenesisState) 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 ErrInvalidLengthGenesis } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - m.IBCPortID = string(dAtA[iNdEx:postIndex]) + m.ApplicationLinks = append(m.ApplicationLinks, ApplicationLink{}) + if err := m.ApplicationLinks[len(m.ApplicationLinks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainLinks", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IBCPortID", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -378,29 +381,27 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenesis } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainLinks = append(m.ChainLinks, ChainLink{}) - if err := m.ChainLinks[len(m.ChainLinks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.IBCPortID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApplicationLinks", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -427,8 +428,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ApplicationLinks = append(m.ApplicationLinks, ApplicationLink{}) - if err := m.ApplicationLinks[len(m.ApplicationLinks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/profiles/types/models_app_links.pb.go b/x/profiles/types/models_app_links.pb.go index 957c3be460..8c0ea2787e 100644 --- a/x/profiles/types/models_app_links.pb.go +++ b/x/profiles/types/models_app_links.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/models_app_links.proto +// source: desmos/profiles/v3/models_app_links.proto package types @@ -65,7 +65,7 @@ func (x ApplicationLinkState) String() string { } func (ApplicationLinkState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{0} + return fileDescriptor_e02d86ea3253bfd9, []int{0} } // ApplicationLink contains the data of a link to a centralized application @@ -75,7 +75,7 @@ type ApplicationLink struct { // Data contains the details of this specific link Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data" yaml:"data"` // State of the link - State ApplicationLinkState `protobuf:"varint,3,opt,name=state,proto3,enum=desmos.profiles.v2.ApplicationLinkState" json:"state,omitempty" yaml:"state"` + State ApplicationLinkState `protobuf:"varint,3,opt,name=state,proto3,enum=desmos.profiles.v3.ApplicationLinkState" json:"state,omitempty" yaml:"state"` // OracleRequest represents the request that has been made to the oracle OracleRequest OracleRequest `protobuf:"bytes,4,opt,name=oracle_request,json=oracleRequest,proto3" json:"oracle_request" yaml:"oracle_request"` // Data coming from the result of the verification. @@ -89,7 +89,7 @@ func (m *ApplicationLink) Reset() { *m = ApplicationLink{} } func (m *ApplicationLink) String() string { return proto.CompactTextString(m) } func (*ApplicationLink) ProtoMessage() {} func (*ApplicationLink) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{0} + return fileDescriptor_e02d86ea3253bfd9, []int{0} } func (m *ApplicationLink) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -131,7 +131,7 @@ func (m *Data) Reset() { *m = Data{} } func (m *Data) String() string { return proto.CompactTextString(m) } func (*Data) ProtoMessage() {} func (*Data) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{1} + return fileDescriptor_e02d86ea3253bfd9, []int{1} } func (m *Data) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -177,7 +177,7 @@ func (m *OracleRequest) Reset() { *m = OracleRequest{} } func (m *OracleRequest) String() string { return proto.CompactTextString(m) } func (*OracleRequest) ProtoMessage() {} func (*OracleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{2} + return fileDescriptor_e02d86ea3253bfd9, []int{2} } func (m *OracleRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -220,7 +220,7 @@ func (m *OracleRequest_CallData) Reset() { *m = OracleRequest_CallData{} func (m *OracleRequest_CallData) String() string { return proto.CompactTextString(m) } func (*OracleRequest_CallData) ProtoMessage() {} func (*OracleRequest_CallData) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{2, 0} + return fileDescriptor_e02d86ea3253bfd9, []int{2, 0} } func (m *OracleRequest_CallData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -278,7 +278,7 @@ func (m *Result) Reset() { *m = Result{} } func (m *Result) String() string { return proto.CompactTextString(m) } func (*Result) ProtoMessage() {} func (*Result) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{3} + return fileDescriptor_e02d86ea3253bfd9, []int{3} } func (m *Result) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -366,7 +366,7 @@ func (m *Result_Success) Reset() { *m = Result_Success{} } func (m *Result_Success) String() string { return proto.CompactTextString(m) } func (*Result_Success) ProtoMessage() {} func (*Result_Success) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{3, 0} + return fileDescriptor_e02d86ea3253bfd9, []int{3, 0} } func (m *Result_Success) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -406,7 +406,7 @@ func (m *Result_Failed) Reset() { *m = Result_Failed{} } func (m *Result_Failed) String() string { return proto.CompactTextString(m) } func (*Result_Failed) ProtoMessage() {} func (*Result_Failed) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{3, 1} + return fileDescriptor_e02d86ea3253bfd9, []int{3, 1} } func (m *Result_Failed) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -436,82 +436,82 @@ func (m *Result_Failed) XXX_DiscardUnknown() { var xxx_messageInfo_Result_Failed proto.InternalMessageInfo func init() { - proto.RegisterEnum("desmos.profiles.v2.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) - proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.v2.ApplicationLink") - proto.RegisterType((*Data)(nil), "desmos.profiles.v2.Data") - proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.v2.OracleRequest") - proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.v2.OracleRequest.CallData") - proto.RegisterType((*Result)(nil), "desmos.profiles.v2.Result") - proto.RegisterType((*Result_Success)(nil), "desmos.profiles.v2.Result.Success") - proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.v2.Result.Failed") + proto.RegisterEnum("desmos.profiles.v3.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) + proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.v3.ApplicationLink") + proto.RegisterType((*Data)(nil), "desmos.profiles.v3.Data") + proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.v3.OracleRequest") + proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.v3.OracleRequest.CallData") + proto.RegisterType((*Result)(nil), "desmos.profiles.v3.Result") + proto.RegisterType((*Result_Success)(nil), "desmos.profiles.v3.Result.Success") + proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.v3.Result.Failed") } func init() { - proto.RegisterFile("desmos/profiles/v2/models_app_links.proto", fileDescriptor_c4a613de86d4edc0) + proto.RegisterFile("desmos/profiles/v3/models_app_links.proto", fileDescriptor_e02d86ea3253bfd9) } -var fileDescriptor_c4a613de86d4edc0 = []byte{ +var fileDescriptor_e02d86ea3253bfd9 = []byte{ // 961 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6e, 0xdb, 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x0e, 0x49, 0x50, 0xe7, 0x24, 0x6e, 0xbf, 0xaa, 0x6d, 0x4d, - 0x13, 0x71, 0xfd, 0x39, 0x1e, 0x7a, 0x07, 0x72, 0x7a, 0x2a, 0x23, 0x5a, 0x84, 0x2d, 0xc0, 0x3b, - 0x38, 0xc2, 0xf5, 0xa2, 0xc4, 0xed, 0xaf, 0x37, 0xeb, 0xca, 0x4d, 0x4b, 0x4a, 0x07, 0x47, 0x58, - 0xdb, 0x7e, 0x9d, 0x88, 0x85, 0xb9, 0x44, 0xca, 0x91, 0x11, 0xa5, 0xc2, 0x1e, 0x58, 0x0b, 0x23, - 0x1c, 0x91, 0x7a, 0x49, 0xe2, 0xf6, 0x37, 0x9b, 0xfb, 0xcb, 0x34, 0xfe, 0xe5, 0xad, 0x9f, 0xe2, - 0xb5, 0xda, 0x34, 0x11, 0x6f, 0x33, 0x3d, 0x2a, 0x20, 0x23, 0x26, 0x04, 0x07, 0x60, 0xd3, 0x0f, - 0xb0, 0xed, 0x11, 0x2b, 0x20, 0x3f, 0xc4, 0x24, 0x8c, 0xea, 0x3c, 0xb5, 0xb7, 0xbb, 0x4c, 0xba, - 0x4b, 0x91, 0x88, 0x01, 0xb5, 0x3b, 0x99, 0xcf, 0xff, 0x33, 0xdd, 0xeb, 0x32, 0x32, 0xda, 0xf0, - 0x17, 0xd1, 0x50, 0x07, 0xe5, 0x80, 0x84, 0xb1, 0x17, 0xd5, 0xd7, 0x68, 0x03, 0x61, 0x59, 0x03, - 0x44, 0x11, 0xda, 0xff, 0xa6, 0x89, 0xb8, 0xc1, 0x54, 0x19, 0x47, 0x46, 0x19, 0x19, 0x62, 0xb0, - 0x61, 0x07, 0x84, 0xde, 0xce, 0x4a, 0x93, 0xa9, 0x97, 0x33, 0x35, 0x16, 0x9b, 0x92, 0xc7, 0xa6, - 0x98, 0x79, 0x6c, 0x9a, 0x94, 0xf9, 0xdc, 0x61, 0x8a, 0xd7, 0xe8, 0xf2, 0xcb, 0xbf, 0x44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7, 0x7a, 0xfe, 0x85, 0xfa, 0xe3, 0xfc, 0x6f, 0x3d, 0x7a, 0x3e, 0x26, 0xe1, 0x69, 0x99, - 0x3e, 0xed, 0x9f, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x98, 0xb6, 0x49, 0xf6, 0x07, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xbf, 0x6f, 0xdb, 0x46, + 0x18, 0x15, 0x25, 0x5a, 0x91, 0xce, 0xb1, 0xad, 0x9e, 0xdd, 0x56, 0x20, 0x10, 0x91, 0xa6, 0x8b, + 0xc2, 0x49, 0x11, 0x12, 0xb1, 0x3b, 0x14, 0x2e, 0x5a, 0x40, 0x94, 0x68, 0x84, 0x8d, 0x6b, 0x09, + 0x27, 0x3a, 0x01, 0xb2, 0x10, 0x67, 0xf2, 0xac, 0x12, 0xa1, 0x44, 0x95, 0x3f, 0x8c, 0xa6, 0x45, + 0xf7, 0xc0, 0x53, 0xfe, 0x01, 0x03, 0x01, 0xfa, 0x4f, 0x74, 0xeb, 0xd0, 0x25, 0x63, 0xc6, 0x4e, + 0x6c, 0x21, 0x2f, 0x99, 0xf5, 0x17, 0x14, 0xbc, 0x23, 0x25, 0xb9, 0x96, 0x92, 0x00, 0xdd, 0xa8, + 0xfb, 0xde, 0x7b, 0xdf, 0xbb, 0xef, 0x7d, 0x38, 0x81, 0xbb, 0x0e, 0x09, 0x07, 0x7e, 0xa8, 0x8e, + 0x02, 0xff, 0xcc, 0xf5, 0x48, 0xa8, 0x9e, 0xef, 0xab, 0x03, 0xdf, 0x21, 0x5e, 0x68, 0xe1, 0xd1, + 0xc8, 0xf2, 0xdc, 0xe1, 0xb3, 0x50, 0x19, 0x05, 0x7e, 0xe4, 0x43, 0xc8, 0xa0, 0x4a, 0x0e, 0x55, + 0xce, 0xf7, 0x85, 0xad, 0xbe, 0xdf, 0xf7, 0x69, 0x59, 0x4d,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, 0x20, + 0x8a, 0xd0, 0x3e, 0x9a, 0x24, 0xe2, 0x1a, 0x53, 0x65, 0x1c, 0x19, 0x65, 0x64, 0x88, 0xc1, 0x9a, + 0x1d, 0x10, 0x7a, 0x3b, 0x2b, 0x4d, 0xa6, 0x5e, 0xce, 0xd4, 0x58, 0x6c, 0x4a, 0x1e, 0x9b, 0x62, + 0xe6, 0xb1, 0x69, 0x52, 0xe6, 0x73, 0x8b, 0x29, 0x5e, 0xa3, 0xcb, 0x2f, 0xff, 0x16, 0x39, 0x74, + 0x3b, 0x3f, 0x4b, 0x49, 0x07, 0x95, 0x17, 0xaf, 0xc4, 0xc2, 0xdb, 0x57, 0x22, 0x27, 0xff, 0x02, + 0xf8, 0x34, 0x11, 0xf8, 0x15, 0x58, 0xc5, 0xb3, 0xa9, 0x66, 0x29, 0x7f, 0x32, 0x49, 0x44, 0xc8, + 0x24, 0xe7, 0x8a, 0x32, 0x9a, 0x87, 0x42, 0x15, 0x54, 0xd2, 0xec, 0x87, 0x78, 0x40, 0x68, 0xee, + 0x55, 0x6d, 0x73, 0x92, 0x88, 0x1b, 0xb3, 0xe5, 0x48, 0x2b, 0x32, 0x9a, 0x82, 0xe6, 0x9a, 0xff, + 0x5e, 0x02, 0x6b, 0xd7, 0x06, 0x0e, 0x77, 0x40, 0xd1, 0x75, 0x68, 0x77, 0x5e, 0xdb, 0x1c, 0x27, + 0x62, 0xd1, 0x68, 0x4f, 0x12, 0xb1, 0xca, 0xc4, 0x5c, 0x47, 0x46, 0x45, 0xd7, 0x81, 0x4f, 0x40, + 0x2d, 0x4b, 0x22, 0xb4, 0x03, 0x77, 0x14, 0x59, 0xae, 0x43, 0x3b, 0xf3, 0xda, 0xfd, 0x71, 0x22, + 0xae, 0x33, 0xc5, 0x1e, 0x2d, 0x51, 0xfa, 0xa7, 0xd7, 0xd2, 0x9b, 0x72, 0x64, 0x94, 0xed, 0x45, + 0x06, 0x75, 0x20, 0x06, 0x55, 0x1b, 0x7b, 0x9e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da, 0xa3, 0xd7, 0xe3, 0x06, 0xf7, 0x66, 0xdc, 0xe0, 0xfe, 0x19, + 0x37, 0xb8, 0x97, 0x57, 0x8d, 0xc2, 0x9b, 0xab, 0x46, 0xe1, 0xaf, 0xab, 0x46, 0xe1, 0xe9, 0x83, + 0xbe, 0x1b, 0xfd, 0x10, 0x9f, 0x2a, 0xb6, 0x3f, 0x50, 0xd9, 0x42, 0xdf, 0xf7, 0xf0, 0x69, 0x98, + 0x7d, 0xab, 0xe7, 0x5f, 0xaa, 0x3f, 0xcd, 0xfe, 0xd6, 0xa3, 0xe7, 0x23, 0x12, 0x9e, 0x96, 0xe9, + 0xd3, 0xbe, 0xff, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x70, 0xf8, 0x96, 0xed, 0xf6, 0x07, 0x00, 0x00, } diff --git a/x/profiles/types/models_chain_links.pb.go b/x/profiles/types/models_chain_links.pb.go index 6f7bb4e608..0ff5906b89 100644 --- a/x/profiles/types/models_chain_links.pb.go +++ b/x/profiles/types/models_chain_links.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/models_chain_links.proto +// source: desmos/profiles/v3/models_chain_links.proto package types @@ -52,7 +52,7 @@ func (m *ChainLink) Reset() { *m = ChainLink{} } func (m *ChainLink) String() string { return proto.CompactTextString(m) } func (*ChainLink) ProtoMessage() {} func (*ChainLink) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{0} + return fileDescriptor_29bee920e792da29, []int{0} } func (m *ChainLink) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -90,7 +90,7 @@ func (m *ChainConfig) Reset() { *m = ChainConfig{} } func (m *ChainConfig) String() string { return proto.CompactTextString(m) } func (*ChainConfig) ProtoMessage() {} func (*ChainConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{1} + return fileDescriptor_29bee920e792da29, []int{1} } func (m *ChainConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -136,7 +136,7 @@ func (m *Proof) Reset() { *m = Proof{} } func (m *Proof) String() string { return proto.CompactTextString(m) } func (*Proof) ProtoMessage() {} func (*Proof) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{2} + return fileDescriptor_29bee920e792da29, []int{2} } func (m *Proof) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -177,7 +177,7 @@ func (m *Bech32Address) Reset() { *m = Bech32Address{} } func (m *Bech32Address) String() string { return proto.CompactTextString(m) } func (*Bech32Address) ProtoMessage() {} func (*Bech32Address) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{3} + return fileDescriptor_29bee920e792da29, []int{3} } func (m *Bech32Address) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -216,7 +216,7 @@ func (m *Base58Address) Reset() { *m = Base58Address{} } func (m *Base58Address) String() string { return proto.CompactTextString(m) } func (*Base58Address) ProtoMessage() {} func (*Base58Address) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{4} + return fileDescriptor_29bee920e792da29, []int{4} } func (m *Base58Address) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -259,7 +259,7 @@ func (m *HexAddress) Reset() { *m = HexAddress{} } func (m *HexAddress) String() string { return proto.CompactTextString(m) } func (*HexAddress) ProtoMessage() {} func (*HexAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{5} + return fileDescriptor_29bee920e792da29, []int{5} } func (m *HexAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -300,7 +300,7 @@ func (m *SingleSignatureData) Reset() { *m = SingleSignatureData{} } func (m *SingleSignatureData) String() string { return proto.CompactTextString(m) } func (*SingleSignatureData) ProtoMessage() {} func (*SingleSignatureData) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{6} + return fileDescriptor_29bee920e792da29, []int{6} } func (m *SingleSignatureData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -341,7 +341,7 @@ func (m *MultiSignatureData) Reset() { *m = MultiSignatureData{} } func (m *MultiSignatureData) String() string { return proto.CompactTextString(m) } func (*MultiSignatureData) ProtoMessage() {} func (*MultiSignatureData) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{7} + return fileDescriptor_29bee920e792da29, []int{7} } func (m *MultiSignatureData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -371,25 +371,25 @@ func (m *MultiSignatureData) XXX_DiscardUnknown() { var xxx_messageInfo_MultiSignatureData proto.InternalMessageInfo func init() { - proto.RegisterType((*ChainLink)(nil), "desmos.profiles.v2.ChainLink") - proto.RegisterType((*ChainConfig)(nil), "desmos.profiles.v2.ChainConfig") - proto.RegisterType((*Proof)(nil), "desmos.profiles.v2.Proof") - proto.RegisterType((*Bech32Address)(nil), "desmos.profiles.v2.Bech32Address") - proto.RegisterType((*Base58Address)(nil), "desmos.profiles.v2.Base58Address") - proto.RegisterType((*HexAddress)(nil), "desmos.profiles.v2.HexAddress") - proto.RegisterType((*SingleSignatureData)(nil), "desmos.profiles.v2.SingleSignatureData") - proto.RegisterType((*MultiSignatureData)(nil), "desmos.profiles.v2.MultiSignatureData") + proto.RegisterType((*ChainLink)(nil), "desmos.profiles.v3.ChainLink") + proto.RegisterType((*ChainConfig)(nil), "desmos.profiles.v3.ChainConfig") + proto.RegisterType((*Proof)(nil), "desmos.profiles.v3.Proof") + proto.RegisterType((*Bech32Address)(nil), "desmos.profiles.v3.Bech32Address") + proto.RegisterType((*Base58Address)(nil), "desmos.profiles.v3.Base58Address") + proto.RegisterType((*HexAddress)(nil), "desmos.profiles.v3.HexAddress") + proto.RegisterType((*SingleSignatureData)(nil), "desmos.profiles.v3.SingleSignatureData") + proto.RegisterType((*MultiSignatureData)(nil), "desmos.profiles.v3.MultiSignatureData") } func init() { - proto.RegisterFile("desmos/profiles/v2/models_chain_links.proto", fileDescriptor_1deb25c5b4df9624) + proto.RegisterFile("desmos/profiles/v3/models_chain_links.proto", fileDescriptor_29bee920e792da29) } -var fileDescriptor_1deb25c5b4df9624 = []byte{ +var fileDescriptor_29bee920e792da29 = []byte{ // 793 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x4d, 0x4f, 0xeb, 0x46, 0x14, 0x8d, 0x0b, 0x81, 0x66, 0x92, 0x50, 0x18, 0x52, 0x29, 0x40, 0x15, 0x53, 0x23, 0xb5, 0x54, - 0x15, 0xb6, 0x08, 0x54, 0xad, 0xb2, 0x6a, 0x4c, 0x2b, 0x21, 0x01, 0x52, 0x6b, 0x58, 0x75, 0x13, + 0x15, 0xb6, 0x20, 0x54, 0xad, 0xb2, 0x6a, 0x4c, 0x2b, 0x21, 0x01, 0x52, 0x6b, 0x58, 0x75, 0x13, 0x8d, 0x9d, 0x89, 0x19, 0x61, 0x7b, 0x2c, 0x7b, 0x1c, 0x25, 0x52, 0xa5, 0x2e, 0xdb, 0x25, 0xcb, 0x2e, 0xba, 0xe0, 0x3f, 0xb4, 0x3f, 0x02, 0x75, 0x85, 0xba, 0x62, 0x95, 0x56, 0xb0, 0xe9, 0x3a, 0xbf, 0xe0, 0x69, 0x3e, 0x9c, 0x84, 0xf0, 0x40, 0x7a, 0xab, 0xb7, 0xf3, 0xdc, 0x7b, 0xce, 0x99, @@ -404,39 +404,39 @@ var fileDescriptor_1deb25c5b4df9624 = []byte{ 0xf8, 0x63, 0x01, 0x94, 0x8e, 0x78, 0xb9, 0xa7, 0x24, 0xba, 0x82, 0x3b, 0x60, 0x31, 0x4b, 0x71, 0x52, 0xd7, 0xb6, 0xb5, 0xdd, 0x92, 0xfd, 0xd1, 0x78, 0xa4, 0x97, 0x87, 0x28, 0x0c, 0x5a, 0x06, 0x8f, 0x1a, 0x8e, 0x48, 0xc2, 0x1f, 0xc1, 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4f, 0xe6, 0x67, 0xa6, 0x32, 0x33, 0x07, 0xad, 0x0d, + 0xee, 0x45, 0xf9, 0xa8, 0x3e, 0xb9, 0xd1, 0xf8, 0x53, 0x03, 0xf0, 0x8c, 0x6f, 0xab, 0xa7, 0x46, + 0x4e, 0x41, 0xc9, 0x25, 0xac, 0x83, 0x92, 0x04, 0xe5, 0x83, 0x6c, 0xe5, 0x6e, 0xe4, 0xd2, 0x33, + 0x27, 0x3b, 0x2e, 0xb7, 0x74, 0x44, 0xc3, 0x18, 0x79, 0xcc, 0x26, 0xac, 0xcd, 0x69, 0xce, 0x87, + 0xae, 0xfa, 0xe2, 0x73, 0x38, 0x31, 0xc3, 0xf7, 0xd9, 0xc2, 0x4b, 0x23, 0xed, 0xcc, 0xe0, 0x5e, + 0x71, 0x6d, 0x9f, 0xdc, 0x3e, 0x34, 0xb4, 0xbb, 0x87, 0x86, 0xf6, 0xdf, 0x43, 0x43, 0xbb, 0x7e, + 0x6c, 0x14, 0xee, 0x1e, 0x1b, 0x85, 0xfb, 0xc7, 0x46, 0xe1, 0xa7, 0x7d, 0x9f, 0xb0, 0xcb, 0xcc, + 0x35, 0x3d, 0x1a, 0x5a, 0x72, 0x23, 0xed, 0x05, 0xc8, 0x4d, 0xd5, 0xb7, 0xd5, 0x3f, 0xb4, 0x06, + 0xd3, 0x9f, 0x11, 0x1b, 0xc6, 0x38, 0x75, 0x97, 0x84, 0x83, 0xe6, 0x9b, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x32, 0xbc, 0x6e, 0x9d, 0xac, 0x06, 0x00, 0x00, } func (this *ChainLink) Equal(that interface{}) bool { diff --git a/x/profiles/types/models_dtag_requests.pb.go b/x/profiles/types/models_dtag_requests.pb.go index 646a367ef9..4751d14be2 100644 --- a/x/profiles/types/models_dtag_requests.pb.go +++ b/x/profiles/types/models_dtag_requests.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/models_dtag_requests.proto +// source: desmos/profiles/v3/models_dtag_requests.proto package types @@ -42,7 +42,7 @@ func (m *DTagTransferRequest) Reset() { *m = DTagTransferRequest{} } func (m *DTagTransferRequest) String() string { return proto.CompactTextString(m) } func (*DTagTransferRequest) ProtoMessage() {} func (*DTagTransferRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3722cfac854d7654, []int{0} + return fileDescriptor_3ee5a4443f48e795, []int{0} } func (m *DTagTransferRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -72,37 +72,37 @@ func (m *DTagTransferRequest) XXX_DiscardUnknown() { var xxx_messageInfo_DTagTransferRequest proto.InternalMessageInfo func init() { - proto.RegisterType((*DTagTransferRequest)(nil), "desmos.profiles.v2.DTagTransferRequest") + proto.RegisterType((*DTagTransferRequest)(nil), "desmos.profiles.v3.DTagTransferRequest") } func init() { - proto.RegisterFile("desmos/profiles/v2/models_dtag_requests.proto", fileDescriptor_3722cfac854d7654) + proto.RegisterFile("desmos/profiles/v3/models_dtag_requests.proto", fileDescriptor_3ee5a4443f48e795) } -var fileDescriptor_3722cfac854d7654 = []byte{ +var fileDescriptor_3ee5a4443f48e795 = []byte{ // 355 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xb1, 0x4e, 0xe3, 0x40, - 0x10, 0x86, 0xbd, 0x77, 0x52, 0x74, 0xe7, 0x5c, 0x74, 0xc2, 0x49, 0x11, 0x52, 0x78, 0x91, 0x1b, - 0x40, 0x28, 0x5e, 0x11, 0xa8, 0x52, 0x46, 0x74, 0xe9, 0xac, 0x54, 0x34, 0xd6, 0xda, 0x9e, 0x38, - 0x16, 0xb6, 0xd7, 0xec, 0x6e, 0x2c, 0xf2, 0x06, 0x94, 0x94, 0x94, 0x79, 0x1c, 0x0a, 0x8a, 0x94, - 0x54, 0x16, 0x72, 0x1a, 0xea, 0x3c, 0x01, 0xb2, 0xd7, 0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10, 0xfd, 0x0f, 0x07, 0x1f, 0xa2, 0x1c, 0x78, 0xff, 0x77, 0x0d, 0x77, 0x77, 0x05, 0xfe, 0xaf, - 0xe0, 0xbd, 0x63, 0x39, 0x1f, 0xd0, 0xf8, 0xdf, 0xfd, 0x1a, 0x6b, 0x8f, 0x6b, 0x8c, 0xde, 0xd6, - 0x18, 0x4d, 0xa6, 0x4f, 0xa5, 0x89, 0x36, 0xa5, 0x89, 0x5e, 0x4b, 0x13, 0x3d, 0x6c, 0x4d, 0x6d, - 0xb3, 0x35, 0xb5, 0x97, 0xad, 0xa9, 0x5d, 0x9f, 0x87, 0x91, 0x5c, 0x2c, 0x3d, 0xdb, 0x67, 0x09, - 0x51, 0x01, 0x0d, 0x63, 0xea, 0x89, 0xa6, 0x26, 0xf9, 0x25, 0xb9, 0xfb, 0x4c, 0x4c, 0xae, 0x32, - 0x10, 0x5e, 0xab, 0x8e, 0xe8, 0xe2, 0x3d, 0x00, 0x00, 0xff, 0xff, 0x25, 0xaf, 0x47, 0x40, 0x01, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xb1, 0x4e, 0xeb, 0x30, + 0x14, 0x86, 0xe3, 0x7b, 0xa5, 0xea, 0xde, 0x94, 0x0a, 0x91, 0x76, 0x28, 0x1d, 0x62, 0x94, 0x05, + 0x10, 0x6a, 0x2c, 0x54, 0xa6, 0x8e, 0x15, 0x5b, 0xb7, 0xa8, 0x13, 0x4b, 0xe4, 0x24, 0xa7, 0x69, + 0x44, 0x12, 0x07, 0xdb, 0x8d, 0xe8, 0x1b, 0x30, 0x32, 0x32, 0xf6, 0x71, 0x18, 0x18, 0x3a, 0x32, + 0x45, 0x28, 0x5d, 0x98, 0xfb, 0x04, 0x28, 0x71, 0x0a, 0x02, 0x89, 0xed, 0xfc, 0xe7, 0xff, 0xce, + 0xb1, 0xcf, 0xaf, 0x0f, 0x03, 0x10, 0x09, 0x13, 0x24, 0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+ 0xef, 0x1d, 0xcb, 0xf9, 0x84, 0xc6, 0x07, 0x0f, 0x6b, 0xac, 0x3d, 0xad, 0x31, 0x7a, 0x5f, 0x63, + 0x34, 0x99, 0x3e, 0x97, 0x26, 0xda, 0x94, 0x26, 0x7a, 0x2b, 0x4d, 0xf4, 0xb8, 0x35, 0xb5, 0xcd, + 0xd6, 0xd4, 0x5e, 0xb7, 0xa6, 0x76, 0x73, 0x19, 0x46, 0x72, 0xb1, 0xf4, 0x6c, 0x9f, 0x25, 0x44, + 0x05, 0x34, 0x8c, 0xa9, 0x27, 0x9a, 0x9a, 0xe4, 0x57, 0xe4, 0xfe, 0x2b, 0x31, 0xb9, 0xca, 0x40, + 0x78, 0xad, 0x3a, 0xa2, 0xd1, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, 0x23, 0x2c, 0x3c, 0x01, 0x02, 0x00, 0x00, } diff --git a/x/profiles/types/models_packets.pb.go b/x/profiles/types/models_packets.pb.go index 5c777a7b39..4515d41f91 100644 --- a/x/profiles/types/models_packets.pb.go +++ b/x/profiles/types/models_packets.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/models_packets.proto +// source: desmos/profiles/v3/models_packets.proto package types @@ -46,7 +46,7 @@ func (m *LinkChainAccountPacketData) Reset() { *m = LinkChainAccountPack func (m *LinkChainAccountPacketData) String() string { return proto.CompactTextString(m) } func (*LinkChainAccountPacketData) ProtoMessage() {} func (*LinkChainAccountPacketData) Descriptor() ([]byte, []int) { - return fileDescriptor_7b1a8c7a3fceacd2, []int{0} + return fileDescriptor_ecd3778626d03f03, []int{0} } func (m *LinkChainAccountPacketData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -86,7 +86,7 @@ func (m *LinkChainAccountPacketAck) Reset() { *m = LinkChainAccountPacke func (m *LinkChainAccountPacketAck) String() string { return proto.CompactTextString(m) } func (*LinkChainAccountPacketAck) ProtoMessage() {} func (*LinkChainAccountPacketAck) Descriptor() ([]byte, []int) { - return fileDescriptor_7b1a8c7a3fceacd2, []int{1} + return fileDescriptor_ecd3778626d03f03, []int{1} } func (m *LinkChainAccountPacketAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -116,19 +116,19 @@ func (m *LinkChainAccountPacketAck) XXX_DiscardUnknown() { var xxx_messageInfo_LinkChainAccountPacketAck proto.InternalMessageInfo func init() { - proto.RegisterType((*LinkChainAccountPacketData)(nil), "desmos.profiles.v2.LinkChainAccountPacketData") - proto.RegisterType((*LinkChainAccountPacketAck)(nil), "desmos.profiles.v2.LinkChainAccountPacketAck") + proto.RegisterType((*LinkChainAccountPacketData)(nil), "desmos.profiles.v3.LinkChainAccountPacketData") + proto.RegisterType((*LinkChainAccountPacketAck)(nil), "desmos.profiles.v3.LinkChainAccountPacketAck") } func init() { - proto.RegisterFile("desmos/profiles/v2/models_packets.proto", fileDescriptor_7b1a8c7a3fceacd2) + proto.RegisterFile("desmos/profiles/v3/models_packets.proto", fileDescriptor_ecd3778626d03f03) } -var fileDescriptor_7b1a8c7a3fceacd2 = []byte{ +var fileDescriptor_ecd3778626d03f03 = []byte{ // 462 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x41, 0x8e, 0xd3, 0x30, 0x14, 0x4d, 0xa0, 0x20, 0x4d, 0x0a, 0x88, 0x49, 0x07, 0xa9, 0x2d, 0x52, 0x52, 0x45, 0x42, 0x54, - 0x42, 0x63, 0x8b, 0xc2, 0x6a, 0x76, 0xcd, 0xb0, 0x40, 0x02, 0x89, 0x51, 0x77, 0xb0, 0xa9, 0x5c, + 0x42, 0x63, 0x0b, 0xca, 0x6a, 0x76, 0xcd, 0xb0, 0x40, 0x02, 0x89, 0x51, 0x77, 0xb0, 0xa9, 0x5c, 0xc7, 0x4d, 0xad, 0xa6, 0xfe, 0x51, 0xec, 0x56, 0xf4, 0x06, 0x2c, 0x59, 0x70, 0x00, 0x0e, 0xc1, 0x21, 0x46, 0xac, 0x66, 0xc9, 0xaa, 0x42, 0xed, 0x0d, 0xe6, 0x04, 0x28, 0xb6, 0xcb, 0xa4, 0xb4, 0x68, 0x76, 0xfe, 0xff, 0xbd, 0xf7, 0xdf, 0xcf, 0xcb, 0xf7, 0x9e, 0x27, 0x4c, 0xce, 0x40, 0xe2, @@ -139,22 +139,22 @@ var fileDescriptor_7b1a8c7a3fceacd2 = []byte{ 0x5f, 0x84, 0x4e, 0x08, 0x17, 0xc3, 0x8c, 0x8b, 0xa9, 0x25, 0x47, 0xdf, 0x6a, 0x5e, 0xfb, 0x3d, 0x17, 0xd3, 0xf3, 0x12, 0xe9, 0x53, 0x0a, 0x73, 0xa1, 0x2e, 0xf4, 0xba, 0x6f, 0x88, 0x22, 0x3e, 0xf3, 0x1e, 0x49, 0x98, 0x17, 0x94, 0x0d, 0x49, 0x92, 0x14, 0x4c, 0xca, 0xa6, 0xdb, 0x71, 0xbb, - 0xf5, 0xde, 0x09, 0x32, 0xab, 0xa1, 0xed, 0x6a, 0xa8, 0x2f, 0x96, 0x71, 0xf7, 0x7a, 0x15, 0x3e, - 0x59, 0x92, 0x59, 0x76, 0x16, 0xed, 0xaa, 0xa2, 0x9f, 0x3f, 0x4e, 0xeb, 0x7d, 0xf3, 0x2e, 0xe7, - 0x0e, 0x1e, 0x1a, 0xdc, 0xb6, 0xfc, 0x8f, 0xde, 0x03, 0x2b, 0xc8, 0x0b, 0x80, 0x71, 0xf3, 0x8e, - 0x36, 0x69, 0xa1, 0xfd, 0xa4, 0xd0, 0x45, 0x49, 0x88, 0x9f, 0x5e, 0xae, 0x42, 0xe7, 0x7a, 0x15, - 0x36, 0x76, 0xdc, 0xb4, 0x38, 0x1a, 0xd4, 0x4d, 0xa9, 0x99, 0xbe, 0xf4, 0x1a, 0x16, 0x35, 0x1f, - 0x4f, 0x41, 0x8c, 0x79, 0xda, 0xbc, 0xab, 0x1d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, 0xaf, 0x03, 0xf7, 0xeb, 0x26, 0x70, 0xae, 0x36, 0x81, 0xf3, 0x6b, 0x13, 0x38, 0x9f, + 0x5e, 0xa6, 0x5c, 0x4d, 0xe6, 0x23, 0x44, 0x61, 0x86, 0xcd, 0x27, 0x9c, 0x66, 0x64, 0x24, 0xed, + 0x1b, 0x2f, 0x5e, 0xe3, 0xcf, 0x37, 0x37, 0xac, 0x96, 0x39, 0x93, 0xa3, 0xfb, 0xfa, 0xdc, 0x7a, + 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x12, 0xb2, 0x30, 0x23, 0x6c, 0x03, 0x00, 0x00, } func (m *LinkChainAccountPacketData) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/models_params.pb.go b/x/profiles/types/models_params.pb.go index dba5e08833..e5bcd2fef2 100644 --- a/x/profiles/types/models_params.pb.go +++ b/x/profiles/types/models_params.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/models_params.proto +// source: desmos/profiles/v3/models_params.proto package types @@ -9,15 +9,19 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -31,13 +35,14 @@ type Params struct { DTag DTagParams `protobuf:"bytes,2,opt,name=dtag,proto3" json:"dtag" yaml:"dtag"` Bio BioParams `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio" yaml:"bio"` Oracle OracleParams `protobuf:"bytes,4,opt,name=oracle,proto3" json:"oracle" yaml:"oracle"` + AppLinks AppLinksParams `protobuf:"bytes,5,opt,name=app_links,json=appLinks,proto3" json:"app_links" yaml:"app_links"` } func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_1b093f5fee9c9f7d, []int{0} + return fileDescriptor_924c89959f3aa975, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -76,7 +81,7 @@ func (m *NicknameParams) Reset() { *m = NicknameParams{} } func (m *NicknameParams) String() string { return proto.CompactTextString(m) } func (*NicknameParams) ProtoMessage() {} func (*NicknameParams) Descriptor() ([]byte, []int) { - return fileDescriptor_1b093f5fee9c9f7d, []int{1} + return fileDescriptor_924c89959f3aa975, []int{1} } func (m *NicknameParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -116,7 +121,7 @@ func (m *DTagParams) Reset() { *m = DTagParams{} } func (m *DTagParams) String() string { return proto.CompactTextString(m) } func (*DTagParams) ProtoMessage() {} func (*DTagParams) Descriptor() ([]byte, []int) { - return fileDescriptor_1b093f5fee9c9f7d, []int{2} + return fileDescriptor_924c89959f3aa975, []int{2} } func (m *DTagParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -154,7 +159,7 @@ func (m *BioParams) Reset() { *m = BioParams{} } func (m *BioParams) String() string { return proto.CompactTextString(m) } func (*BioParams) ProtoMessage() {} func (*BioParams) Descriptor() ([]byte, []int) { - return fileDescriptor_1b093f5fee9c9f7d, []int{3} + return fileDescriptor_924c89959f3aa975, []int{3} } func (m *BioParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -210,7 +215,7 @@ func (m *OracleParams) Reset() { *m = OracleParams{} } func (m *OracleParams) String() string { return proto.CompactTextString(m) } func (*OracleParams) ProtoMessage() {} func (*OracleParams) Descriptor() ([]byte, []int) { - return fileDescriptor_1b093f5fee9c9f7d, []int{4} + return fileDescriptor_924c89959f3aa975, []int{4} } func (m *OracleParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -239,64 +244,111 @@ func (m *OracleParams) XXX_DiscardUnknown() { var xxx_messageInfo_OracleParams proto.InternalMessageInfo +// AppLinksParams define the parameters related to the app links +type AppLinksParams struct { + // ExpirationTime indicates the max amount of time before a link expires + ExpirationTime time.Duration `protobuf:"bytes,1,opt,name=expiration_time,json=expirationTime,proto3,stdduration" json:"expiration_time" yaml:"expiration_time"` +} + +func (m *AppLinksParams) Reset() { *m = AppLinksParams{} } +func (m *AppLinksParams) String() string { return proto.CompactTextString(m) } +func (*AppLinksParams) ProtoMessage() {} +func (*AppLinksParams) Descriptor() ([]byte, []int) { + return fileDescriptor_924c89959f3aa975, []int{5} +} +func (m *AppLinksParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AppLinksParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AppLinksParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AppLinksParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_AppLinksParams.Merge(m, src) +} +func (m *AppLinksParams) XXX_Size() int { + return m.Size() +} +func (m *AppLinksParams) XXX_DiscardUnknown() { + xxx_messageInfo_AppLinksParams.DiscardUnknown(m) +} + +var xxx_messageInfo_AppLinksParams proto.InternalMessageInfo + func init() { - proto.RegisterType((*Params)(nil), "desmos.profiles.v2.Params") - proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.v2.NicknameParams") - proto.RegisterType((*DTagParams)(nil), "desmos.profiles.v2.DTagParams") - proto.RegisterType((*BioParams)(nil), "desmos.profiles.v2.BioParams") - proto.RegisterType((*OracleParams)(nil), "desmos.profiles.v2.OracleParams") + proto.RegisterType((*Params)(nil), "desmos.profiles.v3.Params") + proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.v3.NicknameParams") + proto.RegisterType((*DTagParams)(nil), "desmos.profiles.v3.DTagParams") + proto.RegisterType((*BioParams)(nil), "desmos.profiles.v3.BioParams") + proto.RegisterType((*OracleParams)(nil), "desmos.profiles.v3.OracleParams") + proto.RegisterType((*AppLinksParams)(nil), "desmos.profiles.v3.AppLinksParams") } func init() { - proto.RegisterFile("desmos/profiles/v2/models_params.proto", fileDescriptor_1b093f5fee9c9f7d) + proto.RegisterFile("desmos/profiles/v3/models_params.proto", fileDescriptor_924c89959f3aa975) } -var fileDescriptor_1b093f5fee9c9f7d = []byte{ - // 697 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xd3, 0x4c, - 0x14, 0xc7, 0x93, 0xd8, 0x8d, 0xe2, 0x49, 0xbf, 0x0f, 0x6a, 0x15, 0x08, 0x45, 0xd8, 0xd1, 0x2c, - 0xaa, 0x6c, 0x6a, 0x2b, 0x01, 0x09, 0xa9, 0x12, 0x0b, 0x9c, 0x56, 0xa8, 0xe2, 0xd2, 0xca, 0x20, - 0x21, 0xb1, 0xb1, 0xc6, 0xce, 0xd4, 0xb5, 0x12, 0x7b, 0x2c, 0x8f, 0x13, 0xa5, 0x2b, 0xb6, 0x2c, - 0x79, 0x02, 0xc4, 0x1a, 0xf1, 0x20, 0x5d, 0xa1, 0x2e, 0x11, 0x0b, 0x83, 0xd2, 0x37, 0xc8, 0x13, - 0xa0, 0xb9, 0xe4, 0xd2, 0x52, 0x89, 0x02, 0x62, 0x95, 0xe3, 0x39, 0xe7, 0xff, 0x3b, 0x33, 0xe7, - 0x6f, 0x4f, 0xc0, 0x66, 0x0f, 0xd3, 0x98, 0x50, 0x3b, 0xcd, 0xc8, 0x61, 0x34, 0xc0, 0xd4, 0x1e, - 0x75, 0xec, 0x98, 0xf4, 0xf0, 0x80, 0x7a, 0x29, 0xca, 0x50, 0x4c, 0xad, 0x34, 0x23, 0x39, 0xd1, - 0x75, 0x51, 0x67, 0xcd, 0xea, 0xac, 0x51, 0x67, 0x63, 0x3d, 0x24, 0x21, 0xe1, 0x69, 0x9b, 0x45, - 0xa2, 0x72, 0xc3, 0x08, 0x08, 0x27, 0xfa, 0x88, 0x62, 0x7b, 0xd4, 0xf6, 0x71, 0x8e, 0xda, 0x76, - 0x40, 0xa2, 0x44, 0xe4, 0xe1, 0xe7, 0x0a, 0xa8, 0x1e, 0x70, 0xb4, 0xfe, 0x0a, 0xd4, 0x92, 0x28, - 0xe8, 0x27, 0x28, 0xc6, 0x8d, 0x72, 0xb3, 0xdc, 0xaa, 0x77, 0xa0, 0xf5, 0x73, 0x1f, 0xeb, 0xb9, - 0xac, 0x11, 0x2a, 0xe7, 0xd6, 0x49, 0x61, 0x96, 0xa6, 0x85, 0x79, 0xed, 0x18, 0xc5, 0x83, 0x6d, - 0x38, 0x23, 0x40, 0x77, 0x0e, 0xd3, 0xf7, 0x81, 0xda, 0xcb, 0x51, 0xd8, 0xa8, 0x70, 0xa8, 0x71, - 0x19, 0x74, 0xe7, 0x25, 0x0a, 0x25, 0xf0, 0x0e, 0x03, 0x4e, 0x0a, 0x53, 0x65, 0x6b, 0xd3, 0xc2, - 0xac, 0x0b, 0x30, 0x23, 0x40, 0x97, 0x83, 0xf4, 0x2e, 0x50, 0xfc, 0x88, 0x34, 0x14, 0xce, 0xbb, - 0x7b, 0x19, 0xcf, 0x89, 0x88, 0xc4, 0xe9, 0x72, 0x7f, 0x40, 0x60, 0xfc, 0x88, 0x40, 0x97, 0xa9, - 0xf5, 0x7d, 0x50, 0x25, 0x19, 0x0a, 0x06, 0xb8, 0xa1, 0x72, 0x4e, 0xf3, 0x32, 0xce, 0x3e, 0xaf, - 0x90, 0xa8, 0x1b, 0x12, 0xf5, 0x9f, 0x40, 0x09, 0x35, 0x74, 0x25, 0x66, 0x5b, 0x7d, 0xfb, 0xc1, - 0x2c, 0xc1, 0xa2, 0x0c, 0xfe, 0x3f, 0x3f, 0x22, 0xdd, 0x07,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 0xbc, 0xd7, - 0xd3, 0xdb, 0x40, 0x43, 0xb4, 0xef, 0x05, 0x64, 0x98, 0xe4, 0xdc, 0x2d, 0xd5, 0x59, 0x5f, 0x48, - 0xe6, 0x29, 0xe8, 0xd6, 0x10, 0xed, 0x77, 0x59, 0xc8, 0x24, 0xcc, 0x0a, 0x21, 0x51, 0x2e, 0x4a, - 0xe6, 0x29, 0xe8, 0xd6, 0xe2, 0x28, 0x11, 0x92, 0x07, 0xa0, 0x9e, 0x66, 0x38, 0x45, 0x19, 0xf6, - 0x42, 0x44, 0xf9, 0xa7, 0xa8, 0x3a, 0x37, 0xa7, 0x85, 0xa9, 0x0b, 0xd1, 0x52, 0x12, 0xba, 0x40, - 0x3e, 0x3d, 0x46, 0x94, 0x09, 0xf1, 0x18, 0x07, 0xc3, 0x5c, 0x08, 0x57, 0x2e, 0x0a, 0x97, 0x92, - 0xd0, 0x05, 0xf2, 0x89, 0x09, 0xdf, 0x00, 0x70, 0x88, 0xb1, 0x87, 0x62, 0xbe, 0xcb, 0x6a, 0x53, - 0x69, 0xd5, 0x3b, 0xb7, 0x2d, 0x31, 0x78, 0x8b, 0x5d, 0x93, 0x96, 0xbc, 0x26, 0xad, 0x2e, 0x89, - 0x12, 0x67, 0x57, 0x7e, 0xf4, 0xd2, 0x82, 0x85, 0x14, 0x7e, 0xfc, 0x66, 0xb6, 0xae, 0xe0, 0x20, - 0xa3, 0x50, 0x57, 0x3b, 0xc4, 0xf8, 0x11, 0xd7, 0x09, 0xbb, 0x9c, 0x27, 0x27, 0x13, 0xa3, 0x7c, - 0x3a, 0x31, 0xca, 0xdf, 0x27, 0x46, 0xf9, 0xdd, 0x99, 0x51, 0x3a, 0x3d, 0x33, 0x4a, 0x5f, 0xce, - 0x8c, 0xd2, 0xeb, 0xf6, 0x12, 0x54, 0x5c, 0x49, 0x5b, 0x03, 0xe4, 0x53, 0x19, 0xdb, 0xa3, 0xfb, - 0xf6, 0x78, 0xf1, 0x07, 0xc1, 0x7b, 0xf8, 0x55, 0x7e, 0x99, 0xdf, 0xfb, 0x11, 0x00, 0x00, 0xff, - 0xff, 0xfb, 0x86, 0xa5, 0xb7, 0x40, 0x06, 0x00, 0x00, +var fileDescriptor_924c89959f3aa975 = []byte{ + // 801 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcd, 0x6e, 0xeb, 0x44, + 0x14, 0xc7, 0x93, 0x3a, 0x8d, 0xe2, 0xc9, 0xa5, 0x97, 0x6b, 0x5d, 0x2e, 0xb9, 0x17, 0x61, 0x47, + 0xb3, 0xa8, 0xb2, 0xa9, 0xad, 0xb4, 0x48, 0x48, 0x95, 0x58, 0xd4, 0x69, 0x85, 0x2a, 0x0a, 0xad, + 0x4c, 0x25, 0x04, 0x1b, 0x6b, 0xec, 0x4c, 0xdc, 0x51, 0x6c, 0x8f, 0xe5, 0x71, 0xa2, 0x74, 0x03, + 0x5b, 0x96, 0x2c, 0x59, 0x21, 0xb6, 0x20, 0x1e, 0xa4, 0xcb, 0x2e, 0x11, 0x0b, 0x17, 0xa5, 0x6f, + 0x90, 0x27, 0x40, 0xf3, 0xe1, 0x7c, 0x94, 0x22, 0x0a, 0x88, 0x95, 0xc7, 0x73, 0xce, 0xff, 0x77, + 0xce, 0x9c, 0x33, 0x1f, 0x60, 0x77, 0x88, 0x59, 0x42, 0x99, 0x93, 0xe5, 0x74, 0x44, 0x62, 0xcc, + 0x9c, 0xe9, 0x81, 0x93, 0xd0, 0x21, 0x8e, 0x99, 0x9f, 0xa1, 0x1c, 0x25, 0xcc, 0xce, 0x72, 0x5a, + 0x50, 0xc3, 0x90, 0x7e, 0x76, 0xe5, 0x67, 0x4f, 0x0f, 0xde, 0xbc, 0x8c, 0x68, 0x44, 0x85, 0xd9, + 0xe1, 0x23, 0xe9, 0xf9, 0xc6, 0x0c, 0xa9, 0x20, 0x06, 0x88, 0x61, 0x67, 0xda, 0x0f, 0x70, 0x81, + 0xfa, 0x4e, 0x48, 0x49, 0x5a, 0xd9, 0x23, 0x4a, 0xa3, 0x18, 0x3b, 0xe2, 0x2f, 0x98, 0x8c, 0x9c, + 0xe1, 0x24, 0x47, 0x05, 0xa1, 0xca, 0x0e, 0x7f, 0xd2, 0x40, 0xf3, 0x42, 0x84, 0x36, 0xbe, 0x00, + 0xad, 0x94, 0x84, 0xe3, 0x14, 0x25, 0xb8, 0x53, 0xef, 0xd6, 0x7b, 0xed, 0x7d, 0x68, 0xff, 0x39, + 0x0f, 0xfb, 0x33, 0xe5, 0x23, 0x55, 0xee, 0xbb, 0x37, 0xa5, 0x55, 0x5b, 0x94, 0xd6, 0xf3, 0x6b, + 0x94, 0xc4, 0x87, 0xb0, 0x22, 0x40, 0x6f, 0x09, 0x33, 0xce, 0x41, 0x63, 0x58, 0xa0, 0xa8, 0xb3, + 0x25, 0xa0, 0xe6, 0x63, 0xd0, 0xe3, 0x4b, 0x14, 0x29, 0xe0, 0x7b, 0x1c, 0x38, 0x2f, 0xad, 0x06, + 0x9f, 0x5b, 0x94, 0x56, 0x5b, 0x82, 0x39, 0x01, 0x7a, 0x02, 0x64, 0x0c, 0x80, 0x16, 0x10, 0xda, + 0xd1, 0x04, 0xef, 0xfd, 0xc7, 0x78, 0x2e, 0xa1, 0x0a, 0x67, 0xa8, 0xfc, 0x80, 0xc4, 0x04, 0x84, + 0x42, 0x8f, 0xab, 0x8d, 0x73, 0xd0, 0xa4, 0x39, 0x0a, 0x63, 0xdc, 0x69, 0x08, 0x4e, 0xf7, 0x31, + 0xce, 0xb9, 0xf0, 0x50, 0xa8, 0x77, 0x14, 0xea, 0x2d, 0x89, 0x92, 0x6a, 0xe8, 0x29, 0x8c, 0xf1, + 0x25, 0xd0, 0x51, 0x96, 0xf9, 0x31, 0x49, 0xc7, 0xac, 0xb3, 0xfd, 0xd7, 0x05, 0x3c, 0xca, 0xb2, + 0x33, 0xee, 0xa3, 0xa8, 0x1d, 0x45, 0x7d, 0x5b, 0x52, 0x97, 0x08, 0xe8, 0xb5, 0x90, 0xf2, 0x3c, + 0x6c, 0x7c, 0xfb, 0xa3, 0x55, 0x83, 0x65, 0x1d, 0xec, 0x6c, 0x56, 0xdf, 0x08, 0x00, 0x48, 0x48, + 0xea, 0xc7, 0x38, 0x8d, 0x8a, 0x2b, 0xd1, 0xb5, 0x67, 0xee, 0x80, 0x03, 0x7f, 0x2b, 0xad, 0xdd, + 0x88, 0x14, 0x57, 0x93, 0xc0, 0x0e, 0x69, 0xe2, 0xa8, 0x5d, 0x22, 0x3f, 0x7b, 0x6c, 0x38, 0x76, + 0x8a, 0xeb, 0x0c, 0x33, 0xfb, 0x34, 0x2d, 0x16, 0xa5, 0xf5, 0x42, 0x86, 0x5e, 0x91, 0xa0, 0xa7, + 0x27, 0x24, 0x3d, 0x13, 0x63, 0x11, 0x03, 0xcd, 0xaa, 0x18, 0x5b, 0xff, 0x31, 0xc6, 0x92, 0xc4, + 0x63, 0xa0, 0x99, 0x8c, 0xa1, 0x16, 0xf8, 0xc3, 0x16, 0x00, 0xab, 0x9d, 0x60, 0xf4, 0x40, 0x33, + 0xc7, 0x91, 0x8f, 0x67, 0x62, 0x61, 0xba, 0xfb, 0x62, 0x55, 0x7b, 0x39, 0x0f, 0xbd, 0xed, 0x1c, + 0x47, 0x27, 0x33, 0x83, 0x6e, 0x94, 0x41, 0xa6, 0x78, 0xf1, 0xcf, 0x52, 0x9c, 0x97, 0x96, 0xfe, + 0x69, 0xb5, 0xe6, 0xbf, 0xad, 0x09, 0xdd, 0xa8, 0x89, 0xf6, 0xaf, 0x03, 0x56, 0x05, 0x78, 0x62, + 0x81, 0x26, 0x40, 0x5f, 0xee, 0xec, 0x07, 0x7d, 0xd1, 0xfe, 0xc7, 0xbe, 0xfc, 0xa2, 0x81, 0x67, + 0xeb, 0x27, 0xc1, 0xf8, 0x08, 0xe8, 0x2c, 0xcc, 0x49, 0x56, 0xf8, 0x64, 0x28, 0x9a, 0x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, 0x07, 0xbb, 0x7a, 0x1f, 0xec, 0x63, 0xf5, 0x3e, 0xb8, 0x50, 0x65, 0xf7, + 0xaa, 0x5a, 0xf4, 0x86, 0x1e, 0x7e, 0x7f, 0x67, 0xd5, 0xbd, 0x9d, 0xd5, 0xec, 0x25, 0x49, 0xb0, + 0x8c, 0xef, 0x7e, 0x72, 0x33, 0x37, 0xeb, 0xb7, 0x73, 0xb3, 0xfe, 0xfb, 0xdc, 0xac, 0x7f, 0x77, + 0x6f, 0xd6, 0x6e, 0xef, 0xcd, 0xda, 0xaf, 0xf7, 0x66, 0xed, 0xab, 0xfe, 0xda, 0xa2, 0xe4, 0xcd, + 0xb8, 0x17, 0xa3, 0x80, 0xa9, 0xb1, 0x33, 0xfd, 0xc0, 0x99, 0xad, 0xde, 0x46, 0xb1, 0xc6, 0xa0, + 0x29, 0x32, 0x3b, 0xf8, 0x23, 0x00, 0x00, 0xff, 0xff, 0x05, 0xf3, 0x62, 0x02, 0x3b, 0x07, 0x00, + 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -319,6 +371,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.AppLinks.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a { size, err := m.Oracle.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -550,6 +612,37 @@ func (m *OracleParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *AppLinksParams) 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 *AppLinksParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AppLinksParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintModelsParams(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintModelsParams(dAtA []byte, offset int, v uint64) int { offset -= sovModelsParams(v) base := offset @@ -575,6 +668,8 @@ func (m *Params) Size() (n int) { n += 1 + l + sovModelsParams(uint64(l)) l = m.Oracle.Size() n += 1 + l + sovModelsParams(uint64(l)) + l = m.AppLinks.Size() + n += 1 + l + sovModelsParams(uint64(l)) return n } @@ -649,6 +744,17 @@ func (m *OracleParams) Size() (n int) { return n } +func (m *AppLinksParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime) + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + func sovModelsParams(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -816,6 +922,39 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppLinks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AppLinks.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipModelsParams(dAtA[iNdEx:]) @@ -1363,6 +1502,89 @@ func (m *OracleParams) Unmarshal(dAtA []byte) error { } return nil } +func (m *AppLinksParams) 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 ErrIntOverflowModelsParams + } + 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: AppLinksParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AppLinksParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipModelsParams(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/profiles/types/models_profile.pb.go b/x/profiles/types/models_profile.pb.go index f75eecf8f7..9dec791f16 100644 --- a/x/profiles/types/models_profile.pb.go +++ b/x/profiles/types/models_profile.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/models_profile.proto +// source: desmos/profiles/v3/models_profile.proto package types @@ -49,7 +49,7 @@ type Profile struct { func (m *Profile) Reset() { *m = Profile{} } func (*Profile) ProtoMessage() {} func (*Profile) Descriptor() ([]byte, []int) { - return fileDescriptor_089dd63594c4b06b, []int{0} + return fileDescriptor_0064ca3ec5b2e1f8, []int{0} } func (m *Profile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -90,7 +90,7 @@ func (m *Pictures) Reset() { *m = Pictures{} } func (m *Pictures) String() string { return proto.CompactTextString(m) } func (*Pictures) ProtoMessage() {} func (*Pictures) Descriptor() ([]byte, []int) { - return fileDescriptor_089dd63594c4b06b, []int{1} + return fileDescriptor_0064ca3ec5b2e1f8, []int{1} } func (m *Pictures) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -134,48 +134,47 @@ func (m *Pictures) GetCover() string { } func init() { - proto.RegisterType((*Profile)(nil), "desmos.profiles.v2.Profile") - proto.RegisterType((*Pictures)(nil), "desmos.profiles.v2.Pictures") + proto.RegisterType((*Profile)(nil), "desmos.profiles.v3.Profile") + proto.RegisterType((*Pictures)(nil), "desmos.profiles.v3.Pictures") } func init() { - proto.RegisterFile("desmos/profiles/v2/models_profile.proto", fileDescriptor_089dd63594c4b06b) + proto.RegisterFile("desmos/profiles/v3/models_profile.proto", fileDescriptor_0064ca3ec5b2e1f8) } -var fileDescriptor_089dd63594c4b06b = []byte{ - // 497 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0x6d, 0x9a, 0x36, 0xee, 0x35, 0x14, 0x74, 0x44, 0xaa, 0x89, 0x90, 0x2f, 0xba, 0x01, - 0x2a, 0x95, 0xfa, 0x44, 0x60, 0x8a, 0x58, 0x6a, 0x75, 0x41, 0x2c, 0xc5, 0xea, 0xc4, 0x12, 0x9d, - 0x9d, 0xab, 0x7b, 0xd4, 0xf6, 0x45, 0xf1, 0x25, 0x22, 0x9f, 0x00, 0xc6, 0x8e, 0x1d, 0xf3, 0x21, - 0xf8, 0x10, 0x15, 0x53, 0x47, 0x26, 0x83, 0x92, 0x85, 0xd9, 0x9f, 0x00, 0xd9, 0x77, 0xd7, 0x0a, - 0x2a, 0x36, 0xdf, 0xfb, 0xff, 0xde, 0xff, 0xfd, 0xf5, 0x9e, 0xc1, 0x8b, 0x31, 0x2b, 0x32, 0x51, - 0x90, 0xc9, 0x54, 0x9c, 0xf1, 0x94, 0x15, 0x64, 0x3e, 0x20, 0x99, 0x18, 0xb3, 0xb4, 0x18, 0xe9, - 0x92, 0x3f, 0x99, 0x0a, 0x29, 0x20, 0x54, 0xa0, 0x6f, 0x40, 0x7f, 0x3e, 0xe8, 0x75, 0x13, 0x91, - 0x88, 0x46, 0x26, 0xf5, 0x97, 0x22, 0x7b, 0x4f, 0x13, 0x21, 0x92, 0x94, 0x91, 0xe6, 0x15, 0xcd, - 0xce, 0x08, 0xcd, 0x17, 0x5a, 0x42, 0xff, 0x4a, 0x92, 0x67, 0xac, 0x90, 0x34, 0x9b, 0x98, 0xde, - 0x58, 0xd4, 0x53, 0x46, 0xca, 0x54, 0x3d, 0xb4, 0x74, 0xf0, 0xff, 0xa4, 0xf1, 0x39, 0xe5, 0xf9, - 0x28, 0xe5, 0xf9, 0x85, 0x86, 0xf1, 0x97, 0x0d, 0xd0, 0x3e, 0x51, 0x20, 0x7c, 0x0b, 0xda, 0x34, - 0x8e, 0xc5, 0x2c, 0x97, 0xae, 0xdd, 0xb7, 0xf7, 0x77, 0x06, 0x5d, 0x5f, 0xc5, 0xf0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, 0x80, 0x55, 0x89, 0x76, 0x75, 0x50, 0x25, 0xe0, 0xd0, 0x20, 0xf0, - 0x39, 0xd8, 0x8c, 0xc5, 0x9c, 0x4d, 0xf5, 0xea, 0x1f, 0x57, 0x25, 0xea, 0xe8, 0xf1, 0x75, 0x19, - 0x87, 0x4a, 0x1e, 0x3a, 0x57, 0x4b, 0x64, 0xff, 0x5e, 0x22, 0x3b, 0x78, 0x7f, 0xbd, 0xf2, 0xec, - 0x9b, 0x95, 0x67, 0xff, 0x5a, 0x79, 0xf6, 0xe5, 0xda, 0xb3, 0x6e, 0xd6, 0x9e, 0xf5, 0x63, 0xed, - 0x59, 0x1f, 0x5f, 0x25, 0x5c, 0x9e, 0xcf, 0x22, 0x3f, 0x16, 0x19, 0x51, 0xdb, 0x3b, 0x4c, 0x69, - 0x54, 0xe8, 0x6f, 0x32, 0x7f, 0x43, 0x3e, 0xdf, 0xfd, 0x58, 0x72, 0x31, 0x61, 0x45, 0xb4, 0xd5, - 0xac, 0xe1, 0xf5, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xe4, 0xad, 0x2b, 0x22, 0x03, 0x00, - 0x00, +var fileDescriptor_0064ca3ec5b2e1f8 = []byte{ + // 482 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0xb1, 0x6e, 0xd3, 0x40, + 0x1c, 0xc6, 0x6d, 0x92, 0x36, 0xee, 0x35, 0x14, 0x74, 0x44, 0xaa, 0x89, 0x90, 0x2f, 0xba, 0x01, + 0x2a, 0x41, 0x7d, 0x82, 0x30, 0x45, 0x2c, 0xb5, 0xba, 0x20, 0x96, 0x62, 0x75, 0x62, 0x89, 0xce, + 0xce, 0xd5, 0x18, 0x6c, 0x9f, 0x65, 0x5f, 0x22, 0xf2, 0x04, 0x30, 0x76, 0xec, 0x98, 0x87, 0xe0, + 0x21, 0x2a, 0xa6, 0x8e, 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0x1b, 0xc7, 0xf8, 0xf0, 0x32, 0x8a, 0xc5, 0xc7, 0x79, 0xe0, 0x86, 0x3c, 0x25, 0xb2, 0xbd, 0xe3, + 0x84, 0x06, 0xa5, 0x3a, 0x93, 0xc5, 0x6b, 0xf2, 0xe5, 0xee, 0xaf, 0x16, 0xcb, 0x9c, 0x95, 0xc1, + 0x6e, 0x5b, 0xc3, 0xf8, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4d, 0xaf, 0x27, 0x90, 0xf5, 0x02, + 0x00, 0x00, } func (this *Pictures) Equal(that interface{}) bool { diff --git a/x/profiles/types/msg_server.pb.go b/x/profiles/types/msg_server.pb.go index 3a5de974ab..9d1f30e42d 100644 --- a/x/profiles/types/msg_server.pb.go +++ b/x/profiles/types/msg_server.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/msg_server.proto +// source: desmos/profiles/v3/msg_server.proto package types @@ -29,41 +29,41 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { - proto.RegisterFile("desmos/profiles/v2/msg_server.proto", fileDescriptor_c2fd53889ce3d02c) + proto.RegisterFile("desmos/profiles/v3/msg_server.proto", fileDescriptor_869194438e2ecf0d) } -var fileDescriptor_c2fd53889ce3d02c = []byte{ +var fileDescriptor_869194438e2ecf0d = []byte{ // 477 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xcf, 0x6e, 0xd3, 0x30, 0x1c, 0xc7, 0x5b, 0x21, 0x21, 0x61, 0x84, 0x00, 0xc3, 0x65, 0x3e, 0xe4, 0xc0, 0xbf, 0x31, 0x60, - 0xf1, 0x56, 0x38, 0x70, 0x2d, 0xdb, 0x0d, 0x26, 0xa1, 0x32, 0x2e, 0x48, 0xa8, 0x72, 0xdd, 0x5f, - 0xbd, 0x68, 0xae, 0x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d, 0xde, 0xe3, 0x53, 0x2b, + 0x6a, 0x0c, 0x79, 0xf1, 0x7f, 0x66, 0x00, 0xd6, 0x68, 0x65, 0x01, 0x73, 0x74, 0xe7, 0x04, 0x24, + 0xb8, 0x2a, 0xe0, 0x49, 0x40, 0xbc, 0x42, 0x91, 0x57, 0x6d, 0xa8, 0x2a, 0x24, 0x43, 0x0f, 0x06, + 0xfe, 0xc6, 0x4e, 0xce, 0x98, 0x38, 0x4b, 0x99, 0xb2, 0x13, 0x48, 0x71, 0xa8, 0x67, 0x03, 0x4b, + 0x8e, 0xda, 0xb3, 0x55, 0xec, 0xf7, 0x2e, 0xda, 0x39, 0x66, 0x8a, 0x83, 0x5c, 0x1d, 0x97, 0x0a, + 0x7c, 0x10, 0x70, 0x0c, 0x2a, 0xc8, 0x9b, 0x6d, 0x15, 0x2b, 0x4d, 0xfa, 0x9c, 0x83, 0x71, 0xdb, + 0x34, 0x09, 0x2a, 0x82, 0x4d, 0x82, 0x8a, 0x95, 0x26, 0x03, 0x98, 0x64, 0x16, 0xb6, 0x69, 0x12, + 0x54, 0x04, 0x9b, 0x04, 0x15, 0x55, 0x13, 0x89, 0xee, 0xbd, 0x4f, 0xd4, 0xc5, 0x71, 0xf1, 0x8b, + 0xf4, 0x39, 0xd7, 0x99, 0x72, 0x78, 0x37, 0xe0, 0xb6, 0x0e, 0x12, 0xda, 0x12, 0xac, 0xd2, 0x52, + 0x84, 0x3f, 0x29, 0xb9, 0x9e, 0xb7, 0x17, 0xb0, 0xb9, 0x8e, 0x92, 0xc3, 0xd6, 0x68, 0x95, 0x99, + 0xa0, 0xbb, 0x45, 0x9f, 0xbe, 0x31, 0x32, 0xe1, 0xcc, 0x25, 0x5a, 0xe1, 0x67, 0x1b, 0x7a, 0xd7, + 0x38, 0x12, 0xb7, 0xe3, 0xaa, 0x28, 0x8d, 0xee, 0xfb, 0x22, 0xf5, 0xb0, 0xe7, 0x1b, 0x2b, 0xd7, + 0xe3, 0x0e, 0xda, 0x92, 0xcb, 0xc0, 0xb7, 0xef, 0x7e, 0xcd, 0xa2, 0xee, 0xd5, 0x2c, 0xea, 0xfe, + 0x99, 0x45, 0xdd, 0x1f, 0xf3, 0xa8, 0x73, 0x35, 0x8f, 0x3a, 0xbf, 0xe7, 0x51, 0xe7, 0xf3, 0xa1, + 0x48, 0xdc, 0x79, 0x36, 0x8a, 0xb9, 0x9e, 0x52, 0xef, 0xba, 0x2f, 0xd9, 0xc8, 0x2e, 0xd6, 0x34, + 0x7f, 0x4d, 0xbf, 0xfd, 0x7b, 0xfd, 0xdc, 0xa5, 0x01, 0x3b, 0xba, 0x59, 0x3e, 0x79, 0xbd, 0xbf, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x12, 0xeb, 0x12, 0x96, 0x79, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -117,7 +117,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) SaveProfile(ctx context.Context, in *MsgSaveProfile, opts ...grpc.CallOption) (*MsgSaveProfileResponse, error) { out := new(MsgSaveProfileResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/SaveProfile", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/SaveProfile", in, out, opts...) if err != nil { return nil, err } @@ -126,7 +126,7 @@ func (c *msgClient) SaveProfile(ctx context.Context, in *MsgSaveProfile, opts .. func (c *msgClient) DeleteProfile(ctx context.Context, in *MsgDeleteProfile, opts ...grpc.CallOption) (*MsgDeleteProfileResponse, error) { out := new(MsgDeleteProfileResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/DeleteProfile", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/DeleteProfile", in, out, opts...) if err != nil { return nil, err } @@ -135,7 +135,7 @@ func (c *msgClient) DeleteProfile(ctx context.Context, in *MsgDeleteProfile, opt func (c *msgClient) RequestDTagTransfer(ctx context.Context, in *MsgRequestDTagTransfer, opts ...grpc.CallOption) (*MsgRequestDTagTransferResponse, error) { out := new(MsgRequestDTagTransferResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/RequestDTagTransfer", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/RequestDTagTransfer", in, out, opts...) if err != nil { return nil, err } @@ -144,7 +144,7 @@ func (c *msgClient) RequestDTagTransfer(ctx context.Context, in *MsgRequestDTagT func (c *msgClient) CancelDTagTransferRequest(ctx context.Context, in *MsgCancelDTagTransferRequest, opts ...grpc.CallOption) (*MsgCancelDTagTransferRequestResponse, error) { out := new(MsgCancelDTagTransferRequestResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/CancelDTagTransferRequest", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/CancelDTagTransferRequest", in, out, opts...) if err != nil { return nil, err } @@ -153,7 +153,7 @@ func (c *msgClient) CancelDTagTransferRequest(ctx context.Context, in *MsgCancel func (c *msgClient) AcceptDTagTransferRequest(ctx context.Context, in *MsgAcceptDTagTransferRequest, opts ...grpc.CallOption) (*MsgAcceptDTagTransferRequestResponse, error) { out := new(MsgAcceptDTagTransferRequestResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/AcceptDTagTransferRequest", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/AcceptDTagTransferRequest", in, out, opts...) if err != nil { return nil, err } @@ -162,7 +162,7 @@ func (c *msgClient) AcceptDTagTransferRequest(ctx context.Context, in *MsgAccept func (c *msgClient) RefuseDTagTransferRequest(ctx context.Context, in *MsgRefuseDTagTransferRequest, opts ...grpc.CallOption) (*MsgRefuseDTagTransferRequestResponse, error) { out := new(MsgRefuseDTagTransferRequestResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/RefuseDTagTransferRequest", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/RefuseDTagTransferRequest", in, out, opts...) if err != nil { return nil, err } @@ -171,7 +171,7 @@ func (c *msgClient) RefuseDTagTransferRequest(ctx context.Context, in *MsgRefuse func (c *msgClient) LinkChainAccount(ctx context.Context, in *MsgLinkChainAccount, opts ...grpc.CallOption) (*MsgLinkChainAccountResponse, error) { out := new(MsgLinkChainAccountResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/LinkChainAccount", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/LinkChainAccount", in, out, opts...) if err != nil { return nil, err } @@ -180,7 +180,7 @@ func (c *msgClient) LinkChainAccount(ctx context.Context, in *MsgLinkChainAccoun func (c *msgClient) UnlinkChainAccount(ctx context.Context, in *MsgUnlinkChainAccount, opts ...grpc.CallOption) (*MsgUnlinkChainAccountResponse, error) { out := new(MsgUnlinkChainAccountResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/UnlinkChainAccount", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/UnlinkChainAccount", in, out, opts...) if err != nil { return nil, err } @@ -189,7 +189,7 @@ func (c *msgClient) UnlinkChainAccount(ctx context.Context, in *MsgUnlinkChainAc func (c *msgClient) LinkApplication(ctx context.Context, in *MsgLinkApplication, opts ...grpc.CallOption) (*MsgLinkApplicationResponse, error) { out := new(MsgLinkApplicationResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/LinkApplication", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/LinkApplication", in, out, opts...) if err != nil { return nil, err } @@ -198,7 +198,7 @@ func (c *msgClient) LinkApplication(ctx context.Context, in *MsgLinkApplication, func (c *msgClient) UnlinkApplication(ctx context.Context, in *MsgUnlinkApplication, opts ...grpc.CallOption) (*MsgUnlinkApplicationResponse, error) { out := new(MsgUnlinkApplicationResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/UnlinkApplication", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/UnlinkApplication", in, out, opts...) if err != nil { return nil, err } @@ -285,7 +285,7 @@ func _Msg_SaveProfile_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/SaveProfile", + FullMethod: "/desmos.profiles.v3.Msg/SaveProfile", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).SaveProfile(ctx, req.(*MsgSaveProfile)) @@ -303,7 +303,7 @@ func _Msg_DeleteProfile_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/DeleteProfile", + FullMethod: "/desmos.profiles.v3.Msg/DeleteProfile", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).DeleteProfile(ctx, req.(*MsgDeleteProfile)) @@ -321,7 +321,7 @@ func _Msg_RequestDTagTransfer_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/RequestDTagTransfer", + FullMethod: "/desmos.profiles.v3.Msg/RequestDTagTransfer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).RequestDTagTransfer(ctx, req.(*MsgRequestDTagTransfer)) @@ -339,7 +339,7 @@ func _Msg_CancelDTagTransferRequest_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/CancelDTagTransferRequest", + FullMethod: "/desmos.profiles.v3.Msg/CancelDTagTransferRequest", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).CancelDTagTransferRequest(ctx, req.(*MsgCancelDTagTransferRequest)) @@ -357,7 +357,7 @@ func _Msg_AcceptDTagTransferRequest_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/AcceptDTagTransferRequest", + FullMethod: "/desmos.profiles.v3.Msg/AcceptDTagTransferRequest", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).AcceptDTagTransferRequest(ctx, req.(*MsgAcceptDTagTransferRequest)) @@ -375,7 +375,7 @@ func _Msg_RefuseDTagTransferRequest_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/RefuseDTagTransferRequest", + FullMethod: "/desmos.profiles.v3.Msg/RefuseDTagTransferRequest", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).RefuseDTagTransferRequest(ctx, req.(*MsgRefuseDTagTransferRequest)) @@ -393,7 +393,7 @@ func _Msg_LinkChainAccount_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/LinkChainAccount", + FullMethod: "/desmos.profiles.v3.Msg/LinkChainAccount", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).LinkChainAccount(ctx, req.(*MsgLinkChainAccount)) @@ -411,7 +411,7 @@ func _Msg_UnlinkChainAccount_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/UnlinkChainAccount", + FullMethod: "/desmos.profiles.v3.Msg/UnlinkChainAccount", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).UnlinkChainAccount(ctx, req.(*MsgUnlinkChainAccount)) @@ -429,7 +429,7 @@ func _Msg_LinkApplication_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/LinkApplication", + FullMethod: "/desmos.profiles.v3.Msg/LinkApplication", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).LinkApplication(ctx, req.(*MsgLinkApplication)) @@ -447,7 +447,7 @@ func _Msg_UnlinkApplication_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/UnlinkApplication", + FullMethod: "/desmos.profiles.v3.Msg/UnlinkApplication", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).UnlinkApplication(ctx, req.(*MsgUnlinkApplication)) @@ -456,7 +456,7 @@ func _Msg_UnlinkApplication_Handler(srv interface{}, ctx context.Context, dec fu } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "desmos.profiles.v2.Msg", + ServiceName: "desmos.profiles.v3.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -501,5 +501,5 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "desmos/profiles/v2/msg_server.proto", + Metadata: "desmos/profiles/v3/msg_server.proto", } diff --git a/x/profiles/types/msgs_app_links.pb.go b/x/profiles/types/msgs_app_links.pb.go index 9e590db667..1aaf759a0d 100644 --- a/x/profiles/types/msgs_app_links.pb.go +++ b/x/profiles/types/msgs_app_links.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/msgs_app_links.proto +// source: desmos/profiles/v3/msgs_app_links.proto package types @@ -50,7 +50,7 @@ func (m *MsgLinkApplication) Reset() { *m = MsgLinkApplication{} } func (m *MsgLinkApplication) String() string { return proto.CompactTextString(m) } func (*MsgLinkApplication) ProtoMessage() {} func (*MsgLinkApplication) Descriptor() ([]byte, []int) { - return fileDescriptor_72bc9ee36626b76e, []int{0} + return fileDescriptor_29dfbdba444598ee, []int{0} } func (m *MsgLinkApplication) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -88,7 +88,7 @@ func (m *MsgLinkApplicationResponse) Reset() { *m = MsgLinkApplicationRe func (m *MsgLinkApplicationResponse) String() string { return proto.CompactTextString(m) } func (*MsgLinkApplicationResponse) ProtoMessage() {} func (*MsgLinkApplicationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_72bc9ee36626b76e, []int{1} + return fileDescriptor_29dfbdba444598ee, []int{1} } func (m *MsgLinkApplicationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -133,7 +133,7 @@ func (m *MsgUnlinkApplication) Reset() { *m = MsgUnlinkApplication{} } func (m *MsgUnlinkApplication) String() string { return proto.CompactTextString(m) } func (*MsgUnlinkApplication) ProtoMessage() {} func (*MsgUnlinkApplication) Descriptor() ([]byte, []int) { - return fileDescriptor_72bc9ee36626b76e, []int{2} + return fileDescriptor_29dfbdba444598ee, []int{2} } func (m *MsgUnlinkApplication) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -171,7 +171,7 @@ func (m *MsgUnlinkApplicationResponse) Reset() { *m = MsgUnlinkApplicati func (m *MsgUnlinkApplicationResponse) String() string { return proto.CompactTextString(m) } func (*MsgUnlinkApplicationResponse) ProtoMessage() {} func (*MsgUnlinkApplicationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_72bc9ee36626b76e, []int{3} + return fileDescriptor_29dfbdba444598ee, []int{3} } func (m *MsgUnlinkApplicationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -201,21 +201,21 @@ func (m *MsgUnlinkApplicationResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnlinkApplicationResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgLinkApplication)(nil), "desmos.profiles.v2.MsgLinkApplication") - proto.RegisterType((*MsgLinkApplicationResponse)(nil), "desmos.profiles.v2.MsgLinkApplicationResponse") - proto.RegisterType((*MsgUnlinkApplication)(nil), "desmos.profiles.v2.MsgUnlinkApplication") - proto.RegisterType((*MsgUnlinkApplicationResponse)(nil), "desmos.profiles.v2.MsgUnlinkApplicationResponse") + proto.RegisterType((*MsgLinkApplication)(nil), "desmos.profiles.v3.MsgLinkApplication") + proto.RegisterType((*MsgLinkApplicationResponse)(nil), "desmos.profiles.v3.MsgLinkApplicationResponse") + proto.RegisterType((*MsgUnlinkApplication)(nil), "desmos.profiles.v3.MsgUnlinkApplication") + proto.RegisterType((*MsgUnlinkApplicationResponse)(nil), "desmos.profiles.v3.MsgUnlinkApplicationResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/msgs_app_links.proto", fileDescriptor_72bc9ee36626b76e) + proto.RegisterFile("desmos/profiles/v3/msgs_app_links.proto", fileDescriptor_29dfbdba444598ee) } -var fileDescriptor_72bc9ee36626b76e = []byte{ +var fileDescriptor_29dfbdba444598ee = []byte{ // 559 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0x4f, 0x6f, 0xd3, 0x30, 0x1c, 0x4d, 0xd8, 0x18, 0xad, 0xa7, 0x8e, 0x2d, 0x14, 0x14, 0xaa, 0x92, 0x54, 0xbe, 0xd0, 0x1d, - 0x48, 0xd4, 0x82, 0x04, 0xda, 0x09, 0x02, 0x07, 0x10, 0x4c, 0xa0, 0x08, 0x2e, 0x5c, 0x8a, 0x9b, + 0x48, 0x54, 0x8a, 0x04, 0xda, 0x09, 0x02, 0x07, 0x10, 0x4c, 0xa0, 0x08, 0x2e, 0x5c, 0x8a, 0x9b, 0x9a, 0xd4, 0x5a, 0x62, 0x47, 0xb1, 0x5b, 0xb1, 0x6f, 0xc0, 0x91, 0x8f, 0xb0, 0x4f, 0xc1, 0x67, 0xd8, 0x71, 0x47, 0x4e, 0x11, 0x6a, 0x2f, 0x9c, 0x23, 0x71, 0x47, 0xb1, 0xdd, 0x7f, 0x74, 0xa7, 0x3c, 0xbf, 0xdf, 0x7b, 0xb6, 0x7f, 0xbf, 0x3c, 0x83, 0x87, 0x23, 0xcc, 0x53, 0xc6, 0xfd, 0x2c, @@ -226,28 +226,28 @@ var fileDescriptor_72bc9ee36626b76e = []byte{ 0x02, 0xf8, 0x77, 0x07, 0x58, 0xa7, 0x3c, 0x7e, 0x47, 0xe8, 0xd9, 0x8b, 0x2c, 0x4b, 0x48, 0x84, 0x04, 0x61, 0xd4, 0x3a, 0x06, 0x7b, 0x1c, 0xd3, 0x11, 0xce, 0x6d, 0xb3, 0x63, 0x76, 0xeb, 0xc1, 0x51, 0x59, 0xb8, 0x8d, 0x73, 0x94, 0x26, 0x27, 0x50, 0xf1, 0x30, 0xd4, 0x02, 0xeb, 0x3d, 0xa8, - 0x57, 0xf7, 0x18, 0x8c, 0x90, 0x40, 0xf6, 0x8d, 0x8e, 0xd9, 0xdd, 0xef, 0xdb, 0xde, 0x76, 0x2f, - 0xde, 0x2b, 0x24, 0x50, 0x60, 0x5f, 0x16, 0xae, 0x51, 0x16, 0xee, 0xa1, 0xda, 0x6b, 0x69, 0x84, - 0x61, 0xad, 0xc2, 0x95, 0xc6, 0xea, 0x81, 0x7a, 0x84, 0x92, 0x44, 0x6d, 0xb8, 0x23, 0x8f, 0x6f, - 0xae, 0x2c, 0xcb, 0x12, 0x0c, 0x6b, 0x15, 0x96, 0x96, 0xa7, 0x60, 0x9f, 0xb3, 0x49, 0x1e, 0xe1, - 0x41, 0xc6, 0x72, 0x61, 0xef, 0x4a, 0xd3, 0xbd, 0xb2, 0x70, 0x2d, 0x7d, 0xe7, 0x55, 0x11, 0x86, - 0x40, 0xad, 0x3e, 0xb0, 0x5c, 0x58, 0xcf, 0xc1, 0x81, 0xae, 0x45, 0x63, 0x44, 0x29, 0x4e, 0xec, - 0x9b, 0xd2, 0x7b, 0xbf, 0x2c, 0xdc, 0xbb, 0x1b, 0x5e, 0x5d, 0x87, 0x61, 0x43, 0x11, 0x2f, 0xd5, - 0xda, 0xfa, 0x02, 0x0e, 0x04, 0x49, 0x31, 0x9b, 0x88, 0xc1, 0x18, 0x93, 0x78, 0x2c, 0xec, 0x3d, - 0x39, 0x83, 0x96, 0x47, 0x86, 0x91, 0x57, 0x8d, 0xde, 0xd3, 0x03, 0x9f, 0xf6, 0xb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, + 0xfd, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xeb, 0xb6, 0x1b, 0xcb, 0xe3, 0x03, 0x00, 0x00, } func (m *MsgLinkApplication) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/msgs_chain_links.pb.go b/x/profiles/types/msgs_chain_links.pb.go index a5f56eadcc..d13b8469bf 100644 --- a/x/profiles/types/msgs_chain_links.pb.go +++ b/x/profiles/types/msgs_chain_links.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/msgs_chain_links.proto +// source: desmos/profiles/v3/msgs_chain_links.proto package types @@ -43,7 +43,7 @@ func (m *MsgLinkChainAccount) Reset() { *m = MsgLinkChainAccount{} } func (m *MsgLinkChainAccount) String() string { return proto.CompactTextString(m) } func (*MsgLinkChainAccount) ProtoMessage() {} func (*MsgLinkChainAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_d28c3718ad31f8ee, []int{0} + return fileDescriptor_52cd1f5b825f2f4e, []int{0} } func (m *MsgLinkChainAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -108,7 +108,7 @@ func (m *MsgLinkChainAccountResponse) Reset() { *m = MsgLinkChainAccount func (m *MsgLinkChainAccountResponse) String() string { return proto.CompactTextString(m) } func (*MsgLinkChainAccountResponse) ProtoMessage() {} func (*MsgLinkChainAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d28c3718ad31f8ee, []int{1} + return fileDescriptor_52cd1f5b825f2f4e, []int{1} } func (m *MsgLinkChainAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -153,7 +153,7 @@ func (m *MsgUnlinkChainAccount) Reset() { *m = MsgUnlinkChainAccount{} } func (m *MsgUnlinkChainAccount) String() string { return proto.CompactTextString(m) } func (*MsgUnlinkChainAccount) ProtoMessage() {} func (*MsgUnlinkChainAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_d28c3718ad31f8ee, []int{2} + return fileDescriptor_52cd1f5b825f2f4e, []int{2} } func (m *MsgUnlinkChainAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -211,7 +211,7 @@ func (m *MsgUnlinkChainAccountResponse) Reset() { *m = MsgUnlinkChainAcc func (m *MsgUnlinkChainAccountResponse) String() string { return proto.CompactTextString(m) } func (*MsgUnlinkChainAccountResponse) ProtoMessage() {} func (*MsgUnlinkChainAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d28c3718ad31f8ee, []int{3} + return fileDescriptor_52cd1f5b825f2f4e, []int{3} } func (m *MsgUnlinkChainAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -241,21 +241,21 @@ func (m *MsgUnlinkChainAccountResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnlinkChainAccountResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgLinkChainAccount)(nil), "desmos.profiles.v2.MsgLinkChainAccount") - proto.RegisterType((*MsgLinkChainAccountResponse)(nil), "desmos.profiles.v2.MsgLinkChainAccountResponse") - proto.RegisterType((*MsgUnlinkChainAccount)(nil), "desmos.profiles.v2.MsgUnlinkChainAccount") - proto.RegisterType((*MsgUnlinkChainAccountResponse)(nil), "desmos.profiles.v2.MsgUnlinkChainAccountResponse") + proto.RegisterType((*MsgLinkChainAccount)(nil), "desmos.profiles.v3.MsgLinkChainAccount") + proto.RegisterType((*MsgLinkChainAccountResponse)(nil), "desmos.profiles.v3.MsgLinkChainAccountResponse") + proto.RegisterType((*MsgUnlinkChainAccount)(nil), "desmos.profiles.v3.MsgUnlinkChainAccount") + proto.RegisterType((*MsgUnlinkChainAccountResponse)(nil), "desmos.profiles.v3.MsgUnlinkChainAccountResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/msgs_chain_links.proto", fileDescriptor_d28c3718ad31f8ee) + proto.RegisterFile("desmos/profiles/v3/msgs_chain_links.proto", fileDescriptor_52cd1f5b825f2f4e) } -var fileDescriptor_d28c3718ad31f8ee = []byte{ +var fileDescriptor_52cd1f5b825f2f4e = []byte{ // 486 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xc1, 0x6a, 0xdb, 0x40, 0x10, 0xb5, 0xd2, 0x26, 0xe0, 0x75, 0x02, 0x8d, 0x12, 0x83, 0xe3, 0x10, 0x29, 0xec, 0xa1, 0x38, - 0x94, 0x68, 0xa9, 0x9b, 0x53, 0x6f, 0x56, 0x7a, 0x6b, 0x52, 0x8a, 0xa0, 0x97, 0x5e, 0xcc, 0x7a, + 0x94, 0x68, 0x69, 0x9d, 0x53, 0x6f, 0x56, 0x7a, 0x6b, 0x52, 0x8a, 0xa0, 0x97, 0x5e, 0xcc, 0x7a, 0xbd, 0xde, 0x88, 0x48, 0x3b, 0x42, 0x2b, 0xbb, 0xf5, 0x5f, 0xf4, 0x13, 0xfa, 0x11, 0xfd, 0x88, 0xd0, 0x53, 0x8e, 0x85, 0x82, 0x28, 0xf6, 0x1f, 0xe8, 0x0b, 0x8a, 0x76, 0x25, 0x5c, 0x37, 0xba, 0xcd, 0xcc, 0x7b, 0xf3, 0xe6, 0xcd, 0xec, 0xa2, 0x8b, 0x29, 0x57, 0x31, 0x28, 0x92, 0xa4, 0x30, @@ -265,25 +265,25 @@ var fileDescriptor_d28c3718ad31f8ee = []byte{ 0x67, 0x84, 0xca, 0x65, 0x0d, 0x31, 0x28, 0x45, 0xc6, 0xa6, 0xc7, 0x24, 0x15, 0xf4, 0xaa, 0xc9, 0x0a, 0x4c, 0x79, 0xd4, 0x60, 0x06, 0xff, 0xde, 0x41, 0x47, 0xb7, 0x4a, 0xdc, 0x84, 0xf2, 0xfe, 0xba, 0x04, 0x47, 0x8c, 0xc1, 0x5c, 0x66, 0x36, 0x43, 0x07, 0x86, 0x4c, 0xa7, 0xd3, 0x94, 0x2b, - 0xd5, 0xb3, 0xce, 0xad, 0x41, 0x67, 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3e, 0xf1, 0x18, + 0xc4, 0xc4, 0xbc, 0xc1, 0x65, 0x44, 0x27, 0xaa, 0x8a, 0xc9, 0xe2, 0x8a, 0x7c, 0xdd, 0xfc, 0xd1, + 0x6c, 0x99, 0x70, 0x35, 0xd9, 0xd3, 0xdf, 0x6a, 0xf8, 0x37, 0x00, 0x00, 0xff, 0xff, 0x95, 0xb7, + 0xb7, 0x15, 0x4e, 0x03, 0x00, 0x00, } func (m *MsgLinkChainAccount) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/msgs_dtag_requests.pb.go b/x/profiles/types/msgs_dtag_requests.pb.go index 79d33ce0c8..7db8ae77b2 100644 --- a/x/profiles/types/msgs_dtag_requests.pb.go +++ b/x/profiles/types/msgs_dtag_requests.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/msgs_dtag_requests.proto +// source: desmos/profiles/v3/msgs_dtag_requests.proto package types @@ -40,7 +40,7 @@ func (m *MsgRequestDTagTransfer) Reset() { *m = MsgRequestDTagTransfer{} func (m *MsgRequestDTagTransfer) String() string { return proto.CompactTextString(m) } func (*MsgRequestDTagTransfer) ProtoMessage() {} func (*MsgRequestDTagTransfer) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{0} + return fileDescriptor_00569a18db7c139d, []int{0} } func (m *MsgRequestDTagTransfer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -78,7 +78,7 @@ func (m *MsgRequestDTagTransferResponse) Reset() { *m = MsgRequestDTagTr func (m *MsgRequestDTagTransferResponse) String() string { return proto.CompactTextString(m) } func (*MsgRequestDTagTransferResponse) ProtoMessage() {} func (*MsgRequestDTagTransferResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{1} + return fileDescriptor_00569a18db7c139d, []int{1} } func (m *MsgRequestDTagTransferResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -120,7 +120,7 @@ func (m *MsgCancelDTagTransferRequest) Reset() { *m = MsgCancelDTagTrans func (m *MsgCancelDTagTransferRequest) String() string { return proto.CompactTextString(m) } func (*MsgCancelDTagTransferRequest) ProtoMessage() {} func (*MsgCancelDTagTransferRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{2} + return fileDescriptor_00569a18db7c139d, []int{2} } func (m *MsgCancelDTagTransferRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -158,7 +158,7 @@ func (m *MsgCancelDTagTransferRequestResponse) Reset() { *m = MsgCancelD func (m *MsgCancelDTagTransferRequestResponse) String() string { return proto.CompactTextString(m) } func (*MsgCancelDTagTransferRequestResponse) ProtoMessage() {} func (*MsgCancelDTagTransferRequestResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{3} + return fileDescriptor_00569a18db7c139d, []int{3} } func (m *MsgCancelDTagTransferRequestResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -203,7 +203,7 @@ func (m *MsgAcceptDTagTransferRequest) Reset() { *m = MsgAcceptDTagTrans func (m *MsgAcceptDTagTransferRequest) String() string { return proto.CompactTextString(m) } func (*MsgAcceptDTagTransferRequest) ProtoMessage() {} func (*MsgAcceptDTagTransferRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{4} + return fileDescriptor_00569a18db7c139d, []int{4} } func (m *MsgAcceptDTagTransferRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -241,7 +241,7 @@ func (m *MsgAcceptDTagTransferRequestResponse) Reset() { *m = MsgAcceptD func (m *MsgAcceptDTagTransferRequestResponse) String() string { return proto.CompactTextString(m) } func (*MsgAcceptDTagTransferRequestResponse) ProtoMessage() {} func (*MsgAcceptDTagTransferRequestResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{5} + return fileDescriptor_00569a18db7c139d, []int{5} } func (m *MsgAcceptDTagTransferRequestResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -283,7 +283,7 @@ func (m *MsgRefuseDTagTransferRequest) Reset() { *m = MsgRefuseDTagTrans func (m *MsgRefuseDTagTransferRequest) String() string { return proto.CompactTextString(m) } func (*MsgRefuseDTagTransferRequest) ProtoMessage() {} func (*MsgRefuseDTagTransferRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{6} + return fileDescriptor_00569a18db7c139d, []int{6} } func (m *MsgRefuseDTagTransferRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -321,7 +321,7 @@ func (m *MsgRefuseDTagTransferRequestResponse) Reset() { *m = MsgRefuseD func (m *MsgRefuseDTagTransferRequestResponse) String() string { return proto.CompactTextString(m) } func (*MsgRefuseDTagTransferRequestResponse) ProtoMessage() {} func (*MsgRefuseDTagTransferRequestResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{7} + return fileDescriptor_00569a18db7c139d, []int{7} } func (m *MsgRefuseDTagTransferRequestResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -351,49 +351,49 @@ func (m *MsgRefuseDTagTransferRequestResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRefuseDTagTransferRequestResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgRequestDTagTransfer)(nil), "desmos.profiles.v2.MsgRequestDTagTransfer") - proto.RegisterType((*MsgRequestDTagTransferResponse)(nil), "desmos.profiles.v2.MsgRequestDTagTransferResponse") - proto.RegisterType((*MsgCancelDTagTransferRequest)(nil), "desmos.profiles.v2.MsgCancelDTagTransferRequest") - proto.RegisterType((*MsgCancelDTagTransferRequestResponse)(nil), "desmos.profiles.v2.MsgCancelDTagTransferRequestResponse") - proto.RegisterType((*MsgAcceptDTagTransferRequest)(nil), "desmos.profiles.v2.MsgAcceptDTagTransferRequest") - proto.RegisterType((*MsgAcceptDTagTransferRequestResponse)(nil), "desmos.profiles.v2.MsgAcceptDTagTransferRequestResponse") - proto.RegisterType((*MsgRefuseDTagTransferRequest)(nil), "desmos.profiles.v2.MsgRefuseDTagTransferRequest") - proto.RegisterType((*MsgRefuseDTagTransferRequestResponse)(nil), "desmos.profiles.v2.MsgRefuseDTagTransferRequestResponse") + proto.RegisterType((*MsgRequestDTagTransfer)(nil), "desmos.profiles.v3.MsgRequestDTagTransfer") + proto.RegisterType((*MsgRequestDTagTransferResponse)(nil), "desmos.profiles.v3.MsgRequestDTagTransferResponse") + proto.RegisterType((*MsgCancelDTagTransferRequest)(nil), "desmos.profiles.v3.MsgCancelDTagTransferRequest") + proto.RegisterType((*MsgCancelDTagTransferRequestResponse)(nil), "desmos.profiles.v3.MsgCancelDTagTransferRequestResponse") + proto.RegisterType((*MsgAcceptDTagTransferRequest)(nil), "desmos.profiles.v3.MsgAcceptDTagTransferRequest") + proto.RegisterType((*MsgAcceptDTagTransferRequestResponse)(nil), "desmos.profiles.v3.MsgAcceptDTagTransferRequestResponse") + proto.RegisterType((*MsgRefuseDTagTransferRequest)(nil), "desmos.profiles.v3.MsgRefuseDTagTransferRequest") + proto.RegisterType((*MsgRefuseDTagTransferRequestResponse)(nil), "desmos.profiles.v3.MsgRefuseDTagTransferRequestResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/msgs_dtag_requests.proto", fileDescriptor_530fdfdb77008b0a) + proto.RegisterFile("desmos/profiles/v3/msgs_dtag_requests.proto", fileDescriptor_00569a18db7c139d) } -var fileDescriptor_530fdfdb77008b0a = []byte{ +var fileDescriptor_00569a18db7c139d = []byte{ // 429 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x93, 0xbf, 0x6f, 0xd3, 0x40, 0x14, 0xc7, 0xed, 0x22, 0xb5, 0xe1, 0x24, 0x84, 0x30, 0x08, 0x95, 0x0a, 0x9d, 0x2b, 0x0b, 0xf1, - 0x43, 0xa8, 0x3e, 0x51, 0x58, 0xe8, 0x46, 0xe9, 0x86, 0xca, 0x60, 0x75, 0x62, 0x89, 0xce, 0xf6, - 0xf3, 0x11, 0xc9, 0xf6, 0x99, 0x7b, 0xb6, 0x43, 0x16, 0x26, 0x06, 0x46, 0xfe, 0x84, 0xfe, 0x27, - 0xac, 0x8c, 0x19, 0x99, 0x22, 0xe4, 0x2c, 0xcc, 0xf9, 0x0b, 0x90, 0x7d, 0x76, 0xa2, 0x80, 0x83, - 0x08, 0x03, 0xdb, 0xdd, 0xfb, 0x7e, 0xce, 0xfe, 0xbc, 0x3b, 0x3d, 0xf2, 0x38, 0x04, 0x4c, 0x24, - 0xb2, 0x4c, 0xc9, 0x68, 0x14, 0x03, 0xb2, 0xf2, 0x98, 0x25, 0x28, 0x70, 0x18, 0xe6, 0x5c, 0x0c, - 0x15, 0xbc, 0x2b, 0x00, 0x73, 0x74, 0x33, 0x25, 0x73, 0x69, 0x59, 0x1a, 0x76, 0x3b, 0xd8, 0x2d, - 0x8f, 0x0f, 0x6e, 0x09, 0x29, 0x64, 0x13, 0xb3, 0x7a, 0xa5, 0xc9, 0x83, 0x3b, 0x42, 0x4a, 0x11, - 0x03, 0x6b, 0x76, 0x7e, 0x11, 0x31, 0x9e, 0x4e, 0xba, 0x28, 0x90, 0xf5, 0x47, 0x86, 0xfa, 0x8c, - 0xde, 0xb4, 0xd1, 0x83, 0x3e, 0x19, 0x19, 0x42, 0xdc, 0xd0, 0x75, 0xa9, 0x05, 0x8f, 0x36, 0x83, - 0x3d, 0xde, 0xce, 0x07, 0x72, 0xfb, 0x1c, 0x85, 0xa7, 0x8b, 0x67, 0x17, 0x5c, 0x5c, 0x28, 0x9e, - 0x62, 0x04, 0xca, 0x62, 0x64, 0xa0, 0x20, 0x80, 0x51, 0x09, 0x6a, 0xdf, 0x3c, 0x34, 0x1f, 0x5e, - 0x3d, 0xbd, 0xb9, 0x98, 0xd9, 0xd7, 0x27, 0x3c, 0x89, 0x4f, 0x9c, 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3e, 0xb6, 0x6b, - 0x56, 0x3e, 0x63, 0xef, 0x57, 0xe3, 0x94, 0x4f, 0x32, 0x40, 0x7f, 0xb7, 0x99, 0x9e, 0xa7, 0x3f, - 0x03, 0x00, 0x00, 0xff, 0xff, 0x32, 0x04, 0x36, 0xc5, 0x24, 0x04, 0x00, 0x00, + 0x43, 0xa8, 0x3e, 0xa1, 0xb0, 0xd0, 0x8d, 0xd2, 0x0d, 0x95, 0xc1, 0xea, 0xc4, 0x12, 0x9d, 0xed, + 0xe7, 0x23, 0x92, 0xed, 0x33, 0xf7, 0x6c, 0x87, 0x2c, 0x4c, 0x0c, 0x8c, 0xfc, 0x09, 0xfd, 0x4f, + 0x58, 0x19, 0x3b, 0x32, 0x45, 0xc8, 0x59, 0x98, 0xf3, 0x17, 0x20, 0xfb, 0xec, 0x44, 0x01, 0x07, + 0x11, 0x86, 0x6e, 0x77, 0xef, 0xfb, 0x39, 0xfb, 0xf3, 0xee, 0xf4, 0xc8, 0xd3, 0x10, 0x30, 0x91, + 0xc8, 0x32, 0x25, 0xa3, 0x71, 0x0c, 0xc8, 0xca, 0x21, 0x4b, 0x50, 0xe0, 0x28, 0xcc, 0xb9, 0x18, + 0x29, 0x78, 0x5f, 0x00, 0xe6, 0xe8, 0x66, 0x4a, 0xe6, 0xd2, 0xb2, 0x34, 0xec, 0x76, 0xb0, 0x5b, + 0x0e, 0x0f, 0xee, 0x08, 0x29, 0x64, 0x13, 0xb3, 0x7a, 0xa5, 0xc9, 0x83, 0x7b, 0x42, 0x4a, 0x11, + 0x03, 0x6b, 0x76, 0x7e, 0x11, 0x31, 0x9e, 0x4e, 0xbb, 0x28, 0x90, 0xf5, 0x47, 0x46, 0xfa, 0x8c, + 0xde, 0xb4, 0xd1, 0xa3, 0x3e, 0x19, 0x19, 0x42, 0xdc, 0xd0, 0x75, 0xa9, 0x05, 0x8f, 0x36, 0x83, + 0x3d, 0xde, 0xce, 0x47, 0x72, 0xf7, 0x0c, 0x85, 0xa7, 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 0xb2, 0xa2, + 0xe6, 0x8f, 0x8a, 0x9a, 0x5f, 0xe6, 0xd4, 0xb8, 0x9c, 0x53, 0xe3, 0xfb, 0x9c, 0x1a, 0x6f, 0x9f, + 0x89, 0x71, 0xfe, 0xae, 0xf0, 0xdd, 0x40, 0x26, 0x4c, 0x4f, 0xcf, 0x51, 0xcc, 0x7d, 0x6c, 0xd7, + 0xac, 0x7c, 0xce, 0x3e, 0xac, 0xc6, 0x29, 0x9f, 0x66, 0x80, 0xfe, 0x6e, 0x33, 0x3d, 0xc3, 0x5f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xa6, 0xff, 0x0a, 0xd4, 0x24, 0x04, 0x00, 0x00, } func (m *MsgRequestDTagTransfer) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/msgs_profile.pb.go b/x/profiles/types/msgs_profile.pb.go index e1d3d61237..30e9a26124 100644 --- a/x/profiles/types/msgs_profile.pb.go +++ b/x/profiles/types/msgs_profile.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/msgs_profile.proto +// source: desmos/profiles/v3/msgs_profile.proto package types @@ -39,7 +39,7 @@ func (m *MsgSaveProfile) Reset() { *m = MsgSaveProfile{} } func (m *MsgSaveProfile) String() string { return proto.CompactTextString(m) } func (*MsgSaveProfile) ProtoMessage() {} func (*MsgSaveProfile) Descriptor() ([]byte, []int) { - return fileDescriptor_e19057696b6ec51e, []int{0} + return fileDescriptor_5ea75cf4ca5bb3a3, []int{0} } func (m *MsgSaveProfile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -76,7 +76,7 @@ func (m *MsgSaveProfileResponse) Reset() { *m = MsgSaveProfileResponse{} func (m *MsgSaveProfileResponse) String() string { return proto.CompactTextString(m) } func (*MsgSaveProfileResponse) ProtoMessage() {} func (*MsgSaveProfileResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e19057696b6ec51e, []int{1} + return fileDescriptor_5ea75cf4ca5bb3a3, []int{1} } func (m *MsgSaveProfileResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -114,7 +114,7 @@ func (m *MsgDeleteProfile) Reset() { *m = MsgDeleteProfile{} } func (m *MsgDeleteProfile) String() string { return proto.CompactTextString(m) } func (*MsgDeleteProfile) ProtoMessage() {} func (*MsgDeleteProfile) Descriptor() ([]byte, []int) { - return fileDescriptor_e19057696b6ec51e, []int{2} + return fileDescriptor_5ea75cf4ca5bb3a3, []int{2} } func (m *MsgDeleteProfile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -151,7 +151,7 @@ func (m *MsgDeleteProfileResponse) Reset() { *m = MsgDeleteProfileRespon func (m *MsgDeleteProfileResponse) String() string { return proto.CompactTextString(m) } func (*MsgDeleteProfileResponse) ProtoMessage() {} func (*MsgDeleteProfileResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e19057696b6ec51e, []int{3} + return fileDescriptor_5ea75cf4ca5bb3a3, []int{3} } func (m *MsgDeleteProfileResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -181,46 +181,46 @@ func (m *MsgDeleteProfileResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDeleteProfileResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgSaveProfile)(nil), "desmos.profiles.v2.MsgSaveProfile") - proto.RegisterType((*MsgSaveProfileResponse)(nil), "desmos.profiles.v2.MsgSaveProfileResponse") - proto.RegisterType((*MsgDeleteProfile)(nil), "desmos.profiles.v2.MsgDeleteProfile") - proto.RegisterType((*MsgDeleteProfileResponse)(nil), "desmos.profiles.v2.MsgDeleteProfileResponse") + proto.RegisterType((*MsgSaveProfile)(nil), "desmos.profiles.v3.MsgSaveProfile") + proto.RegisterType((*MsgSaveProfileResponse)(nil), "desmos.profiles.v3.MsgSaveProfileResponse") + proto.RegisterType((*MsgDeleteProfile)(nil), "desmos.profiles.v3.MsgDeleteProfile") + proto.RegisterType((*MsgDeleteProfileResponse)(nil), "desmos.profiles.v3.MsgDeleteProfileResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/msgs_profile.proto", fileDescriptor_e19057696b6ec51e) + proto.RegisterFile("desmos/profiles/v3/msgs_profile.proto", fileDescriptor_5ea75cf4ca5bb3a3) } -var fileDescriptor_e19057696b6ec51e = []byte{ +var fileDescriptor_5ea75cf4ca5bb3a3 = []byte{ // 444 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x6e, 0xd4, 0x40, 0x10, 0x86, 0xed, 0xe4, 0x08, 0x61, 0x81, 0x0b, 0x32, 0x51, 0x30, 0x2e, 0xbc, 0xd1, 0x4a, 0x08, - 0x24, 0xc8, 0xad, 0x08, 0x54, 0x91, 0x68, 0x42, 0x2a, 0x50, 0xa4, 0xc8, 0x50, 0xd1, 0x9c, 0xd6, - 0xbe, 0xc9, 0x62, 0x61, 0xdf, 0x18, 0xef, 0x9e, 0xc5, 0xbd, 0x01, 0x25, 0x8f, 0x90, 0xc7, 0xa1, - 0xa0, 0x48, 0x49, 0x65, 0xa1, 0xbb, 0x86, 0xda, 0x4f, 0x80, 0xbc, 0x6b, 0x1f, 0xe4, 0x04, 0x05, - 0xdd, 0xce, 0xfc, 0xdf, 0xff, 0xcf, 0x68, 0x35, 0xe4, 0xc1, 0x04, 0x54, 0x8e, 0x8a, 0x17, 0x25, - 0x9e, 0xa7, 0x19, 0x28, 0x5e, 0x1d, 0xf2, 0x5c, 0x49, 0x35, 0xee, 0x1a, 0xa3, 0xa2, 0x44, 0x8d, - 0x9e, 0x67, 0xb1, 0x51, 0x8f, 0x8d, 0xaa, 0xc3, 0x60, 0x57, 0xa2, 0x44, 0x23, 0xf3, 0xf6, 0x65, - 0xc9, 0xe0, 0xbe, 0x44, 0x94, 0x19, 0x70, 0x53, 0xc5, 0xb3, 0x73, 0x2e, 0xa6, 0xf3, 0x5e, 0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17, + 0x78, 0x91, 0xa4, 0x20, 0x79, 0x39, 0xe6, 0x99, 0x14, 0x72, 0xd2, 0x35, 0x46, 0x79, 0x81, 0x0a, + 0x1d, 0xc7, 0x60, 0xa3, 0x1e, 0x1b, 0x95, 0x63, 0x6f, 0x5f, 0xa0, 0x40, 0x2d, 0xf3, 0xf6, 0x65, + 0x48, 0xef, 0xa1, 0x40, 0x14, 0x29, 0x70, 0x5d, 0x45, 0xf3, 0x0b, 0x1e, 0xce, 0x16, 0xbd, 0x14, + 0x63, 0x1b, 0x32, 0x31, 0x1e, 0x53, 0x74, 0xd2, 0xe3, 0x7f, 0xad, 0x81, 0x53, 0x48, 0x37, 0x16, + 0xf1, 0x8e, 0xfe, 0x0f, 0x4e, 0x55, 0x28, 0x26, 0x05, 0x7c, 0x9a, 0x83, 0x54, 0x5d, 0x2e, 0xfb, + 0xbe, 0x45, 0x86, 0x67, 0x52, 0xbc, 0x0d, 0x4b, 0x38, 0x37, 0x0e, 0xe7, 0x29, 0x19, 0xb4, 0xa4, + 0x6b, 0x1f, 0xda, 0x4f, 0x6e, 0x9d, 0x3c, 0xa8, 0x2b, 0x3a, 0x38, 0x7d, 0x17, 0x8a, 0xa6, 0xa2, + 0xb7, 0x17, 0x61, 0x96, 0x1e, 0xb3, 0x56, 0x65, 0x81, 0x86, 0x1c, 0x4e, 0x76, 0x67, 0x49, 0xfc, + 0x71, 0x16, 0x66, 0xe0, 0x6e, 0x69, 0xc3, 0xfd, 0xa6, 0xa2, 0x7b, 0x06, 0xec, 0x15, 0x16, 0xac, + 0x20, 0xe7, 0x90, 0x6c, 0x47, 0x09, 0xba, 0xdb, 0x9a, 0x1d, 0x36, 0x15, 0x25, 0x86, 0x8d, 0x12, + 0x64, 0x41, 0x2b, 0x39, 0xaf, 0xc8, 0x5e, 0xb7, 0xfc, 0x24, 0x4f, 0x62, 0x35, 0x2f, 0xc0, 0x1d, + 0x68, 0xda, 0x6b, 0x2a, 0x7a, 0x60, 0xe8, 0x0d, 0x80, 0x05, 0xc3, 0xae, 0x73, 0x6e, 0x1a, 0xce, + 0x4b, 0x72, 0x37, 0xc6, 0x12, 0x8a, 0x55, 0xc4, 0x0d, 0x1d, 0xe1, 0x36, 0x15, 0xdd, 0x37, 0x11, + 0x6b, 0x32, 0x0b, 0xee, 0xe8, 0xba, 0xb7, 0x3f, 0x23, 0x37, 0xe3, 0x02, 0x42, 0x85, 0x85, 0xbb, + 0xa3, 0x8d, 0x4e, 0x53, 0xd1, 0x61, 0x67, 0x34, 0x02, 0x0b, 0x7a, 0xe4, 0x78, 0xf7, 0xcb, 0x25, + 0xb5, 0x7e, 0x5d, 0x52, 0x8b, 0xb9, 0xe4, 0x60, 0xfd, 0x37, 0x03, 0x90, 0x39, 0xce, 0x24, 0xb0, + 0xd7, 0xe4, 0xde, 0x99, 0x14, 0xa7, 0x90, 0x82, 0x5a, 0xfd, 0xf4, 0x5f, 0x53, 0xec, 0xeb, 0x4c, + 0xf1, 0x88, 0xbb, 0x99, 0xd5, 0xcf, 0x39, 0x79, 0xf3, 0xad, 0xf6, 0xed, 0xab, 0xda, 0xb7, 0x7f, + 0xd6, 0xbe, 0xfd, 0x75, 0xe9, 0x5b, 0x57, 0x4b, 0xdf, 0xfa, 0xb1, 0xf4, 0xad, 0xf7, 0xcf, 0x45, + 0xa2, 0x3e, 0xcc, 0xa3, 0x51, 0x8c, 0x19, 0x37, 0x47, 0x72, 0x94, 0x86, 0x91, 0xec, 0xde, 0xbc, + 0x7c, 0xc1, 0x3f, 0xff, 0xb9, 0x1a, 0xb5, 0xc8, 0x41, 0x46, 0x3b, 0xfa, 0x48, 0xc6, 0xbf, 0x03, + 0x00, 0x00, 0xff, 0xff, 0xb8, 0x1c, 0x11, 0xc5, 0x05, 0x03, 0x00, 0x00, } func (m *MsgSaveProfile) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/query.pb.go b/x/profiles/types/query.pb.go index 9f6fe43a6e..61b7cd8af3 100644 --- a/x/profiles/types/query.pb.go +++ b/x/profiles/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/query.proto +// source: desmos/profiles/v3/query.proto package types @@ -30,13 +30,13 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -func init() { proto.RegisterFile("desmos/profiles/v2/query.proto", fileDescriptor_fba4df0d7bde4d7c) } +func init() { proto.RegisterFile("desmos/profiles/v3/query.proto", fileDescriptor_bcbdebc2a1cf2f2b) } -var fileDescriptor_fba4df0d7bde4d7c = []byte{ +var fileDescriptor_bcbdebc2a1cf2f2b = []byte{ // 613 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x3d, 0x6f, 0xd3, 0x40, 0x18, 0xc7, 0x6b, 0x24, 0x8a, 0x74, 0x0b, 0xe8, 0x04, 0x43, 0xa2, 0xe0, 0x8a, 0x42, 0x5e, 0x94, - 0x26, 0x3e, 0x92, 0x02, 0x52, 0x11, 0x0c, 0xb4, 0x5d, 0x2a, 0x90, 0x28, 0xa8, 0x13, 0x4b, 0x74, + 0x26, 0x3e, 0xd2, 0x00, 0x52, 0x11, 0x0c, 0xb4, 0x5d, 0x2a, 0x90, 0x28, 0xa8, 0x13, 0x4b, 0x74, 0x76, 0x2e, 0xee, 0x09, 0xe7, 0xee, 0xea, 0x73, 0x02, 0x51, 0x95, 0x85, 0x8d, 0x05, 0x21, 0xb1, 0x33, 0xf1, 0x11, 0xf8, 0x08, 0x0c, 0x2c, 0x88, 0x4a, 0x2c, 0x8c, 0x28, 0xe1, 0x83, 0x20, 0xdf, 0x4b, 0xa3, 0x86, 0x38, 0x49, 0xbb, 0xd9, 0xbe, 0xdf, 0xff, 0x9e, 0xdf, 0x73, 0x7e, 0x74, 0xc0, @@ -49,30 +49,30 @@ var fileDescriptor_fba4df0d7bde4d7c = []byte{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0xe5, + 0x76, 0x0b, 0xae, 0xcd, 0x72, 0x53, 0xf3, 0x56, 0x57, 0x53, 0x04, 0xbf, 0x38, 0xe0, 0xea, 0x69, + 0xfe, 0xf9, 0x1b, 0x46, 0x62, 0x09, 0xd1, 0xe2, 0x4a, 0x9a, 0xb4, 0x6a, 0x77, 0x97, 0x0f, 0x18, + 0x3f, 0x4f, 0xf9, 0x55, 0x60, 0x69, 0x81, 0x1f, 0xe2, 0x5a, 0xe9, 0xb3, 0x03, 0xae, 0x3d, 0x11, + 0x22, 0xa2, 0x81, 0x9a, 0x5a, 0x7d, 0x7a, 0xd9, 0x65, 0xa7, 0x51, 0x2b, 0xda, 0x38, 0x47, 0xc2, + 0x98, 0x16, 0x95, 0xe9, 0x1a, 0xbc, 0x39, 0xcb, 0x14, 0x0b, 0x61, 0xce, 0xf1, 0x87, 0x03, 0x72, + 0x53, 0x7b, 0x6c, 0x0f, 0x76, 0x22, 0x4a, 0x58, 0xb2, 0xb7, 0x0b, 0xb7, 0x96, 0xad, 0x3b, 0xc9, + 0x58, 0xe5, 0x87, 0x17, 0x89, 0x1a, 0xf7, 0x2d, 0xe5, 0xde, 0x84, 0x8d, 0xb9, 0xee, 0x28, 0x50, + 0x39, 0x89, 0x8e, 0xf5, 0x43, 0x8b, 0xb6, 0x87, 0xf0, 0xab, 0x03, 0x6e, 0x4c, 0x15, 0x30, 0xd3, + 0x71, 0x7f, 0x59, 0xa1, 0xb3, 0x33, 0xf2, 0xe0, 0xbc, 0x31, 0xd3, 0x43, 0x4d, 0xf5, 0x50, 0x82, + 0x77, 0xe6, 0xf7, 0x60, 0xe6, 0x64, 0x08, 0x56, 0xf7, 0xd5, 0xa5, 0x0b, 0x4b, 0xd9, 0x57, 0x92, + 0x02, 0xac, 0x57, 0x79, 0x21, 0x67, 0x44, 0xd6, 0x95, 0x48, 0x01, 0xe6, 0x67, 0xde, 0x5c, 0x8a, + 0xdd, 0x7e, 0xfa, 0x7d, 0xe4, 0x3a, 0x27, 0x23, 0xd7, 0xf9, 0x33, 0x72, 0x9d, 0x8f, 0x63, 0x77, + 0xe5, 0x64, 0xec, 0xae, 0xfc, 0x1e, 0xbb, 0x2b, 0xaf, 0x1a, 0x21, 0x4d, 0x0e, 0x7b, 0xbe, 0x17, + 0xf0, 0xae, 0xc9, 0xd7, 0x23, 0xec, 0x4b, 0xbb, 0x57, 0xff, 0x1e, 0x7a, 0x3b, 0xd9, 0x30, 0x19, + 0x08, 0x22, 0xfd, 0x55, 0x75, 0x35, 0x37, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xef, 0x67, 0x18, + 0xbe, 0x39, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -123,7 +123,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Profile(ctx context.Context, in *QueryProfileRequest, opts ...grpc.CallOption) (*QueryProfileResponse, error) { out := new(QueryProfileResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/Profile", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/Profile", in, out, opts...) if err != nil { return nil, err } @@ -132,7 +132,7 @@ func (c *queryClient) Profile(ctx context.Context, in *QueryProfileRequest, opts func (c *queryClient) IncomingDTagTransferRequests(ctx context.Context, in *QueryIncomingDTagTransferRequestsRequest, opts ...grpc.CallOption) (*QueryIncomingDTagTransferRequestsResponse, error) { out := new(QueryIncomingDTagTransferRequestsResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/IncomingDTagTransferRequests", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/IncomingDTagTransferRequests", in, out, opts...) if err != nil { return nil, err } @@ -141,7 +141,7 @@ func (c *queryClient) IncomingDTagTransferRequests(ctx context.Context, in *Quer func (c *queryClient) ChainLinks(ctx context.Context, in *QueryChainLinksRequest, opts ...grpc.CallOption) (*QueryChainLinksResponse, error) { out := new(QueryChainLinksResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/ChainLinks", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/ChainLinks", in, out, opts...) if err != nil { return nil, err } @@ -150,7 +150,7 @@ func (c *queryClient) ChainLinks(ctx context.Context, in *QueryChainLinksRequest func (c *queryClient) ChainLinkOwners(ctx context.Context, in *QueryChainLinkOwnersRequest, opts ...grpc.CallOption) (*QueryChainLinkOwnersResponse, error) { out := new(QueryChainLinkOwnersResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/ChainLinkOwners", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/ChainLinkOwners", in, out, opts...) if err != nil { return nil, err } @@ -159,7 +159,7 @@ func (c *queryClient) ChainLinkOwners(ctx context.Context, in *QueryChainLinkOwn func (c *queryClient) ApplicationLinks(ctx context.Context, in *QueryApplicationLinksRequest, opts ...grpc.CallOption) (*QueryApplicationLinksResponse, error) { out := new(QueryApplicationLinksResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/ApplicationLinks", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/ApplicationLinks", in, out, opts...) if err != nil { return nil, err } @@ -168,7 +168,7 @@ func (c *queryClient) ApplicationLinks(ctx context.Context, in *QueryApplication func (c *queryClient) ApplicationLinkByClientID(ctx context.Context, in *QueryApplicationLinkByClientIDRequest, opts ...grpc.CallOption) (*QueryApplicationLinkByClientIDResponse, error) { out := new(QueryApplicationLinkByClientIDResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/ApplicationLinkByClientID", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/ApplicationLinkByClientID", in, out, opts...) if err != nil { return nil, err } @@ -177,7 +177,7 @@ func (c *queryClient) ApplicationLinkByClientID(ctx context.Context, in *QueryAp func (c *queryClient) ApplicationLinkOwners(ctx context.Context, in *QueryApplicationLinkOwnersRequest, opts ...grpc.CallOption) (*QueryApplicationLinkOwnersResponse, error) { out := new(QueryApplicationLinkOwnersResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/ApplicationLinkOwners", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/ApplicationLinkOwners", in, out, opts...) if err != nil { return nil, err } @@ -186,7 +186,7 @@ func (c *queryClient) ApplicationLinkOwners(ctx context.Context, in *QueryApplic func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -264,7 +264,7 @@ func _Query_Profile_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/Profile", + FullMethod: "/desmos.profiles.v3.Query/Profile", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Profile(ctx, req.(*QueryProfileRequest)) @@ -282,7 +282,7 @@ func _Query_IncomingDTagTransferRequests_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/IncomingDTagTransferRequests", + FullMethod: "/desmos.profiles.v3.Query/IncomingDTagTransferRequests", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).IncomingDTagTransferRequests(ctx, req.(*QueryIncomingDTagTransferRequestsRequest)) @@ -300,7 +300,7 @@ func _Query_ChainLinks_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/ChainLinks", + FullMethod: "/desmos.profiles.v3.Query/ChainLinks", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ChainLinks(ctx, req.(*QueryChainLinksRequest)) @@ -318,7 +318,7 @@ func _Query_ChainLinkOwners_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/ChainLinkOwners", + FullMethod: "/desmos.profiles.v3.Query/ChainLinkOwners", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ChainLinkOwners(ctx, req.(*QueryChainLinkOwnersRequest)) @@ -336,7 +336,7 @@ func _Query_ApplicationLinks_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/ApplicationLinks", + FullMethod: "/desmos.profiles.v3.Query/ApplicationLinks", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ApplicationLinks(ctx, req.(*QueryApplicationLinksRequest)) @@ -354,7 +354,7 @@ func _Query_ApplicationLinkByClientID_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/ApplicationLinkByClientID", + FullMethod: "/desmos.profiles.v3.Query/ApplicationLinkByClientID", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ApplicationLinkByClientID(ctx, req.(*QueryApplicationLinkByClientIDRequest)) @@ -372,7 +372,7 @@ func _Query_ApplicationLinkOwners_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/ApplicationLinkOwners", + FullMethod: "/desmos.profiles.v3.Query/ApplicationLinkOwners", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ApplicationLinkOwners(ctx, req.(*QueryApplicationLinkOwnersRequest)) @@ -390,7 +390,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/Params", + FullMethod: "/desmos.profiles.v3.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -399,7 +399,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "desmos.profiles.v2.Query", + ServiceName: "desmos.profiles.v3.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -436,5 +436,5 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "desmos/profiles/v2/query.proto", + Metadata: "desmos/profiles/v3/query.proto", } diff --git a/x/profiles/types/query.pb.gw.go b/x/profiles/types/query.pb.gw.go index 5ec0613d09..5fc0d2acad 100644 --- a/x/profiles/types/query.pb.gw.go +++ b/x/profiles/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: desmos/profiles/v2/query.proto +// source: desmos/profiles/v3/query.proto /* Package types is a reverse proxy. @@ -708,21 +708,21 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Profile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 1, 0, 4, 1, 5, 3}, []string{"desmos", "profiles", "v2", "user"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Profile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 1, 0, 4, 1, 5, 3}, []string{"desmos", "profiles", "v3", "user"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_IncomingDTagTransferRequests_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v2", "dtag-transfer-requests"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_IncomingDTagTransferRequests_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v3", "dtag-transfer-requests"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ChainLinks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v2", "chain-links"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_ChainLinks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v3", "chain-links"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ChainLinkOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"desmos", "profiles", "v2", "chain-links", "owners"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_ChainLinkOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"desmos", "profiles", "v3", "chain-links", "owners"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ApplicationLinks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v2", "app-links"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_ApplicationLinks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v3", "app-links"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ApplicationLinkByClientID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"desmos", "profiles", "v2", "app-links", "clients", "client_id"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_ApplicationLinkByClientID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"desmos", "profiles", "v3", "app-links", "clients", "client_id"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ApplicationLinkOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"desmos", "profiles", "v2", "app-links", "owners"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_ApplicationLinkOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"desmos", "profiles", "v3", "app-links", "owners"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v2", "params"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v3", "params"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( diff --git a/x/profiles/types/query_app_links.pb.go b/x/profiles/types/query_app_links.pb.go index fff4848105..22106d1fb7 100644 --- a/x/profiles/types/query_app_links.pb.go +++ b/x/profiles/types/query_app_links.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/query_app_links.proto +// source: desmos/profiles/v3/query_app_links.proto package types @@ -47,7 +47,7 @@ func (m *QueryApplicationLinksRequest) Reset() { *m = QueryApplicationLi func (m *QueryApplicationLinksRequest) String() string { return proto.CompactTextString(m) } func (*QueryApplicationLinksRequest) ProtoMessage() {} func (*QueryApplicationLinksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{0} + return fileDescriptor_b3b6ad0478f8a288, []int{0} } func (m *QueryApplicationLinksRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -116,7 +116,7 @@ func (m *QueryApplicationLinksResponse) Reset() { *m = QueryApplicationL func (m *QueryApplicationLinksResponse) String() string { return proto.CompactTextString(m) } func (*QueryApplicationLinksResponse) ProtoMessage() {} func (*QueryApplicationLinksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{1} + return fileDescriptor_b3b6ad0478f8a288, []int{1} } func (m *QueryApplicationLinksResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -170,7 +170,7 @@ func (m *QueryApplicationLinkByClientIDRequest) Reset() { *m = QueryAppl func (m *QueryApplicationLinkByClientIDRequest) String() string { return proto.CompactTextString(m) } func (*QueryApplicationLinkByClientIDRequest) ProtoMessage() {} func (*QueryApplicationLinkByClientIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{2} + return fileDescriptor_b3b6ad0478f8a288, []int{2} } func (m *QueryApplicationLinkByClientIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -218,7 +218,7 @@ func (m *QueryApplicationLinkByClientIDResponse) Reset() { func (m *QueryApplicationLinkByClientIDResponse) String() string { return proto.CompactTextString(m) } func (*QueryApplicationLinkByClientIDResponse) ProtoMessage() {} func (*QueryApplicationLinkByClientIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{3} + return fileDescriptor_b3b6ad0478f8a288, []int{3} } func (m *QueryApplicationLinkByClientIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -271,7 +271,7 @@ func (m *QueryApplicationLinkOwnersRequest) Reset() { *m = QueryApplicat func (m *QueryApplicationLinkOwnersRequest) String() string { return proto.CompactTextString(m) } func (*QueryApplicationLinkOwnersRequest) ProtoMessage() {} func (*QueryApplicationLinkOwnersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{4} + return fileDescriptor_b3b6ad0478f8a288, []int{4} } func (m *QueryApplicationLinkOwnersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -334,7 +334,7 @@ func (m *QueryApplicationLinkOwnersResponse) Reset() { *m = QueryApplica func (m *QueryApplicationLinkOwnersResponse) String() string { return proto.CompactTextString(m) } func (*QueryApplicationLinkOwnersResponse) ProtoMessage() {} func (*QueryApplicationLinkOwnersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{5} + return fileDescriptor_b3b6ad0478f8a288, []int{5} } func (m *QueryApplicationLinkOwnersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -393,7 +393,7 @@ func (m *QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails) String( } func (*QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails) ProtoMessage() {} func (*QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{5, 0} + return fileDescriptor_b3b6ad0478f8a288, []int{5, 0} } func (m *QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -444,54 +444,54 @@ func (m *QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails) GetUser } func init() { - proto.RegisterType((*QueryApplicationLinksRequest)(nil), "desmos.profiles.v2.QueryApplicationLinksRequest") - proto.RegisterType((*QueryApplicationLinksResponse)(nil), "desmos.profiles.v2.QueryApplicationLinksResponse") - proto.RegisterType((*QueryApplicationLinkByClientIDRequest)(nil), "desmos.profiles.v2.QueryApplicationLinkByClientIDRequest") - proto.RegisterType((*QueryApplicationLinkByClientIDResponse)(nil), "desmos.profiles.v2.QueryApplicationLinkByClientIDResponse") - proto.RegisterType((*QueryApplicationLinkOwnersRequest)(nil), "desmos.profiles.v2.QueryApplicationLinkOwnersRequest") - proto.RegisterType((*QueryApplicationLinkOwnersResponse)(nil), "desmos.profiles.v2.QueryApplicationLinkOwnersResponse") - proto.RegisterType((*QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails)(nil), "desmos.profiles.v2.QueryApplicationLinkOwnersResponse.ApplicationLinkOwnerDetails") + proto.RegisterType((*QueryApplicationLinksRequest)(nil), "desmos.profiles.v3.QueryApplicationLinksRequest") + proto.RegisterType((*QueryApplicationLinksResponse)(nil), "desmos.profiles.v3.QueryApplicationLinksResponse") + proto.RegisterType((*QueryApplicationLinkByClientIDRequest)(nil), "desmos.profiles.v3.QueryApplicationLinkByClientIDRequest") + proto.RegisterType((*QueryApplicationLinkByClientIDResponse)(nil), "desmos.profiles.v3.QueryApplicationLinkByClientIDResponse") + proto.RegisterType((*QueryApplicationLinkOwnersRequest)(nil), "desmos.profiles.v3.QueryApplicationLinkOwnersRequest") + proto.RegisterType((*QueryApplicationLinkOwnersResponse)(nil), "desmos.profiles.v3.QueryApplicationLinkOwnersResponse") + proto.RegisterType((*QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails)(nil), "desmos.profiles.v3.QueryApplicationLinkOwnersResponse.ApplicationLinkOwnerDetails") } func init() { - proto.RegisterFile("desmos/profiles/v2/query_app_links.proto", fileDescriptor_df55d222350c3dbf) + proto.RegisterFile("desmos/profiles/v3/query_app_links.proto", fileDescriptor_b3b6ad0478f8a288) } -var fileDescriptor_df55d222350c3dbf = []byte{ - // 521 bytes of a gzipped FileDescriptorProto +var fileDescriptor_b3b6ad0478f8a288 = []byte{ + // 522 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xc1, 0x6e, 0x13, 0x31, - 0x10, 0x8d, 0x93, 0x50, 0xb5, 0xce, 0xcd, 0xe2, 0x90, 0x6e, 0xcb, 0x12, 0x82, 0x28, 0x01, 0x09, - 0x5b, 0x09, 0x5c, 0x11, 0x22, 0x44, 0xa0, 0x0a, 0x24, 0x60, 0x8f, 0x5c, 0x22, 0x6f, 0xe2, 0x2e, - 0x16, 0x1b, 0xdb, 0x5d, 0x7b, 0x03, 0xf9, 0x0b, 0x7e, 0x83, 0x3f,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a4, 0x8b, 0xcf, 0x72, 0x9a, 0x4d, 0x07, 0x44, 0xca, 0x41, 0xca, 0xf8, 0x67, 0x85, + 0x64, 0x26, 0xb4, 0xf0, 0x3c, 0xcb, 0x44, 0x17, 0x4c, 0x34, 0xe9, 0x06, 0xb7, 0x13, 0x91, 0x08, + 0x03, 0xe3, 0xe2, 0x65, 0x99, 0xc1, 0x61, 0x22, 0x44, 0x92, 0x52, 0x4c, 0x24, 0xc3, 0x84, 0x73, + 0xa1, 0x89, 0x66, 0x82, 0xbb, 0x3e, 0xc1, 0xbe, 0x43, 0x4d, 0x14, 0xe7, 0xa7, 0x98, 0xf0, 0xa9, + 0x83, 0x1e, 0x95, 0x88, 0x19, 0x8b, 0x11, 0x4d, 0xd5, 0xaa, 0x9a, 0x60, 0x7f, 0x28, 0x0a, 0xea, + 0xc0, 0x0e, 0xb7, 0x81, 0x83, 0x1e, 0xdb, 0x08, 0xc7, 0x44, 0x51, 0xbb, 0x0b, 0x9e, 0x74, 0x62, + 0xaa, 0x49, 0x07, 0x4b, 0x92, 0x30, 0x6e, 0xd4, 0x58, 0x6e, 0xeb, 0x07, 0x80, 0x87, 0x1f, 0x0a, + 0xca, 0x0b, 0x29, 0x53, 0x36, 0x34, 0xd0, 0xdb, 0x62, 0x4c, 0x44, 0xcf, 0x72, 0xaa, 0xb4, 0xe7, + 0xc1, 0x7a, 0xae, 0x68, 0xe6, 0x83, 0x26, 0x68, 0xef, 0x45, 0xe6, 0xed, 0x35, 0x61, 0x83, 0x2c, + 0xe9, 0x7e, 0xd5, 0x40, 0x57, 0x53, 0x5e, 0x00, 0x77, 0x0b, 0x26, 0x27, 0x63, 0xea, 0xd7, 0x0c, + 0x7c, 0x19, 0x7b, 0xaf, 0x20, 0x5c, 0xca, 0xf0, 0xeb, 0x4d, 0xd0, 0x6e, 0x1c, 0x1f, 0x21, 0xb7, + 0x41, 0xa1, 0x19, 0x19, 0xcd, 0xc8, 0x69, 0x46, 0xef, 0x49, 0x42, 0x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+ 0x7c, 0x5b, 0x84, 0x95, 0xd9, 0x22, 0xac, 0xfc, 0x5c, 0x84, 0x95, 0x8f, 0x9d, 0x84, 0xe9, 0x4f, + 0x79, 0x8c, 0x86, 0x62, 0x8c, 0xad, 0x7f, 0x4f, 0x52, 0x12, 0x2b, 0xf7, 0xc6, 0x93, 0xa7, 0xf8, + 0xeb, 0xf2, 0xe3, 0xa5, 0xa7, 0x92, 0xaa, 0x78, 0xc7, 0x7c, 0x68, 0xba, 0x7f, 0x02, 0x00, 0x00, + 0xff, 0xff, 0x59, 0xd6, 0xf6, 0x1c, 0x69, 0x05, 0x00, 0x00, } func (m *QueryApplicationLinksRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/query_chain_links.pb.go b/x/profiles/types/query_chain_links.pb.go index 740fed69a5..13e853c2b9 100644 --- a/x/profiles/types/query_chain_links.pb.go +++ b/x/profiles/types/query_chain_links.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/query_chain_links.proto +// source: desmos/profiles/v3/query_chain_links.proto package types @@ -48,7 +48,7 @@ func (m *QueryChainLinksRequest) Reset() { *m = QueryChainLinksRequest{} func (m *QueryChainLinksRequest) String() string { return proto.CompactTextString(m) } func (*QueryChainLinksRequest) ProtoMessage() {} func (*QueryChainLinksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f3f86dba4268625b, []int{0} + return fileDescriptor_17ef8689aa5884e9, []int{0} } func (m *QueryChainLinksRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -117,7 +117,7 @@ func (m *QueryChainLinksResponse) Reset() { *m = QueryChainLinksResponse func (m *QueryChainLinksResponse) String() string { return proto.CompactTextString(m) } func (*QueryChainLinksResponse) ProtoMessage() {} func (*QueryChainLinksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f3f86dba4268625b, []int{1} + return fileDescriptor_17ef8689aa5884e9, []int{1} } func (m *QueryChainLinksResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -177,7 +177,7 @@ func (m *QueryChainLinkOwnersRequest) Reset() { *m = QueryChainLinkOwner func (m *QueryChainLinkOwnersRequest) String() string { return proto.CompactTextString(m) } func (*QueryChainLinkOwnersRequest) ProtoMessage() {} func (*QueryChainLinkOwnersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f3f86dba4268625b, []int{2} + return fileDescriptor_17ef8689aa5884e9, []int{2} } func (m *QueryChainLinkOwnersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -240,7 +240,7 @@ func (m *QueryChainLinkOwnersResponse) Reset() { *m = QueryChainLinkOwne func (m *QueryChainLinkOwnersResponse) String() string { return proto.CompactTextString(m) } func (*QueryChainLinkOwnersResponse) ProtoMessage() {} func (*QueryChainLinkOwnersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f3f86dba4268625b, []int{3} + return fileDescriptor_17ef8689aa5884e9, []int{3} } func (m *QueryChainLinkOwnersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -298,7 +298,7 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) String() string { } func (*QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) ProtoMessage() {} func (*QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) Descriptor() ([]byte, []int) { - return fileDescriptor_f3f86dba4268625b, []int{3, 0} + return fileDescriptor_17ef8689aa5884e9, []int{3, 0} } func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -349,49 +349,49 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) GetTarget() string } func init() { - proto.RegisterType((*QueryChainLinksRequest)(nil), "desmos.profiles.v2.QueryChainLinksRequest") - proto.RegisterType((*QueryChainLinksResponse)(nil), "desmos.profiles.v2.QueryChainLinksResponse") - proto.RegisterType((*QueryChainLinkOwnersRequest)(nil), "desmos.profiles.v2.QueryChainLinkOwnersRequest") - proto.RegisterType((*QueryChainLinkOwnersResponse)(nil), "desmos.profiles.v2.QueryChainLinkOwnersResponse") - proto.RegisterType((*QueryChainLinkOwnersResponse_ChainLinkOwnerDetails)(nil), "desmos.profiles.v2.QueryChainLinkOwnersResponse.ChainLinkOwnerDetails") + proto.RegisterType((*QueryChainLinksRequest)(nil), "desmos.profiles.v3.QueryChainLinksRequest") + proto.RegisterType((*QueryChainLinksResponse)(nil), "desmos.profiles.v3.QueryChainLinksResponse") + proto.RegisterType((*QueryChainLinkOwnersRequest)(nil), "desmos.profiles.v3.QueryChainLinkOwnersRequest") + proto.RegisterType((*QueryChainLinkOwnersResponse)(nil), "desmos.profiles.v3.QueryChainLinkOwnersResponse") + proto.RegisterType((*QueryChainLinkOwnersResponse_ChainLinkOwnerDetails)(nil), "desmos.profiles.v3.QueryChainLinkOwnersResponse.ChainLinkOwnerDetails") } func init() { - proto.RegisterFile("desmos/profiles/v2/query_chain_links.proto", fileDescriptor_f3f86dba4268625b) + proto.RegisterFile("desmos/profiles/v3/query_chain_links.proto", fileDescriptor_17ef8689aa5884e9) } -var fileDescriptor_f3f86dba4268625b = []byte{ +var fileDescriptor_17ef8689aa5884e9 = []byte{ // 476 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0x4f, 0x6f, 0xd3, 0x30, 0x18, 0x87, 0xeb, 0xb6, 0x54, 0x9a, 0x77, 0xb3, 0x60, 0x64, 0x61, 0x0b, 0xd5, 0x0e, 0x50, 0x0d, - 0x61, 0xab, 0x85, 0x0b, 0xd7, 0x81, 0xc6, 0x01, 0xc4, 0x9f, 0x1e, 0xb9, 0x54, 0x4e, 0xfb, 0x2e, - 0xb3, 0x48, 0xec, 0x2c, 0x76, 0x0a, 0xfd, 0x16, 0x7c, 0x00, 0xf8, 0x04, 0x9c, 0xf8, 0x16, 0x3b, - 0xee, 0xc8, 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0x8f, 0x12, 0x8a, + 0x0b, 0xa5, 0x75, 0x7d, 0xe8, 0xdf, 0xfa, 0xda, 0x57, 0xe8, 0xeb, 0x5c, 0x5b, 0xdf, 0xf7, 0x36, + 0xde, 0x69, 0xc6, 0xf3, 0x0e, 0x67, 0xb8, 0xa7, 0xec, 0x8e, 0x97, 0x78, 0xd4, 0x24, 0xf1, 0xaa, + 0x1b, 0x68, 0x7d, 0xff, 0x39, 0x18, 0x2e, 0x52, 0xed, 0x6d, 0xfb, 0xbb, 0x6f, 0x4c, 0x77, 0x18, + 0xe3, 0x3b, 0x8d, 0x79, 0x37, 0xf8, 0xe9, 0x1e, 0xbe, 0x3c, 0x5b, 0x46, 0xe8, 0x7c, 0x19, 0xa1, + 0x5f, 0xcb, 0x08, 0x7d, 0x5e, 0x45, 0xad, 0xf3, 0x55, 0xd4, 0xfa, 0xb1, 0x8a, 0x5a, 0xef, 0x87, + 0x89, 0x30, 0x27, 0x65, 0x4c, 0xa7, 0x2a, 0x63, 0x4e, 0xd3, 0xe3, 0x94, 0xc7, 0xda, 0xaf, 0xd9, + 0xfc, 0x09, 0xfb, 0x74, 0xf9, 0x94, 0xcd, 0x22, 0x07, 0x1d, 0xf7, 0xec, 0xa3, 0x1b, 0xfd, 0x0e, + 0x00, 0x00, 0xff, 0xff, 0x34, 0x00, 0x65, 0xf3, 0x79, 0x04, 0x00, 0x00, } func (m *QueryChainLinksRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/query_dtag_requests.pb.go b/x/profiles/types/query_dtag_requests.pb.go index 3db5f2ea36..97d1ea3c26 100644 --- a/x/profiles/types/query_dtag_requests.pb.go +++ b/x/profiles/types/query_dtag_requests.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/query_dtag_requests.proto +// source: desmos/profiles/v3/query_dtag_requests.proto package types @@ -43,7 +43,7 @@ func (m *QueryIncomingDTagTransferRequestsRequest) Reset() { func (m *QueryIncomingDTagTransferRequestsRequest) String() string { return proto.CompactTextString(m) } func (*QueryIncomingDTagTransferRequestsRequest) ProtoMessage() {} func (*QueryIncomingDTagTransferRequestsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1695790c33fec123, []int{0} + return fileDescriptor_ba6e00c149c010bd, []int{0} } func (m *QueryIncomingDTagTransferRequestsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -90,7 +90,7 @@ func (m *QueryIncomingDTagTransferRequestsResponse) String() string { } func (*QueryIncomingDTagTransferRequestsResponse) ProtoMessage() {} func (*QueryIncomingDTagTransferRequestsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1695790c33fec123, []int{1} + return fileDescriptor_ba6e00c149c010bd, []int{1} } func (m *QueryIncomingDTagTransferRequestsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -134,41 +134,41 @@ func (m *QueryIncomingDTagTransferRequestsResponse) GetPagination() *query.PageR } func init() { - proto.RegisterType((*QueryIncomingDTagTransferRequestsRequest)(nil), "desmos.profiles.v2.QueryIncomingDTagTransferRequestsRequest") - proto.RegisterType((*QueryIncomingDTagTransferRequestsResponse)(nil), "desmos.profiles.v2.QueryIncomingDTagTransferRequestsResponse") + proto.RegisterType((*QueryIncomingDTagTransferRequestsRequest)(nil), "desmos.profiles.v3.QueryIncomingDTagTransferRequestsRequest") + proto.RegisterType((*QueryIncomingDTagTransferRequestsResponse)(nil), "desmos.profiles.v3.QueryIncomingDTagTransferRequestsResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/query_dtag_requests.proto", fileDescriptor_1695790c33fec123) + proto.RegisterFile("desmos/profiles/v3/query_dtag_requests.proto", fileDescriptor_ba6e00c149c010bd) } -var fileDescriptor_1695790c33fec123 = []byte{ - // 395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xb1, 0xce, 0xd3, 0x30, - 0x14, 0x85, 0x63, 0x40, 0xe8, 0x27, 0xff, 0x16, 0x31, 0xb4, 0x11, 0x4a, 0xab, 0x0e, 0x34, 0x20, - 0x6a, 0xab, 0x81, 0x89, 0xb1, 0x42, 0xa0, 0x8a, 0x05, 0xa2, 0x4e, 0x2c, 0x95, 0x93, 0xde, 0x9a, +var fileDescriptor_ba6e00c149c010bd = []byte{ + // 396 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xb1, 0xae, 0xd3, 0x30, + 0x18, 0x85, 0x63, 0x40, 0xe8, 0x92, 0xbb, 0x45, 0x0c, 0x6d, 0x84, 0xd2, 0xaa, 0x03, 0x0d, 0x88, + 0xda, 0x6a, 0xcb, 0xc4, 0x58, 0x21, 0x50, 0xc5, 0x02, 0x51, 0x27, 0x96, 0xca, 0x49, 0xff, 0x9a, 0x48, 0x89, 0x9d, 0xda, 0x4e, 0x44, 0xdf, 0x80, 0x91, 0x91, 0xb1, 0x6f, 0xc2, 0xda, 0xb1, 0x23, - 0x13, 0x42, 0xed, 0xc2, 0x63, 0xa0, 0xc4, 0xa6, 0xad, 0x44, 0x24, 0x98, 0xe2, 0x9b, 0x73, 0x7c, - 0xf2, 0x1d, 0xdd, 0xb8, 0xcf, 0x56, 0xa0, 0x0a, 0xa1, 0x48, 0x29, 0xc5, 0x3a, 0xcb, 0x41, 0x91, - 0x3a, 0x22, 0x9b, 0x0a, 0xe4, 0x76, 0xb9, 0xd2, 0x94, 0x2d, 0x25, 0x6c, 0x2a, 0x50, 0x5a, 0xe1, - 0x52, 0x0a, 0x2d, 0x3c, 0xcf, 0xb8, 0xf1, 0x1f, 0x37, 0xae, 0x23, 0xff, 0x21, 0x13, 0x4c, 0xb4, - 0x32, 0x69, 0x4e, 0xc6, 0xe9, 0x3f, 0x62, 0x42, 0xb0, 0x1c, 0x08, 0x2d, 0x33, 0x42, 0x39, 0x17, - 0x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x68, 0xac, 0xec, 0x99, 0x54, + 0x2f, 0xc9, 0xe7, 0xcb, 0x8f, 0xa0, 0xb7, 0x05, 0xa8, 0xf8, 0x61, 0xb3, 0xb0, 0xe9, 0x9f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xb6, 0xcd, 0x12, 0xd1, 0xb9, 0x02, 0x00, 0x00, } func (m *QueryIncomingDTagTransferRequestsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/query_params.pb.go b/x/profiles/types/query_params.pb.go index 627a659f57..8083507a39 100644 --- a/x/profiles/types/query_params.pb.go +++ b/x/profiles/types/query_params.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/query_params.proto +// source: desmos/profiles/v3/query_params.proto package types @@ -35,7 +35,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cc715515401743a, []int{0} + return fileDescriptor_9afa8e27b0a00e24, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -73,7 +73,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cc715515401743a, []int{1} + return fileDescriptor_9afa8e27b0a00e24, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -110,19 +110,19 @@ func (m *QueryParamsResponse) GetParams() Params { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "desmos.profiles.v2.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "desmos.profiles.v2.QueryParamsResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "desmos.profiles.v3.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "desmos.profiles.v3.QueryParamsResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/query_params.proto", fileDescriptor_3cc715515401743a) + proto.RegisterFile("desmos/profiles/v3/query_params.proto", fileDescriptor_9afa8e27b0a00e24) } -var fileDescriptor_3cc715515401743a = []byte{ +var fileDescriptor_9afa8e27b0a00e24 = []byte{ // 294 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xb1, 0x4e, 0xf3, 0x30, 0x14, 0x85, 0x13, 0xe9, 0x57, 0x87, 0xfc, 0x5b, 0xe8, 0x40, 0x23, 0x64, 0x50, 0x25, 0x10, 0x42, - 0xc2, 0x57, 0x0d, 0x0c, 0xcc, 0x5d, 0x19, 0x80, 0x8e, 0x2c, 0x95, 0xdd, 0xba, 0x26, 0x52, 0xe2, + 0xc2, 0x57, 0x25, 0x0c, 0xcc, 0x5d, 0x19, 0x80, 0x8e, 0x2c, 0x95, 0xdd, 0xba, 0x26, 0x52, 0xe2, 0xeb, 0xc6, 0x4e, 0x44, 0xde, 0x82, 0xc7, 0xea, 0xd8, 0x91, 0x09, 0xa1, 0xe4, 0x45, 0x50, 0x62, 0x23, 0x54, 0xc1, 0x76, 0x8f, 0xcf, 0xe7, 0xe3, 0xe3, 0x1b, 0x9d, 0xaf, 0x85, 0x29, 0xd0, 0x80, 0x2e, 0x71, 0x93, 0xe5, 0xc2, 0x40, 0x9d, 0xc2, 0xb6, 0x12, 0x65, 0xb3, 0xd4, 0xac, 0x64, 0x85, @@ -133,12 +133,12 @@ var fileDescriptor_3cc715515401743a = []byte{ 0x09, 0x6f, 0x5d, 0x39, 0x05, 0x9c, 0x19, 0xe1, 0x7e, 0x01, 0xf5, 0x8c, 0x0b, 0xcb, 0x66, 0xa0, 0x99, 0xcc, 0xd4, 0x50, 0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0x85, 0xe1, 0xa3, 0xa1, 0x7a, 0xfa, 0x15, 0x00, 0x00, 0xff, 0xff, 0xc4, 0x40, + 0x1c, 0xd7, 0xb5, 0x01, 0x00, 0x00, } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/query_profile.pb.go b/x/profiles/types/query_profile.pb.go index 5d473491e4..2708aa289c 100644 --- a/x/profiles/types/query_profile.pb.go +++ b/x/profiles/types/query_profile.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/query_profile.proto +// source: desmos/profiles/v3/query_profile.proto package types @@ -37,7 +37,7 @@ func (m *QueryProfileRequest) Reset() { *m = QueryProfileRequest{} } func (m *QueryProfileRequest) String() string { return proto.CompactTextString(m) } func (*QueryProfileRequest) ProtoMessage() {} func (*QueryProfileRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_705b9d777999c138, []int{0} + return fileDescriptor_7c0e029b5401ec84, []int{0} } func (m *QueryProfileRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -75,7 +75,7 @@ func (m *QueryProfileResponse) Reset() { *m = QueryProfileResponse{} } func (m *QueryProfileResponse) String() string { return proto.CompactTextString(m) } func (*QueryProfileResponse) ProtoMessage() {} func (*QueryProfileResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_705b9d777999c138, []int{1} + return fileDescriptor_7c0e029b5401ec84, []int{1} } func (m *QueryProfileResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -112,36 +112,36 @@ func (m *QueryProfileResponse) GetProfile() *types.Any { } func init() { - proto.RegisterType((*QueryProfileRequest)(nil), "desmos.profiles.v2.QueryProfileRequest") - proto.RegisterType((*QueryProfileResponse)(nil), "desmos.profiles.v2.QueryProfileResponse") + proto.RegisterType((*QueryProfileRequest)(nil), "desmos.profiles.v3.QueryProfileRequest") + proto.RegisterType((*QueryProfileResponse)(nil), "desmos.profiles.v3.QueryProfileResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/query_profile.proto", fileDescriptor_705b9d777999c138) + proto.RegisterFile("desmos/profiles/v3/query_profile.proto", fileDescriptor_7c0e029b5401ec84) } -var fileDescriptor_705b9d777999c138 = []byte{ - // 319 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x51, 0xb1, 0x4e, 0xf3, 0x30, - 0x18, 0x4c, 0xa4, 0x5f, 0x3f, 0x25, 0x30, 0x85, 0x0e, 0x50, 0xa1, 0x14, 0x75, 0x40, 0x08, 0xa9, - 0xfe, 0xd4, 0x96, 0x09, 0xb1, 0xb4, 0x1b, 0x62, 0x81, 0x8a, 0x89, 0xa5, 0x72, 0x82, 0x6b, 0x22, - 0xb5, 0xfe, 0xdc, 0xd8, 0x8e, 0xc8, 0x1b, 0x30, 0xf2, 0x08, 0x7d, 0x08, 0x1e, 0x02, 0x31, 0x75, - 0x64, 0x44, 0xed, 0xc2, 0x63, 0xa0, 0xda, 0x8e, 0x10, 0xdb, 0x77, 0xbe, 0x3b, 0xdf, 0x77, 0x76, - 0x74, 0xfa, 0xc8, 0xd4, 0x1c, 0x15, 0xc8, 0x02, 0xa7, 0xf9, 0x8c, 0x29, 0x28, 0xfb, 0xb0, 0x30, - 0xac, 0xa8, 0x26, 0xfe, 0x84, 0xc8, 0x02, 0x35, 0xc6, 0xb1, 0xd3, 0x91, 0x5a, 0x47, 0xca, 0x7e, - 0xab, 0xc9, 0x91, 0xa3, 0xa5, 0x61, 0x3b, 0x39, 0x65, 0xeb, 0x98, 0x23, 0xf2, 0x19, 0x03, 0x2a, - 0x73, 0xa0, 0x42, 0xa0, 0xa6, 0x3a, 0x47, 0xa1, 0x3c, 0x7b, 0xe4, 0x59, 0x8b, 0x52, 0x33, 0x05, - 0x2a, 0xaa, 0x9a, 0xca, 0x70, 0x1b, 0x31, 0x71, 0x37, 0x3a, 0xe0, 0xa9, 0x73, 0x87, 0x20, 0xa5, - 0x8a, 0xb9, 0xf5, 0xa0, 0xec, 0xa5, 0x4c, 0xd3, 0x1e, 0x48, 0xca, 0x73, 0x61, 0x23, 0x9c, 0xb6, - 0x33, 0x88, 0x0e, 0xee, 0xb6, 0x8a, 0x5b, 0xb7, 0xe9, 0x98, 0x2d, 0x0c, 0x53, 0x3a, 0x8e, 0xa3, - 0x7f, 0x46, 0xb1, 0xe2, 0x30, 0x3c, 0x09, 0xcf, 0x76, 0xc7, 0x76, 0xbe, 0x6c, 0xbc, 0x2c, 0xdb, - 0xc1, 0xf7, 0xb2, 0x1d, 0x74, 0xee, 0xa3, 0xe6, 0x5f, 0x93, 0x92, 0x28, 0x14, 0x8b, 0xaf, 0xa2, - 0x1d, 0xdf, 0xd8, 0x1a, 0xf7, 0xfa, 0x4d, 0xe2, 0x0a, 0x90, 0xba, 0x00, 0x19, 0x8a, 0x6a, 0xb4, - 0xff, 0xf1, 0xd6, 0x6d, 0x0c, 0xb3, 0x0c, 0x8d, 0xd0, 0xd7, 0xe3, 0xda, 0x32, 0xba, 0x79, 0x5f, - 0x27, 0xe1, 0x6a, 0x9d, 0x84, 0x5f, 0xeb, 0x24, 0x7c, 0xdd, 0x24, 0xc1, 0x6a, 0x93, 0x04, 0x9f, - 0x9b, 0x24, 0x78, 0xe8, 0xf1, 0x5c, 0x3f, 0x99, 0x94, 0x64, 0x38, 0x07, 0xf7, 0xb2, 0xdd, 0x19, - 0x4d, 0x95, 0x9f, 0xa1, 0xbc, 0x80, 0xe7, 0xdf, 0x2f, 0xd1, 0x95, 0x64, 0x2a, 0xfd, 0x6f, 0x13, - 0x07, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x43, 0xf4, 0x50, 0x8e, 0xb2, 0x01, 0x00, 0x00, +var fileDescriptor_7c0e029b5401ec84 = []byte{ + // 317 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff,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 0xc5, 0xa1, 0x7f, 0xe2, 0x9f, 0xed, 0x8e, 0xcd, 0x7c, 0xd5, 0x7a, 0x5d, 0x76, 0xbd, 0x9f, + 0x65, 0xd7, 0xeb, 0x3d, 0x04, 0xed, 0xff, 0x26, 0x29, 0x90, 0x4b, 0x16, 0x5e, 0x07, 0x3b, 0xae, + 0xb1, 0x31, 0xee, 0x5d, 0xb4, 0x89, 0x2d, 0x40, 0x9a, 0x02, 0x64, 0xc8, 0xab, 0xd1, 0xfe, 0xe7, + 0x7b, 0xbf, 0x35, 0x4c, 0x53, 0xd4, 0x5c, 0xdd, 0x8c, 0x1b, 0xcb, 0xe8, 0xf6, 0x63, 0x1d, 0xf9, + 0xab, 0x75, 0xe4, 0x7f, 0xaf, 0x23, 0xff, 0x6d, 0x13, 0x79, 0xab, 0x4d, 0xe4, 0x7d, 0x6d, 0x22, + 0xef, 0x71, 0x90, 0xe5, 0xea, 0x59, 0x27, 0x24, 0xc5, 0x39, 0xd8, 0x97, 0xed, 0xcf, 0x68, 0x22, + 0xdd, 0x0c, 0xe5, 0x25, 0xbc, 0xfc, 0x7d, 0x89, 0xaa, 0x04, 0x93, 0xc9, 0xb6, 0x49, 0x8c, 0x7f, + 0x03, 0x00, 0x00, 0xff, 0xff, 0x01, 0x0a, 0x39, 0x3f, 0xb2, 0x01, 0x00, 0x00, } func (m *QueryProfileRequest) Marshal() (dAtA []byte, err error) { From 9248cb3e635e6b712e57b888e7fd13ed3f88a1e1 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 8 Jul 2022 08:12:24 +0200 Subject: [PATCH 095/112] updated go package Signed-off-by: Riccardo Montagnin --- go.mod | 2 -- go.sum | 19 ------------------- x/profiles/keeper/alias_functions_test.go | 2 +- .../keeper_app_links_benchmarks_test.go | 11 ++++++----- x/profiles/keeper/keeper_app_links_test.go | 3 +-- 5 files changed, 8 insertions(+), 29 deletions(-) diff --git a/go.mod b/go.mod index e4aba92e9f..096c0623d2 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,6 @@ require ( github.com/cosmos/cosmos-sdk v0.45.4 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/ibc-go/v3 v3.1.0 - github.com/desmos-labs/desmos/v3 v3.2.0 github.com/ethereum/go-ethereum v1.10.18 github.com/ghodss/yaml v1.0.0 github.com/gogo/protobuf v1.3.3 @@ -71,7 +70,6 @@ require ( github.com/cosmos/btcutil v1.0.4 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/cosmos/iavl v0.17.3 // indirect - github.com/cosmos/ibc-go/v2 v2.2.0 // indirect github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect github.com/cosmos/ledger-go v0.9.2 // indirect github.com/daixiang0/gci v0.3.3 // indirect diff --git a/go.sum b/go.sum index 9372235cfb..e60b6e9d9c 100644 --- a/go.sum +++ b/go.sum @@ -101,7 +101,6 @@ github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CosmWasm/wasmvm v1.0.0-beta10/go.mod h1:y+yd9piV8KlrB7ISRZz1sDwH4UVm4Q9rEX9501dBNog= github.com/CosmWasm/wasmvm v1.0.0 h1:NRmnHe3xXsKn2uEcB1F5Ha323JVAhON+BI6L177dlKc= github.com/CosmWasm/wasmvm v1.0.0/go.mod h1:ei0xpvomwSdONsxDuONzV7bL1jSET1M8brEx0FCXc+A= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= @@ -173,7 +172,6 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5 github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-metrics v0.3.11/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= @@ -212,7 +210,6 @@ github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/bkielbasa/cyclop v1.2.0 h1:7Jmnh0yL2DjKfw28p86YTd/B4lRGcNuu12sKE35sM7A= github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= @@ -325,8 +322,6 @@ github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4 github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y= github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= -github.com/cosmos/ibc-go/v2 v2.2.0 h1:nqpvElI9ku5oQZtKvLerhZ/UXH7QoL44VBTWwZkS4C8= -github.com/cosmos/ibc-go/v2 v2.2.0/go.mod h1:rAHRlBcRiHPP/JszN+08SJx3pegww9bcVncIb9QLx7I= github.com/cosmos/ibc-go/v3 v3.0.0/go.mod h1:Mb+1NXiPOLd+CPFlOC6BKeAUaxXlhuWenMmRiUiSmwY= github.com/cosmos/ibc-go/v3 v3.1.0 h1:aVPqkrGBluz6t9+d/sLZIG/zQ9O1KJzVeR4UlL/IFTQ= github.com/cosmos/ibc-go/v3 v3.1.0/go.mod h1:DbOlOa4yKumaHGKApKkJN90L88PCjSD9ZBdAfL9tT40= @@ -371,8 +366,6 @@ github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20220620111621-ec38a43a60c9 h1:V8P8q102LhzfLzTHaL7w/lnKaaafUI/lLHO1vEi1qfA= github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20220620111621-ec38a43a60c9/go.mod h1:WOqtDxN3eCCmnYLVla10xG7lEXkFjpTaqm2a2WasgCc= -github.com/desmos-labs/desmos/v3 v3.2.0 h1:HSjO48b8MaEfKyJ2KHWY01XWkV6TMFuzBDlQLL0WNiY= -github.com/desmos-labs/desmos/v3 v3.2.0/go.mod h1:2t64ztQh0t4d5dGhPE1bfrAgTj4irGqczR6TOPpcrQU= github.com/desmos-labs/ledger-desmos-go v0.11.2-0.20210814121638-5d87e392e8a9 h1:b77qmphsyX3+hjJraaqLyzjt9eKqbosy4LaYScPvTAs= github.com/desmos-labs/ledger-desmos-go v0.11.2-0.20210814121638-5d87e392e8a9/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/desmos-labs/wasmd v0.23.1-0.20220525160858-4494e885f34a h1:/I5jVg5JGEDc2tqu+96lavSfXxGf1ZfjU6B5ZJyBv8E= @@ -399,7 +392,6 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= -github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -422,7 +414,6 @@ github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= -github.com/ethereum/go-ethereum v1.10.16/go.mod h1:Anj6cxczl+AHy63o4X9O8yWNHuN5wMpfb8MAnHkWn7Y= github.com/ethereum/go-ethereum v1.10.18 h1:hLEd5M+UD0GJWPaROiYMRgZXl6bi5YwoTJSthsx5CZw= github.com/ethereum/go-ethereum v1.10.18/go.mod h1:RD3NhcSBjZpj3k+SnQq24wBrmnmie78P5R/P62iNBD8= github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= @@ -679,7 +670,6 @@ github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4Mgqvf github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -819,7 +809,6 @@ github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63 github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= -github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= @@ -1175,7 +1164,6 @@ github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChl github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -1368,7 +1356,6 @@ github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= @@ -1376,7 +1363,6 @@ github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3 github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= @@ -1392,7 +1378,6 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= github.com/spf13/viper v1.11.0 h1:7OX/1FS6n7jHD1zGrZTM7WtY13ZELRyosK4k93oPr44= @@ -1749,7 +1734,6 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -2062,7 +2046,6 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= @@ -2210,8 +2193,6 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/x/profiles/keeper/alias_functions_test.go b/x/profiles/keeper/alias_functions_test.go index 4e0deb6c80..6ffcf2c00e 100644 --- a/x/profiles/keeper/alias_functions_test.go +++ b/x/profiles/keeper/alias_functions_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "time" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v4/testutil" "github.com/desmos-labs/desmos/v4/testutil/profilestesting" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" diff --git a/x/profiles/keeper/keeper_app_links_benchmarks_test.go b/x/profiles/keeper/keeper_app_links_benchmarks_test.go index 2d906aa376..c82b359c2b 100644 --- a/x/profiles/keeper/keeper_app_links_benchmarks_test.go +++ b/x/profiles/keeper/keeper_app_links_benchmarks_test.go @@ -5,6 +5,8 @@ import ( "testing" "time" + "github.com/desmos-labs/desmos/v4/testutil/profilestesting" + "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -18,10 +20,9 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" db "github.com/tendermint/tm-db" - "github.com/desmos-labs/desmos/v3/app" - "github.com/desmos-labs/desmos/v3/testutil" - "github.com/desmos-labs/desmos/v3/x/profiles/keeper" - "github.com/desmos-labs/desmos/v3/x/profiles/types" + "github.com/desmos-labs/desmos/v4/app" + "github.com/desmos-labs/desmos/v4/x/profiles/keeper" + "github.com/desmos-labs/desmos/v4/x/profiles/types" ) func setupBenchTest() (authkeeper.AccountKeeper, keeper.Keeper, sdk.Context) { @@ -111,7 +112,7 @@ func BenchmarkKeeper_DeleteExpiredApplicationLinks(b *testing.B) { ctx, _ = ctx.CacheContext() for _, link := range links { - ak.SetAccount(ctx, testutil.ProfileFromAddr(link.User)) + ak.SetAccount(ctx, profilestesting.ProfileFromAddr(link.User)) err := k.SaveApplicationLink(ctx, link) require.NoError(b, err) } diff --git a/x/profiles/keeper/keeper_app_links_test.go b/x/profiles/keeper/keeper_app_links_test.go index 1f549f5ed8..ac7ab61fab 100644 --- a/x/profiles/keeper/keeper_app_links_test.go +++ b/x/profiles/keeper/keeper_app_links_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "time" - "github.com/desmos-labs/desmos/v3/testutil" "github.com/desmos-labs/desmos/v4/testutil/profilestesting" sdk "github.com/cosmos/cosmos-sdk/types" @@ -575,7 +574,7 @@ func (suite *KeeperTestSuite) Test_DeleteExpiredApplicationLinks() { time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(address))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(address))) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) }, From c63d070fe39f9266e052938d7f8c48d50cb78c1c Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 8 Jul 2022 08:15:01 +0200 Subject: [PATCH 096/112] updated Proto files definitions Signed-off-by: Riccardo Montagnin --- .../desmos/profiles/v2/models_app_links.proto | 7 - proto/desmos/profiles/v2/models_params.proto | 17 - .../desmos/profiles/v3/models_app_links.proto | 7 + x/profiles/legacy/v5/models_app_links.pb.go | 175 ++++------ x/profiles/legacy/v5/models_params.pb.go | 312 +++--------------- x/profiles/types/models_app_links.pb.go | 175 ++++++---- 6 files changed, 228 insertions(+), 465 deletions(-) diff --git a/proto/desmos/profiles/v2/models_app_links.proto b/proto/desmos/profiles/v2/models_app_links.proto index 4648a0eacb..972946bd71 100644 --- a/proto/desmos/profiles/v2/models_app_links.proto +++ b/proto/desmos/profiles/v2/models_app_links.proto @@ -37,13 +37,6 @@ message ApplicationLink { (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"creation_time\"" ]; - - // ExpirationTime represents the time in which the link will expire - google.protobuf.Timestamp expiration_time = 7 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"expiration_time\"" - ]; } // Data contains the data associated to a specific user of a diff --git a/proto/desmos/profiles/v2/models_params.proto b/proto/desmos/profiles/v2/models_params.proto index f3390b72c9..ead20b3078 100644 --- a/proto/desmos/profiles/v2/models_params.proto +++ b/proto/desmos/profiles/v2/models_params.proto @@ -29,11 +29,6 @@ message Params { (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"oracle\"" ]; - - AppLinksParams app_links = 5 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"app_links\"" - ]; } // NicknameParams defines the parameters related to the profiles nicknames @@ -120,16 +115,4 @@ message OracleParams { (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.moretags) = "yaml:\"fee_amount\"" ]; -} - -// AppLinksParams define the parameters related to the app links -message AppLinksParams { - option (gogoproto.goproto_getters) = false; - - // ExpirationTime indicates the max amount of time before a link expires - google.protobuf.Duration expiration_time = 1 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"expiration_time\"" - ]; } \ No newline at end of file diff --git a/proto/desmos/profiles/v3/models_app_links.proto b/proto/desmos/profiles/v3/models_app_links.proto index c21c5c32f6..4a15cbc381 100644 --- a/proto/desmos/profiles/v3/models_app_links.proto +++ b/proto/desmos/profiles/v3/models_app_links.proto @@ -37,6 +37,13 @@ message ApplicationLink { (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"creation_time\"" ]; + + // ExpirationTime represents the time in which the link will expire + google.protobuf.Timestamp expiration_time = 7 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"expiration_time\"" + ]; } // Data contains the data associated to a specific user of a diff --git a/x/profiles/legacy/v5/models_app_links.pb.go b/x/profiles/legacy/v5/models_app_links.pb.go index 6133b3d1e6..99f677a192 100644 --- a/x/profiles/legacy/v5/models_app_links.pb.go +++ b/x/profiles/legacy/v5/models_app_links.pb.go @@ -83,8 +83,6 @@ type ApplicationLink struct { Result *Result `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty" yaml:"result"` // CreationTime represents the time in which the link was created CreationTime time.Time `protobuf:"bytes,6,opt,name=creation_time,json=creationTime,proto3,stdtime" json:"creation_time" yaml:"creation_time"` - // ExpirationTime represents the time in which the link will expire - ExpirationTime time.Time `protobuf:"bytes,7,opt,name=expiration_time,json=expirationTime,proto3,stdtime" json:"expiration_time" yaml:"expiration_time"` } func (m *ApplicationLink) Reset() { *m = ApplicationLink{} } @@ -453,69 +451,68 @@ func init() { } var fileDescriptor_c4a613de86d4edc0 = []byte{ - // 992 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x6f, 0xdb, 0x36, - 0x18, 0xf6, 0x87, 0xe2, 0xc4, 0x4c, 0x93, 0x78, 0x4c, 0xd6, 0x19, 0x02, 0x6a, 0x29, 0xca, 0x30, - 0xa4, 0x1d, 0x2a, 0x61, 0xde, 0x0a, 0x0c, 0x19, 0x36, 0xc0, 0xb2, 0x15, 0x54, 0x5b, 0x16, 0x07, - 0xb4, 0xd2, 0x02, 0xbd, 0x08, 0x8c, 0xc4, 0x78, 0x44, 0x65, 0xcb, 0xd3, 0x47, 0xd0, 0x6e, 0xd8, - 0xbd, 0xc8, 0xa9, 0x7f, 0x20, 0x40, 0x81, 0xfd, 0x89, 0xdd, 0x76, 0xd8, 0xa5, 0xc7, 0xee, 0xb6, - 0x93, 0x36, 0x38, 0x97, 0x9d, 0xfd, 0x0b, 0x06, 0x91, 0x52, 0xec, 0x34, 0x71, 0x53, 0x60, 0x37, - 0x99, 0xef, 0xf3, 0xf1, 0x92, 0xcf, 0x4b, 0xc2, 0xe0, 0xae, 0x4b, 0xc2, 0x81, 0x1f, 0x6a, 0xa3, - 0xc0, 0x3f, 0xa6, 0x1e, 0x09, 0xb5, 0x93, 0xa6, 0x36, 0xf0, 0x5d, 0xe2, 0x85, 0x36, 0x1e, 0x8d, - 0x6c, 0x8f, 0x0e, 0x9f, 0x86, 0xea, 0x28, 0xf0, 0x23, 0x1f, 0x42, 0x0e, 0x55, 0x73, 0xa8, 0x7a, - 0xd2, 0x14, 0x37, 0xfa, 0x7e, 0xdf, 0x67, 0x65, 0x2d, 0xfd, 0xe2, 0x48, 0x51, 0xea, 0xfb, 0x7e, - 0xdf, 0x23, 0x1a, 0xfb, 0x75, 0x14, 0x1f, 0x6b, 0x11, 0x1d, 0x90, 0x30, 0xc2, 0x83, 0x11, 0x07, - 0x28, 0x7f, 0x0a, 0x60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89, 0xc2, 0x8b, 0x5f, 0x1b, - 0x05, 0xbd, 0xfb, 0x7a, 0xdc, 0x28, 0xbe, 0x19, 0x37, 0x8a, 0xff, 0x8c, 0x1b, 0xc5, 0x97, 0xe7, - 0x8d, 0xc2, 0x9b, 0xf3, 0x46, 0xe1, 0xaf, 0xf3, 0x46, 0xe1, 0xc9, 0x83, 0x3e, 0x8d, 0x7e, 0x88, - 0x8f, 0x54, 0xc7, 0x1f, 0x68, 0x7c, 0xa0, 0xef, 0x7b, 0xf8, 0x28, 0xcc, 0xbe, 0xb5, 0x93, 0x2f, - 0xb4, 0x67, 0xd3, 0xff, 0x0f, 0x1e, 0xe9, 0x63, 0xe7, 0xb9, 0x76, 0xf2, 0xe0, 0xa8, 0xc2, 0x9e, - 0xf8, 0xcf, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x5c, 0x77, 0xfd, 0x63, 0x08, 0x00, 0x00, + // 965 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6e, 0xdb, 0x46, + 0x17, 0x15, 0x25, 0x5a, 0xb1, 0xc6, 0xb1, 0xad, 0x6f, 0xec, 0xaf, 0x15, 0x08, 0x44, 0xa4, 0xe9, + 0xa2, 0x70, 0x52, 0x84, 0x44, 0xd5, 0x06, 0x28, 0x5c, 0xb4, 0x80, 0x28, 0xd1, 0x08, 0x5b, 0xd7, + 0x12, 0x46, 0x74, 0x02, 0x64, 0x43, 0x8c, 0xc9, 0xb1, 0x4a, 0x84, 0x12, 0x55, 0xfe, 0x08, 0x4d, + 0x8b, 0xee, 0x03, 0xaf, 0xf2, 0x02, 0x06, 0x02, 0xf4, 0x25, 0xba, 0xeb, 0xa2, 0x9b, 0x2c, 0xb3, + 0xec, 0x8a, 0x2d, 0xe4, 0x4d, 0xd6, 0x7a, 0x82, 0x82, 0x33, 0xa4, 0x24, 0xd7, 0x52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0x11, 0x6f, 0x33, 0x3d, 0x2a, 0x20, 0x23, 0x26, 0x04, 0xfb, 0x60, 0xcb, 0x0f, + 0xb0, 0xed, 0x11, 0x2b, 0x20, 0x3f, 0xc4, 0x24, 0x8c, 0x6a, 0x3c, 0xb5, 0xb7, 0xb7, 0x4c, 0xba, + 0x43, 0x91, 0x88, 0x01, 0xb5, 0x3b, 0x99, 0xcf, 0xff, 0x33, 0xdd, 0xeb, 0x32, 0x32, 0xda, 0xf4, + 0x17, 0xd1, 0x50, 0x07, 0xe5, 0x80, 0x84, 0xb1, 0x17, 0xd5, 0xd6, 0x68, 0x03, 0x61, 0x59, 0x03, + 0x44, 0x11, 0xda, 0xff, 0xa6, 0x89, 0xb8, 0xc9, 0x54, 0x19, 0x47, 0x46, 0x19, 0x19, 0x62, 0xb0, + 0x69, 0x07, 0x84, 0xde, 0xce, 0x4a, 0x93, 0xa9, 0x95, 0x33, 0x35, 0x16, 0x9b, 0x92, 0xc7, 0xa6, + 0x98, 0x79, 0x6c, 0x9a, 0x94, 0xf9, 0xdc, 0x65, 0x8a, 0xd7, 0xe8, 0xf2, 0x8b, 0xbf, 0x44, 0x0e, + 0xdd, 0xce, 0xcf, 0x52, 0xd2, 0xe1, 0xfa, 0xf3, 0x97, 0x62, 0xe1, 0xcd, 0x4b, 0x91, 0x93, 0x7f, + 0x06, 0x7c, 0x9a, 0x08, 0xfc, 0x02, 0x6c, 0xe0, 0xf9, 0x54, 0xb3, 0x94, 0x3f, 0x98, 0x26, 0x22, + 0x64, 0x92, 0x0b, 0x45, 0x19, 0x2d, 0x42, 0xa1, 0x0a, 0xd6, 0xd3, 0xec, 0x87, 0x78, 0x40, 0x68, + 0xee, 0x15, 0x6d, 0x67, 0x9a, 0x88, 0xdb, 0xf3, 0xe5, 0x48, 0x2b, 0x32, 0x9a, 0x81, 0x16, 0x9a, + 0xff, 0x56, 0x02, 0x9b, 0xd7, 0x06, 0x0e, 0xf7, 0x41, 0xd1, 0x75, 0x68, 0x77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x1d, 0x54, 0x2d, 0x0a, 0x7b, 0x17, 0x97, + 0xd2, 0x9d, 0x55, 0x9a, 0x7a, 0x3a, 0xb4, 0xf7, 0xf6, 0x79, 0xda, 0x6a, 0xe9, 0xbd, 0x5e, 0xb5, + 0xf4, 0x0e, 0x9f, 0xd9, 0x8a, 0x7c, 0x03, 0xa4, 0x15, 0xaa, 0xa6, 0xf1, 0x9d, 0xde, 0xb6, 0x3a, + 0xa7, 0x66, 0x95, 0x17, 0x3e, 0xba, 0xb8, 0x94, 0xa4, 0x55, 0x52, 0xe9, 0xfb, 0xe9, 0x74, 0xe2, + 0x48, 0xe0, 0x9f, 0xff, 0x5a, 0x2f, 0x68, 0x9d, 0x57, 0x93, 0x3a, 0xf7, 0x7a, 0x52, 0xe7, 0xfe, + 0x9e, 0xd4, 0xb9, 0x17, 0x57, 0xf5, 0xc2, 0xeb, 0xab, 0x7a, 0xe1, 0xcf, 0xab, 0x7a, 0xe1, 0xc9, + 0x83, 0xbe, 0x1b, 0x7d, 0x1f, 0x9f, 0x29, 0xb6, 0x3f, 0x50, 0xd9, 0x42, 0xdf, 0xf7, 0xf0, 0x59, + 0x98, 0x7d, 0xab, 0xe3, 0xcf, 0xd5, 0x1f, 0xe7, 0x7f, 0xeb, 0x1e, 0xe9, 0x63, 0xfb, 0x99, 0x3a, + 0x7e, 0x70, 0x56, 0xa6, 0xcf, 0xfb, 0x67, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xc5, 0xba, 0x70, + 0x52, 0xfa, 0x07, 0x00, 0x00, } func (this *ApplicationLink) Equal(that interface{}) bool { @@ -555,9 +552,6 @@ func (this *ApplicationLink) Equal(that interface{}) bool { if !this.CreationTime.Equal(that1.CreationTime) { return false } - if !this.ExpirationTime.Equal(that1.ExpirationTime) { - return false - } return true } func (this *Data) Equal(that interface{}) bool { @@ -796,21 +790,13 @@ func (m *ApplicationLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime):]) + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) if err1 != nil { return 0, err1 } i -= n1 i = encodeVarintModelsAppLinks(dAtA, i, uint64(n1)) i-- - dAtA[i] = 0x3a - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintModelsAppLinks(dAtA, i, uint64(n2)) - i-- dAtA[i] = 0x32 if m.Result != nil { { @@ -1158,8 +1144,6 @@ func (m *ApplicationLink) Size() (n int) { } l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime) n += 1 + l + sovModelsAppLinks(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime) - n += 1 + l + sovModelsAppLinks(uint64(l)) return n } @@ -1505,39 +1489,6 @@ func (m *ApplicationLink) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModelsAppLinks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModelsAppLinks - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModelsAppLinks - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) diff --git a/x/profiles/legacy/v5/models_params.pb.go b/x/profiles/legacy/v5/models_params.pb.go index 0b9a90a629..ee87c794ef 100644 --- a/x/profiles/legacy/v5/models_params.pb.go +++ b/x/profiles/legacy/v5/models_params.pb.go @@ -9,19 +9,16 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" math_bits "math/bits" - time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf -var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -35,7 +32,6 @@ type Params struct { DTag DTagParams `protobuf:"bytes,2,opt,name=dtag,proto3" json:"dtag" yaml:"dtag"` Bio BioParams `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio" yaml:"bio"` Oracle OracleParams `protobuf:"bytes,4,opt,name=oracle,proto3" json:"oracle" yaml:"oracle"` - AppLinks AppLinksParams `protobuf:"bytes,5,opt,name=app_links,json=appLinks,proto3" json:"app_links" yaml:"app_links"` } func (m *Params) Reset() { *m = Params{} } @@ -244,52 +240,12 @@ func (m *OracleParams) XXX_DiscardUnknown() { var xxx_messageInfo_OracleParams proto.InternalMessageInfo -// AppLinksParams define the parameters related to the app links -type AppLinksParams struct { - // ExpirationTime indicates the max amount of time before a link expires - ExpirationTime time.Duration `protobuf:"bytes,1,opt,name=expiration_time,json=expirationTime,proto3,stdduration" json:"expiration_time" yaml:"expiration_time"` -} - -func (m *AppLinksParams) Reset() { *m = AppLinksParams{} } -func (m *AppLinksParams) String() string { return proto.CompactTextString(m) } -func (*AppLinksParams) ProtoMessage() {} -func (*AppLinksParams) Descriptor() ([]byte, []int) { - return fileDescriptor_1b093f5fee9c9f7d, []int{5} -} -func (m *AppLinksParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AppLinksParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AppLinksParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AppLinksParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_AppLinksParams.Merge(m, src) -} -func (m *AppLinksParams) XXX_Size() int { - return m.Size() -} -func (m *AppLinksParams) XXX_DiscardUnknown() { - xxx_messageInfo_AppLinksParams.DiscardUnknown(m) -} - -var xxx_messageInfo_AppLinksParams proto.InternalMessageInfo - func init() { proto.RegisterType((*Params)(nil), "desmos.profiles.v2.Params") proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.v2.NicknameParams") proto.RegisterType((*DTagParams)(nil), "desmos.profiles.v2.DTagParams") proto.RegisterType((*BioParams)(nil), "desmos.profiles.v2.BioParams") proto.RegisterType((*OracleParams)(nil), "desmos.profiles.v2.OracleParams") - proto.RegisterType((*AppLinksParams)(nil), "desmos.profiles.v2.AppLinksParams") } func init() { @@ -297,58 +253,52 @@ func init() { } var fileDescriptor_1b093f5fee9c9f7d = []byte{ - // 807 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0xc7, 0x93, 0x3a, 0x8d, 0xe2, 0xc9, 0xd2, 0x65, 0xad, 0x65, 0xc9, 0x2e, 0xc2, 0x8e, 0xe6, - 0xb0, 0xca, 0x65, 0x6d, 0x35, 0x50, 0x21, 0x55, 0xe2, 0x50, 0xa7, 0x15, 0xaa, 0x54, 0x48, 0x65, - 0x2a, 0x21, 0xb8, 0x58, 0x63, 0x67, 0xe2, 0x8e, 0x62, 0x7b, 0x2c, 0x8f, 0x13, 0xa5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x82, 0x1e, 0x5f, 0xa0, 0x48, 0x01, 0xdf, 0xe3, 0xc0, 0x45, 0x69, 0x35, - 0xf8, 0xdc, 0xb2, 0xb4, 0xda, 0x12, 0xcc, 0x09, 0xd0, 0x13, 0x20, 0x63, 0x00, 0xb4, 0x80, 0xd0, - 0x8e, 0x26, 0x78, 0xef, 0x3f, 0xc4, 0x73, 0x09, 0x55, 0x38, 0x43, 0xe5, 0x07, 0x24, 0x26, 0x20, - 0x14, 0x7a, 0x5c, 0x6d, 0x0c, 0x41, 0x93, 0xe6, 0x28, 0x8c, 0x71, 0xa7, 0x21, 0x38, 0xdd, 0x87, - 0x38, 0x43, 0xe1, 0xa1, 0x50, 0xef, 0x28, 0xd4, 0x5b, 0x12, 0x25, 0xd5, 0xd0, 0x53, 0x18, 0xe3, - 0x4b, 0xa0, 0xa3, 0x2c, 0xf3, 0x63, 0x92, 0x4e, 0x58, 0x67, 0xf7, 0xaf, 0x0b, 0x78, 0x94, 0x65, - 0x67, 0xdc, 0x47, 0x51, 0x3b, 0x8a, 0xfa, 0xb6, 0xa4, 0xae, 0x10, 0xd0, 0x6b, 0x21, 0xe5, 0x79, - 0xd8, 0xf8, 0xf6, 0x47, 0xab, 0x06, 0xcb, 0x3a, 0xd8, 0xdb, 0xae, 0xbe, 0x11, 0x00, 0x90, 0x90, - 0xd4, 0x8f, 0x71, 0x1a, 0x15, 0x97, 0xa2, 0x6b, 0x4f, 0xdc, 0x01, 0x07, 0xfe, 0x56, 0x5a, 0xaf, - 0x23, 0x52, 0x5c, 0x4e, 0x03, 0x3b, 0xa4, 0x89, 0xa3, 0x76, 0x89, 0xfc, 0xbc, 0x61, 0xa3, 0x89, - 0x53, 0x5c, 0x65, 0x98, 0xd9, 0xa7, 0x69, 0xb1, 0x2c, 0xad, 0x67, 0x32, 0xf4, 0x9a, 0x04, 0x3d, - 0x3d, 0x21, 0xe9, 0x99, 0x18, 0x8b, 0x18, 0x68, 0x5e, 0xc5, 0xd8, 0xf9, 0x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 0x07, 0x7f, 0x04, 0x00, 0x00, 0xff, 0xff, 0x4a, - 0xc3, 0xd0, 0xd4, 0x3f, 0x07, 0x00, 0x00, + // 718 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xd3, 0x40, + 0x14, 0x86, 0x73, 0x6b, 0x94, 0x4c, 0xca, 0xa5, 0x56, 0x81, 0x50, 0x84, 0x1d, 0xcd, 0xa2, 0xca, + 0xa6, 0xb6, 0x1a, 0xa8, 0x90, 0x2a, 0xb1, 0xc0, 0x69, 0x85, 0x2a, 0x01, 0xa9, 0x0c, 0x12, 0x12, + 0x9b, 0x68, 0xec, 0x4c, 0xdc, 0x51, 0x6c, 0x8f, 0xe5, 0x71, 0xa2, 0x74, 0xc5, 0x96, 0x25, 0x4f, + 0x80, 0x58, 0x23, 0x1e, 0xa4, 0x2b, 0xd4, 0x25, 0x62, 0x61, 0x50, 0xfa, 0x06, 0x79, 0x02, 0x34, + 0x97, 0x5c, 0x5a, 0x2a, 0x51, 0x40, 0xac, 0x32, 0x9e, 0x73, 0xfe, 0xef, 0x9c, 0x39, 0xbf, 0x3d, + 0x01, 0x9b, 0x3d, 0xcc, 0x42, 0xca, 0xac, 0x38, 0xa1, 0x7d, 0x12, 0x60, 0x66, 0x8d, 0x5a, 0x56, + 0x48, 0x7b, 0x38, 0x60, 0xdd, 0x18, 0x25, 0x28, 0x64, 0x66, 0x9c, 0xd0, 0x94, 0x6a, 0x9a, 0xcc, + 0x33, 0x67, 0x79, 0xe6, 0xa8, 0xb5, 0xb1, 0xee, 0x53, 0x9f, 0x8a, 0xb0, 0xc5, 0x57, 0x32, 0x73, + 0x43, 0xf7, 0xa8, 0x20, 0xba, 0x88, 0x61, 0x6b, 0xb4, 0xed, 0xe2, 0x14, 0x6d, 0x5b, 0x1e, 0x25, + 0xd1, 0x2c, 0xee, 0x53, 0xea, 0x07, 0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0x5c, 0x64, 0x06, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -371,16 +321,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.AppLinks.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModelsParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a { size, err := m.Oracle.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -612,37 +552,6 @@ func (m *OracleParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *AppLinksParams) 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 *AppLinksParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AppLinksParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintModelsParams(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func encodeVarintModelsParams(dAtA []byte, offset int, v uint64) int { offset -= sovModelsParams(v) base := offset @@ -668,8 +577,6 @@ func (m *Params) Size() (n int) { n += 1 + l + sovModelsParams(uint64(l)) l = m.Oracle.Size() n += 1 + l + sovModelsParams(uint64(l)) - l = m.AppLinks.Size() - n += 1 + l + sovModelsParams(uint64(l)) return n } @@ -744,17 +651,6 @@ func (m *OracleParams) Size() (n int) { return n } -func (m *AppLinksParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime) - n += 1 + l + sovModelsParams(uint64(l)) - return n -} - func sovModelsParams(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -922,39 +818,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppLinks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModelsParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModelsParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModelsParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AppLinks.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipModelsParams(dAtA[iNdEx:]) @@ -1502,89 +1365,6 @@ func (m *OracleParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *AppLinksParams) 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 ErrIntOverflowModelsParams - } - 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: AppLinksParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AppLinksParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModelsParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModelsParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModelsParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModelsParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModelsParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipModelsParams(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/profiles/types/models_app_links.pb.go b/x/profiles/types/models_app_links.pb.go index 8c0ea2787e..b844e6b796 100644 --- a/x/profiles/types/models_app_links.pb.go +++ b/x/profiles/types/models_app_links.pb.go @@ -83,6 +83,8 @@ type ApplicationLink struct { Result *Result `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty" yaml:"result"` // CreationTime represents the time in which the link was created CreationTime time.Time `protobuf:"bytes,6,opt,name=creation_time,json=creationTime,proto3,stdtime" json:"creation_time" yaml:"creation_time"` + // ExpirationTime represents the time in which the link will expire + ExpirationTime time.Time `protobuf:"bytes,7,opt,name=expiration_time,json=expirationTime,proto3,stdtime" json:"expiration_time" yaml:"expiration_time"` } func (m *ApplicationLink) Reset() { *m = ApplicationLink{} } @@ -451,68 +453,69 @@ func init() { } var fileDescriptor_e02d86ea3253bfd9 = []byte{ - // 961 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0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0x69, 0x52, 0xe6, 0x73, 0x8b, 0x29, 0x5e, 0xa3, 0xcb, 0x2f, 0xff, 0x16, 0x39, 0x74, - 0x3b, 0x3f, 0x4b, 0x49, 0x07, 0x95, 0x17, 0xaf, 0xc4, 0xc2, 0xdb, 0x57, 0x22, 0x27, 0xff, 0x02, - 0xf8, 0x34, 0x11, 0xf8, 0x15, 0x58, 0xc5, 0xb3, 0xa9, 0x66, 0x29, 0x7f, 0x32, 0x49, 0x44, 0xc8, - 0x24, 0xe7, 0x8a, 0x32, 0x9a, 0x87, 0x42, 0x15, 0x54, 0xd2, 0xec, 0x87, 0x78, 0x40, 0x68, 0xee, - 0x55, 0x6d, 0x73, 0x92, 0x88, 0x1b, 0xb3, 0xe5, 0x48, 0x2b, 0x32, 0x9a, 0x82, 0xe6, 0x9a, 0xff, - 0x5e, 0x02, 0x6b, 0xd7, 0x06, 0x0e, 0x77, 0x40, 0xd1, 0x75, 0x68, 0x77, 0x5e, 0xdb, 0x1c, 0x27, - 0x62, 0xd1, 0x68, 0x4f, 0x12, 0xb1, 0xca, 0xc4, 0x5c, 0x47, 0x46, 0x45, 0xd7, 0x81, 0x4f, 0x40, - 0x2d, 0x4b, 0x22, 0xb4, 0x03, 0x77, 0x14, 0x59, 0xae, 0x43, 0x3b, 0xf3, 0xda, 0xfd, 0x71, 0x22, - 0xae, 0x33, 0xc5, 0x1e, 0x2d, 0x51, 0xfa, 0xa7, 0xd7, 0xd2, 0x9b, 0x72, 0x64, 0x94, 0xed, 0x45, - 0x06, 0x75, 0x20, 0x06, 0x55, 0x1b, 0x7b, 0x9e, 0x45, 0x77, 0xb8, 0x44, 0xa7, 0x7e, 0xef, 0xbd, - 0x4b, 0xa2, 0xb4, 0xb0, 0xe7, 0xd1, 0xad, 0xae, 0x67, 0x29, 0xd4, 0xb2, 0x14, 0x72, 0x29, 0x19, - 0x55, 0xec, 0x0c, 0x03, 0xbf, 0x01, 0x55, 0xdb, 0x73, 0xc9, 0x90, 0x9a, 0x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xd9, 0x42, 0xdf, 0xf7, 0xf0, 0x69, 0x98, - 0x7d, 0xab, 0xe7, 0x5f, 0xaa, 0x3f, 0xcd, 0xfe, 0xd6, 0xa3, 0xe7, 0x23, 0x12, 0x9e, 0x96, 0xe9, - 0xd3, 0xbe, 0xff, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x70, 0xf8, 0x96, 0xed, 0xf6, 0x07, 0x00, - 0x00, + // 989 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x4f, 0xdc, 0x46, + 0x18, 0xde, 0x0f, 0xb3, 0xb0, 0x43, 0x80, 0xed, 0x40, 0xd3, 0x95, 0xa5, 0xac, 0x8d, 0xa9, 0x2a, + 0x92, 0x2a, 0xb6, 0x02, 0x3d, 0x54, 0x54, 0xad, 0xb4, 0xde, 0x35, 0x8a, 0x1b, 0x0a, 0x68, 0xd6, + 0x24, 0x52, 0x2e, 0xd6, 0x60, 0x0f, 0xdb, 0x51, 0xbc, 0x6b, 0xd7, 0x1f, 0x28, 0x69, 0xd5, 0x7b, + 0xc4, 0x29, 0x7f, 0x00, 0x29, 0x52, 0xff, 0x44, 0x6f, 0x3d, 0xf4, 0x92, 0x63, 0x7a, 0xeb, 0xc9, + 0xad, 0x96, 0x4b, 0xcf, 0xfb, 0x0b, 0x2a, 0xcf, 0xd8, 0xec, 0x12, 0x20, 0x44, 0xca, 0xcd, 0x3b, + 0xef, 0xf3, 0xf1, 0xce, 0x3c, 0xef, 0x8c, 0x16, 0xdc, 0x75, 0x49, 0x34, 0xf0, 0x23, 0x2d, 0x08, + 0xfd, 0x23, 0xea, 0x91, 0x48, 0x3b, 0xde, 0xd4, 0x06, 0xbe, 0x4b, 0xbc, 0xc8, 0xc6, 0x41, 0x60, + 0x7b, 0x74, 0xf8, 0x2c, 0x52, 0x83, 0xd0, 0x8f, 0x7d, 0x08, 0x39, 0x54,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d, 0x0d, 0x50, 0x0b, 0x49, 0x94, 0x78, 0x71, 0x73, 0x86, 0x19, 0x88, 0x57, 0x19, 0x20, 0x86, + 0xd0, 0x3f, 0x19, 0xa7, 0xd2, 0x02, 0x57, 0xe5, 0x1c, 0x05, 0xe5, 0x64, 0x88, 0xc1, 0x82, 0x13, + 0x12, 0xb6, 0x3b, 0x3b, 0x4b, 0xa6, 0x59, 0xcb, 0xd5, 0x78, 0x6c, 0x6a, 0x11, 0x9b, 0x6a, 0x15, + 0xb1, 0xe9, 0x72, 0xde, 0xe7, 0x0a, 0x57, 0xbc, 0x40, 0x57, 0x5e, 0xfd, 0x23, 0x95, 0xd1, 0xad, + 0x62, 0x2d, 0x23, 0xc1, 0x3e, 0x58, 0x22, 0xcf, 0x03, 0x1a, 0x4e, 0x99, 0xcc, 0xde, 0x68, 0xa2, + 0xe4, 0x26, 0xb7, 0xb9, 0xc9, 0x3b, 0x02, 0xdc, 0x66, 0x71, 0xb2, 0x9a, 0x11, 0xb7, 0xe6, 0x5e, + 0xbe, 0x96, 0x4a, 0xff, 0xbd, 0x96, 0xca, 0xca, 0x2f, 0x40, 0xc8, 0xa2, 0x87, 0x5f, 0x83, 0x79, + 0x3c, 0x89, 0x2f, 0x1f, 0xa7, 0xdb, 0xe3, 0x54, 0x82, 0x5c, 0x76, 0xaa, 0xa8, 0xa0, 0x69, 0x28, + 0xd4, 0xc0, 0x5c, 0x36, 0x64, 0x43, 0x3c, 0x20, 0x6c, 0xc0, 0xea, 0xfa, 0xf2, 0x38, 0x95, 0x96, + 0x26, 0x53, 0x98, 0x55, 0x14, 0x74, 0x0e, 0x9a, 0x32, 0xff, 0xbd, 0x0a, 0x16, 0x2e, 0x24, 0x0b, + 0xd7, 0x40, 0x85, 0xba, 0xcc, 0x5d, 0xd0, 0x97, 0x47, 0xa9, 0x54, 0x31, 0xbb, 0xe3, 0x54, 0xaa, + 0x73, 0x31, 0xea, 0x2a, 0xa8, 0x42, 0x5d, 0xf8, 0x04,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, 0xa7, 0x63, 0xf4, 0x7a, 0x8d, 0xea, 0x0d, 0x7d, 0xe6, 0x23, 0xf2, + 0x3d, 0x90, 0xaf, 0x51, 0xb5, 0xcc, 0x1f, 0x8c, 0xae, 0xbd, 0x77, 0x60, 0x35, 0x04, 0xf1, 0xf3, + 0x93, 0x53, 0x59, 0xbe, 0x4e, 0x2a, 0x7b, 0x3f, 0xdd, 0xbd, 0x24, 0x16, 0x85, 0x97, 0xbf, 0xb5, + 0x4a, 0xfa, 0xa3, 0x37, 0xa3, 0x56, 0xf9, 0xed, 0xa8, 0x55, 0xfe, 0x77, 0xd4, 0x2a, 0xbf, 0x3a, + 0x6b, 0x95, 0xde, 0x9e, 0xb5, 0x4a, 0x7f, 0x9f, 0xb5, 0x4a, 0x4f, 0x1f, 0xf4, 0x69, 0xfc, 0x63, + 0x72, 0xa8, 0x3a, 0xfe, 0x40, 0xe3, 0x03, 0x7d, 0xdf, 0xc3, 0x87, 0x51, 0xfe, 0xad, 0x1d, 0x7f, + 0xa5, 0x3d, 0x9f, 0xfc, 0x7f, 0x88, 0x5f, 0x04, 0x24, 0x3a, 0xac, 0xb1, 0xe7, 0x7d, 0xf3, 0xff, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x89, 0xbe, 0x63, 0x5f, 0x08, 0x00, 0x00, } func (this *ApplicationLink) Equal(that interface{}) bool { @@ -552,6 +555,9 @@ func (this *ApplicationLink) Equal(that interface{}) bool { if !this.CreationTime.Equal(that1.CreationTime) { return false } + if !this.ExpirationTime.Equal(that1.ExpirationTime) { + return false + } return true } func (this *Data) Equal(that interface{}) bool { @@ -790,13 +796,21 @@ func (m *ApplicationLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime):]) if err1 != nil { return 0, err1 } i -= n1 i = encodeVarintModelsAppLinks(dAtA, i, uint64(n1)) i-- + dAtA[i] = 0x3a + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintModelsAppLinks(dAtA, i, uint64(n2)) + i-- dAtA[i] = 0x32 if m.Result != nil { { @@ -1144,6 +1158,8 @@ func (m *ApplicationLink) Size() (n int) { } l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime) n += 1 + l + sovModelsAppLinks(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime) + n += 1 + l + sovModelsAppLinks(uint64(l)) return n } @@ -1489,6 +1505,39 @@ func (m *ApplicationLink) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) From 4bda50cfa5d6ef9ea85b57c7141ee40ea5e55e95 Mon Sep 17 00:00:00 2001 From: RiccardoM Date: Fri, 8 Jul 2022 06:15:44 +0000 Subject: [PATCH 097/112] Updated Swagger definition --- client/docs/swagger-ui/swagger.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 20dc34cf6d..dcf9ad8934 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -125,6 +125,12 @@ paths: title: >- CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: >- + ExpirationTime represents the time in which the link + will expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -555,6 +561,12 @@ paths: title: >- CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: >- + ExpirationTime represents the time in which the link will + expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -11656,6 +11668,10 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: ExpirationTime represents the time in which the link will expire title: ApplicationLink contains the data of a link to a centralized application desmos.profiles.v3.ApplicationLinkState: type: string @@ -12940,6 +12956,10 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: ExpirationTime represents the time in which the link will expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -13115,6 +13135,10 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: ExpirationTime represents the time in which the link will expire title: >- ApplicationLink contains the data of a link to a centralized application From 43990e0a4213b32b0178ca9cc45f3484f7100b8b Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 8 Jul 2022 08:40:05 +0200 Subject: [PATCH 098/112] fixed tests Signed-off-by: Riccardo Montagnin --- proto/desmos/profiles/v2/models_params.proto | 1 - proto/desmos/profiles/v3/models_params.proto | 6 +- x/profiles/keeper/alias_functions_test.go | 3 +- x/profiles/keeper/genesis_test.go | 8 +- x/profiles/keeper/keeper_params_test.go | 6 +- x/profiles/keeper/relay_app_links.go | 2 +- x/profiles/legacy/v5/models.go | 283 +++++++++++++++++++ x/profiles/legacy/v5/models_params.pb.go | 92 +++--- x/profiles/simulation/decoder.go | 6 +- x/profiles/simulation/decoder_test.go | 6 +- x/profiles/simulation/params.go | 2 +- x/profiles/types/keys.go | 2 +- x/profiles/types/models_app_links.go | 2 +- x/profiles/types/models_params.go | 24 +- x/profiles/types/models_params.pb.go | 116 ++++---- x/profiles/wasm/querier_test.go | 5 + 16 files changed, 424 insertions(+), 140 deletions(-) create mode 100644 x/profiles/legacy/v5/models.go diff --git a/proto/desmos/profiles/v2/models_params.proto b/proto/desmos/profiles/v2/models_params.proto index ead20b3078..cbc4c74e2f 100644 --- a/proto/desmos/profiles/v2/models_params.proto +++ b/proto/desmos/profiles/v2/models_params.proto @@ -3,7 +3,6 @@ package desmos.profiles.v2; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -import "google/protobuf/duration.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5"; diff --git a/proto/desmos/profiles/v3/models_params.proto b/proto/desmos/profiles/v3/models_params.proto index 4b916960a8..9f5badf4d2 100644 --- a/proto/desmos/profiles/v3/models_params.proto +++ b/proto/desmos/profiles/v3/models_params.proto @@ -126,10 +126,10 @@ message OracleParams { message AppLinksParams { option (gogoproto.goproto_getters) = false; - // ExpirationTime indicates the max amount of time before a link expires - google.protobuf.Duration expiration_time = 1 [ + // Default validity duration before an application link expires + google.protobuf.Duration validity_duration = 1 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"expiration_time\"" + (gogoproto.moretags) = "yaml:\"validity_duration\"" ]; } \ No newline at end of file diff --git a/x/profiles/keeper/alias_functions_test.go b/x/profiles/keeper/alias_functions_test.go index 6ffcf2c00e..a50c63d43f 100644 --- a/x/profiles/keeper/alias_functions_test.go +++ b/x/profiles/keeper/alias_functions_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "time" - "github.com/desmos-labs/desmos/v4/testutil" "github.com/desmos-labs/desmos/v4/testutil/profilestesting" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -312,7 +311,7 @@ func (suite *KeeperTestSuite) TestKeeper_IterateExpiringApplicationLinks() { ctx, _ := suite.ctx.CacheContext() for _, link := range links { - suite.ak.SetAccount(ctx, testutil.ProfileFromAddr(link.User)) + suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr(link.User)) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) } diff --git a/x/profiles/keeper/genesis_test.go b/x/profiles/keeper/genesis_test.go index d8c3863c67..0b48ebb7e2 100644 --- a/x/profiles/keeper/genesis_test.go +++ b/x/profiles/keeper/genesis_test.go @@ -65,7 +65,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ) suite.k.SetParams(ctx, params) suite.k.SetPort(ctx, "port-id") @@ -119,7 +119,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ), "port-id", []types.ChainLink{ @@ -250,7 +250,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ), "profiles-port-id", []types.ChainLink{ @@ -304,7 +304,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ) suite.Require().Equal(params, suite.k.GetParams(ctx)) diff --git a/x/profiles/keeper/keeper_params_test.go b/x/profiles/keeper/keeper_params_test.go index ada86a5c0c..626741e6e1 100644 --- a/x/profiles/keeper/keeper_params_test.go +++ b/x/profiles/keeper/keeper_params_test.go @@ -19,7 +19,7 @@ func (suite *KeeperTestSuite) TestKeeper_SetParams() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ) suite.k.SetParams(suite.ctx, params) @@ -49,7 +49,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetParams() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ) suite.k.SetParams(ctx, params) }, @@ -66,7 +66,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetParams() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), - types.NewAppLinksParams(types.DefaultAppLinksExpirationTime), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ), }, { diff --git a/x/profiles/keeper/relay_app_links.go b/x/profiles/keeper/relay_app_links.go index 1b179a550c..d2390be60d 100644 --- a/x/profiles/keeper/relay_app_links.go +++ b/x/profiles/keeper/relay_app_links.go @@ -131,7 +131,7 @@ func (k Keeper) StartProfileConnection( ), nil, creationTime, - creationTime.Add(k.GetParams(ctx).AppLinks.ExpirationTime), + creationTime.Add(k.GetParams(ctx).AppLinks.ValidityDuration), )) if err != nil { diff --git a/x/profiles/legacy/v5/models.go b/x/profiles/legacy/v5/models.go new file mode 100644 index 0000000000..902f94a126 --- /dev/null +++ b/x/profiles/legacy/v5/models.go @@ -0,0 +1,283 @@ +package v5 + +import ( + "encoding/json" + "time" + + "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/ghodss/yaml" +) + +var ( + _ authtypes.AccountI = (*Profile)(nil) + _ exported.VestingAccount = (*Profile)(nil) +) + +// GetAccount returns the underlying account as an authtypes.AccountI instance +func (p *Profile) GetAccount() authtypes.AccountI { + return p.Account.GetCachedValue().(authtypes.AccountI) +} + +// getVestingAccount returns the underlying account as an exported.VestingAccount instance +func (p *Profile) getVestingAccount() exported.VestingAccount { + acc, ok := p.Account.GetCachedValue().(exported.VestingAccount) + if !ok { + return nil + } + return acc +} + +// setAccount sets the given account as the underlying account instance. +// This should be called after updating anything about the account (eg. after calling SetSequence). +func (p *Profile) setAccount(account authtypes.AccountI) error { + accAny, err := codectypes.NewAnyWithValue(account) + if err != nil { + return err + } + + p.Account = accAny + return nil +} + +// GetAddress implements authtypes.AccountI +func (p *Profile) GetAddress() sdk.AccAddress { + return p.GetAccount().GetAddress() +} + +// SetAddress implements authtypes.AccountI +func (p *Profile) SetAddress(addr sdk.AccAddress) error { + acc := p.GetAccount() + err := acc.SetAddress(addr) + if err != nil { + return err + } + + return p.setAccount(acc) +} + +// GetPubKey implements authtypes.AccountI +func (p *Profile) GetPubKey() cryptotypes.PubKey { + return p.GetAccount().GetPubKey() +} + +// SetPubKey implements authtypes.AccountI +func (p *Profile) SetPubKey(pubKey cryptotypes.PubKey) error { + acc := p.GetAccount() + err := acc.SetPubKey(pubKey) + if err != nil { + return err + } + + return p.setAccount(acc) +} + +// GetAccountNumber implements authtypes.AccountI +func (p *Profile) GetAccountNumber() uint64 { + return p.GetAccount().GetAccountNumber() +} + +// SetAccountNumber implements authtypes.AccountI +func (p *Profile) SetAccountNumber(accountNumber uint64) error { + acc := p.GetAccount() + err := acc.SetAccountNumber(accountNumber) + if err != nil { + return err + } + + return p.setAccount(acc) +} + +// GetSequence implements authtypes.AccountI +func (p *Profile) GetSequence() uint64 { + return p.GetAccount().GetSequence() +} + +// SetSequence implements authtypes.AccountI +func (p *Profile) SetSequence(sequence uint64) error { + acc := p.GetAccount() + err := acc.SetSequence(sequence) + if err != nil { + return err + } + + return p.setAccount(acc) +} + +// LockedCoins implements exported.VestingAccount +func (p *Profile) LockedCoins(blockTime time.Time) sdk.Coins { + acc := p.getVestingAccount() + if acc == nil { + return sdk.NewCoins() + } + return acc.LockedCoins(blockTime) +} + +// TrackDelegation implements exported.VestingAccount +func (p *Profile) TrackDelegation(blockTime time.Time, balance, amount sdk.Coins) { + acc := p.getVestingAccount() + if acc == nil { + return + } + + acc.TrackDelegation(blockTime, balance, amount) + err := p.setAccount(acc) + if err != nil { + panic(err) + } +} + +// TrackUndelegation implements exported.VestingAccount +func (p *Profile) TrackUndelegation(amount sdk.Coins) { + acc := p.getVestingAccount() + if acc == nil { + return + } + + acc.TrackUndelegation(amount) + err := p.setAccount(acc) + if err != nil { + panic(err) + } +} + +// GetVestedCoins implements exported.VestingAccount +func (p *Profile) GetVestedCoins(blockTime time.Time) sdk.Coins { + acc := p.getVestingAccount() + if acc == nil { + return sdk.NewCoins() + } + return acc.GetVestedCoins(blockTime) +} + +// GetVestingCoins implements exported.VestingAccount +func (p *Profile) GetVestingCoins(blockTime time.Time) sdk.Coins { + acc := p.getVestingAccount() + if acc == nil { + return sdk.NewCoins() + } + return acc.GetVestingCoins(blockTime) +} + +// GetStartTime implements exported.VestingAccount +func (p *Profile) GetStartTime() int64 { + acc := p.getVestingAccount() + if acc == nil { + return -1 + } + return acc.GetStartTime() +} + +// GetEndTime implements exported.VestingAccount +func (p *Profile) GetEndTime() int64 { + acc := p.getVestingAccount() + if acc == nil { + return -1 + } + return acc.GetEndTime() +} + +// GetOriginalVesting implements exported.VestingAccount +func (p *Profile) GetOriginalVesting() sdk.Coins { + acc := p.getVestingAccount() + if acc == nil { + return sdk.NewCoins() + } + return acc.GetOriginalVesting() +} + +// GetDelegatedFree implements exported.VestingAccount +func (p *Profile) GetDelegatedFree() sdk.Coins { + acc := p.getVestingAccount() + if acc == nil { + return sdk.NewCoins() + } + return acc.GetDelegatedFree() +} + +// GetDelegatedVesting implements exported.VestingAccount +func (p *Profile) GetDelegatedVesting() sdk.Coins { + acc := p.getVestingAccount() + if acc == nil { + return sdk.NewCoins() + } + return acc.GetDelegatedVesting() +} + +// UnpackInterfaces implements codectypes.UnpackInterfacesMessage +func (p *Profile) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + if p.Account != nil { + var account authtypes.AccountI + err := unpacker.UnpackAny(p.Account, &account) + if err != nil { + return err + } + } + + return nil +} + +// ------------------------------------------------------------------------------------------------------------------- + +type profilePretty struct { + Address sdk.AccAddress `json:"address" yaml:"address"` + PubKey string `json:"public_key" yaml:"public_key"` + AccountNumber uint64 `json:"account_number" yaml:"account_number"` + Sequence uint64 `json:"sequence" yaml:"sequence"` + DTag string `json:"dtag" yaml:"dtag"` + Nickname string `json:"nickname" yaml:"nickname"` + Bio string `json:"bio" yaml:"bio"` + Pictures Pictures `json:"pictures" yaml:"pictures"` + CreationDate time.Time `json:"creation_date" yaml:"creation_date"` +} + +// String implements authtypes.AccountI implements stringer +func (p *Profile) String() string { + out, _ := p.MarshalYAML() + return out.(string) +} + +// MarshalYAML returns the YAML representation of a Profile. +func (p *Profile) MarshalYAML() (interface{}, error) { + bs, err := yaml.Marshal(profilePretty{ + Address: p.GetAddress(), + PubKey: p.GetPubKey().String(), + AccountNumber: p.GetAccountNumber(), + Sequence: p.GetSequence(), + DTag: p.DTag, + Nickname: p.Nickname, + Bio: p.Bio, + Pictures: p.Pictures, + CreationDate: p.CreationDate, + }) + + if err != nil { + return nil, err + } + + return string(bs), nil +} + +// MarshalJSON returns the JSON representation of a Profile. +func (p *Profile) MarshalJSON() ([]byte, error) { + var pubKey = "" + if p.GetPubKey() != nil { + pubKey = p.GetPubKey().String() + } + + return json.Marshal(profilePretty{ + Address: p.GetAddress(), + PubKey: pubKey, + AccountNumber: p.GetAccountNumber(), + Sequence: p.GetSequence(), + DTag: p.DTag, + Nickname: p.Nickname, + Bio: p.Bio, + Pictures: p.Pictures, + CreationDate: p.CreationDate, + }) +} diff --git a/x/profiles/legacy/v5/models_params.pb.go b/x/profiles/legacy/v5/models_params.pb.go index ee87c794ef..0f21d6ddf9 100644 --- a/x/profiles/legacy/v5/models_params.pb.go +++ b/x/profiles/legacy/v5/models_params.pb.go @@ -9,7 +9,6 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" math_bits "math/bits" @@ -253,52 +252,51 @@ func init() { } var fileDescriptor_1b093f5fee9c9f7d = []byte{ - // 718 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xd3, 0x40, - 0x14, 0x86, 0x73, 0x6b, 0x94, 0x4c, 0xca, 0xa5, 0x56, 0x81, 0x50, 0x84, 0x1d, 0xcd, 0xa2, 0xca, - 0xa6, 0xb6, 0x1a, 0xa8, 0x90, 0x2a, 0xb1, 0xc0, 0x69, 0x85, 0x2a, 0x01, 0xa9, 0x0c, 0x12, 0x12, - 0x9b, 0x68, 0xec, 0x4c, 0xdc, 0x51, 0x6c, 0x8f, 0xe5, 0x71, 0xa2, 0x74, 0xc5, 0x96, 0x25, 0x4f, - 0x80, 0x58, 0x23, 0x1e, 0xa4, 0x2b, 0xd4, 0x25, 0x62, 0x61, 0x50, 0xfa, 0x06, 0x79, 0x02, 0x34, - 0x97, 0x5c, 0x5a, 0x2a, 0x51, 0x40, 0xac, 0x32, 0x9e, 0x73, 0xfe, 0xef, 0x9c, 0x39, 0xbf, 0x3d, - 0x01, 0x9b, 0x3d, 0xcc, 0x42, 0xca, 0xac, 0x38, 0xa1, 0x7d, 0x12, 0x60, 0x66, 0x8d, 0x5a, 0x56, - 0x48, 0x7b, 0x38, 0x60, 0xdd, 0x18, 0x25, 0x28, 0x64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0x67, 0x7a, 0xee, 0xeb, 0x99, - 0x9e, 0x7b, 0xb3, 0xb3, 0x04, 0x95, 0x57, 0xd2, 0x56, 0x80, 0x5c, 0xa6, 0xd6, 0xd6, 0xe8, 0xa1, - 0x35, 0x5e, 0xfc, 0x81, 0x04, 0xd8, 0x47, 0xde, 0xb1, 0x35, 0xda, 0x71, 0xcb, 0xe2, 0x42, 0x7f, - 0xf0, 0x33, 0x00, 0x00, 0xff, 0xff, 0x95, 0x96, 0x45, 0x5c, 0x64, 0x06, 0x00, 0x00, + // 702 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xd3, 0x4e, + 0x14, 0xc6, 0x73, 0x71, 0xa3, 0x78, 0xd2, 0xff, 0xa5, 0x56, 0x81, 0x50, 0x84, 0x1d, 0xcd, 0xa2, + 0xca, 0xa6, 0xb6, 0x1a, 0xa8, 0x90, 0x2a, 0xb1, 0xc0, 0x69, 0x85, 0x2a, 0x01, 0xa9, 0x0c, 0x12, + 0x12, 0x1b, 0x6b, 0xec, 0x4c, 0x5d, 0x2b, 0xb6, 0xc7, 0xf2, 0x38, 0x51, 0xba, 0x62, 0xcb, 0x92, + 0x27, 0x40, 0xac, 0x11, 0x0f, 0xd2, 0x15, 0xea, 0x12, 0xb1, 0x30, 0x28, 0x7d, 0x83, 0x3c, 0x01, + 0x9a, 0x4b, 0x2e, 0x2d, 0x95, 0x28, 0x20, 0x56, 0x39, 0x9e, 0x73, 0xbe, 0xdf, 0x99, 0x39, 0x9f, + 0x3d, 0x01, 0x9b, 0x7d, 0x4c, 0x63, 0x42, 0xad, 0x34, 0x23, 0x47, 0x61, 0x84, 0xa9, 0x35, 0xea, + 0x58, 0x31, 0xe9, 0xe3, 0x88, 0xba, 0x29, 0xca, 0x50, 0x4c, 0xcd, 0x34, 0x23, 0x39, 0xd1, 0x34, + 0x51, 0x67, 0xce, 0xea, 0xcc, 0x51, 0x67, 0x63, 0x3d, 0x20, 0x01, 0xe1, 0x69, 0x8b, 0x45, 0xa2, + 0x72, 0x43, 0xf7, 0x09, 0x27, 0x7a, 0x88, 0x62, 0x6b, 0xb4, 0xed, 0xe1, 0x1c, 0x6d, 0x5b, 0x3e, + 0x09, 0x13, 0x91, 0x87, 0x9f, 0x2a, 0xa0, 0x76, 0xc8, 0xd1, 0xda, 0x4b, 0x50, 0x4f, 0x42, 0x7f, + 0x90, 0xa0, 0x18, 0x37, 0xcb, 0xad, 0x72, 0xbb, 0xd1, 0x81, 0xe6, 0x8f, 0x7d, 0xcc, 0x67, 0xb2, + 0x46, 0xa8, 0xec, 0x5b, 0xa7, 0x85, 0x51, 0x9a, 0x16, 0xc6, 0x7f, 0x27, 0x28, 0x8e, 0x76, 0xe1, + 0x8c, 0x00, 0x9d, 0x39, 0x4c, 0xeb, 0x01, 0xa5, 0x9f, 0xa3, 0xa0, 0x59, 0xe1, 0x50, 0xfd, 0x2a, + 0xe8, 0xde, 0x0b, 0x14, 0x48, 0xe0, 0x1d, 0x06, 0x9c, 0x14, 0x86, 0xc2, 0xd6, 0xa6, 0x85, 0xd1, + 0x10, 0x60, 0x46, 0x80, 0x0e, 0x07, 0x69, 0x5d, 0x50, 0xf5, 0x42, 0xd2, 0xac, 0x72, 0xde, 0xdd, + 0xab, 0x78, 0x76, 0x48, 0x24, 0x4e, 0x93, 0xfb, 0x03, 0x02, 0xe3, 0x85, 0x04, 0x3a, 0x4c, 0xad, + 0xf5, 0x40, 0x8d, 0x64, 0xc8, 0x8f, 0x70, 0x53, 0xe1, 0x9c, 0xd6, 0x55, 0x9c, 0x1e, 0xaf, 0x90, + 0xa8, 0x1b, 0x12, 0xf5, 0x8f, 0x40, 0x09, 0x35, 0x74, 0x24, 0x66, 0x57, 0x79, 0xf3, 0xde, 0x28, + 0xc1, 0xa2, 0x0c, 0xfe, 0xbd, 0x38, 0x22, 0xcd, 0x03, 0x20, 0x0e, 0x13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 0x62, 0x8d, 0x76, 0xbc, 0x1a, 0xbf, 0xd0, 0xef, + 0x7d, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xaa, 0xa5, 0xcd, 0x44, 0x06, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/simulation/decoder.go b/x/profiles/simulation/decoder.go index dd3a6f89fc..fbf6cd616e 100644 --- a/x/profiles/simulation/decoder.go +++ b/x/profiles/simulation/decoder.go @@ -31,19 +31,19 @@ func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string { var chainLinkA, chainLinkB types.ChainLink cdc.MustUnmarshal(kvA.Value, &chainLinkA) cdc.MustUnmarshal(kvB.Value, &chainLinkB) - return fmt.Sprintf("Chain link A: %s\nChain link B: %s\n", chainLinkA, chainLinkB) + return fmt.Sprintf("ChainLinkA: %s\nChainLinkB: %s\n", chainLinkA, chainLinkB) case bytes.HasPrefix(kvA.Key, types.ApplicationLinkPrefix): var applicationLinkA, applicationLinkB types.ApplicationLink cdc.MustUnmarshal(kvA.Value, &applicationLinkA) cdc.MustUnmarshal(kvB.Value, &applicationLinkB) - return fmt.Sprintf("Application link A: %s\nApplication link B: %s\n", &applicationLinkA, &applicationLinkB) + return fmt.Sprintf("ApplicationLinkA: %s\nApplicationLinkB: %s\n", &applicationLinkA, &applicationLinkB) case bytes.HasPrefix(kvA.Key, types.ExpiringAppLinkTimePrefix): var clientIDA, clientIDB string clientIDA = string(kvA.Value) clientIDB = string(kvB.Value) - return fmt.Sprintf("Client ID A: %s\nClient ID B: %s\n", + return fmt.Sprintf("ExpiringClientIDA: %s\nExpiringClientIDB: %s\n", clientIDA, clientIDB) default: diff --git a/x/profiles/simulation/decoder_test.go b/x/profiles/simulation/decoder_test.go index f2f2eaf075..b285abab20 100644 --- a/x/profiles/simulation/decoder_test.go +++ b/x/profiles/simulation/decoder_test.go @@ -93,9 +93,9 @@ func TestDecodeStore(t *testing.T) { }{ {"DTags", fmt.Sprintf("DTagAddressA: %s\nDTagAddressB: %s\n", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns")}, {"DTag transfer request", fmt.Sprintf("RequestA: %s\nRequestB: %s\n", request, request)}, - {"Chain link", fmt.Sprintf("Chain link A: %s\nChain link B: %s\n", chainLink, chainLink)}, - {"Application link", fmt.Sprintf("Application link A: %s\nApplication link B: %s\n", &applicationLink, &applicationLink)}, - {"Expiring Application link", fmt.Sprintf("Client ID A: %s\nClient ID B: %s\n", "client_id", "client_id")}, + {"Chain link", fmt.Sprintf("ChainLinkA: %s\nChainLinkB: %s\n", chainLink, chainLink)}, + {"Application link", fmt.Sprintf("ApplicationLinkA: %s\nApplicationLinkB: %s\n", &applicationLink, &applicationLink)}, + {"Expiring Application link", fmt.Sprintf("ExpiringClientIDA: %s\nExpiringClientIDB: %s\n", "client_id", "client_id")}, {"other", ""}, } diff --git a/x/profiles/simulation/params.go b/x/profiles/simulation/params.go index 24c18d9c5e..27b5a6f850 100644 --- a/x/profiles/simulation/params.go +++ b/x/profiles/simulation/params.go @@ -52,7 +52,7 @@ func ParamChanges(r *rand.Rand) []simtypes.ParamChange { simulation.NewSimParamChange(types.ModuleName, string(types.AppLinksParamsKey), func(r *rand.Rand) string { params := RandomAppLinksParams(r) - return fmt.Sprintf(`{"expiration_time":"%d"}`, params.ExpirationTime) + return fmt.Sprintf(`{"validity_duration":"%d"}`, params.ValidityDuration) }, ), } diff --git a/x/profiles/types/keys.go b/x/profiles/types/keys.go index 74825fdd2f..59e6f22afe 100644 --- a/x/profiles/types/keys.go +++ b/x/profiles/types/keys.go @@ -157,7 +157,7 @@ func ApplicationLinkExpiringTimePrefix(expirationTime time.Time) []byte { return append(ExpiringAppLinkTimePrefix, sdk.FormatTimeBytes(expirationTime)...) } -// ApplicationLinkExpiringTimeKey returns the key used to store the clientID associated with the expirationTime +// ApplicationLinkExpiringTimeKey returns the key used to store the expirationTime // of the application link associated with the given clientID func ApplicationLinkExpiringTimeKey(expirationTime time.Time, clientID string) []byte { return append(ApplicationLinkExpiringTimePrefix(expirationTime), []byte(clientID)...) diff --git a/x/profiles/types/models_app_links.go b/x/profiles/types/models_app_links.go index b0601a74fe..711a64d799 100644 --- a/x/profiles/types/models_app_links.go +++ b/x/profiles/types/models_app_links.go @@ -58,7 +58,7 @@ func (l ApplicationLink) Validate() error { } if l.ExpirationTime.Before(l.CreationTime) { - return fmt.Errorf("expiration time: %s can't be before creation time: %s", l.ExpirationTime, l.CreationTime) + return fmt.Errorf("expiration time: %s cannot be before creation time: %s", l.ExpirationTime, l.CreationTime) } return nil diff --git a/x/profiles/types/models_params.go b/x/profiles/types/models_params.go index d482db6a89..85871b29fe 100644 --- a/x/profiles/types/models_params.go +++ b/x/profiles/types/models_params.go @@ -18,13 +18,13 @@ const ( // Default profile paramsModule var ( - DefaultMinNicknameLength = sdk.NewInt(2) - DefaultMaxNicknameLength = sdk.NewInt(1000) // Longest name on earth count 954 chars - DefaultRegEx = `^[A-Za-z0-9_]+$` - DefaultMinDTagLength = sdk.NewInt(3) - DefaultMaxDTagLength = sdk.NewInt(30) - DefaultMaxBioLength = sdk.NewInt(1000) - DefaultAppLinksExpirationTime = time.Hour*24*7*4*6 + FourteenDaysCorrectionFactor // This duration is equal to 5.9835 months time. Equivalent to 262080 minutes + DefaultMinNicknameLength = sdk.NewInt(2) + DefaultMaxNicknameLength = sdk.NewInt(1000) // Longest name on earth count 954 chars + DefaultRegEx = `^[A-Za-z0-9_]+$` + DefaultMinDTagLength = sdk.NewInt(3) + DefaultMaxDTagLength = sdk.NewInt(30) + DefaultMaxBioLength = sdk.NewInt(1000) + DefaultAppLinksValidityDuration = time.Hour*24*7*4*6 + FourteenDaysCorrectionFactor // This duration is equal to 5.9835 months time. Equivalent to 262080 minutes ) // Parameters store keys @@ -271,14 +271,14 @@ func ValidateOracleParams(i interface{}) error { // ___________________________________________________________________________________________________________________ -func NewAppLinksParams(expirationTime time.Duration) AppLinksParams { +func NewAppLinksParams(validityDuration time.Duration) AppLinksParams { return AppLinksParams{ - ExpirationTime: expirationTime, + ValidityDuration: validityDuration, } } func DefaultAppLinksParams() AppLinksParams { - return NewAppLinksParams(DefaultAppLinksExpirationTime) + return NewAppLinksParams(DefaultAppLinksValidityDuration) } func ValidateAppLinksParams(i interface{}) error { @@ -287,8 +287,8 @@ func ValidateAppLinksParams(i interface{}) error { return fmt.Errorf("invalid parameters type: %s", i) } - if params.ExpirationTime < FourteenDaysCorrectionFactor { - return fmt.Errorf("expiration time param must be not less than 14 days: %s", params.ExpirationTime) + if params.ValidityDuration < FourteenDaysCorrectionFactor { + return fmt.Errorf("validity duration must be not less than 14 days: %s", params.ValidityDuration) } return nil diff --git a/x/profiles/types/models_params.pb.go b/x/profiles/types/models_params.pb.go index e5bcd2fef2..d0aa11e0a2 100644 --- a/x/profiles/types/models_params.pb.go +++ b/x/profiles/types/models_params.pb.go @@ -246,8 +246,8 @@ var xxx_messageInfo_OracleParams proto.InternalMessageInfo // AppLinksParams define the parameters related to the app links type AppLinksParams struct { - // ExpirationTime indicates the max amount of time before a link expires - ExpirationTime time.Duration `protobuf:"bytes,1,opt,name=expiration_time,json=expirationTime,proto3,stdduration" json:"expiration_time" yaml:"expiration_time"` + // Default validity duration before an application link expires + ValidityDuration time.Duration `protobuf:"bytes,1,opt,name=validity_duration,json=validityDuration,proto3,stdduration" json:"validity_duration" yaml:"validity_duration"` } func (m *AppLinksParams) Reset() { *m = AppLinksParams{} } @@ -297,58 +297,58 @@ func init() { } var fileDescriptor_924c89959f3aa975 = []byte{ - // 801 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcd, 0x6e, 0xeb, 0x44, - 0x14, 0xc7, 0x93, 0x3a, 0x8d, 0xe2, 0xc9, 0xa5, 0x97, 0x6b, 0x5d, 0x2e, 0xb9, 0x17, 0x61, 0x47, - 0xb3, 0xa8, 0xb2, 0xa9, 0xad, 0xb4, 0x48, 0x48, 0x95, 0x58, 0xd4, 0x69, 0x85, 0x2a, 0x0a, 0xad, - 0x4c, 0x25, 0x04, 0x1b, 0x6b, 0xec, 0x4c, 0xdc, 0x51, 0x6c, 0x8f, 0xe5, 0x71, 0xa2, 0x74, 0x03, - 0x5b, 0x96, 0x2c, 0x59, 0x21, 0xb6, 0x20, 0x1e, 0xa4, 0xcb, 0x2e, 0x11, 0x0b, 0x17, 0xa5, 0x6f, - 0x90, 0x27, 0x40, 0xf3, 0xe1, 0x7c, 0x94, 0x22, 0x0a, 0x88, 0x95, 0xc7, 0x73, 0xce, 0xff, 0x77, - 0xce, 0x9c, 0x33, 0x1f, 0x60, 0x77, 0x88, 0x59, 0x42, 0x99, 0x93, 0xe5, 0x74, 0x44, 0x62, 0xcc, - 0x9c, 0xe9, 0x81, 0x93, 0xd0, 0x21, 0x8e, 0x99, 0x9f, 0xa1, 0x1c, 0x25, 0xcc, 0xce, 0x72, 0x5a, - 0x50, 0xc3, 0x90, 0x7e, 0x76, 0xe5, 0x67, 0x4f, 0x0f, 0xde, 0xbc, 0x8c, 0x68, 0x44, 0x85, 0xd9, - 0xe1, 0x23, 0xe9, 0xf9, 0xc6, 0x0c, 0xa9, 0x20, 0x06, 0x88, 0x61, 0x67, 0xda, 0x0f, 0x70, 0x81, - 0xfa, 0x4e, 0x48, 0x49, 0x5a, 0xd9, 0x23, 0x4a, 0xa3, 0x18, 0x3b, 0xe2, 0x2f, 0x98, 0x8c, 0x9c, - 0xe1, 0x24, 0x47, 0x05, 0xa1, 0xca, 0x0e, 0x7f, 0xd2, 0x40, 0xf3, 0x42, 0x84, 0x36, 0xbe, 0x00, - 0xad, 0x94, 0x84, 0xe3, 0x14, 0x25, 0xb8, 0x53, 0xef, 0xd6, 0x7b, 0xed, 0x7d, 0x68, 0xff, 0x39, - 0x0f, 0xfb, 0x33, 0xe5, 0x23, 0x55, 0xee, 0xbb, 0x37, 0xa5, 0x55, 0x5b, 0x94, 0xd6, 0xf3, 0x6b, - 0x94, 0xc4, 0x87, 0xb0, 0x22, 0x40, 0x6f, 0x09, 0x33, 0xce, 0x41, 0x63, 0x58, 0xa0, 0xa8, 0xb3, - 0x25, 0xa0, 0xe6, 0x63, 0xd0, 0xe3, 0x4b, 0x14, 0x29, 0xe0, 0x7b, 0x1c, 0x38, 0x2f, 0xad, 0x06, - 0x9f, 0x5b, 0x94, 0x56, 0x5b, 0x82, 0x39, 0x01, 0x7a, 0x02, 0x64, 0x0c, 0x80, 0x16, 0x10, 0xda, - 0xd1, 0x04, 0xef, 0xfd, 0xc7, 0x78, 0x2e, 0xa1, 0x0a, 0x67, 0xa8, 0xfc, 0x80, 0xc4, 0x04, 0x84, - 0x42, 0x8f, 0xab, 0x8d, 0x73, 0xd0, 0xa4, 0x39, 0x0a, 0x63, 0xdc, 0x69, 0x08, 0x4e, 0xf7, 0x31, - 0xce, 0xb9, 0xf0, 0x50, 0xa8, 0x77, 0x14, 0xea, 0x2d, 0x89, 0x92, 0x6a, 0xe8, 0x29, 0x8c, 0xf1, - 0x25, 0xd0, 0x51, 0x96, 0xf9, 0x31, 0x49, 0xc7, 0xac, 0xb3, 0xfd, 0xd7, 0x05, 0x3c, 0xca, 0xb2, - 0x33, 0xee, 0xa3, 0xa8, 0x1d, 0x45, 0x7d, 0x5b, 0x52, 0x97, 0x08, 0xe8, 0xb5, 0x90, 0xf2, 0x3c, - 0x6c, 0x7c, 0xfb, 0xa3, 0x55, 0x83, 0x65, 0x1d, 0xec, 0x6c, 0x56, 0xdf, 0x08, 0x00, 0x48, 0x48, - 0xea, 0xc7, 0x38, 0x8d, 0x8a, 0x2b, 0xd1, 0xb5, 0x67, 0xee, 0x80, 0x03, 0x7f, 0x2b, 0xad, 0xdd, - 0x88, 0x14, 0x57, 0x93, 0xc0, 0x0e, 0x69, 0xe2, 0xa8, 0x5d, 0x22, 0x3f, 0x7b, 0x6c, 0x38, 0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da, 0xa2, 0xe4, 0xcd, - 0xb8, 0x17, 0xa3, 0x80, 0xa9, 0xb1, 0x33, 0xfd, 0xc0, 0x99, 0xad, 0xde, 0x46, 0xb1, 0xc6, 0xa0, - 0x29, 0x32, 0x3b, 0xf8, 0x23, 0x00, 0x00, 0xff, 0xff, 0x05, 0xf3, 0x62, 0x02, 0x3b, 0x07, 0x00, - 0x00, + // 804 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0xc7, 0xe3, 0x3a, 0x8d, 0xe2, 0xc9, 0xb2, 0x6c, 0xad, 0x05, 0xb2, 0x8b, 0xb0, 0xa3, 0x11, + 0x5a, 0xe5, 0xb2, 0xb6, 0xb2, 0x45, 0x42, 0x5a, 0x89, 0xc3, 0x3a, 0x5d, 0xa1, 0x8a, 0x85, 0xae, + 0x0c, 0x12, 0x82, 0x8b, 0x35, 0xb6, 0x27, 0xee, 0x28, 0xb6, 0xc7, 0xf2, 0x38, 0x51, 0x7a, 0xe2, + 0xc2, 0x81, 0x23, 0x47, 0x4e, 0x88, 0x2b, 0x88, 0x3f, 0xa4, 0xc7, 0x1e, 0x11, 0x07, 0x17, 0xa5, + 0xff, 0x41, 0xfe, 0x02, 0x34, 0x3f, 0x9c, 0x1f, 0x6d, 0x11, 0x05, 0xc4, 0xc9, 0xe3, 0x79, 0xef, + 0xfb, 0x79, 0x6f, 0xde, 0x9b, 0x1f, 0xe0, 0x49, 0x8c, 0x59, 0x46, 0x99, 0x5b, 0x94, 0x74, 0x42, + 0x52, 0xcc, 0xdc, 0xf9, 0xa1, 0x9b, 0xd1, 0x18, 0xa7, 0x2c, 0x28, 0x50, 0x89, 0x32, 0xe6, 0x14, + 0x25, 0xad, 0xa8, 0x69, 0x4a, 0x3f, 0xa7, 0xf1, 0x73, 0xe6, 0x87, 0x8f, 0x1f, 0x26, 0x34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xab, 0x81, 0xfb, 0xbb, 0x97, 0x8c, 0x99, 0x82, 0x83, 0x39, 0x4a, 0x49, 0x4c, 0xaa, 0xb3, + 0xa0, 0x79, 0x01, 0xd4, 0x25, 0xff, 0xc8, 0x91, 0x4f, 0x84, 0xd3, 0x3c, 0x11, 0xce, 0x91, 0x72, + 0xf0, 0xde, 0x57, 0x09, 0xf6, 0x65, 0x82, 0x37, 0x08, 0xf0, 0x87, 0x4b, 0x5b, 0xf3, 0x1f, 0x34, + 0xf3, 0x8d, 0x4e, 0xa6, 0xe1, 0x7d, 0x72, 0xbe, 0xb4, 0xb4, 0x8b, 0xa5, 0xa5, 0xfd, 0xb1, 0xb4, + 0xb4, 0xef, 0xaf, 0xac, 0xd6, 0xc5, 0x95, 0xd5, 0xfa, 0xed, 0xca, 0x6a, 0x7d, 0x3d, 0xda, 0x5a, + 0x9b, 0xbc, 0x20, 0x9f, 0xa6, 0x28, 0x64, 0x6a, 0xec, 0xce, 0x3f, 0x70, 0x17, 0x9b, 0x27, 0x52, + 0x2c, 0x35, 0xec, 0x88, 0xec, 0x0e, 0xff, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x27, 0x48, 0xa2, 0xab, + 0x42, 0x07, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -632,7 +632,7 @@ func (m *AppLinksParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime):]) + n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ValidityDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidityDuration):]) if err6 != nil { return 0, err6 } @@ -750,7 +750,7 @@ func (m *AppLinksParams) Size() (n int) { } var l int _ = l - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.ExpirationTime) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidityDuration) n += 1 + l + sovModelsParams(uint64(l)) return n } @@ -1533,7 +1533,7 @@ func (m *AppLinksParams) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidityDuration", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1560,7 +1560,7 @@ func (m *AppLinksParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.ValidityDuration, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/profiles/wasm/querier_test.go b/x/profiles/wasm/querier_test.go index cceacc0f31..dbd5f80039 100644 --- a/x/profiles/wasm/querier_test.go +++ b/x/profiles/wasm/querier_test.go @@ -170,6 +170,7 @@ func (suite *TestSuite) TestProfilesWasmQuerier_QueryCustom() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), )), ) }, @@ -191,6 +192,7 @@ func (suite *TestSuite) TestProfilesWasmQuerier_QueryCustom() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, Pagination: &query.PageResponse{NextKey: nil, Total: 1}}, @@ -220,6 +222,7 @@ func (suite *TestSuite) TestProfilesWasmQuerier_QueryCustom() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), )), ) }, @@ -240,6 +243,7 @@ func (suite *TestSuite) TestProfilesWasmQuerier_QueryCustom() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), )}, ), }, @@ -271,6 +275,7 @@ func (suite *TestSuite) TestProfilesWasmQuerier_QueryCustom() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), )), ) }, From 9f66e6b2a3c5d554835f4250b6e5f08ec9133ce5 Mon Sep 17 00:00:00 2001 From: RiccardoM Date: Fri, 8 Jul 2022 06:40:55 +0000 Subject: [PATCH 099/112] Updated Swagger definition --- client/docs/swagger-ui/swagger.yaml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index dcf9ad8934..4a226c59fa 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -2796,11 +2796,11 @@ paths: app_links: type: object properties: - expiration_time: + validity_duration: type: string title: >- - ExpirationTime indicates the max amount of time before - a link expires + Default validity duration before an application link + expires title: >- AppLinksParams define the parameters related to the app links @@ -11571,9 +11571,9 @@ definitions: desmos.profiles.v3.AppLinksParams: type: object properties: - expiration_time: + validity_duration: type: string - title: ExpirationTime indicates the max amount of time before a link expires + title: Default validity duration before an application link expires title: AppLinksParams define the parameters related to the app links desmos.profiles.v3.ApplicationLink: type: object @@ -12512,11 +12512,9 @@ definitions: app_links: type: object properties: - expiration_time: + validity_duration: type: string - title: >- - ExpirationTime indicates the max amount of time before a link - expires + title: Default validity duration before an application link expires title: AppLinksParams define the parameters related to the app links title: Params contains the parameters for the profiles module desmos.profiles.v3.Proof: @@ -14002,11 +14000,9 @@ definitions: app_links: type: object properties: - expiration_time: + validity_duration: type: string - title: >- - ExpirationTime indicates the max amount of time before a link - expires + title: Default validity duration before an application link expires title: AppLinksParams define the parameters related to the app links title: Params contains the parameters for the profiles module description: QueryParamsResponse is the response type for the Query/Params RPC method. From 0e1e58d7a7b51e18d70d93e5bfbc6988ba8bad16 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 8 Jul 2022 09:28:51 +0200 Subject: [PATCH 100/112] improved tests Signed-off-by: Riccardo Montagnin --- x/profiles/abci.go | 18 +++ x/profiles/abci_test.go | 140 ++++++++++++++++++ x/profiles/keeper/alias_functions.go | 6 +- x/profiles/keeper/alias_functions_test.go | 132 ++++++++++------- x/profiles/keeper/keeper_app_links.go | 14 +- .../keeper_app_links_benchmarks_test.go | 14 +- x/profiles/keeper/keeper_app_links_test.go | 63 -------- x/profiles/keeper/relay_app_links.go | 7 +- x/profiles/legacy/v5/models.go | 2 + x/profiles/module.go | 3 +- 10 files changed, 256 insertions(+), 143 deletions(-) create mode 100644 x/profiles/abci.go create mode 100644 x/profiles/abci_test.go diff --git a/x/profiles/abci.go b/x/profiles/abci.go new file mode 100644 index 0000000000..edd5647b76 --- /dev/null +++ b/x/profiles/abci.go @@ -0,0 +1,18 @@ +package profiles + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/desmos-labs/desmos/v4/x/profiles/keeper" + "github.com/desmos-labs/desmos/v4/x/profiles/types" +) + +// BeginBlocker is called every block, processes expired application links +func BeginBlocker(ctx sdk.Context, keeper keeper.Keeper) { + // Iterate over all the expiring application links + keeper.IterateExpiringApplicationLinks(ctx, func(_ int64, link types.ApplicationLink) (stop bool) { + // Delete the application link + keeper.DeleteApplicationLink(ctx, link) + return false + }) +} diff --git a/x/profiles/abci_test.go b/x/profiles/abci_test.go new file mode 100644 index 0000000000..19cc72d3d7 --- /dev/null +++ b/x/profiles/abci_test.go @@ -0,0 +1,140 @@ +package profiles_test + +import ( + "testing" + "time" + + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + "github.com/desmos-labs/desmos/v4/testutil/profilestesting" + "github.com/desmos-labs/desmos/v4/x/profiles" + + "github.com/desmos-labs/desmos/v4/x/profiles/keeper" + "github.com/desmos-labs/desmos/v4/x/profiles/types" + + relationshipskeeper "github.com/desmos-labs/desmos/v4/x/relationships/keeper" + relationshipstypes "github.com/desmos-labs/desmos/v4/x/relationships/types" + + "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + db "github.com/tendermint/tm-db" + + "github.com/desmos-labs/desmos/v4/app" + subspaceskeeper "github.com/desmos-labs/desmos/v4/x/subspaces/keeper" + subspacestypes "github.com/desmos-labs/desmos/v4/x/subspaces/types" +) + +func TestBeginBlocker(t *testing.T) { + // Define store keys + keys := sdk.NewMemoryStoreKeys( + paramstypes.StoreKey, authtypes.StoreKey, + relationshipstypes.StoreKey, types.StoreKey, + ) + tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) + + // Create an in-memory db + memDB := db.NewMemDB() + ms := store.NewCommitMultiStore(memDB) + for _, key := range keys { + ms.MountStoreWithDB(key, sdk.StoreTypeIAVL, memDB) + } + for _, tKey := range tKeys { + ms.MountStoreWithDB(tKey, sdk.StoreTypeTransient, memDB) + } + + err := ms.LoadLatestVersion() + require.NoError(t, err) + + ctx := sdk.NewContext(ms, tmproto.Header{ChainID: "test-chain"}, false, log.NewNopLogger()) + cdc, legacyAmino := app.MakeCodecs() + pk := paramskeeper.NewKeeper(cdc, legacyAmino, keys[paramstypes.StoreKey], tKeys[paramstypes.TStoreKey]) + sk := subspaceskeeper.NewKeeper(cdc, keys[subspacestypes.StoreKey]) + rk := relationshipskeeper.NewKeeper(cdc, keys[relationshipstypes.StoreKey], sk) + ak := authkeeper.NewAccountKeeper(cdc, keys[authtypes.StoreKey], pk.Subspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, app.GetMaccPerms()) + k := keeper.NewKeeper(cdc, legacyAmino, keys[types.StoreKey], pk.Subspace(types.DefaultParamsSpace), ak, rk, nil, nil, nil) + + testCases := []struct { + name string + setupCtx func(ctx sdk.Context) sdk.Context + store func(ctx sdk.Context) + check func(ctx sdk.Context) + expEvents sdk.Events + }{ + { + name: "expired links are deleted correctly", + setupCtx: func(ctx sdk.Context) sdk.Context { + return ctx.WithBlockTime(time.Date(2020, 1, 1, 01, 00, 00, 000, time.UTC)) + }, + store: func(ctx sdk.Context) { + address := "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773" + link := types.NewApplicationLink( + address, + types.NewData("twitter", "twitteruser"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("twitter", "calldata"), + "client_id", + ), + nil, + time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + ) + + require.NoError(t, k.SaveProfile(ctx, profilestesting.ProfileFromAddr(address))) + require.NoError(t, k.SaveApplicationLink(ctx, link)) + }, + expEvents: sdk.Events{ + sdk.NewEvent( + types.EventTypeApplicationLinkDeleted, + sdk.NewAttribute(types.AttributeKeyUser, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + sdk.NewAttribute(types.AttributeKeyApplicationName, "twitter"), + sdk.NewAttribute(types.AttributeKeyApplicationUsername, "twitteruser"), + sdk.NewAttribute( + types.AttributeKeyApplicationLinkExpirationTime, + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC).Format(time.RFC3339), + ), + ), + }, + check: func(ctx sdk.Context) { + require.False(t, k.HasApplicationLink(ctx, + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + "twitter", + "twitteruser", + )) + }, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + ctx, _ := ctx.CacheContext() + if tc.setupCtx != nil { + ctx = tc.setupCtx(ctx) + } + if tc.store != nil { + tc.store(ctx) + } + + // Reset the events + ctx = ctx.WithEventManager(sdk.NewEventManager()) + + // Run the BeginBlocker + profiles.BeginBlocker(ctx, k) + + // Check the events and storage + require.Equal(t, tc.expEvents, ctx.EventManager().Events()) + if tc.check != nil { + tc.check(ctx) + } + }) + } +} diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go index beb2c19cd4..f2fe0ab014 100644 --- a/x/profiles/keeper/alias_functions.go +++ b/x/profiles/keeper/alias_functions.go @@ -135,7 +135,7 @@ func (k Keeper) GetApplicationLinks(ctx sdk.Context) []types.ApplicationLink { // IterateExpiringApplicationLinks iterates through all the expiring application links references. // The key will be skipped and deleted if the application link has already been deleted. -func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index int64, link types.ApplicationLink) (stop bool)) error { +func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index int64, link types.ApplicationLink) (stop bool)) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.ExpiringAppLinkTimePrefix) @@ -146,7 +146,7 @@ func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index i trimmedPrefixKey := bytes.TrimPrefix(iterator.Key(), types.ExpiringAppLinkTimePrefix) expiringTime, err := sdk.ParseTimeBytes(bytes.TrimSuffix(trimmedPrefixKey, iterator.Value())) if err != nil { - return err + panic(err) } // Skip if application link has been deleted already @@ -166,8 +166,6 @@ func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index i } i++ } - - return nil } // -------------------------------------------------------------------------------------------------------------------- diff --git a/x/profiles/keeper/alias_functions_test.go b/x/profiles/keeper/alias_functions_test.go index a50c63d43f..7dc2b0718c 100644 --- a/x/profiles/keeper/alias_functions_test.go +++ b/x/profiles/keeper/alias_functions_test.go @@ -272,65 +272,91 @@ func (suite *KeeperTestSuite) TestKeeper_GetApplicationLinks() { } func (suite *KeeperTestSuite) TestKeeper_IterateExpiringApplicationLinks() { - address := "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47" - links := []types.ApplicationLink{ - types.NewApplicationLink( - address, - types.NewData("github", "github-user"), - types.ApplicationLinkStateInitialized, - types.NewOracleRequest( - 0, - 1, - types.NewOracleRequestCallData("github", "call_data"), - "client_id", - ), - nil, - time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), - ), - types.NewApplicationLink( - address, - types.NewData("reddit", "reddit-user"), - types.ApplicationLinkStateInitialized, - types.NewOracleRequest( - 0, - 1, - types.NewOracleRequestCallData("reddit", "call_data"), - "client_id2", - ), - nil, - time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), - ), - } + testCases := []struct { + name string + setupCtx func(ctx sdk.Context) sdk.Context + store func(ctx sdk.Context) + expLinks []types.ApplicationLink + }{ + { + name: "expiring links are iterated properly", + setupCtx: func(ctx sdk.Context) sdk.Context { + return ctx.WithBlockTime(time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC)) + }, + store: func(ctx sdk.Context) { + suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47")) - // ensure the expiring time is the same of the links - suite.ctx = suite.ctx.WithBlockTime( - time.Date(2022, 1, 6, 00, 00, 00, 000, time.UTC), - ) - ctx, _ := suite.ctx.CacheContext() + err := suite.k.SaveApplicationLink(ctx, types.NewApplicationLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + types.NewData("github", "github-user"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("github", "call_data"), + "client_id", + ), + nil, + time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + )) + suite.Require().NoError(err) - for _, link := range links { - suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr(link.User)) - err := suite.k.SaveApplicationLink(ctx, link) - suite.Require().NoError(err) + err = suite.k.SaveApplicationLink(ctx, types.NewApplicationLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + types.NewData("reddit", "reddit-user"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("reddit", "call_data"), + "client_id2", + ), + nil, + time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + )) + suite.Require().NoError(err) + }, + expLinks: []types.ApplicationLink{ + types.NewApplicationLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + types.NewData("github", "github-user"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("github", "call_data"), + "client_id", + ), + nil, + time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + ), + }, + }, } - clientID := "already_deleted" - applicationLinkExpiringTimeKey := types.ApplicationLinkExpiringTimeKey( - time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), clientID, - ) - store := ctx.KVStore(suite.storeKey) - store.Set(applicationLinkExpiringTimeKey, []byte(clientID)) + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + ctx, _ := suite.ctx.CacheContext() + if tc.setupCtx != nil { + ctx = tc.setupCtx(ctx) + } + if tc.store != nil { + tc.store(ctx) + } - var expiredLinks []types.ApplicationLink - err := suite.k.IterateExpiringApplicationLinks(ctx, func(index int64, link types.ApplicationLink) (stop bool) { - expiredLinks = append(expiredLinks, link) - return index == 1 - }) + var iteratedLinks []types.ApplicationLink + suite.k.IterateExpiringApplicationLinks(ctx, func(index int64, link types.ApplicationLink) (stop bool) { + iteratedLinks = append(iteratedLinks, link) + return false + }) - suite.Require().NoError(err) - suite.Require().Equal([]types.ApplicationLink{links[0], links[1]}, expiredLinks) + suite.Require().Equal(tc.expLinks, iteratedLinks) + }) + } } // -------------------------------------------------------------------------------------------------------------------- diff --git a/x/profiles/keeper/keeper_app_links.go b/x/profiles/keeper/keeper_app_links.go index fda31641ea..42e4823da1 100644 --- a/x/profiles/keeper/keeper_app_links.go +++ b/x/profiles/keeper/keeper_app_links.go @@ -1,6 +1,8 @@ package keeper import ( + "time" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -23,10 +25,10 @@ func (k Keeper) SaveApplicationLink(ctx sdk.Context, link types.ApplicationLink) // Store the data store := ctx.KVStore(k.storeKey) userApplicationLinkKey := types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username) - applicationLinkExpiringTimeKey := types.ApplicationLinkExpiringTimeKey(link.ExpirationTime, link.OracleRequest.ClientID) store.Set(userApplicationLinkKey, types.MustMarshalApplicationLink(k.cdc, link)) store.Set(types.ApplicationLinkClientIDKey(link.OracleRequest.ClientID), userApplicationLinkKey) store.Set(types.ApplicationLinkOwnerKey(link.Data.Application, link.Data.Username, link.User), []byte{0x01}) + applicationLinkExpiringTimeKey := types.ApplicationLinkExpiringTimeKey(link.ExpirationTime, link.OracleRequest.ClientID) store.Set(applicationLinkExpiringTimeKey, []byte(link.OracleRequest.ClientID)) ctx.EventManager().EmitEvent( @@ -110,7 +112,7 @@ func (k Keeper) DeleteApplicationLink(ctx sdk.Context, appLink types.Application sdk.NewAttribute(types.AttributeKeyUser, appLink.User), sdk.NewAttribute(types.AttributeKeyApplicationName, appLink.Data.Application), sdk.NewAttribute(types.AttributeKeyApplicationUsername, appLink.Data.Username), - sdk.NewAttribute(types.AttributeKeyApplicationLinkExpirationTime, appLink.ExpirationTime.String()), + sdk.NewAttribute(types.AttributeKeyApplicationLinkExpirationTime, appLink.ExpirationTime.Format(time.RFC3339)), ), ) } @@ -127,11 +129,3 @@ func (k Keeper) DeleteAllUserApplicationLinks(ctx sdk.Context, user string) { k.DeleteApplicationLink(ctx, link) } } - -// DeleteExpiredApplicationLinks deletes all the expired application links in the given context -func (k Keeper) DeleteExpiredApplicationLinks(ctx sdk.Context) { - k.IterateExpiringApplicationLinks(ctx, func(_ int64, link types.ApplicationLink) (stop bool) { - k.DeleteApplicationLink(ctx, link) - return false - }) -} diff --git a/x/profiles/keeper/keeper_app_links_benchmarks_test.go b/x/profiles/keeper/keeper_app_links_benchmarks_test.go index c82b359c2b..4689c49071 100644 --- a/x/profiles/keeper/keeper_app_links_benchmarks_test.go +++ b/x/profiles/keeper/keeper_app_links_benchmarks_test.go @@ -5,6 +5,8 @@ import ( "testing" "time" + "github.com/desmos-labs/desmos/v4/x/profiles" + "github.com/desmos-labs/desmos/v4/testutil/profilestesting" "github.com/cosmos/cosmos-sdk/store" @@ -25,7 +27,7 @@ import ( "github.com/desmos-labs/desmos/v4/x/profiles/types" ) -func setupBenchTest() (authkeeper.AccountKeeper, keeper.Keeper, sdk.Context) { +func setupBenchTest() (sdk.Context, authkeeper.AccountKeeper, keeper.Keeper) { // Define the store keys keys := sdk.NewKVStoreKeys(types.StoreKey, authtypes.StoreKey, paramstypes.StoreKey) tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) @@ -77,7 +79,7 @@ func setupBenchTest() (authkeeper.AccountKeeper, keeper.Keeper, sdk.Context) { nil, ) - return ak, k, ctx + return ctx, ak, k } func generateRandomAppLinks(r *rand.Rand, linkNum int) []types.ApplicationLink { @@ -106,9 +108,8 @@ func generateRandomAppLinks(r *rand.Rand, linkNum int) []types.ApplicationLink { } func BenchmarkKeeper_DeleteExpiredApplicationLinks(b *testing.B) { - r := rand.New(rand.NewSource(100)) - ak, k, ctx := setupBenchTest() - links := generateRandomAppLinks(r, 1) + ctx, ak, k := setupBenchTest() + links := generateRandomAppLinks(rand.New(rand.NewSource(100)), 1) ctx, _ = ctx.CacheContext() for _, link := range links { @@ -117,10 +118,11 @@ func BenchmarkKeeper_DeleteExpiredApplicationLinks(b *testing.B) { require.NoError(b, err) } + b.ResetTimer() b.Run("iterate and delete expired links", func(b *testing.B) { for i := 0; i < b.N; i++ { b.ReportAllocs() - k.DeleteExpiredApplicationLinks(ctx) + profiles.BeginBlocker(ctx, k) } }) } diff --git a/x/profiles/keeper/keeper_app_links_test.go b/x/profiles/keeper/keeper_app_links_test.go index ac7ab61fab..cb4589fa2c 100644 --- a/x/profiles/keeper/keeper_app_links_test.go +++ b/x/profiles/keeper/keeper_app_links_test.go @@ -548,66 +548,3 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { }) } } - -func (suite *KeeperTestSuite) Test_DeleteExpiredApplicationLinks() { - testCases := []struct { - name string - store func(store sdk.Context) - expectedEmittedEvent sdk.Event - }{ - { - name: "Expired links are deleted correctly", - store: func(ctx sdk.Context) { - address := "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773" - link := types.NewApplicationLink( - address, - types.NewData("twitter", "twitteruser"), - types.ApplicationLinkStateInitialized, - types.NewOracleRequest( - 0, - 1, - types.NewOracleRequestCallData("twitter", "calldata"), - "client_id", - ), - nil, - time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), - ) - - suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(address))) - err := suite.k.SaveApplicationLink(ctx, link) - suite.Require().NoError(err) - }, - expectedEmittedEvent: sdk.NewEvent( - types.EventTypeApplicationLinkDeleted, - sdk.NewAttribute(types.AttributeKeyUser, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), - sdk.NewAttribute(types.AttributeKeyApplicationName, "twitter"), - sdk.NewAttribute(types.AttributeKeyApplicationUsername, "twitteruser"), - sdk.NewAttribute( - types.AttributeKeyApplicationLinkExpirationTime, - time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC).String(), - ), - ), - }, - } - - for _, tc := range testCases { - tc := tc - suite.Run(tc.name, func() { - // ensure the expiring time is the same of the links - suite.ctx = suite.ctx.WithBlockTime( - time.Date(2022, 1, 2, 00, 00, 00, 000, time.UTC), - ) - ctx, _ := suite.ctx.CacheContext() - if tc.store != nil { - tc.store(ctx) - } - suite.k.DeleteExpiredApplicationLinks(ctx) - emittedEvents := ctx.EventManager().Events() - appLinks := suite.k.GetApplicationLinks(ctx) - - suite.Require().Equal(0, len(appLinks)) - suite.Require().Equal(tc.expectedEmittedEvent, emittedEvents[1]) - }) - } -} diff --git a/x/profiles/keeper/relay_app_links.go b/x/profiles/keeper/relay_app_links.go index d2390be60d..101ab779a5 100644 --- a/x/profiles/keeper/relay_app_links.go +++ b/x/profiles/keeper/relay_app_links.go @@ -115,9 +115,6 @@ func (k Keeper) StartProfileConnection( return err } - // Get block time as the creation time of the appLink - creationTime := ctx.BlockTime() - // Store the connection err = k.SaveApplicationLink(ctx, types.NewApplicationLink( sender.String(), @@ -130,8 +127,8 @@ func (k Keeper) StartProfileConnection( clientID, ), nil, - creationTime, - creationTime.Add(k.GetParams(ctx).AppLinks.ValidityDuration), + ctx.BlockTime(), + ctx.BlockTime().Add(k.GetParams(ctx).AppLinks.ValidityDuration), )) if err != nil { diff --git a/x/profiles/legacy/v5/models.go b/x/profiles/legacy/v5/models.go index 902f94a126..3630ae8d47 100644 --- a/x/profiles/legacy/v5/models.go +++ b/x/profiles/legacy/v5/models.go @@ -1,5 +1,7 @@ package v5 +// DONTCOVER + import ( "encoding/json" "time" diff --git a/x/profiles/module.go b/x/profiles/module.go index 60ba228a35..c479dbacea 100644 --- a/x/profiles/module.go +++ b/x/profiles/module.go @@ -183,8 +183,7 @@ func (AppModule) ConsensusVersion() uint64 { // BeginBlock returns the begin blocker for the profiles module. func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { - // TODO should we emit an event for this? - am.keeper.DeleteExpiredApplicationLinks(ctx) + BeginBlocker(ctx, am.keeper) } // EndBlock returns the end blocker for the profiles module. It returns no validator From 1aba69b40b9fd7ed7034499f2283e7a45ff8f6d5 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 8 Jul 2022 09:30:18 +0200 Subject: [PATCH 101/112] fixed small formatting Signed-off-by: Riccardo Montagnin --- x/profiles/keeper/relay_app_links.go | 1 - 1 file changed, 1 deletion(-) diff --git a/x/profiles/keeper/relay_app_links.go b/x/profiles/keeper/relay_app_links.go index 101ab779a5..09cb97066d 100644 --- a/x/profiles/keeper/relay_app_links.go +++ b/x/profiles/keeper/relay_app_links.go @@ -130,7 +130,6 @@ func (k Keeper) StartProfileConnection( ctx.BlockTime(), ctx.BlockTime().Add(k.GetParams(ctx).AppLinks.ValidityDuration), )) - if err != nil { return err } From 355f21d16a671d0289a6c5f8b8564a08ea48005c Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 8 Jul 2022 11:36:03 +0200 Subject: [PATCH 102/112] updated the migrations Signed-off-by: Riccardo Montagnin --- .../profiles/v1beta1/models_app_links.proto | 155 ++ .../profiles/v1beta1/models_chain_links.proto | 2 +- .../v1beta1/models_dtag_requests.proto | 31 + .../profiles/v1beta1/models_profile.proto | 2 +- .../v1beta1/models_relationships.proto | 2 +- .../desmos/profiles/v2/models_app_links.proto | 2 +- .../profiles/v2/models_chain_links.proto | 142 + .../profiles/v2/models_dtag_requests.proto | 30 + proto/desmos/profiles/v2/models_params.proto | 2 +- proto/desmos/profiles/v2/models_profile.proto | 2 +- .../profiles/v3/models_dtag_requests.proto | 1 - x/profiles/keeper/migrations.go | 23 +- x/profiles/legacy/v4/keeper.go | 58 +- x/profiles/legacy/v4/store.go | 59 +- x/profiles/legacy/v4/store_test.go | 193 +- x/profiles/legacy/v4/{ => types}/codec.go | 2 +- x/profiles/legacy/v4/{ => types}/keys.go | 2 +- .../legacy/v4/types/models_app_links.go | 224 ++ .../legacy/v4/types/models_app_links.pb.go | 2293 +++++++++++++++++ .../v4/{ => types}/models_chain_links.go | 2 +- .../v4/{ => types}/models_chain_links.pb.go | 82 +- .../v4/types/models_dtag_requests.pb.go | 452 ++++ .../legacy/v4/{ => types}/models_profile.go | 2 +- .../v4/{ => types}/models_profile.pb.go | 66 +- .../v4/{ => types}/models_relationships.pb.go | 55 +- x/profiles/legacy/v5/store.go | 13 +- x/profiles/legacy/v5/store_test.go | 47 +- x/profiles/legacy/v5/types/codec.go | 27 + .../legacy/v5/types/models_app_links.go | 224 ++ .../v5/{ => types}/models_app_links.pb.go | 126 +- .../legacy/v5/types/models_chain_links.go | 563 ++++ .../legacy/v5/types/models_chain_links.pb.go | 2237 ++++++++++++++++ .../legacy/v5/types/models_dtag_requests.go | 51 + .../v5/types/models_dtag_requests.pb.go | 449 ++++ .../legacy/v5/{ => types}/models_params.pb.go | 93 +- .../v5/{models.go => types/models_profile.go} | 70 +- .../v5/{ => types}/models_profile.pb.go | 62 +- x/profiles/legacy/v6/store.go | 263 ++ x/profiles/legacy/v6/store_test.go | 252 ++ x/profiles/module.go | 15 +- x/profiles/types/models_dtag_requests.pb.go | 47 +- x/profiles/types/models_params.go | 2 +- x/relationships/legacy/v1/store_test.go | 14 +- 43 files changed, 7963 insertions(+), 476 deletions(-) create mode 100644 proto/desmos/profiles/v1beta1/models_app_links.proto create mode 100644 proto/desmos/profiles/v1beta1/models_dtag_requests.proto create mode 100644 proto/desmos/profiles/v2/models_chain_links.proto create mode 100644 proto/desmos/profiles/v2/models_dtag_requests.proto rename x/profiles/legacy/v4/{ => types}/codec.go (97%) rename x/profiles/legacy/v4/{ => types}/keys.go (99%) create mode 100644 x/profiles/legacy/v4/types/models_app_links.go create mode 100644 x/profiles/legacy/v4/types/models_app_links.pb.go rename x/profiles/legacy/v4/{ => types}/models_chain_links.go (99%) rename x/profiles/legacy/v4/{ => types}/models_chain_links.pb.go (91%) create mode 100644 x/profiles/legacy/v4/types/models_dtag_requests.pb.go rename x/profiles/legacy/v4/{ => types}/models_profile.go (99%) rename x/profiles/legacy/v4/{ => types}/models_profile.pb.go (86%) rename x/profiles/legacy/v4/{ => types}/models_relationships.pb.go (88%) create mode 100644 x/profiles/legacy/v5/types/codec.go create mode 100644 x/profiles/legacy/v5/types/models_app_links.go rename x/profiles/legacy/v5/{ => types}/models_app_links.pb.go (90%) create mode 100644 x/profiles/legacy/v5/types/models_chain_links.go create mode 100644 x/profiles/legacy/v5/types/models_chain_links.pb.go create mode 100644 x/profiles/legacy/v5/types/models_dtag_requests.go create mode 100644 x/profiles/legacy/v5/types/models_dtag_requests.pb.go rename x/profiles/legacy/v5/{ => types}/models_params.pb.go (88%) rename x/profiles/legacy/v5/{models.go => types/models_profile.go} (79%) rename x/profiles/legacy/v5/{ => types}/models_profile.pb.go (87%) create mode 100644 x/profiles/legacy/v6/store.go create mode 100644 x/profiles/legacy/v6/store_test.go diff --git a/proto/desmos/profiles/v1beta1/models_app_links.proto b/proto/desmos/profiles/v1beta1/models_app_links.proto new file mode 100644 index 0000000000..588bb21f74 --- /dev/null +++ b/proto/desmos/profiles/v1beta1/models_app_links.proto @@ -0,0 +1,155 @@ +syntax = "proto3"; +package desmos.profiles.v1beta1; + +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +// ApplicationLink contains the data of a link to a centralized application +message ApplicationLink { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // User to which the link is associated + string user = 1 [ (gogoproto.moretags) = "yaml:\"user\"" ]; + + // Data contains the details of this specific link + Data data = 2 + [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"data\"" ]; + + // State of the link + ApplicationLinkState state = 3 [ (gogoproto.moretags) = "yaml:\"state\"" ]; + + // OracleRequest represents the request that has been made to the oracle + OracleRequest oracle_request = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"oracle_request\"" + ]; + + // Data coming from the result of the verification. + // Only available when the state is STATE_SUCCESS + Result result = 5 [ (gogoproto.moretags) = "yaml:\"result\"" ]; + + // CreationTime represents the time in which the link was created + google.protobuf.Timestamp creation_time = 6 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"creation_time\"" + ]; +} + +// Data contains the data associated to a specific user of a +// generic centralized application +message Data { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // The application name (eg. Twitter, GitHub, etc) + string application = 1 [ (gogoproto.moretags) = "yaml:\"application\"" ]; + // Username on the application (eg. Twitter tag, GitHub profile, etc) + string username = 2 [ (gogoproto.moretags) = "yaml:\"username\"" ]; +} + +// OracleRequest represents a generic oracle request used to +// verify the ownership of a centralized application account +message OracleRequest { + option (gogoproto.goproto_getters) = false; + + option (gogoproto.equal) = true; + + // ID is the ID of the request + uint64 id = 1 + [ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ]; + + // OracleScriptID is ID of an oracle script + uint64 oracle_script_id = 2 [ + (gogoproto.customname) = "OracleScriptID", + (gogoproto.moretags) = "yaml:\"oracle_script_id\"" + ]; + + // CallData contains the data used to perform the oracle request + CallData call_data = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"call_data\"" + ]; + + // ClientID represents the ID of the client that has called the oracle script + string client_id = 4 [ + (gogoproto.customname) = "ClientID", + (gogoproto.moretags) = "yaml:\"client_id\"" + ]; + + // CallData contains the data sent to a single oracle request in order to + // verify the ownership of a centralized application by a Desmos profile + message CallData { + option (gogoproto.equal) = true; + + // The application for which the ownership should be verified + string application = 1 [ (gogoproto.moretags) = "yaml:\"application\"" ]; + + // The hex encoded call data that should be used to verify the application + // account ownership + string call_data = 2 [ (gogoproto.moretags) = "yaml:\"call_data\"" ]; + } +} + +// ApplicationLinkState defines if an application link is in the following +// states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT +enum ApplicationLinkState { + option (gogoproto.goproto_enum_prefix) = false; + + // A link has just been initialized + APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED = 0 + [ (gogoproto.enumvalue_customname) = "ApplicationLinkStateInitialized" ]; + // A link has just started being verified + APPLICATION_LINK_STATE_VERIFICATION_STARTED = 1 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationStarted" ]; + // A link has errored during the verification process + APPLICATION_LINK_STATE_VERIFICATION_ERROR = 2 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationError" ]; + // A link has being verified successfully + APPLICATION_LINK_STATE_VERIFICATION_SUCCESS = 3 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationSuccess" ]; + // A link has timed out while waiting for the verification + APPLICATION_LINK_STATE_TIMED_OUT = 4 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationTimedOut" ]; +} + +// Result represents a verification result +message Result { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // sum is the oneof that specifies whether this represents a success or + // failure result + oneof sum { + // Success represents a successful verification + Success success = 1; + + // Failed represents a failed verification + Failed failed = 2; + } + + // Success is the result of an application link that has been successfully + // verified + message Success { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // Hex-encoded value that has be signed by the profile + string value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; + // Hex-encoded signature that has been produced by signing the value + string signature = 2 [ (gogoproto.moretags) = "yaml:\"signature\"" ]; + } + + // Failed is the result of an application link that has not been verified + // successfully + message Failed { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // Error that is associated with the failure + string error = 1 [ (gogoproto.moretags) = "yaml:\"error\"" ]; + } +} diff --git a/proto/desmos/profiles/v1beta1/models_chain_links.proto b/proto/desmos/profiles/v1beta1/models_chain_links.proto index 463537ab04..d65c0408a2 100644 --- a/proto/desmos/profiles/v1beta1/models_chain_links.proto +++ b/proto/desmos/profiles/v1beta1/models_chain_links.proto @@ -6,7 +6,7 @@ import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types"; // ChainLink contains the data representing either an inter- or cross- chain // link diff --git a/proto/desmos/profiles/v1beta1/models_dtag_requests.proto b/proto/desmos/profiles/v1beta1/models_dtag_requests.proto new file mode 100644 index 0000000000..0aea977918 --- /dev/null +++ b/proto/desmos/profiles/v1beta1/models_dtag_requests.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package desmos.profiles.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "desmos/profiles/v3/models_chain_links.proto"; + +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types"; + +// DTagTransferRequest represent a DTag transfer request between two users +message DTagTransferRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // DTagToTrade contains the value of the DTag that should be transferred from + // the receiver of the request to the sender + string dtag_to_trade = 1 [ + (gogoproto.moretags) = "yaml:\"dtag_to_trade\"", + (gogoproto.customname) = "DTagToTrade" + ]; + + // Sender represents the address of the account that sent the request + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + // Receiver represents the receiver of the request that, if accepted, will + // give to the sender their DTag + string receiver = 3 [ (gogoproto.moretags) = "yaml:\"receiver\"" ]; +} \ No newline at end of file diff --git a/proto/desmos/profiles/v1beta1/models_profile.proto b/proto/desmos/profiles/v1beta1/models_profile.proto index 740f1e2e77..f563354cfe 100644 --- a/proto/desmos/profiles/v1beta1/models_profile.proto +++ b/proto/desmos/profiles/v1beta1/models_profile.proto @@ -6,7 +6,7 @@ import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types"; // -------------------------------------------------------------------------------------------------------------------- diff --git a/proto/desmos/profiles/v1beta1/models_relationships.proto b/proto/desmos/profiles/v1beta1/models_relationships.proto index 1f28ae4691..0ddc603896 100644 --- a/proto/desmos/profiles/v1beta1/models_relationships.proto +++ b/proto/desmos/profiles/v1beta1/models_relationships.proto @@ -6,7 +6,7 @@ import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types"; // Relationship is the struct of a relationship. // It represent the concept of "follow" of traditional social networks. diff --git a/proto/desmos/profiles/v2/models_app_links.proto b/proto/desmos/profiles/v2/models_app_links.proto index 972946bd71..813d0de3ad 100644 --- a/proto/desmos/profiles/v2/models_app_links.proto +++ b/proto/desmos/profiles/v2/models_app_links.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package desmos.profiles.v2; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/desmos/profiles/v2/models_chain_links.proto b/proto/desmos/profiles/v2/models_chain_links.proto new file mode 100644 index 0000000000..53760fc6b1 --- /dev/null +++ b/proto/desmos/profiles/v2/models_chain_links.proto @@ -0,0 +1,142 @@ +syntax = "proto3"; +package desmos.profiles.v2; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/tx/signing/v1beta1/signing.proto"; +import "cosmos/crypto/multisig/v1beta1/multisig.proto"; + +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types"; + +// ChainLink contains the data representing either an inter- or cross- chain +// link +message ChainLink { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // User defines the destination profile address to link + string user = 1 [ (gogoproto.moretags) = "yaml:\"user\"" ]; + + // Address contains the data of the external chain address to be connected + // with the Desmos profile + google.protobuf.Any address = 2 [ + (gogoproto.moretags) = "yaml:\"address\"", + (cosmos_proto.accepts_interface) = "AddressData" + ]; + + // Proof contains the ownership proof of the external chain address + Proof proof = 3 + [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"proof\"" ]; + + // ChainConfig contains the configuration of the external chain + ChainConfig chain_config = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"chain_config\"" + ]; + + // CreationTime represents the time in which the link has been created + google.protobuf.Timestamp creation_time = 5 [ + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"creation_time\"", + (gogoproto.nullable) = false + ]; +} + +// ChainConfig contains the data of the chain with which the link is made. +message ChainConfig { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + string name = 1 [ (gogoproto.moretags) = "yaml:\"name\"" ]; +} + +// Proof contains all the data used to verify a signature when linking an +// account to a profile +message Proof { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // PubKey represents the public key associated with the address for which to + // prove the ownership + google.protobuf.Any pub_key = 1 [ (gogoproto.moretags) = "yaml:\"pub_key\"" ]; + + // Signature represents the hex-encoded signature of the PlainText value + google.protobuf.Any signature = 2 + [ (gogoproto.moretags) = "yaml:\"signature\"" ]; + + // PlainText represents the hex-encoded value signed in order to produce the + // Signature + string plain_text = 3 [ (gogoproto.moretags) = "yaml:\"plain_text\"" ]; +} + +// Bech32Address represents a Bech32-encoded address +message Bech32Address { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "AddressData"; + + // Value represents the Bech-32 encoded address value + string value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; + + // Prefix represents the HRP of the Bech32 address + string prefix = 2 [ (gogoproto.moretags) = "yaml:\"prefix\"" ]; +} + +// Base58Address represents a Base58-encoded address +message Base58Address { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "AddressData"; + + // Value contains the Base58-encoded address + string value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; +} + +// HexAddress represents an Hex-encoded address +// NOTE: Currently it only supports keccak256-uncompressed addresses +message HexAddress { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "AddressData"; + + // Value represents the hex address value + string value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; + + // Prefix represents the optional prefix used during address encoding (e.g. + // 0x) + string prefix = 2 [ (gogoproto.moretags) = "yaml:\"prefix\"" ]; +} + +// SingleSignatureData is the signature data for a single signer +message SingleSignatureData { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (cosmos_proto.implements_interface) = "SignatureData"; + + // Mode is the signing mode of the single signer + cosmos.tx.signing.v1beta1.SignMode mode = 1; + + // Signature is the raw signature bytes + bytes signature = 2; +} + +// MultiSignatureData is the signature data for a multisig public key +message MultiSignatureData { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (cosmos_proto.implements_interface) = "SignatureData"; + + // Bitarray specifies which keys within the multisig are signing + cosmos.crypto.multisig.v1beta1.CompactBitArray bit_array = 1; + + // Signatures is the signatures of the multi-signature + repeated google.protobuf.Any signatures = 2; +} \ No newline at end of file diff --git a/proto/desmos/profiles/v2/models_dtag_requests.proto b/proto/desmos/profiles/v2/models_dtag_requests.proto new file mode 100644 index 0000000000..5f6577d389 --- /dev/null +++ b/proto/desmos/profiles/v2/models_dtag_requests.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package desmos.profiles.v2; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types"; + +// DTagTransferRequest represent a DTag transfer request between two users +message DTagTransferRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // DTagToTrade contains the value of the DTag that should be transferred from + // the receiver of the request to the sender + string dtag_to_trade = 1 [ + (gogoproto.moretags) = "yaml:\"dtag_to_trade\"", + (gogoproto.customname) = "DTagToTrade" + ]; + + // Sender represents the address of the account that sent the request + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + // Receiver represents the receiver of the request that, if accepted, will + // give to the sender their DTag + string receiver = 3 [ (gogoproto.moretags) = "yaml:\"receiver\"" ]; +} \ No newline at end of file diff --git a/proto/desmos/profiles/v2/models_params.proto b/proto/desmos/profiles/v2/models_params.proto index cbc4c74e2f..b3887751c2 100644 --- a/proto/desmos/profiles/v2/models_params.proto +++ b/proto/desmos/profiles/v2/models_params.proto @@ -4,7 +4,7 @@ package desmos.profiles.v2; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types"; // Params contains the parameters for the profiles module message Params { diff --git a/proto/desmos/profiles/v2/models_profile.proto b/proto/desmos/profiles/v2/models_profile.proto index 8814045e33..1c95d48a5f 100644 --- a/proto/desmos/profiles/v2/models_profile.proto +++ b/proto/desmos/profiles/v2/models_profile.proto @@ -6,7 +6,7 @@ import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types"; // -------------------------------------------------------------------------------------------------------------------- diff --git a/proto/desmos/profiles/v3/models_dtag_requests.proto b/proto/desmos/profiles/v3/models_dtag_requests.proto index f54849a688..ad443954d4 100644 --- a/proto/desmos/profiles/v3/models_dtag_requests.proto +++ b/proto/desmos/profiles/v3/models_dtag_requests.proto @@ -5,7 +5,6 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v3/models_chain_links.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; diff --git a/x/profiles/keeper/migrations.go b/x/profiles/keeper/migrations.go index aca434200b..18a53a6594 100644 --- a/x/profiles/keeper/migrations.go +++ b/x/profiles/keeper/migrations.go @@ -3,27 +3,25 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - "github.com/gogo/protobuf/grpc" v4 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4" v5 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5" + v6 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v6" ) // DONTCOVER // Migrator is a struct for handling in-place store migrations. type Migrator struct { - keeper Keeper - ak authkeeper.AccountKeeper - queryServer grpc.Server + keeper Keeper + ak authkeeper.AccountKeeper } // NewMigrator returns a new Migrator -func NewMigrator(ak authkeeper.AccountKeeper, keeper Keeper, queryServer grpc.Server) Migrator { +func NewMigrator(ak authkeeper.AccountKeeper, keeper Keeper) Migrator { return Migrator{ - keeper: keeper, - ak: ak, - queryServer: queryServer, + keeper: keeper, + ak: ak, } } @@ -32,7 +30,12 @@ func (m Migrator) Migrate4to5(ctx sdk.Context) error { return v4.MigrateStore(ctx, m.ak, m.keeper.storeKey, m.keeper.legacyAmino, m.keeper.cdc) } -// Migrate5To6 migrates from version 5 to 6. -func (m Migrator) Migrate5To6(ctx sdk.Context) error { +// Migrate5to6 migrates from version 5 to 6. +func (m Migrator) Migrate5to6(ctx sdk.Context) error { return v5.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc, m.keeper.legacyAmino) } + +// Migrate6to7 migrates from version 6 to 7. +func (m Migrator) Migrate6to7(ctx sdk.Context) error { + return v6.MigrateStore(ctx, m.keeper.ak, m.keeper.storeKey, m.keeper.legacyAmino, m.keeper.cdc) +} diff --git a/x/profiles/legacy/v4/keeper.go b/x/profiles/legacy/v4/keeper.go index 1e9a733fb4..48a818d4f4 100644 --- a/x/profiles/legacy/v4/keeper.go +++ b/x/profiles/legacy/v4/keeper.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/desmos-labs/desmos/v4/x/profiles/types" + v4types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types" ) type Keeper struct { @@ -23,7 +23,7 @@ func NewKeeper(storeKey sdk.StoreKey, cdc codec.BinaryCodec) Keeper { func (k Keeper) IterateDTags(ctx sdk.Context, fn func(index int64, dTag string, value []byte) (stop bool)) { store := ctx.KVStore(k.storeKey) - dTagsStore := prefix.NewStore(store, DTagPrefix) + dTagsStore := prefix.NewStore(store, v4types.DTagPrefix) iterator := dTagsStore.Iterator(nil, nil) defer iterator.Close() @@ -35,17 +35,17 @@ func (k Keeper) IterateDTags(ctx sdk.Context, fn func(index int64, dTag string, } } -func (k Keeper) IterateDTagTransferRequests(ctx sdk.Context, fn func(index int64, request types.DTagTransferRequest) (stop bool)) { +func (k Keeper) IterateDTagTransferRequests(ctx sdk.Context, fn func(index int64, request v4types.DTagTransferRequest) (stop bool)) { store := ctx.KVStore(k.storeKey) - requestsStore := prefix.NewStore(store, DTagTransferRequestPrefix) + requestsStore := prefix.NewStore(store, v4types.DTagTransferRequestPrefix) iterator := requestsStore.Iterator(nil, nil) defer iterator.Close() var stop = false var index = int64(0) for ; iterator.Valid() && !stop; iterator.Next() { - var request types.DTagTransferRequest + var request v4types.DTagTransferRequest err := k.cdc.Unmarshal(iterator.Value(), &request) if err != nil { panic(err) @@ -55,17 +55,17 @@ func (k Keeper) IterateDTagTransferRequests(ctx sdk.Context, fn func(index int64 } } -func (k Keeper) IterateRelationships(ctx sdk.Context, fn func(index int64, relationship Relationship) (stop bool)) { +func (k Keeper) IterateRelationships(ctx sdk.Context, fn func(index int64, relationship v4types.Relationship) (stop bool)) { store := ctx.KVStore(k.storeKey) - relationshipsStore := prefix.NewStore(store, RelationshipsStorePrefix) + relationshipsStore := prefix.NewStore(store, v4types.RelationshipsStorePrefix) iterator := relationshipsStore.Iterator(nil, nil) defer iterator.Close() var stop = false var index = int64(0) for ; iterator.Valid() && !stop; iterator.Next() { - var relationship Relationship + var relationship v4types.Relationship err := k.cdc.Unmarshal(iterator.Value(), &relationship) if err != nil { panic(err) @@ -75,9 +75,9 @@ func (k Keeper) IterateRelationships(ctx sdk.Context, fn func(index int64, relat } } -func (k Keeper) GetRelationships(ctx sdk.Context) []Relationship { - var values []Relationship - k.IterateRelationships(ctx, func(_ int64, relationship Relationship) (stop bool) { +func (k Keeper) GetRelationships(ctx sdk.Context) []v4types.Relationship { + var values []v4types.Relationship + k.IterateRelationships(ctx, func(_ int64, relationship v4types.Relationship) (stop bool) { values = append(values, relationship) return false }) @@ -86,8 +86,8 @@ func (k Keeper) GetRelationships(ctx sdk.Context) []Relationship { func (k Keeper) DeleteRelationships(ctx sdk.Context) { var keys [][]byte - k.IterateRelationships(ctx, func(_ int64, relationship Relationship) (stop bool) { - keys = append(keys, RelationshipsStoreKey(relationship.Creator, relationship.SubspaceID, relationship.Recipient)) + k.IterateRelationships(ctx, func(_ int64, relationship v4types.Relationship) (stop bool) { + keys = append(keys, v4types.RelationshipsStoreKey(relationship.Creator, relationship.SubspaceID, relationship.Recipient)) return false }) @@ -97,17 +97,17 @@ func (k Keeper) DeleteRelationships(ctx sdk.Context) { } } -func (k Keeper) IterateBlocks(ctx sdk.Context, fn func(index int64, relationship UserBlock) (stop bool)) { +func (k Keeper) IterateBlocks(ctx sdk.Context, fn func(index int64, relationship v4types.UserBlock) (stop bool)) { store := ctx.KVStore(k.storeKey) - userBlocksStore := prefix.NewStore(store, UsersBlocksStorePrefix) + userBlocksStore := prefix.NewStore(store, v4types.UsersBlocksStorePrefix) iterator := userBlocksStore.Iterator(nil, nil) defer iterator.Close() var stop = false var index = int64(0) for ; iterator.Valid() && !stop; iterator.Next() { - var block UserBlock + var block v4types.UserBlock err := k.cdc.Unmarshal(iterator.Value(), &block) if err != nil { panic(err) @@ -117,9 +117,9 @@ func (k Keeper) IterateBlocks(ctx sdk.Context, fn func(index int64, relationship } } -func (k Keeper) GetBlocks(ctx sdk.Context) []UserBlock { - var values []UserBlock - k.IterateBlocks(ctx, func(_ int64, block UserBlock) (stop bool) { +func (k Keeper) GetBlocks(ctx sdk.Context) []v4types.UserBlock { + var values []v4types.UserBlock + k.IterateBlocks(ctx, func(_ int64, block v4types.UserBlock) (stop bool) { values = append(values, block) return false }) @@ -129,8 +129,8 @@ func (k Keeper) GetBlocks(ctx sdk.Context) []UserBlock { func (k Keeper) DeleteBlocks(ctx sdk.Context) { var keys [][]byte - k.IterateBlocks(ctx, func(_ int64, block UserBlock) (stop bool) { - keys = append(keys, UserBlockStoreKey(block.Blocker, block.SubspaceID, block.Blocked)) + k.IterateBlocks(ctx, func(_ int64, block v4types.UserBlock) (stop bool) { + keys = append(keys, v4types.UserBlockStoreKey(block.Blocker, block.SubspaceID, block.Blocked)) return false }) @@ -140,17 +140,17 @@ func (k Keeper) DeleteBlocks(ctx sdk.Context) { } } -func (k Keeper) IterateChainLinks(ctx sdk.Context, fn func(index int64, chainLink ChainLink) (stop bool)) { +func (k Keeper) IterateChainLinks(ctx sdk.Context, fn func(index int64, chainLink v4types.ChainLink) (stop bool)) { store := ctx.KVStore(k.storeKey) - chainLinksStore := prefix.NewStore(store, ChainLinksPrefix) + chainLinksStore := prefix.NewStore(store, v4types.ChainLinksPrefix) iterator := chainLinksStore.Iterator(nil, nil) defer iterator.Close() var stop = false var index = int64(0) for ; iterator.Valid() && !stop; iterator.Next() { - var chainLink ChainLink + var chainLink v4types.ChainLink err := k.cdc.Unmarshal(iterator.Value(), &chainLink) if err != nil { panic(err) @@ -160,17 +160,17 @@ func (k Keeper) IterateChainLinks(ctx sdk.Context, fn func(index int64, chainLin } } -func (k Keeper) IterateApplicationLinks(ctx sdk.Context, fn func(index int64, applicationLink types.ApplicationLink) (stop bool)) { +func (k Keeper) IterateApplicationLinks(ctx sdk.Context, fn func(index int64, applicationLink v4types.ApplicationLink) (stop bool)) { store := ctx.KVStore(k.storeKey) - applicationLinksStore := prefix.NewStore(store, UserApplicationLinkPrefix) + applicationLinksStore := prefix.NewStore(store, v4types.UserApplicationLinkPrefix) iterator := applicationLinksStore.Iterator(nil, nil) defer iterator.Close() var stop = false var index = int64(0) for ; iterator.Valid() && !stop; iterator.Next() { - var applicationLink types.ApplicationLink + var applicationLink v4types.ApplicationLink err := k.cdc.Unmarshal(iterator.Value(), &applicationLink) if err != nil { panic(err) @@ -183,14 +183,14 @@ func (k Keeper) IterateApplicationLinks(ctx sdk.Context, fn func(index int64, ap func (k Keeper) IterateApplicationLinkClientIDKeys(ctx sdk.Context, fn func(index int64, key []byte, value []byte) (stop bool)) { store := ctx.KVStore(k.storeKey) - clientIDsStore := prefix.NewStore(store, ApplicationLinkClientIDPrefix) + clientIDsStore := prefix.NewStore(store, v4types.ApplicationLinkClientIDPrefix) iterator := clientIDsStore.Iterator(nil, nil) defer iterator.Close() var stop = false var index = int64(0) for ; iterator.Valid() && !stop; iterator.Next() { - stop = fn(index, append(ApplicationLinkClientIDPrefix, iterator.Key()...), iterator.Value()) + stop = fn(index, append(v4types.ApplicationLinkClientIDPrefix, iterator.Key()...), iterator.Value()) index++ } } diff --git a/x/profiles/legacy/v4/store.go b/x/profiles/legacy/v4/store.go index 5f27383a4a..882f0fae85 100644 --- a/x/profiles/legacy/v4/store.go +++ b/x/profiles/legacy/v4/store.go @@ -13,6 +13,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + v4types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types" + v5types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" "github.com/desmos-labs/desmos/v4/x/profiles/types" ) @@ -51,9 +53,9 @@ func MigrateStore(ctx sdk.Context, ak authkeeper.AccountKeeper, storeKey sdk.Sto } func migrateProfiles(ctx sdk.Context, ak authkeeper.AccountKeeper) error { - var profiles []*Profile + var profiles []*v4types.Profile ak.IterateAccounts(ctx, func(account authtypes.AccountI) (stop bool) { - if profile, ok := account.(*Profile); ok { + if profile, ok := account.(*v4types.Profile); ok { profiles = append(profiles, profile) } return false @@ -61,11 +63,11 @@ func migrateProfiles(ctx sdk.Context, ak authkeeper.AccountKeeper) error { for _, profile := range profiles { // Convert the profile - v2Profile, err := types.NewProfile( + v5Profile, err := v5types.NewProfile( profile.DTag, profile.Nickname, profile.Bio, - types.NewPictures(profile.Pictures.Profile, profile.Pictures.Cover), + v5types.NewPictures(profile.Pictures.Profile, profile.Pictures.Cover), profile.CreationDate, profile.GetAccount(), ) @@ -74,7 +76,7 @@ func migrateProfiles(ctx sdk.Context, ak authkeeper.AccountKeeper) error { } // Set the account - ak.SetAccount(ctx, v2Profile) + ak.SetAccount(ctx, v5Profile) } return nil @@ -90,7 +92,7 @@ func migrateDTags(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey) { store := ctx.KVStore(storeKey) for dTag, address := range dTags { // Delete the old key - store.Delete(DTagStoreKey(dTag)) + store.Delete(v4types.DTagStoreKey(dTag)) // Store the DTag using the new key store.Set(types.DTagStoreKey(dTag), address) @@ -98,8 +100,8 @@ func migrateDTags(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey) { } func migrateDTagTransferRequests(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, cdc codec.BinaryCodec) { - var requests []types.DTagTransferRequest - k.IterateDTagTransferRequests(ctx, func(index int64, request types.DTagTransferRequest) (stop bool) { + var requests []v4types.DTagTransferRequest + k.IterateDTagTransferRequests(ctx, func(index int64, request v4types.DTagTransferRequest) (stop bool) { requests = append(requests, request) return false }) @@ -107,7 +109,7 @@ func migrateDTagTransferRequests(ctx sdk.Context, k Keeper, storeKey sdk.StoreKe store := ctx.KVStore(storeKey) for i, request := range requests { // Delete the old key - store.Delete(DTagTransferRequestStoreKey(request.Sender, request.Receiver)) + store.Delete(v4types.DTagTransferRequestStoreKey(request.Sender, request.Receiver)) // Store the request using the new key store.Set( @@ -120,8 +122,8 @@ func migrateDTagTransferRequests(ctx sdk.Context, k Keeper, storeKey sdk.StoreKe func migrateApplicationLinks(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, cdc codec.BinaryCodec) { store := ctx.KVStore(storeKey) - var applicationLinks []types.ApplicationLink - k.IterateApplicationLinks(ctx, func(index int64, applicationLink types.ApplicationLink) (stop bool) { + var applicationLinks []v4types.ApplicationLink + k.IterateApplicationLinks(ctx, func(index int64, applicationLink v4types.ApplicationLink) (stop bool) { applicationLinks = append(applicationLinks, applicationLink) return false }) @@ -140,7 +142,7 @@ func migrateApplicationLinks(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, c for i, link := range applicationLinks { // Delete the old keys - store.Delete(UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username)) + store.Delete(v4types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username)) // Store the link with the new key linkKey := types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username) @@ -150,15 +152,15 @@ func migrateApplicationLinks(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, c } func migrateChainLinks(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, amino *codec.LegacyAmino, cdc codec.BinaryCodec) error { - var chainLinks []ChainLink - k.IterateChainLinks(ctx, func(index int64, chainLink ChainLink) (stop bool) { + var chainLinks []v4types.ChainLink + k.IterateChainLinks(ctx, func(index int64, chainLink v4types.ChainLink) (stop bool) { chainLinks = append(chainLinks, chainLink) return false }) store := ctx.KVStore(storeKey) for _, link := range chainLinks { - var address AddressData + var address v4types.AddressData err := cdc.UnpackAny(link.Address, &address) if err != nil { return err @@ -167,12 +169,12 @@ func migrateChainLinks(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, amino * // Convert the address data var addressData types.AddressData switch address := address.(type) { - case *Bech32Address: - addressData = types.NewBech32Address(address.Value, address.Prefix) - case *Base58Address: - addressData = types.NewBase58Address(address.Value) - case *HexAddress: - addressData = types.NewHexAddress(address.Value, address.Prefix) + case *v4types.Bech32Address: + addressData = v5types.NewBech32Address(address.Value, address.Prefix) + case *v4types.Base58Address: + addressData = v5types.NewBase58Address(address.Value) + case *v4types.HexAddress: + addressData = v5types.NewHexAddress(address.Value, address.Prefix) default: panic(fmt.Errorf("unsupported AddressData type: %T", link.Address)) } @@ -209,31 +211,28 @@ func migrateChainLinks(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, amino * } // Build the new chain link - v2Link := types.NewChainLink( + v5Link := v5types.NewChainLink( link.User, addressData, - types.NewProof( + v5types.NewProof( pubKey, - &types.SingleSignatureData{ + &v5types.SingleSignatureData{ Signature: signature, Mode: signMode, }, link.Proof.PlainText, ), - types.NewChainConfig( + v5types.NewChainConfig( link.ChainConfig.Name, ), link.CreationTime, ) // Delete the old key - store.Delete(ChainLinksStoreKey(link.User, link.ChainConfig.Name, addressData.GetValue())) + store.Delete(v4types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, addressData.GetValue())) // Store the chain link using the new key - store.Set( - types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, addressData.GetValue()), - types.MustMarshalChainLink(cdc, v2Link), - ) + store.Set(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, addressData.GetValue()), cdc.MustMarshal(&v5Link)) } return nil diff --git a/x/profiles/legacy/v4/store_test.go b/x/profiles/legacy/v4/store_test.go index 41935386fd..09119d51c0 100644 --- a/x/profiles/legacy/v4/store_test.go +++ b/x/profiles/legacy/v4/store_test.go @@ -5,6 +5,10 @@ import ( "testing" "time" + v4 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4" + types2 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types" + v5types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" + "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" @@ -27,8 +31,7 @@ import ( "github.com/stretchr/testify/require" "github.com/desmos-labs/desmos/v4/app" - v4 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4" - "github.com/desmos-labs/desmos/v4/x/relationships/types" + v4types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types" ) func buildContext( @@ -58,7 +61,7 @@ func TestMigrateStore(t *testing.T) { cdc, legacyAmino := app.MakeCodecs() // Build all the necessary keys - keys := sdk.NewKVStoreKeys(authtypes.StoreKey, types.StoreKey) + keys := sdk.NewKVStoreKeys(authtypes.StoreKey, profilestypes.StoreKey) tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) @@ -81,7 +84,7 @@ func TestMigrateStore(t *testing.T) { pubKey := profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d") pubKeyAny := profilestesting.NewAny(pubKey) - addressAny := profilestesting.NewAny(&v4.Bech32Address{ + addressAny := profilestesting.NewAny(&v4types.Bech32Address{ Value: "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", Prefix: "cosmos", }) @@ -95,14 +98,14 @@ func TestMigrateStore(t *testing.T) { { name: "profiles are migrated properly", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Store a profile - profile, err := v4.NewProfile( + profile, err := types2.NewProfile( "john_doe", "John Doe", "My name if John Doe", - v4.Pictures{ + v4types.Pictures{ Profile: "", Cover: "", }, @@ -113,17 +116,17 @@ func TestMigrateStore(t *testing.T) { authKeeper.SetAccount(ctx, profile) // Store a DTag reference - kvStore.Set(v4.DTagStoreKey("john_doe"), []byte("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf")) + kvStore.Set(profilestypes.DTagStoreKey("john_doe"), []byte("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf")) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Check the profile to make sure it contains the same data - v2Profile, err := profilestypes.NewProfile( + v2Profile, err := v5types.NewProfile( "john_doe", "John Doe", "My name if John Doe", - profilestypes.NewPictures("", ""), + v5types.NewPictures("", ""), time.Date(2020, 1, 1, 0, 0, 0, 00, time.UTC), profilestesting.AccountFromAddr("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), ) @@ -133,7 +136,7 @@ func TestMigrateStore(t *testing.T) { require.NoError(t, err) account := authKeeper.GetAccount(ctx, sdkAddr) - profile, ok := account.(*profilestypes.Profile) + profile, ok := account.(*v5types.Profile) require.True(t, ok) require.Equal(t, v2Profile, profile) @@ -145,12 +148,12 @@ func TestMigrateStore(t *testing.T) { { name: "DTag transfer requests are migrated properly", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Store a DTag transfer request kvStore.Set( - v4.DTagTransferRequestStoreKey("cosmos13vsgmgs9tjktnnc6pkln7pm4jswxmeajrqc4xd", "cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), - cdc.MustMarshal(&profilestypes.DTagTransferRequest{ + profilestypes.DTagTransferRequestStoreKey("cosmos13vsgmgs9tjktnnc6pkln7pm4jswxmeajrqc4xd", "cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), + cdc.MustMarshal(&v4types.DTagTransferRequest{ DTagToTrade: "john_doe", Sender: "cosmos13vsgmgs9tjktnnc6pkln7pm4jswxmeajrqc4xd", Receiver: "cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf", @@ -158,16 +161,16 @@ func TestMigrateStore(t *testing.T) { ) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Check the migrated DTag transfer request - var stored profilestypes.DTagTransferRequest + var stored v5types.DTagTransferRequest cdc.MustUnmarshal(kvStore.Get(profilestypes.DTagTransferRequestStoreKey( "cosmos13vsgmgs9tjktnnc6pkln7pm4jswxmeajrqc4xd", "cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf", )), &stored) - require.Equal(t, profilestypes.NewDTagTransferRequest( + require.Equal(t, v5types.NewDTagTransferRequest( "john_doe", "cosmos13vsgmgs9tjktnnc6pkln7pm4jswxmeajrqc4xd", "cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf", @@ -175,35 +178,34 @@ func TestMigrateStore(t *testing.T) { }, }, { - name: "application links are stored properly", + name: "application links are migrated properly", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Store an application link - linkKey := v4.UserApplicationLinkKey("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", "twitter", "twitteruser") + linkKey := profilestypes.UserApplicationLinkKey("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", "twitter", "twitteruser") kvStore.Set( linkKey, - cdc.MustMarshal(&profilestypes.ApplicationLink{ + cdc.MustMarshal(&v5types.ApplicationLink{ User: "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", - Data: profilestypes.NewData("twitter", "twitteruser"), - State: profilestypes.ApplicationLinkStateInitialized, - OracleRequest: profilestypes.NewOracleRequest( + Data: v5types.NewData("twitter", "twitteruser"), + State: v5types.ApplicationLinkStateInitialized, + OracleRequest: v5types.NewOracleRequest( 0, 1, - profilestypes.NewOracleRequestCallData("twitter", "calldata"), + v5types.NewOracleRequestCallData("twitter", "calldata"), "client_id", ), - Result: nil, - CreationTime: time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - ExpirationTime: time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), + Result: nil, + CreationTime: time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), }), ) // Store an application link client id - kvStore.Set(v4.ApplicationLinkClientIDKey("client_id"), linkKey) + kvStore.Set(profilestypes.ApplicationLinkClientIDKey("client_id"), linkKey) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Check the application links linkKey := profilestypes.UserApplicationLinkKey( @@ -212,21 +214,20 @@ func TestMigrateStore(t *testing.T) { "twitteruser", ) - var stored profilestypes.ApplicationLink + var stored v5types.ApplicationLink cdc.MustUnmarshal(kvStore.Get(linkKey), &stored) - require.Equal(t, profilestypes.NewApplicationLink( + require.Equal(t, v5types.NewApplicationLink( "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", - profilestypes.NewData("twitter", "twitteruser"), - profilestypes.ApplicationLinkStateInitialized, - profilestypes.NewOracleRequest( + v5types.NewData("twitter", "twitteruser"), + v5types.ApplicationLinkStateInitialized, + v5types.NewOracleRequest( 0, 1, - profilestypes.NewOracleRequestCallData("twitter", "calldata"), + v5types.NewOracleRequestCallData("twitter", "calldata"), "client_id", ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), stored) // Check the application link client id @@ -236,62 +237,66 @@ func TestMigrateStore(t *testing.T) { { name: "leftover application client id keys are deleted properly", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) - kvStore.Set(v4.ApplicationLinkClientIDKey("client_id"), []byte("client_id_value")) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) + kvStore.Set(v4types.ApplicationLinkClientIDKey("client_id"), []byte("client_id_value")) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) - require.False(t, kvStore.Has(v4.ApplicationLinkClientIDKey("client_id"))) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) + require.False(t, kvStore.Has(v4types.ApplicationLinkClientIDKey("client_id"))) require.False(t, kvStore.Has(profilestypes.ApplicationLinkClientIDKey("client_id"))) }, }, { name: "chain link is migrated properly (text signature)", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Store the chain link kvStore.Set( - v4.ChainLinksStoreKey("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f"), - cdc.MustMarshal(&v4.ChainLink{ + v4types.ChainLinksStoreKey( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", + ), + cdc.MustMarshal(&v4types.ChainLink{ User: "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", Address: addressAny, - Proof: v4.Proof{ + Proof: v4types.Proof{ PubKey: pubKeyAny, Signature: "7369676E6174757265", PlainText: "74657874", }, - ChainConfig: v4.ChainConfig{Name: "cosmos"}, + ChainConfig: v4types.ChainConfig{Name: "cosmos"}, CreationTime: time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), }), ) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) signatureValue, err := hex.DecodeString("7369676E6174757265") require.NoError(t, err) - signature := profilestypes.SingleSignatureData{ + signature := v5types.SingleSignatureData{ Mode: signing.SignMode_SIGN_MODE_TEXTUAL, Signature: signatureValue, } signatureAny := profilestesting.NewAny(&signature) - var stored profilestypes.ChainLink + var stored v5types.ChainLink cdc.MustUnmarshal(kvStore.Get(profilestypes.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", )), &stored) - require.Equal(t, profilestypes.NewChainLink( + require.Equal(t, v5types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", - profilestypes.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), - profilestypes.Proof{ + v5types.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), + v5types.Proof{ PubKey: pubKeyAny, Signature: signatureAny, PlainText: "74657874", }, - profilestypes.ChainConfig{Name: "cosmos"}, + v5types.ChainConfig{Name: "cosmos"}, time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), stored) }, @@ -299,7 +304,7 @@ func TestMigrateStore(t *testing.T) { { name: "chain link is migrated properly (direct sign tx signature)", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Build the signature bz, err := cdc.Marshal(&tx.SignDoc{ @@ -313,22 +318,26 @@ func TestMigrateStore(t *testing.T) { // Store the chain link kvStore.Set( - v4.ChainLinksStoreKey("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f"), - cdc.MustMarshal(&v4.ChainLink{ + v4types.ChainLinksStoreKey( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", + ), + cdc.MustMarshal(&v4types.ChainLink{ User: "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", Address: addressAny, - Proof: v4.Proof{ + Proof: v4types.Proof{ PubKey: pubKeyAny, Signature: "7369676E6174757265", PlainText: plainTextValue, }, - ChainConfig: v4.ChainConfig{Name: "cosmos"}, + ChainConfig: v4types.ChainConfig{Name: "cosmos"}, CreationTime: time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), }), ) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) bz, err := cdc.Marshal(&tx.SignDoc{ BodyBytes: nil, @@ -342,26 +351,26 @@ func TestMigrateStore(t *testing.T) { signatureValue, err := hex.DecodeString("7369676E6174757265") require.NoError(t, err) - signatureAny := profilestesting.NewAny(&profilestypes.SingleSignatureData{ + signatureAny := profilestesting.NewAny(&v5types.SingleSignatureData{ Mode: signing.SignMode_SIGN_MODE_DIRECT, Signature: signatureValue, }) - var stored profilestypes.ChainLink + var stored v5types.ChainLink cdc.MustUnmarshal(kvStore.Get(profilestypes.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", )), &stored) - require.Equal(t, profilestypes.NewChainLink( + require.Equal(t, v5types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", - profilestypes.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), - profilestypes.Proof{ + v5types.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), + v5types.Proof{ PubKey: pubKeyAny, Signature: signatureAny, PlainText: plainTextValue, }, - profilestypes.ChainConfig{Name: "cosmos"}, + v5types.ChainConfig{Name: "cosmos"}, time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), stored) }, @@ -369,7 +378,7 @@ func TestMigrateStore(t *testing.T) { { name: "chain link is migrated properly (amino sign tx signature)", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Build the signature bz, err := legacyAmino.MarshalJSON(&legacytx.StdSignDoc{ @@ -386,22 +395,26 @@ func TestMigrateStore(t *testing.T) { // Store the chain link kvStore.Set( - v4.ChainLinksStoreKey("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f"), - cdc.MustMarshal(&v4.ChainLink{ + v4types.ChainLinksStoreKey( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", + ), + cdc.MustMarshal(&v4types.ChainLink{ User: "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", Address: addressAny, - Proof: v4.Proof{ + Proof: v4types.Proof{ PubKey: pubKeyAny, Signature: "7369676E6174757265", PlainText: plainTextValue, }, - ChainConfig: v4.ChainConfig{Name: "cosmos"}, + ChainConfig: v4types.ChainConfig{Name: "cosmos"}, CreationTime: time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), }), ) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) bz, err := legacyAmino.MarshalJSON(&legacytx.StdSignDoc{ AccountNumber: 1, @@ -418,27 +431,27 @@ func TestMigrateStore(t *testing.T) { signatureValue, err := hex.DecodeString("7369676E6174757265") require.NoError(t, err) - signature := profilestypes.SingleSignatureData{ + signature := v5types.SingleSignatureData{ Mode: signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, Signature: signatureValue, } signatureAny := profilestesting.NewAny(&signature) - var stored profilestypes.ChainLink + var stored v5types.ChainLink cdc.MustUnmarshal(kvStore.Get(profilestypes.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", )), &stored) - require.Equal(t, profilestypes.NewChainLink( + require.Equal(t, v5types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", - profilestypes.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), - profilestypes.Proof{ + v5types.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), + v5types.Proof{ PubKey: pubKeyAny, Signature: signatureAny, PlainText: plainTextValue, }, - profilestypes.ChainConfig{Name: "cosmos"}, + v5types.ChainConfig{Name: "cosmos"}, time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), stored) }, @@ -446,12 +459,12 @@ func TestMigrateStore(t *testing.T) { { name: "user blocks and relationships are deleted properly", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Store a user block kvStore.Set( - v4.UserBlockStoreKey("blocker", "", "blocked"), - cdc.MustMarshal(&v4.UserBlock{ + v4types.UserBlockStoreKey("blocker", "", "blocked"), + cdc.MustMarshal(&v4types.UserBlock{ Blocker: "blocker", Blocked: "blocked", Reason: "reason", @@ -461,16 +474,16 @@ func TestMigrateStore(t *testing.T) { // Store some relationships kvStore.Set( - v4.RelationshipsStoreKey("user", "1", "recipient"), - cdc.MustMarshal(&v4.Relationship{ + v4types.RelationshipsStoreKey("user", "1", "recipient"), + cdc.MustMarshal(&v4types.Relationship{ Creator: "user", Recipient: "recipient", SubspaceID: "1", }), ) kvStore.Set( - v4.RelationshipsStoreKey("user", "2", "recipient"), - cdc.MustMarshal(&v4.Relationship{ + v4types.RelationshipsStoreKey("user", "2", "recipient"), + cdc.MustMarshal(&v4types.Relationship{ Creator: "user", Recipient: "recipient", SubspaceID: "2", @@ -479,14 +492,14 @@ func TestMigrateStore(t *testing.T) { }, shouldErr: false, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Make sure all blocks are deleted - require.False(t, kvStore.Has(v4.UserBlockStoreKey("blocker", "", "blocked"))) + require.False(t, kvStore.Has(v4types.UserBlockStoreKey("blocker", "", "blocked"))) // Make sure all relationships are deleted - require.False(t, kvStore.Has(v4.RelationshipsStoreKey("user", "1", "recipient"))) - require.False(t, kvStore.Has(v4.RelationshipsStoreKey("user", "1", "recipient"))) + require.False(t, kvStore.Has(v4types.RelationshipsStoreKey("user", "1", "recipient"))) + require.False(t, kvStore.Has(v4types.RelationshipsStoreKey("user", "1", "recipient"))) }, }, } @@ -499,7 +512,7 @@ func TestMigrateStore(t *testing.T) { tc.store(ctx) } - err := v4.MigrateStore(ctx, authKeeper, keys[types.StoreKey], legacyAmino, cdc) + err := v4.MigrateStore(ctx, authKeeper, keys[profilestypes.StoreKey], legacyAmino, cdc) if tc.shouldErr { require.Error(t, err) } else { diff --git a/x/profiles/legacy/v4/codec.go b/x/profiles/legacy/v4/types/codec.go similarity index 97% rename from x/profiles/legacy/v4/codec.go rename to x/profiles/legacy/v4/types/codec.go index 5f9b6860e3..9ba48f06f4 100644 --- a/x/profiles/legacy/v4/codec.go +++ b/x/profiles/legacy/v4/types/codec.go @@ -1,4 +1,4 @@ -package v4 +package types // DONTCOVER diff --git a/x/profiles/legacy/v4/keys.go b/x/profiles/legacy/v4/types/keys.go similarity index 99% rename from x/profiles/legacy/v4/keys.go rename to x/profiles/legacy/v4/types/keys.go index fd58504abb..48285ff262 100644 --- a/x/profiles/legacy/v4/keys.go +++ b/x/profiles/legacy/v4/types/keys.go @@ -1,4 +1,4 @@ -package v4 +package types // DONTCOVER diff --git a/x/profiles/legacy/v4/types/models_app_links.go b/x/profiles/legacy/v4/types/models_app_links.go new file mode 100644 index 0000000000..d06a69792b --- /dev/null +++ b/x/profiles/legacy/v4/types/models_app_links.go @@ -0,0 +1,224 @@ +package types + +// DONTCOVER + +import ( + "encoding/hex" + "fmt" + "strings" + "time" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// NewApplicationLink allows to build a new ApplicationLink instance +func NewApplicationLink( + user string, data Data, state ApplicationLinkState, oracleRequest OracleRequest, result *Result, creationTime time.Time, +) ApplicationLink { + return ApplicationLink{ + User: user, + Data: data, + State: state, + OracleRequest: oracleRequest, + Result: result, + CreationTime: creationTime, + } +} + +// Validate returns an error if the instance does not contain valid data +func (l ApplicationLink) Validate() error { + _, err := sdk.AccAddressFromBech32(l.User) + if err != nil { + return fmt.Errorf("invalid user address: %s", err) + } + + err = l.Data.Validate() + if err != nil { + return err + } + + err = l.OracleRequest.Validate() + if err != nil { + return err + } + + if l.Result != nil { + err = l.Result.Validate() + if err != nil { + return err + } + } + + if l.CreationTime.IsZero() { + return fmt.Errorf("invalid creation time: %s", l.CreationTime) + } + + return nil +} + +// IsVerificationOngoing tells whether the verification for the link is still ongoing +func (l *ApplicationLink) IsVerificationOngoing() bool { + return l.State == ApplicationLinkStateInitialized || l.State == AppLinkStateVerificationStarted +} + +// IsVerificationCompleted tells whether the verification for the link has completed or not +func (l *ApplicationLink) IsVerificationCompleted() bool { + return l.State == AppLinkStateVerificationSuccess || + l.State == AppLinkStateVerificationError || + l.State == AppLinkStateVerificationTimedOut +} + +// MustMarshalApplicationLink serializes the given application link using the provided BinaryCodec +func MustMarshalApplicationLink(cdc codec.BinaryCodec, link ApplicationLink) []byte { + return cdc.MustMarshal(&link) +} + +// MustUnmarshalApplicationLink deserializes the given byte array as an application link using +// the provided BinaryCodec +func MustUnmarshalApplicationLink(cdc codec.BinaryCodec, bz []byte) ApplicationLink { + var link ApplicationLink + cdc.MustUnmarshal(bz, &link) + return link +} + +// -------------------------------------------------------------------------------------------------------------------- + +// NewData allows to build a new Data instance +func NewData(application, username string) Data { + return Data{ + Application: application, + Username: username, + } +} + +// Validate returns an error if the instance does not contain valid data +func (d Data) Validate() error { + if len(strings.TrimSpace(d.Application)) == 0 { + return fmt.Errorf("application name cannot be empty or blank") + } + + if len(strings.TrimSpace(d.Username)) == 0 { + return fmt.Errorf("application username cannot be empty or blank") + } + + return nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// NewOracleRequest allows to build a new OracleRequest instance +func NewOracleRequest(id uint64, scriptID uint64, callData OracleRequest_CallData, clientID string) OracleRequest { + return OracleRequest{ + ID: id, + OracleScriptID: scriptID, + CallData: callData, + ClientID: clientID, + } +} + +// Validate returns an error if the instance does not contain valid data +func (o OracleRequest) Validate() error { + if o.OracleScriptID <= 0 { + return fmt.Errorf("invalid oracle script id: %d", o.OracleScriptID) + } + + err := o.CallData.Validate() + if err != nil { + return err + } + + if len(strings.TrimSpace(o.ClientID)) == 0 { + return fmt.Errorf("client id cannot be empty or blank") + } + + return nil +} + +// NewOracleRequestCallData allows to build a new OracleRequest_CallData instance +func NewOracleRequestCallData(application, callData string) OracleRequest_CallData { + return OracleRequest_CallData{ + Application: application, + CallData: callData, + } +} + +// Validate returns an error if the instance does not contain valid data +func (c OracleRequest_CallData) Validate() error { + if len(strings.TrimSpace(c.Application)) == 0 { + return fmt.Errorf("application cannot be empty or blank") + } + + if len(strings.TrimSpace(c.CallData)) == 0 { + return fmt.Errorf("call data cannot be empty or blank") + } + + if _, err := hex.DecodeString(c.CallData); err != nil { + return fmt.Errorf("invalid call data encoding: must be hex") + } + + return nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// Validate returns an error if the instance does not contain valid data +func (r *Result) Validate() error { + var err error + switch result := (r.Sum).(type) { + case *Result_Success_: + err = result.Validate() + case *Result_Failed_: + err = result.Validate() + } + return err +} + +// NewErrorResult allows to build a new Result instance representing an error +func NewErrorResult(error string) *Result { + return &Result{ + Sum: &Result_Failed_{ + Failed: &Result_Failed{ + Error: error, + }, + }, + } +} + +// Validate returns an error if the instance does not contain valid data +func (r Result_Failed_) Validate() error { + if len(strings.TrimSpace(r.Failed.Error)) == 0 { + return fmt.Errorf("error message cannot be empty or blank") + } + + return nil +} + +// NewSuccessResult allows to build a new Result instance representing a success +func NewSuccessResult(value, signature string) *Result { + return &Result{ + Sum: &Result_Success_{ + Success: &Result_Success{ + Value: value, + Signature: signature, + }, + }, + } +} + +// Validate returns an error if the instance does not contain valid data +func (r Result_Success_) Validate() error { + if len(strings.TrimSpace(r.Success.Value)) == 0 { + return fmt.Errorf("value cannot be empty or blank") + } + + if len(strings.TrimSpace(r.Success.Signature)) == 0 { + return fmt.Errorf("signature cannot be empty or blank") + } + + if _, err := hex.DecodeString(r.Success.Signature); err != nil { + return fmt.Errorf("invalid signature encoding; must be hex") + } + + return nil +} diff --git a/x/profiles/legacy/v4/types/models_app_links.pb.go b/x/profiles/legacy/v4/types/models_app_links.pb.go new file mode 100644 index 0000000000..9930977573 --- /dev/null +++ b/x/profiles/legacy/v4/types/models_app_links.pb.go @@ -0,0 +1,2293 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v1beta1/models_app_links.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// ApplicationLinkState defines if an application link is in the following +// states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT +type ApplicationLinkState int32 + +const ( + // A link has just been initialized + ApplicationLinkStateInitialized ApplicationLinkState = 0 + // A link has just started being verified + AppLinkStateVerificationStarted ApplicationLinkState = 1 + // A link has errored during the verification process + AppLinkStateVerificationError ApplicationLinkState = 2 + // A link has being verified successfully + AppLinkStateVerificationSuccess ApplicationLinkState = 3 + // A link has timed out while waiting for the verification + AppLinkStateVerificationTimedOut ApplicationLinkState = 4 +) + +var ApplicationLinkState_name = map[int32]string{ + 0: "APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED", + 1: "APPLICATION_LINK_STATE_VERIFICATION_STARTED", + 2: "APPLICATION_LINK_STATE_VERIFICATION_ERROR", + 3: "APPLICATION_LINK_STATE_VERIFICATION_SUCCESS", + 4: "APPLICATION_LINK_STATE_TIMED_OUT", +} + +var ApplicationLinkState_value = map[string]int32{ + "APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED": 0, + "APPLICATION_LINK_STATE_VERIFICATION_STARTED": 1, + "APPLICATION_LINK_STATE_VERIFICATION_ERROR": 2, + "APPLICATION_LINK_STATE_VERIFICATION_SUCCESS": 3, + "APPLICATION_LINK_STATE_TIMED_OUT": 4, +} + +func (x ApplicationLinkState) String() string { + return proto.EnumName(ApplicationLinkState_name, int32(x)) +} + +func (ApplicationLinkState) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{0} +} + +// ApplicationLink contains the data of a link to a centralized application +type ApplicationLink struct { + // User to which the link is associated + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty" yaml:"user"` + // Data contains the details of this specific link + Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data" yaml:"data"` + // State of the link + State ApplicationLinkState `protobuf:"varint,3,opt,name=state,proto3,enum=desmos.profiles.v1beta1.ApplicationLinkState" json:"state,omitempty" yaml:"state"` + // OracleRequest represents the request that has been made to the oracle + OracleRequest OracleRequest `protobuf:"bytes,4,opt,name=oracle_request,json=oracleRequest,proto3" json:"oracle_request" yaml:"oracle_request"` + // Data coming from the result of the verification. + // Only available when the state is STATE_SUCCESS + Result *Result `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty" yaml:"result"` + // CreationTime represents the time in which the link was created + CreationTime time.Time `protobuf:"bytes,6,opt,name=creation_time,json=creationTime,proto3,stdtime" json:"creation_time" yaml:"creation_time"` +} + +func (m *ApplicationLink) Reset() { *m = ApplicationLink{} } +func (m *ApplicationLink) String() string { return proto.CompactTextString(m) } +func (*ApplicationLink) ProtoMessage() {} +func (*ApplicationLink) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{0} +} +func (m *ApplicationLink) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ApplicationLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ApplicationLink.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ApplicationLink) XXX_Merge(src proto.Message) { + xxx_messageInfo_ApplicationLink.Merge(m, src) +} +func (m *ApplicationLink) XXX_Size() int { + return m.Size() +} +func (m *ApplicationLink) XXX_DiscardUnknown() { + xxx_messageInfo_ApplicationLink.DiscardUnknown(m) +} + +var xxx_messageInfo_ApplicationLink proto.InternalMessageInfo + +// Data contains the data associated to a specific user of a +// generic centralized application +type Data struct { + // The application name (eg. Twitter, GitHub, etc) + Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty" yaml:"application"` + // Username on the application (eg. Twitter tag, GitHub profile, etc) + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty" yaml:"username"` +} + +func (m *Data) Reset() { *m = Data{} } +func (m *Data) String() string { return proto.CompactTextString(m) } +func (*Data) ProtoMessage() {} +func (*Data) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{1} +} +func (m *Data) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Data.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Data) XXX_Merge(src proto.Message) { + xxx_messageInfo_Data.Merge(m, src) +} +func (m *Data) XXX_Size() int { + return m.Size() +} +func (m *Data) XXX_DiscardUnknown() { + xxx_messageInfo_Data.DiscardUnknown(m) +} + +var xxx_messageInfo_Data proto.InternalMessageInfo + +// OracleRequest represents a generic oracle request used to +// verify the ownership of a centralized application account +type OracleRequest struct { + // ID is the ID of the request + ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` + // OracleScriptID is ID of an oracle script + OracleScriptID uint64 `protobuf:"varint,2,opt,name=oracle_script_id,json=oracleScriptId,proto3" json:"oracle_script_id,omitempty" yaml:"oracle_script_id"` + // CallData contains the data used to perform the oracle request + CallData OracleRequest_CallData `protobuf:"bytes,3,opt,name=call_data,json=callData,proto3" json:"call_data" yaml:"call_data"` + // ClientID represents the ID of the client that has called the oracle script + ClientID string `protobuf:"bytes,4,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` +} + +func (m *OracleRequest) Reset() { *m = OracleRequest{} } +func (m *OracleRequest) String() string { return proto.CompactTextString(m) } +func (*OracleRequest) ProtoMessage() {} +func (*OracleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{2} +} +func (m *OracleRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleRequest.Merge(m, src) +} +func (m *OracleRequest) XXX_Size() int { + return m.Size() +} +func (m *OracleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_OracleRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleRequest proto.InternalMessageInfo + +// CallData contains the data sent to a single oracle request in order to +// verify the ownership of a centralized application by a Desmos profile +type OracleRequest_CallData struct { + // The application for which the ownership should be verified + Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty" yaml:"application"` + // The hex encoded call data that should be used to verify the application + // account ownership + CallData string `protobuf:"bytes,2,opt,name=call_data,json=callData,proto3" json:"call_data,omitempty" yaml:"call_data"` +} + +func (m *OracleRequest_CallData) Reset() { *m = OracleRequest_CallData{} } +func (m *OracleRequest_CallData) String() string { return proto.CompactTextString(m) } +func (*OracleRequest_CallData) ProtoMessage() {} +func (*OracleRequest_CallData) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{2, 0} +} +func (m *OracleRequest_CallData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleRequest_CallData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleRequest_CallData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleRequest_CallData) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleRequest_CallData.Merge(m, src) +} +func (m *OracleRequest_CallData) XXX_Size() int { + return m.Size() +} +func (m *OracleRequest_CallData) XXX_DiscardUnknown() { + xxx_messageInfo_OracleRequest_CallData.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleRequest_CallData proto.InternalMessageInfo + +func (m *OracleRequest_CallData) GetApplication() string { + if m != nil { + return m.Application + } + return "" +} + +func (m *OracleRequest_CallData) GetCallData() string { + if m != nil { + return m.CallData + } + return "" +} + +// Result represents a verification result +type Result struct { + // sum is the oneof that specifies whether this represents a success or + // failure result + // + // Types that are valid to be assigned to Sum: + // *Result_Success_ + // *Result_Failed_ + Sum isResult_Sum `protobuf_oneof:"sum"` +} + +func (m *Result) Reset() { *m = Result{} } +func (m *Result) String() string { return proto.CompactTextString(m) } +func (*Result) ProtoMessage() {} +func (*Result) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{3} +} +func (m *Result) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result.Merge(m, src) +} +func (m *Result) XXX_Size() int { + return m.Size() +} +func (m *Result) XXX_DiscardUnknown() { + xxx_messageInfo_Result.DiscardUnknown(m) +} + +var xxx_messageInfo_Result proto.InternalMessageInfo + +type isResult_Sum interface { + isResult_Sum() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type Result_Success_ struct { + Success *Result_Success `protobuf:"bytes,1,opt,name=success,proto3,oneof" json:"success,omitempty"` +} +type Result_Failed_ struct { + Failed *Result_Failed `protobuf:"bytes,2,opt,name=failed,proto3,oneof" json:"failed,omitempty"` +} + +func (*Result_Success_) isResult_Sum() {} +func (*Result_Failed_) isResult_Sum() {} + +func (m *Result) GetSum() isResult_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *Result) GetSuccess() *Result_Success { + if x, ok := m.GetSum().(*Result_Success_); ok { + return x.Success + } + return nil +} + +func (m *Result) GetFailed() *Result_Failed { + if x, ok := m.GetSum().(*Result_Failed_); ok { + return x.Failed + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Result) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Result_Success_)(nil), + (*Result_Failed_)(nil), + } +} + +// Success is the result of an application link that has been successfully +// verified +type Result_Success struct { + // Hex-encoded value that has be signed by the profile + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" yaml:"value"` + // Hex-encoded signature that has been produced by signing the value + Signature string `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" yaml:"signature"` +} + +func (m *Result_Success) Reset() { *m = Result_Success{} } +func (m *Result_Success) String() string { return proto.CompactTextString(m) } +func (*Result_Success) ProtoMessage() {} +func (*Result_Success) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{3, 0} +} +func (m *Result_Success) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result_Success) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result_Success.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result_Success) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result_Success.Merge(m, src) +} +func (m *Result_Success) XXX_Size() int { + return m.Size() +} +func (m *Result_Success) XXX_DiscardUnknown() { + xxx_messageInfo_Result_Success.DiscardUnknown(m) +} + +var xxx_messageInfo_Result_Success proto.InternalMessageInfo + +// Failed is the result of an application link that has not been verified +// successfully +type Result_Failed struct { + // Error that is associated with the failure + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty" yaml:"error"` +} + +func (m *Result_Failed) Reset() { *m = Result_Failed{} } +func (m *Result_Failed) String() string { return proto.CompactTextString(m) } +func (*Result_Failed) ProtoMessage() {} +func (*Result_Failed) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{3, 1} +} +func (m *Result_Failed) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result_Failed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result_Failed.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result_Failed) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result_Failed.Merge(m, src) +} +func (m *Result_Failed) XXX_Size() int { + return m.Size() +} +func (m *Result_Failed) XXX_DiscardUnknown() { + xxx_messageInfo_Result_Failed.DiscardUnknown(m) +} + +var xxx_messageInfo_Result_Failed proto.InternalMessageInfo + +func init() { + proto.RegisterEnum("desmos.profiles.v1beta1.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) + proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.v1beta1.ApplicationLink") + proto.RegisterType((*Data)(nil), "desmos.profiles.v1beta1.Data") + proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.v1beta1.OracleRequest") + proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.v1beta1.OracleRequest.CallData") + proto.RegisterType((*Result)(nil), "desmos.profiles.v1beta1.Result") + proto.RegisterType((*Result_Success)(nil), "desmos.profiles.v1beta1.Result.Success") + proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.v1beta1.Result.Failed") +} + +func init() { + proto.RegisterFile("desmos/profiles/v1beta1/models_app_links.proto", fileDescriptor_33caa1214beac081) +} + +var fileDescriptor_33caa1214beac081 = []byte{ + // 974 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0xc7, 0xe3, 0xc4, 0xcd, 0x36, 0xd3, 0x6d, 0x1b, 0xa6, 0x85, 0x8d, 0x2c, 0x35, 0x36, 0x2e, + 0x2a, 0x05, 0x54, 0x5b, 0x2d, 0x1c, 0x50, 0x11, 0x12, 0x71, 0xe2, 0x6a, 0xbd, 0x94, 0xb6, 0x9a, + 0x38, 0xbb, 0xd2, 0x5e, 0xac, 0x89, 0x3d, 0x09, 0xd6, 0x3a, 0x71, 0xf0, 0x8f, 0x8a, 0x82, 0xb8, + 0xaf, 0x7a, 0xda, 0x7f, 0xa0, 0xd2, 0x4a, 0xfc, 0x1d, 0x88, 0xeb, 0x5e, 0x90, 0xf6, 0xc8, 0xc9, + 0xa0, 0xf4, 0xc2, 0x39, 0x67, 0x0e, 0xc8, 0x33, 0x76, 0x92, 0xb2, 0x1b, 0x5a, 0x89, 0xdb, 0x74, + 0xde, 0xf7, 0x7d, 0xde, 0xf3, 0xfb, 0xbe, 0x8e, 0x02, 0x14, 0x87, 0x84, 0x03, 0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, 0xb6, 0x16, 0x31, 0xf5, 0x74, 0x68, 0x77, 0xee, + 0xb3, 0xd3, 0x6c, 0xea, 0xed, 0x76, 0xb5, 0x74, 0x4b, 0x9f, 0xd9, 0x8a, 0x3c, 0x02, 0xd2, 0x02, + 0xaa, 0x69, 0x7c, 0xa3, 0xb7, 0xac, 0xd3, 0x8e, 0x59, 0xe5, 0x85, 0x0f, 0x2e, 0xaf, 0x24, 0x69, + 0x11, 0x2a, 0x7d, 0x4e, 0x9d, 0xd3, 0x38, 0x12, 0xf8, 0xe7, 0x3f, 0xd7, 0x0b, 0x5a, 0xe7, 0xd5, + 0xb8, 0xce, 0xbd, 0x1e, 0xd7, 0xb9, 0x3f, 0xc7, 0x75, 0xee, 0xc5, 0x75, 0xbd, 0xf0, 0xfa, 0xba, + 0x5e, 0xf8, 0xfd, 0xba, 0x5e, 0x78, 0xfa, 0x45, 0xdf, 0x8d, 0xbe, 0x8d, 0xbb, 0x8a, 0xed, 0x0f, + 0x54, 0xb6, 0xd5, 0x7b, 0x1e, 0xee, 0x86, 0xd9, 0x59, 0x3d, 0xff, 0x4c, 0xfd, 0x7e, 0xf6, 0x1b, + 0xc0, 0x23, 0x7d, 0x6c, 0x5f, 0xa4, 0x97, 0xd1, 0xc5, 0x88, 0x84, 0xdd, 0x32, 0x7d, 0xf3, 0x3f, + 0xfd, 0x27, 0x00, 0x00, 0xff, 0xff, 0x33, 0xe4, 0x13, 0xaf, 0x2d, 0x08, 0x00, 0x00, +} + +func (this *ApplicationLink) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ApplicationLink) + if !ok { + that2, ok := that.(ApplicationLink) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.User != that1.User { + return false + } + if !this.Data.Equal(&that1.Data) { + return false + } + if this.State != that1.State { + return false + } + if !this.OracleRequest.Equal(&that1.OracleRequest) { + return false + } + if !this.Result.Equal(that1.Result) { + return false + } + if !this.CreationTime.Equal(that1.CreationTime) { + return false + } + return true +} +func (this *Data) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Data) + if !ok { + that2, ok := that.(Data) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Application != that1.Application { + return false + } + if this.Username != that1.Username { + return false + } + return true +} +func (this *OracleRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*OracleRequest) + if !ok { + that2, ok := that.(OracleRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ID != that1.ID { + return false + } + if this.OracleScriptID != that1.OracleScriptID { + return false + } + if !this.CallData.Equal(&that1.CallData) { + return false + } + if this.ClientID != that1.ClientID { + return false + } + return true +} +func (this *OracleRequest_CallData) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*OracleRequest_CallData) + if !ok { + that2, ok := that.(OracleRequest_CallData) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Application != that1.Application { + return false + } + if this.CallData != that1.CallData { + return false + } + return true +} +func (this *Result) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result) + if !ok { + that2, ok := that.(Result) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if that1.Sum == nil { + if this.Sum != nil { + return false + } + } else if this.Sum == nil { + return false + } else if !this.Sum.Equal(that1.Sum) { + return false + } + return true +} +func (this *Result_Success_) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Success_) + if !ok { + that2, ok := that.(Result_Success_) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Success.Equal(that1.Success) { + return false + } + return true +} +func (this *Result_Failed_) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Failed_) + if !ok { + that2, ok := that.(Result_Failed_) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Failed.Equal(that1.Failed) { + return false + } + return true +} +func (this *Result_Success) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Success) + if !ok { + that2, ok := that.(Result_Success) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Value != that1.Value { + return false + } + if this.Signature != that1.Signature { + return false + } + return true +} +func (this *Result_Failed) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Failed) + if !ok { + that2, ok := that.(Result_Failed) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Error != that1.Error { + return false + } + return true +} +func (m *ApplicationLink) 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 *ApplicationLink) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ApplicationLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintModelsAppLinks(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x32 + if m.Result != nil { + { + size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + { + size, err := m.OracleRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.State != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Data) 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 *Data) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x12 + } + if len(m.Application) > 0 { + i -= len(m.Application) + copy(dAtA[i:], m.Application) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Application))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OracleRequest) 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 *OracleRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ClientID) > 0 { + i -= len(m.ClientID) + copy(dAtA[i:], m.ClientID) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.ClientID))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.CallData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.OracleScriptID != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.OracleScriptID)) + i-- + dAtA[i] = 0x10 + } + if m.ID != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *OracleRequest_CallData) 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 *OracleRequest_CallData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleRequest_CallData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CallData) > 0 { + i -= len(m.CallData) + copy(dAtA[i:], m.CallData) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.CallData))) + i-- + dAtA[i] = 0x12 + } + if len(m.Application) > 0 { + i -= len(m.Application) + copy(dAtA[i:], m.Application) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Application))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Result) 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 *Result) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Result_Success_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Success_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Success != nil { + { + size, err := m.Success.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Result_Failed_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Failed_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Failed != nil { + { + size, err := m.Failed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Result_Success) 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 *Result_Success) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Success) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x12 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Result_Failed) 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 *Result_Failed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Failed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsAppLinks(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsAppLinks(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ApplicationLink) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.User) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = m.Data.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + if m.State != 0 { + n += 1 + sovModelsAppLinks(uint64(m.State)) + } + l = m.OracleRequest.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + if m.Result != nil { + l = m.Result.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime) + n += 1 + l + sovModelsAppLinks(uint64(l)) + return n +} + +func (m *Data) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Application) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.Username) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *OracleRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ID != 0 { + n += 1 + sovModelsAppLinks(uint64(m.ID)) + } + if m.OracleScriptID != 0 { + n += 1 + sovModelsAppLinks(uint64(m.OracleScriptID)) + } + l = m.CallData.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + l = len(m.ClientID) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *OracleRequest_CallData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Application) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.CallData) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *Result) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *Result_Success_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success != nil { + l = m.Success.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} +func (m *Result_Failed_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Failed != nil { + l = m.Failed.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} +func (m *Result_Success) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *Result_Failed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Error) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func sovModelsAppLinks(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsAppLinks(x uint64) (n int) { + return sovModelsAppLinks(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ApplicationLink) 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 ErrIntOverflowModelsAppLinks + } + 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: ApplicationLink: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ApplicationLink: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.User = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= ApplicationLinkState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OracleRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Result == nil { + m.Result = &Result{} + } + if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Data) 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 ErrIntOverflowModelsAppLinks + } + 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: Data: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Data: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Application = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleRequest) 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 ErrIntOverflowModelsAppLinks + } + 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: OracleRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OracleRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleScriptID", wireType) + } + m.OracleScriptID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OracleScriptID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CallData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleRequest_CallData) 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 ErrIntOverflowModelsAppLinks + } + 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: CallData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CallData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Application = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallData", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CallData = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result) 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 ErrIntOverflowModelsAppLinks + } + 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: Result: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Result: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Result_Success{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Result_Success_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Result_Failed{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Result_Failed_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result_Success) 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 ErrIntOverflowModelsAppLinks + } + 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: Success: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Success: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result_Failed) 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 ErrIntOverflowModelsAppLinks + } + 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: Failed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Failed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + 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 ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsAppLinks(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, ErrIntOverflowModelsAppLinks + } + 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, ErrIntOverflowModelsAppLinks + } + 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, ErrIntOverflowModelsAppLinks + } + 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, ErrInvalidLengthModelsAppLinks + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsAppLinks + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsAppLinks + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsAppLinks = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsAppLinks = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsAppLinks = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v4/models_chain_links.go b/x/profiles/legacy/v4/types/models_chain_links.go similarity index 99% rename from x/profiles/legacy/v4/models_chain_links.go rename to x/profiles/legacy/v4/types/models_chain_links.go index 55eccfb5dc..6a5b10326f 100644 --- a/x/profiles/legacy/v4/models_chain_links.go +++ b/x/profiles/legacy/v4/types/models_chain_links.go @@ -1,4 +1,4 @@ -package v4 +package types // DONTCOVER diff --git a/x/profiles/legacy/v4/models_chain_links.pb.go b/x/profiles/legacy/v4/types/models_chain_links.pb.go similarity index 91% rename from x/profiles/legacy/v4/models_chain_links.pb.go rename to x/profiles/legacy/v4/types/models_chain_links.pb.go index c318b26944..64cf7b4401 100644 --- a/x/profiles/legacy/v4/models_chain_links.pb.go +++ b/x/profiles/legacy/v4/types/models_chain_links.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: desmos/profiles/v1beta1/models_chain_links.proto -package v4 +package types import ( fmt "fmt" @@ -299,47 +299,47 @@ func init() { } var fileDescriptor_1c1946212735e419 = []byte{ - // 636 bytes of a gzipped FileDescriptorProto + // 640 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0xbd, 0x6e, 0xd3, 0x40, - 0x1c, 0x8f, 0x69, 0xd3, 0x2a, 0x97, 0x04, 0xda, 0x23, 0x88, 0xd0, 0x4a, 0xbe, 0x72, 0x20, 0x54, - 0x86, 0xda, 0xf4, 0x4b, 0x42, 0x9d, 0xa8, 0xcb, 0x80, 0x00, 0x09, 0xb0, 0x3a, 0xb1, 0x44, 0x67, - 0xe7, 0xe2, 0x5a, 0xb5, 0x7d, 0x96, 0xcf, 0x8e, 0x12, 0x09, 0x89, 0x95, 0xb1, 0x23, 0x63, 0x27, - 0x9e, 0x80, 0x27, 0x60, 0xaa, 0x98, 0x2a, 0x26, 0x26, 0x83, 0xda, 0x85, 0x39, 0x4f, 0x80, 0xee, - 0xce, 0x6e, 0x42, 0xab, 0x20, 0x31, 0xb1, 0xdd, 0xfd, 0x7f, 0x1f, 0xf7, 0xff, 0xb2, 0xc1, 0xa3, - 0x2e, 0xe5, 0x21, 0xe3, 0x66, 0x9c,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x1d, + 0x9c, 0x1a, 0xb5, 0xe3, 0x53, 0xa3, 0xf6, 0xfd, 0xd4, 0xa8, 0xbd, 0x7d, 0xec, 0x07, 0x7c, 0x37, + 0x73, 0x4d, 0x8f, 0x46, 0x96, 0xfa, 0x80, 0x56, 0x42, 0xec, 0xb2, 0xf2, 0x6c, 0xed, 0x6f, 0x58, + 0xc3, 0xf1, 0x2f, 0x2f, 0x24, 0x3e, 0xf6, 0x72, 0x11, 0xe4, 0x79, 0x42, 0x98, 0x3b, 0x23, 0xb7, + 0x69, 0xfd, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xae, 0x85, 0x42, 0x4e, 0x1c, 0x05, 0x00, 0x00, } func (this *ChainLink) Equal(that interface{}) bool { diff --git a/x/profiles/legacy/v4/types/models_dtag_requests.pb.go b/x/profiles/legacy/v4/types/models_dtag_requests.pb.go new file mode 100644 index 0000000000..6385f456e3 --- /dev/null +++ b/x/profiles/legacy/v4/types/models_dtag_requests.pb.go @@ -0,0 +1,452 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v1beta1/models_dtag_requests.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/desmos-labs/desmos/v4/x/profiles/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/regen-network/cosmos-proto" + _ "google.golang.org/protobuf/types/known/timestamppb" + 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 + +// DTagTransferRequest represent a DTag transfer request between two users +type DTagTransferRequest struct { + // DTagToTrade contains the value of the DTag that should be transferred from + // the receiver of the request to the sender + DTagToTrade string `protobuf:"bytes,1,opt,name=dtag_to_trade,json=dtagToTrade,proto3" json:"dtag_to_trade,omitempty" yaml:"dtag_to_trade"` + // Sender represents the address of the account that sent the request + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` + // Receiver represents the receiver of the request that, if accepted, will + // give to the sender their DTag + Receiver string `protobuf:"bytes,3,opt,name=receiver,proto3" json:"receiver,omitempty" yaml:"receiver"` +} + +func (m *DTagTransferRequest) Reset() { *m = DTagTransferRequest{} } +func (m *DTagTransferRequest) String() string { return proto.CompactTextString(m) } +func (*DTagTransferRequest) ProtoMessage() {} +func (*DTagTransferRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_08f2e5360e821c5e, []int{0} +} +func (m *DTagTransferRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DTagTransferRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DTagTransferRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DTagTransferRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DTagTransferRequest.Merge(m, src) +} +func (m *DTagTransferRequest) XXX_Size() int { + return m.Size() +} +func (m *DTagTransferRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DTagTransferRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DTagTransferRequest proto.InternalMessageInfo + +func init() { + proto.RegisterType((*DTagTransferRequest)(nil), "desmos.profiles.v1beta1.DTagTransferRequest") +} + +func init() { + proto.RegisterFile("desmos/profiles/v1beta1/models_dtag_requests.proto", fileDescriptor_08f2e5360e821c5e) +} + +var fileDescriptor_08f2e5360e821c5e = []byte{ + // 371 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xb1, 0x6e, 0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 0x93, 0x2b, 0x10, 0x9e, 0xbe, 0xc8, 0xfa, 0x6b, 0x0e, 0x9a, 0x0b, + 0x15, 0xf7, 0x95, 0xa0, 0x11, 0x8c, 0xd1, 0x67, 0xf4, 0xf5, 0xed, 0xe2, 0x4b, 0x55, 0xe2, 0x7e, + 0xc3, 0xf3, 0x65, 0xdd, 0x3e, 0x96, 0x78, 0x54, 0xd0, 0x34, 0x99, 0x3b, 0x4f, 0x68, 0xc7, 0xeb, + 0xd7, 0x75, 0x0b, 0x59, 0xdf, 0xcc, 0x9e, 0x84, 0x2c, 0x02, 0x31, 0x7e, 0xd5, 0x4c, 0xf9, 0x70, + 0x2c, 0xf1, 0x40, 0xdb, 0x74, 0xdf, 0xf1, 0x5a, 0xc0, 0x22, 0xe6, 0x1b, 0x01, 0x21, 0xc4, 0x5b, + 0x10, 0xe3, 0xd7, 0x0d, 0x3c, 0x3c, 0x96, 0xf8, 0xbd, 0x86, 0x3b, 0xc5, 0xf1, 0x1e, 0xa0, 0xf9, + 0xbb, 0xf3, 0x1d, 0x36, 0x2e, 0x77, 0x18, 0xdd, 0xed, 0x30, 0x5a, 0xfc, 0xbb, 0xaa, 0x6c, 0xb4, + 0xaf, 0x6c, 0x74, 0x5b, 0xd9, 0xe8, 0xe2, 0x60, 0x1b, 0xfb, 0x83, 0x6d, 0xdc, 0x1c, 0x6c, 0xe3, + 0xff, 0x6f, 0x16, 0xab, 0xf5, 0x26, 0x70, 0x43, 0x9e, 0x12, 0x1d, 0xd0, 0x8f, 0x84, 0x06, 0xb2, + 0x7d, 0x93, 0xed, 0x2f, 0x72, 0xf6, 0x98, 0x58, 0x02, 0x8c, 0x86, 0x45, 0xdd, 0x54, 0x45, 0x0e, + 0x32, 0xe8, 0x35, 0x61, 0xcd, 0xee, 0x03, 0x00, 0x00, 0xff, 0xff, 0x40, 0x7c, 0xc1, 0x7c, 0x15, + 0x02, 0x00, 0x00, +} + +func (this *DTagTransferRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DTagTransferRequest) + if !ok { + that2, ok := that.(DTagTransferRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.DTagToTrade != that1.DTagToTrade { + return false + } + if this.Sender != that1.Sender { + return false + } + if this.Receiver != that1.Receiver { + return false + } + return true +} +func (m *DTagTransferRequest) 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 *DTagTransferRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DTagTransferRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintModelsDtagRequests(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x1a + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintModelsDtagRequests(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x12 + } + if len(m.DTagToTrade) > 0 { + i -= len(m.DTagToTrade) + copy(dAtA[i:], m.DTagToTrade) + i = encodeVarintModelsDtagRequests(dAtA, i, uint64(len(m.DTagToTrade))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsDtagRequests(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsDtagRequests(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *DTagTransferRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DTagToTrade) + if l > 0 { + n += 1 + l + sovModelsDtagRequests(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovModelsDtagRequests(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovModelsDtagRequests(uint64(l)) + } + return n +} + +func sovModelsDtagRequests(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsDtagRequests(x uint64) (n int) { + return sovModelsDtagRequests(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *DTagTransferRequest) 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 ErrIntOverflowModelsDtagRequests + } + 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: DTagTransferRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DTagTransferRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DTagToTrade", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + 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 ErrInvalidLengthModelsDtagRequests + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DTagToTrade = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + 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 ErrInvalidLengthModelsDtagRequests + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + 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 ErrInvalidLengthModelsDtagRequests + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsDtagRequests(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsDtagRequests(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, ErrIntOverflowModelsDtagRequests + } + 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, ErrIntOverflowModelsDtagRequests + } + 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, ErrIntOverflowModelsDtagRequests + } + 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, ErrInvalidLengthModelsDtagRequests + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsDtagRequests + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsDtagRequests + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsDtagRequests = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsDtagRequests = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsDtagRequests = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v4/models_profile.go b/x/profiles/legacy/v4/types/models_profile.go similarity index 99% rename from x/profiles/legacy/v4/models_profile.go rename to x/profiles/legacy/v4/types/models_profile.go index 5c43aa854a..5cccc296d8 100644 --- a/x/profiles/legacy/v4/models_profile.go +++ b/x/profiles/legacy/v4/types/models_profile.go @@ -1,4 +1,4 @@ -package v4 +package types // DONTCOVER diff --git a/x/profiles/legacy/v4/models_profile.pb.go b/x/profiles/legacy/v4/types/models_profile.pb.go similarity index 86% rename from x/profiles/legacy/v4/models_profile.pb.go rename to x/profiles/legacy/v4/types/models_profile.pb.go index 62eea0b9fd..3162b9b8eb 100644 --- a/x/profiles/legacy/v4/models_profile.pb.go +++ b/x/profiles/legacy/v4/types/models_profile.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: desmos/profiles/v1beta1/models_profile.proto -package v4 +package types import ( fmt "fmt" @@ -143,38 +143,38 @@ func init() { } var fileDescriptor_a19232e029005b86 = []byte{ - // 491 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x3f, 0x6f, 0xd3, 0x40, - 0x18, 0xc6, 0x6d, 0x92, 0x36, 0xee, 0x35, 0x14, 0x74, 0x44, 0x8a, 0xc9, 0xe0, 0x0b, 0x37, 0xa0, - 0x4a, 0xb4, 0x3e, 0x15, 0xca, 0x12, 0xb1, 0xd4, 0xea, 0xc2, 0x44, 0x65, 0x55, 0x0c, 0x2c, 0xd1, - 0xd9, 0xb9, 0x1a, 0x83, 0xed, 0x8b, 0xe2, 0x4b, 0x44, 0xbe, 0x01, 0x03, 0x43, 0xc7, 0x8e, 0xf9, - 0x10, 0x7c, 0x88, 0x8a, 0xa9, 0x23, 0x93, 0x41, 0xc9, 0xc2, 0xec, 0x4f, 0x80, 0x7c, 0x7f, 0x5a, - 0x01, 0x62, 0xbb, 0xbb, 0xe7, 0xf7, 0x3e, 0xef, 0xa3, 0xc7, 0x06, 0x07, 0x13, 0x56, 0xe6, 0xbc, - 0x24, 0xd3, 0x19, 0xbf, 0x48, 0x33, 0x56, 0x92, 0xc5, 0x51, 0xc4, 0x04, 0x3d, 0x22, 0x39, 0x9f, - 0xb0, 0xac, 0x1c, 0xeb, 0x77, 0x7f, 0x3a, 0xe3, 0x82, 0xc3, 0xbe, 0xa2, 0x7d, 0x43, 0xfb, 0x9a, - 0x1e, 0xf4, 0x12, 0x9e, 0x70, 0xc9, 0x90, 0xe6, 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 0x05, 0x29, - 0xb8, 0x1f, 0xcf, 0x18, 0x15, 0x29, 0x2f, 0xc6, 0x13, 0x2a, 0x98, 0xbb, 0x2d, 0xcd, 0x07, 0xff, - 0x74, 0x73, 0x6e, 0x5a, 0x0f, 0x86, 0xda, 0xb5, 0xa7, 0x5c, 0xff, 0x18, 0xc7, 0x97, 0x3f, 0x90, - 0x1d, 0x76, 0xcd, 0xdb, 0x29, 0x15, 0x6c, 0xe4, 0x7c, 0x5e, 0x21, 0xeb, 0x6a, 0x85, 0x2c, 0xfc, - 0x01, 0x38, 0x26, 0x1b, 0x3c, 0x00, 0x1d, 0x1d, 0x5c, 0x7e, 0x8e, 0x9d, 0x00, 0xd6, 0x15, 0xda, - 0xd3, 0x41, 0x95, 0x80, 0x43, 0x83, 0xc0, 0xa7, 0x60, 0x2b, 0xe6, 0x0b, 0x36, 0xd3, 0xfd, 0x3f, - 0xac, 0x2b, 0xd4, 0xd5, 0xeb, 0x9b, 0x67, 0x1c, 0x2a, 0x79, 0xe4, 0x5c, 0xad, 0x90, 0xfd, 0x6b, - 0x85, 0xec, 0xe0, 0xcd, 0xf5, 0xda, 0xb3, 0x6f, 0xd6, 0x9e, 0xfd, 0x73, 0xed, 0xd9, 0x97, 0x1b, - 0xcf, 0xba, 0xd9, 0x78, 0xd6, 0xf7, 0x8d, 0x67, 0xbd, 0x7b, 0x99, 0xa4, 0xe2, 0xfd, 0x3c, 0xf2, - 0x63, 0x9e, 0x13, 0x55, 0xe1, 0x61, 0x46, 0xa3, 0x52, 0x9f, 0xc9, 0xe2, 0x98, 0x7c, 0xba, 0xfb, - 0xc9, 0x33, 0x96, 0xd0, 0x78, 0x49, 0x16, 0xc7, 0xd1, 0xb6, 0xac, 0xe2, 0xc5, 0xef, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xb1, 0xdb, 0x82, 0x0c, 0x08, 0x03, 0x00, 0x00, + // 493 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xb1, 0x6e, 0xd3, 0x40, + 0x1c, 0xc6, 0x6d, 0x92, 0x36, 0xee, 0x35, 0x14, 0x74, 0x44, 0x8a, 0xc9, 0xe0, 0x0b, 0x37, 0xa0, + 0x4a, 0xb4, 0x3e, 0x15, 0x98, 0x02, 0x4b, 0xad, 0x2e, 0x6c, 0x95, 0x55, 0x18, 0x58, 0xa2, 0xb3, + 0x73, 0x35, 0x06, 0xdb, 0x17, 0xd9, 0x97, 0x08, 0xbf, 0x01, 0x03, 0x43, 0xc7, 0x8e, 0x79, 0x08, + 0x1e, 0xa2, 0x62, 0xea, 0xc8, 0x64, 0x50, 0xb2, 0x30, 0xfb, 0x09, 0x90, 0x7d, 0x77, 0xad, 0x00, + 0x75, 0xbb, 0xfb, 0x7f, 0xbf, 0xff, 0x77, 0x9f, 0x3e, 0x1b, 0x1c, 0xcc, 0x58, 0x91, 0xf2, 0x82, + 0xcc, 0x73, 0x7e, 0x1e, 0x27, 0xac, 0x20, 0xcb, 0xa3, 0x80, 0x09, 0x7a, 0x44, 0x52, 0x3e, 0x63, + 0x49, 0x31, 0x55, 0x73, 0x77, 0x9e, 0x73, 0xc1, 0xe1, 0x50, 0xd2, 0xae, 0xa6, 0x5d, 0x45, 0x8f, + 0x06, 0x11, 0x8f, 0x78, 0xcb, 0x90, 0xe6, 0x24, 0xf1, 0xd1, 0xe3, 0x88, 0xf3, 0x28, 0x61, 0xa4, + 0xbd, 0x05, 0x8b, 0x73, 0x42, 0xb3, 0x52, 0x49, 0xe8, 0x5f, 0x49, 0xc4, 0x29, 0x2b, 0x04, 0x4d, + 0xe7, 0x7a, 0x37, 0xe4, 0xcd, 0x53, 0x53, 0x69, 0x2a, 0x2f, 0x52, 0xc2, 0x5f, 0x3b, 0xa0, 0x77, + 0x2a, 0x13, 0xc0, 0xd7, 0xa0, 0x47, 0xc3, 0x90, 0x2f, 0x32, 0x61, 0x9b, 0x63, 0x73, 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, 0x00, 0x7a, 0x2a, 0x78, 0xfb, 0x39, 0x76, 0x3c, 0x58, 0x57, 0x68, 0x4f, + 0x05, 0x95, 0x02, 0xf6, 0x35, 0x02, 0x9f, 0x82, 0xad, 0x90, 0x2f, 0x59, 0xae, 0xfa, 0x7f, 0x58, + 0x57, 0xa8, 0xaf, 0x9e, 0x6f, 0xc6, 0xd8, 0x97, 0xf2, 0xc4, 0xba, 0x5c, 0x21, 0xf3, 0xf7, 0x0a, + 0x99, 0xde, 0xdb, 0xab, 0xb5, 0x63, 0x5e, 0xaf, 0x1d, 0xf3, 0xd7, 0xda, 0x31, 0x2f, 0x36, 0x8e, + 0x71, 0xbd, 0x71, 0x8c, 0x1f, 0x1b, 0xc7, 0x78, 0xff, 0x2a, 0x8a, 0xc5, 0x87, 0x45, 0xe0, 0x86, + 0x3c, 0x25, 0xb2, 0xc2, 0xc3, 0x84, 0x06, 0x85, 0x3a, 0x93, 0xe5, 0x4b, 0xf2, 0xf9, 0xf6, 0x27, + 0x4f, 0x58, 0x44, 0xc3, 0xb2, 0x19, 0x8a, 0x72, 0xce, 0x8a, 0x60, 0xbb, 0x2d, 0xe4, 0xc5, 0x9f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x96, 0x94, 0x7e, 0x0e, 0x03, 0x00, 0x00, } func (this *Pictures) Equal(that interface{}) bool { diff --git a/x/profiles/legacy/v4/models_relationships.pb.go b/x/profiles/legacy/v4/types/models_relationships.pb.go similarity index 88% rename from x/profiles/legacy/v4/models_relationships.pb.go rename to x/profiles/legacy/v4/types/models_relationships.pb.go index 03a1a6778e..514af24158 100644 --- a/x/profiles/legacy/v4/models_relationships.pb.go +++ b/x/profiles/legacy/v4/types/models_relationships.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: desmos/profiles/v1beta1/models_relationships.proto -package v4 +package types import ( fmt "fmt" @@ -173,32 +173,33 @@ func init() { } var fileDescriptor_47c7d48489f1a7d0 = []byte{ - // 399 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xbf, 0xae, 0xd3, 0x30, - 0x18, 0xc5, 0x6b, 0x40, 0x17, 0x6a, 0xfe, 0x47, 0x57, 0xa2, 0xdc, 0x21, 0x06, 0x4f, 0x20, 0x41, - 0xac, 0x5b, 0xca, 0xd2, 0x31, 0x62, 0xe9, 0x84, 0x14, 0xc4, 0xc2, 0x52, 0x39, 0x89, 0x9b, 0x5a, - 0x38, 0x71, 0x64, 0xbb, 0x15, 0x7d, 0x0b, 0x46, 0xc6, 0x3e, 0x09, 0x33, 0x63, 0x47, 0xa6, 0xa8, - 0x4a, 0x17, 0xe6, 0x3c, 0x01, 0x4a, 0xec, 0xb4, 0xa8, 0xb0, 0xb1, 0x1d, 0xfb, 0xfc, 0x8e, 0x73, - 0x3e, 0xe5, 0x83, 0xe3, 0x94, 0xe9, 0x5c, 0x6a, 0x52, 0x2a, 0xb9, 0xe0, 0x82, 0x69, 0xb2, 0xbe, - 0x8e, 0x99, 0xa1, 0xd7, 0x24, 0x97, 0x29, 0x13, 0x7a, 0xae, 0x98, 0xa0, 0x86, 0xcb, 0x42, 0x2f, - 0x79, 0xa9, 0x83, 0x52, 0x49, 0x23, 0xbd, 0x27, 0x36, 0x13, 0xf4, 0x99, 0xc0, 0x65, 0xae, 0x2e, - 0x33, 0x99, 0xc9, 0x8e, 0x21, 0xad, 0xb2, 0xf8, 0xd5, 0xd3, 0x4c, 0xca, 0x4c, 0x30, 0xd2, 0x9d, - 0xe2, 0xd5, 0x82, 0xd0, 0x62, 0xe3, 0x2c, 0x74, 0x6e, 0x19, 0x9e, 0x33, 0x6d, 0x68, 0x5e, 0xf6, - 0xd9, 0x44, 0xb6, 0x9f, 0x9a, 0xdb, 0x47, 0xed, 0xc1, 0x5a, 0xf8, 0x3b, 0x80, 0xf7, 0xa2, 0x3f, - 0xda, 0x79, 0x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, 0xe6, 0xc4, 0xae, 0xd3, 0x6b, 0x41, 0x63, 0xed, 0x34, 0x59, - 0x4f, 0xc8, 0x97, 0xd3, 0x4e, 0x0a, 0x96, 0xd1, 0x64, 0x43, 0xd6, 0x93, 0xf8, 0xa2, 0xfb, 0xf7, - 0x6f, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0xc5, 0xed, 0xc5, 0x77, 0xb7, 0x02, 0x00, 0x00, + // 402 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xbf, 0x6f, 0xd4, 0x30, + 0x14, 0xc7, 0xcf, 0x80, 0x0a, 0x67, 0x7e, 0x47, 0x95, 0x38, 0x3a, 0xc4, 0xe0, 0x09, 0x24, 0x88, + 0xd5, 0xc2, 0x54, 0xb6, 0x88, 0xa5, 0x6b, 0x50, 0x17, 0x96, 0x93, 0x93, 0xbc, 0xa6, 0x16, 0x4e, + 0x1c, 0xd9, 0xbe, 0x8a, 0xfc, 0x17, 0x8c, 0x8c, 0xfd, 0x4b, 0x98, 0x19, 0x3b, 0x32, 0x45, 0x55, + 0x6e, 0x61, 0xce, 0x5f, 0x80, 0x12, 0x3b, 0x77, 0xe8, 0x60, 0xeb, 0xf6, 0xfc, 0xbe, 0x9f, 0xef, + 0xf3, 0xf7, 0x49, 0x0f, 0x1f, 0xe5, 0x60, 0x4a, 0x65, 0x58, 0xad, 0xd5, 0x99, 0x90, 0x60, 0xd8, + 0xc5, 0x61, 0x0a, 0x96, 0x1f, 0xb2, 0x52, 0xe5, 0x20, 0xcd, 0x52, 0x83, 0xe4, 0x56, 0xa8, 0xca, + 0x9c, 0x8b, 0xda, 0x44, 0xb5, 0x56, 0x56, 0x05, 0xcf, 0x9c, 0x27, 0x9a, 0x3c, 0x91, 0xf7, 0x1c, + 0xec, 0x17, 0xaa, 0x50, 0x23, 0xc3, 0x86, 0xca, 0xe1, 0x07, 0xcf,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0xc4, 0x03, 0xbb, 0x2b, 0xde, 0xb9, 0xd1, 0x8a, 0xf1, 0xe9, 0xcf, 0x2e, 0x44, 0x57, 0x5d, 0x88, + 0xae, 0xbb, 0x10, 0x7d, 0x5b, 0x87, 0xb3, 0xab, 0x75, 0x38, 0xfb, 0xb5, 0x0e, 0x67, 0x9f, 0x3f, + 0x14, 0xc2, 0x9e, 0xaf, 0xd2, 0x28, 0x53, 0x25, 0x73, 0xe7, 0xf4, 0x56, 0xf2, 0xd4, 0xf8, 0x9a, + 0x5d, 0xbc, 0x67, 0x5f, 0xb7, 0x37, 0x29, 0xa1, 0xe0, 0x59, 0x33, 0x34, 0x6d, 0x53, 0x83, 0x49, + 0xf7, 0xc6, 0x0b, 0x78, 0xf7, 0x27, 0x00, 0x00, 0xff, 0xff, 0xef, 0x73, 0x21, 0x9e, 0xbd, 0x02, + 0x00, 0x00, } func (this *Relationship) Equal(that interface{}) bool { diff --git a/x/profiles/legacy/v5/store.go b/x/profiles/legacy/v5/store.go index eac1d165f0..bd8eba2927 100644 --- a/x/profiles/legacy/v5/store.go +++ b/x/profiles/legacy/v5/store.go @@ -5,6 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" + v5types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" + "github.com/desmos-labs/desmos/v4/x/profiles/types" ) @@ -14,7 +16,6 @@ import ( // - add missing application links owner keys to allow reverse searches // - add missing chain links owner keys to allow reverse searches // - remove all chain links that are not valid anymore due to the new validation rules -// func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, cdc codec.BinaryCodec, legacyAmino *codec.LegacyAmino) error { store := ctx.KVStore(storeKey) @@ -38,9 +39,9 @@ func fixApplicationLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { applicationLinksStore := prefix.NewStore(store, types.ApplicationLinkPrefix) applicationLinksIterator := applicationLinksStore.Iterator(nil, nil) - var applicationLinks []types.ApplicationLink + var applicationLinks []v5types.ApplicationLink for ; applicationLinksIterator.Valid(); applicationLinksIterator.Next() { - var applicationLink types.ApplicationLink + var applicationLink v5types.ApplicationLink err := cdc.Unmarshal(applicationLinksIterator.Value(), &applicationLink) if err != nil { return err @@ -63,10 +64,10 @@ func fixChainLinks(store sdk.KVStore, cdc codec.BinaryCodec, legacyAmino *codec. chainLinkStore := prefix.NewStore(store, types.ChainLinksPrefix) chainLinksIterator := chainLinkStore.Iterator(nil, nil) - var validChainLinks []types.ChainLink - var invalidChainLinks []types.ChainLink + var validChainLinks []v5types.ChainLink + var invalidChainLinks []v5types.ChainLink for ; chainLinksIterator.Valid(); chainLinksIterator.Next() { - var chainLink types.ChainLink + var chainLink v5types.ChainLink err := cdc.Unmarshal(chainLinksIterator.Value(), &chainLink) if err != nil { return err diff --git a/x/profiles/legacy/v5/store_test.go b/x/profiles/legacy/v5/store_test.go index 75c314c6b8..21567c2395 100644 --- a/x/profiles/legacy/v5/store_test.go +++ b/x/profiles/legacy/v5/store_test.go @@ -5,6 +5,8 @@ import ( "testing" "time" + v5types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" + v5 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5" "github.com/cosmos/cosmos-sdk/types/tx/signing" @@ -12,7 +14,7 @@ import ( "github.com/desmos-labs/desmos/v4/testutil/storetesting" "github.com/desmos-labs/desmos/v4/testutil/profilestesting" - profilestypes "github.com/desmos-labs/desmos/v4/x/profiles/types" + "github.com/desmos-labs/desmos/v4/x/profiles/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -21,7 +23,6 @@ import ( "github.com/stretchr/testify/require" "github.com/desmos-labs/desmos/v4/app" - "github.com/desmos-labs/desmos/v4/x/relationships/types" ) func TestMigrateStore(t *testing.T) { @@ -45,17 +46,17 @@ func TestMigrateStore(t *testing.T) { kvStore := ctx.KVStore(keys[types.StoreKey]) // Store an application link - linkKey := profilestypes.UserApplicationLinkKey("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", "twitter", "twitteruser") + linkKey := types.UserApplicationLinkKey("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", "twitter", "twitteruser") kvStore.Set( linkKey, - cdc.MustMarshal(&profilestypes.ApplicationLink{ + cdc.MustMarshal(&v5types.ApplicationLink{ User: "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", - Data: profilestypes.NewData("twitter", "twitteruser"), - State: profilestypes.ApplicationLinkStateInitialized, - OracleRequest: profilestypes.NewOracleRequest( + Data: v5types.NewData("twitter", "twitteruser"), + State: v5types.ApplicationLinkStateInitialized, + OracleRequest: v5types.NewOracleRequest( 0, 1, - profilestypes.NewOracleRequestCallData("twitter", "calldata"), + v5types.NewOracleRequestCallData("twitter", "calldata"), "client_id", ), Result: nil, @@ -64,13 +65,13 @@ func TestMigrateStore(t *testing.T) { ) // Store an application link client id - kvStore.Set(profilestypes.ApplicationLinkClientIDKey("client_id"), linkKey) + kvStore.Set(types.ApplicationLinkClientIDKey("client_id"), linkKey) }, check: func(ctx sdk.Context) { kvStore := ctx.KVStore(keys[types.StoreKey]) // Check the application link owner - key := profilestypes.ApplicationLinkOwnerKey( + key := types.ApplicationLinkOwnerKey( "twitter", "twitteruser", "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", @@ -85,26 +86,26 @@ func TestMigrateStore(t *testing.T) { // Store the chain link signatureValue := []byte("custom value") - signature := profilestypes.SingleSignatureData{ + signature := v5types.SingleSignatureData{ Mode: signing.SignMode_SIGN_MODE_TEXTUAL, Signature: signatureValue, } signatureAny := profilestesting.NewAny(&signature) - chainLink := profilestypes.NewChainLink( + chainLink := v5types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", - profilestypes.NewBech32Address(account.Bech32Address().GetValue(), "cosmos"), - profilestypes.Proof{ + v5types.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), + v5types.Proof{ PubKey: account.PubKeyAny(), Signature: signatureAny, PlainText: hex.EncodeToString(signatureValue), }, - profilestypes.ChainConfig{Name: "cosmos"}, + v5types.ChainConfig{Name: "cosmos"}, time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ) kvStore.Set( - profilestypes.ChainLinksStoreKey( + types.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", @@ -116,15 +117,15 @@ func TestMigrateStore(t *testing.T) { kvStore := ctx.KVStore(keys[types.StoreKey]) // Make sure the chain link is deleted and the owner key is not added - require.False(t, kvStore.Has(profilestypes.ChainLinkOwnerKey( + require.False(t, kvStore.Has(types.ChainLinkOwnerKey( "cosmos", - account.Bech32Address().GetValue(), + "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", ))) - require.False(t, kvStore.Has(profilestypes.ChainLinksStoreKey( + require.False(t, kvStore.Has(types.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", - account.Bech32Address().GetValue(), + "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", ))) }, }, @@ -140,7 +141,7 @@ func TestMigrateStore(t *testing.T) { ) kvStore.Set( - profilestypes.ChainLinksStoreKey( + types.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", @@ -151,9 +152,9 @@ func TestMigrateStore(t *testing.T) { check: func(ctx sdk.Context) { kvStore := ctx.KVStore(keys[types.StoreKey]) - key := profilestypes.ChainLinkOwnerKey( + key := types.ChainLinkOwnerKey( "cosmos", - account.Bech32Address().GetValue(), + "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", ) require.Equal(t, []byte{0x01}, kvStore.Get(key)) diff --git a/x/profiles/legacy/v5/types/codec.go b/x/profiles/legacy/v5/types/codec.go new file mode 100644 index 0000000000..51739f2da7 --- /dev/null +++ b/x/profiles/legacy/v5/types/codec.go @@ -0,0 +1,27 @@ +package types + +// DONTCOVER + +import ( + "github.com/cosmos/cosmos-sdk/codec/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" +) + +func RegisterInterfaces(registry types.InterfaceRegistry) { + registry.RegisterImplementations((*authtypes.AccountI)(nil), &Profile{}) + registry.RegisterImplementations((*exported.VestingAccount)(nil), &Profile{}) + registry.RegisterInterface( + "desmos.profiles.v2.AddressData", + (*AddressData)(nil), + &Bech32Address{}, + &Base58Address{}, + &HexAddress{}, + ) + registry.RegisterInterface( + "desmos.profiles.v2.Signature", + (*SignatureData)(nil), + &SingleSignatureData{}, + &MultiSignatureData{}, + ) +} diff --git a/x/profiles/legacy/v5/types/models_app_links.go b/x/profiles/legacy/v5/types/models_app_links.go new file mode 100644 index 0000000000..d06a69792b --- /dev/null +++ b/x/profiles/legacy/v5/types/models_app_links.go @@ -0,0 +1,224 @@ +package types + +// DONTCOVER + +import ( + "encoding/hex" + "fmt" + "strings" + "time" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// NewApplicationLink allows to build a new ApplicationLink instance +func NewApplicationLink( + user string, data Data, state ApplicationLinkState, oracleRequest OracleRequest, result *Result, creationTime time.Time, +) ApplicationLink { + return ApplicationLink{ + User: user, + Data: data, + State: state, + OracleRequest: oracleRequest, + Result: result, + CreationTime: creationTime, + } +} + +// Validate returns an error if the instance does not contain valid data +func (l ApplicationLink) Validate() error { + _, err := sdk.AccAddressFromBech32(l.User) + if err != nil { + return fmt.Errorf("invalid user address: %s", err) + } + + err = l.Data.Validate() + if err != nil { + return err + } + + err = l.OracleRequest.Validate() + if err != nil { + return err + } + + if l.Result != nil { + err = l.Result.Validate() + if err != nil { + return err + } + } + + if l.CreationTime.IsZero() { + return fmt.Errorf("invalid creation time: %s", l.CreationTime) + } + + return nil +} + +// IsVerificationOngoing tells whether the verification for the link is still ongoing +func (l *ApplicationLink) IsVerificationOngoing() bool { + return l.State == ApplicationLinkStateInitialized || l.State == AppLinkStateVerificationStarted +} + +// IsVerificationCompleted tells whether the verification for the link has completed or not +func (l *ApplicationLink) IsVerificationCompleted() bool { + return l.State == AppLinkStateVerificationSuccess || + l.State == AppLinkStateVerificationError || + l.State == AppLinkStateVerificationTimedOut +} + +// MustMarshalApplicationLink serializes the given application link using the provided BinaryCodec +func MustMarshalApplicationLink(cdc codec.BinaryCodec, link ApplicationLink) []byte { + return cdc.MustMarshal(&link) +} + +// MustUnmarshalApplicationLink deserializes the given byte array as an application link using +// the provided BinaryCodec +func MustUnmarshalApplicationLink(cdc codec.BinaryCodec, bz []byte) ApplicationLink { + var link ApplicationLink + cdc.MustUnmarshal(bz, &link) + return link +} + +// -------------------------------------------------------------------------------------------------------------------- + +// NewData allows to build a new Data instance +func NewData(application, username string) Data { + return Data{ + Application: application, + Username: username, + } +} + +// Validate returns an error if the instance does not contain valid data +func (d Data) Validate() error { + if len(strings.TrimSpace(d.Application)) == 0 { + return fmt.Errorf("application name cannot be empty or blank") + } + + if len(strings.TrimSpace(d.Username)) == 0 { + return fmt.Errorf("application username cannot be empty or blank") + } + + return nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// NewOracleRequest allows to build a new OracleRequest instance +func NewOracleRequest(id uint64, scriptID uint64, callData OracleRequest_CallData, clientID string) OracleRequest { + return OracleRequest{ + ID: id, + OracleScriptID: scriptID, + CallData: callData, + ClientID: clientID, + } +} + +// Validate returns an error if the instance does not contain valid data +func (o OracleRequest) Validate() error { + if o.OracleScriptID <= 0 { + return fmt.Errorf("invalid oracle script id: %d", o.OracleScriptID) + } + + err := o.CallData.Validate() + if err != nil { + return err + } + + if len(strings.TrimSpace(o.ClientID)) == 0 { + return fmt.Errorf("client id cannot be empty or blank") + } + + return nil +} + +// NewOracleRequestCallData allows to build a new OracleRequest_CallData instance +func NewOracleRequestCallData(application, callData string) OracleRequest_CallData { + return OracleRequest_CallData{ + Application: application, + CallData: callData, + } +} + +// Validate returns an error if the instance does not contain valid data +func (c OracleRequest_CallData) Validate() error { + if len(strings.TrimSpace(c.Application)) == 0 { + return fmt.Errorf("application cannot be empty or blank") + } + + if len(strings.TrimSpace(c.CallData)) == 0 { + return fmt.Errorf("call data cannot be empty or blank") + } + + if _, err := hex.DecodeString(c.CallData); err != nil { + return fmt.Errorf("invalid call data encoding: must be hex") + } + + return nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// Validate returns an error if the instance does not contain valid data +func (r *Result) Validate() error { + var err error + switch result := (r.Sum).(type) { + case *Result_Success_: + err = result.Validate() + case *Result_Failed_: + err = result.Validate() + } + return err +} + +// NewErrorResult allows to build a new Result instance representing an error +func NewErrorResult(error string) *Result { + return &Result{ + Sum: &Result_Failed_{ + Failed: &Result_Failed{ + Error: error, + }, + }, + } +} + +// Validate returns an error if the instance does not contain valid data +func (r Result_Failed_) Validate() error { + if len(strings.TrimSpace(r.Failed.Error)) == 0 { + return fmt.Errorf("error message cannot be empty or blank") + } + + return nil +} + +// NewSuccessResult allows to build a new Result instance representing a success +func NewSuccessResult(value, signature string) *Result { + return &Result{ + Sum: &Result_Success_{ + Success: &Result_Success{ + Value: value, + Signature: signature, + }, + }, + } +} + +// Validate returns an error if the instance does not contain valid data +func (r Result_Success_) Validate() error { + if len(strings.TrimSpace(r.Success.Value)) == 0 { + return fmt.Errorf("value cannot be empty or blank") + } + + if len(strings.TrimSpace(r.Success.Signature)) == 0 { + return fmt.Errorf("signature cannot be empty or blank") + } + + if _, err := hex.DecodeString(r.Success.Signature); err != nil { + return fmt.Errorf("invalid signature encoding; must be hex") + } + + return nil +} diff --git a/x/profiles/legacy/v5/models_app_links.pb.go b/x/profiles/legacy/v5/types/models_app_links.pb.go similarity index 90% rename from x/profiles/legacy/v5/models_app_links.pb.go rename to x/profiles/legacy/v5/types/models_app_links.pb.go index 99f677a192..c7a93788b6 100644 --- a/x/profiles/legacy/v5/models_app_links.pb.go +++ b/x/profiles/legacy/v5/types/models_app_links.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: desmos/profiles/v2/models_app_links.proto -package v5 +package types import ( fmt "fmt" @@ -451,68 +451,68 @@ func init() { } var fileDescriptor_c4a613de86d4edc0 = []byte{ - // 965 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6e, 0xdb, 0x46, - 0x17, 0x15, 0x25, 0x5a, 0xb1, 0xc6, 0xb1, 0xad, 0x6f, 0xec, 0xaf, 0x15, 0x08, 0x44, 0xa4, 0xe9, - 0xa2, 0x70, 0x52, 0x84, 0x44, 0xd5, 0x06, 0x28, 0x5c, 0xb4, 0x80, 0x28, 0xd1, 0x08, 0x5b, 0xd7, - 0x12, 0x46, 0x74, 0x02, 0x64, 0x43, 0x8c, 0xc9, 0xb1, 0x4a, 0x84, 0x12, 0x55, 0xfe, 0x08, 0x4d, - 0x8b, 0xee, 0x03, 0xaf, 0xf2, 0x02, 0x06, 0x02, 0xf4, 0x25, 0xba, 0xeb, 0xa2, 0x9b, 0x2c, 0xb3, - 0xec, 0x8a, 0x2d, 0xe4, 0x4d, 0xd6, 0x7a, 0x82, 0x82, 0x33, 0xa4, 0x24, 0xd7, 0x52, 0x12, 0xa0, - 0x3b, 0x6a, 0xee, 0x39, 0xe7, 0x9e, 0xb9, 0xe7, 0x62, 0x04, 0xee, 0x3a, 0x24, 0x1c, 0xf8, 0xa1, - 0x3a, 0x0a, 0xfc, 0x73, 0xd7, 0x23, 0xa1, 0x3a, 0x6e, 0xa8, 0x03, 0xdf, 0x21, 0x5e, 0x68, 0x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3b, 0x99, 0xcf, 0xff, 0x33, 0xdd, 0xeb, 0x32, 0x32, 0xda, 0xf4, - 0x17, 0xd1, 0x50, 0x07, 0xe5, 0x80, 0x84, 0xb1, 0x17, 0xd5, 0xd6, 0x68, 0x03, 0x61, 0x59, 0x03, - 0x44, 0x11, 0xda, 0xff, 0xa6, 0x89, 0xb8, 0xc9, 0x54, 0x19, 0x47, 0x46, 0x19, 0x19, 0x62, 0xb0, - 0x69, 0x07, 0x84, 0xde, 0xce, 0x4a, 0x93, 0xa9, 0x95, 0x33, 0x35, 0x16, 0x9b, 0x92, 0xc7, 0xa6, - 0x98, 0x79, 0x6c, 0x9a, 0x94, 0xf9, 0xdc, 0x65, 0x8a, 0xd7, 0xe8, 0xf2, 0x8b, 0xbf, 0x44, 0x0e, - 0xdd, 0xce, 0xcf, 0x52, 0xd2, 0xe1, 0xfa, 0xf3, 0x97, 0x62, 0xe1, 0xcd, 0x4b, 0x91, 0x93, 0x7f, - 0x06, 0x7c, 0x9a, 0x08, 0xfc, 0x02, 0x6c, 0xe0, 0xf9, 0x54, 0xb3, 0x94, 0x3f, 0x98, 0x26, 0x22, - 0x64, 0x92, 0x0b, 0x45, 0x19, 0x2d, 0x42, 0xa1, 0x0a, 0xd6, 0xd3, 0xec, 0x87, 0x78, 0x40, 0x68, - 0xee, 0x15, 0x6d, 0x67, 0x9a, 0x88, 0xdb, 0xf3, 0xe5, 0x48, 0x2b, 0x32, 0x9a, 0x81, 0x16, 0x9a, - 0xff, 0x56, 0x02, 0x9b, 0xd7, 0x06, 0x0e, 0xf7, 0x41, 0xd1, 0x75, 0x68, 0x77, 0x5e, 0xdb, 0x99, - 0x24, 0x62, 0xd1, 0x68, 0x4f, 0x13, 0xb1, 0xc2, 0xc4, 0x5c, 0x47, 0x46, 0x45, 0xd7, 0x81, 0x8f, - 0x41, 0x35, 0x4b, 0x22, 0xb4, 0x03, 0x77, 0x14, 0x59, 0xae, 0x43, 0x3b, 0xf3, 0xda, 0xfd, 0x49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xa6, 0xf1, 0x9d, 0xde, 0xb6, 0x3a, - 0xa7, 0x66, 0x95, 0x17, 0x3e, 0xba, 0xb8, 0x94, 0xa4, 0x55, 0x52, 0xe9, 0xfb, 0xe9, 0x74, 0xe2, - 0x48, 0xe0, 0x9f, 0xff, 0x5a, 0x2f, 0x68, 0x9d, 0x57, 0x93, 0x3a, 0xf7, 0x7a, 0x52, 0xe7, 0xfe, - 0x9e, 0xd4, 0xb9, 0x17, 0x57, 0xf5, 0xc2, 0xeb, 0xab, 0x7a, 0xe1, 0xcf, 0xab, 0x7a, 0xe1, 0xc9, - 0x83, 0xbe, 0x1b, 0x7d, 0x1f, 0x9f, 0x29, 0xb6, 0x3f, 0x50, 0xd9, 0x42, 0xdf, 0xf7, 0xf0, 0x59, - 0x98, 0x7d, 0xab, 0xe3, 0xcf, 0xd5, 0x1f, 0xe7, 0x7f, 0xeb, 0x1e, 0xe9, 0x63, 0xfb, 0x99, 0x3a, - 0x7e, 0x70, 0x56, 0xa6, 0xcf, 0xfb, 0x67, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xc5, 0xba, 0x70, - 0x52, 0xfa, 0x07, 0x00, 0x00, + // 969 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4d, 0x6f, 0xdb, 0x46, + 0x14, 0x14, 0x25, 0x5a, 0xb1, 0xd6, 0xb1, 0xad, 0xae, 0xdd, 0x56, 0x20, 0x10, 0x91, 0xa6, 0x8b, + 0xc2, 0x49, 0x11, 0x12, 0x55, 0x5b, 0xa0, 0x70, 0xd0, 0x02, 0xa2, 0x44, 0x23, 0x6c, 0x5d, 0x5b, + 0x58, 0xd1, 0x09, 0x90, 0x0b, 0xb1, 0x26, 0xd7, 0x2a, 0x11, 0x4a, 0x54, 0xf9, 0x21, 0xd4, 0x2d, + 0x7a, 0x0f, 0x7c, 0xca, 0x1f, 0x30, 0x10, 0x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, 0xac, 0x84, 0x11, 0x8e, + 0x48, 0xad, 0x24, 0x71, 0x7b, 0x1b, 0x8d, 0xbd, 0x45, 0x1a, 0xff, 0xf3, 0xd6, 0x4d, 0xf1, 0x5a, + 0x75, 0x92, 0x88, 0xb7, 0x99, 0x1e, 0x15, 0x90, 0x11, 0x13, 0x82, 0x3d, 0xb0, 0xe1, 0x07, 0xd8, + 0xf6, 0x88, 0x15, 0x90, 0x9f, 0x62, 0x12, 0x46, 0x35, 0x9e, 0xda, 0xdb, 0x59, 0x24, 0x7d, 0x4c, + 0x91, 0x88, 0x01, 0xb5, 0x3b, 0x99, 0xcf, 0x0f, 0x99, 0xee, 0x75, 0x19, 0x19, 0xad, 0xfb, 0xf3, + 0x68, 0xa8, 0x83, 0x72, 0x40, 0xc2, 0xd8, 0x8b, 0x6a, 0x2b, 0xb4, 0x81, 0xb0, 0xa8, 0x01, 0xa2, + 0x08, 0xed, 0x83, 0x49, 0x22, 0xae, 0x33, 0x55, 0xc6, 0x91, 0x51, 0x46, 0x86, 0x18, 0xac, 0xdb, + 0x01, 0xa1, 0xb7, 0xb3, 0xd2, 0x64, 0x6a, 0xe5, 0x4c, 0x8d, 0xc5, 0xa6, 0xe4, 0xb1, 0x29, 0x66, + 0x1e, 0x9b, 0x26, 0x65, 0x3e, 0xb7, 0x99, 0xe2, 0x35, 0xba, 0xfc, 0xfc, 0x1f, 0x91, 0x43, 0xb7, + 0xf3, 0xb3, 0x94, 0xb4, 0xbf, 0xfa, 0xec, 0x85, 0x58, 0x78, 0xfd, 0x42, 0xe4, 0xe4, 0x5f, 0x01, + 0x9f, 0x26, 0x02, 0xbf, 0x06, 0x6b, 0x78, 0x36, 0xd5, 0x2c, 0xe5, 0x8f, 0x26, 0x89, 0x08, 0x99, + 0xe4, 0x5c, 0x51, 0x46, 0xf3, 0x50, 0xa8, 0x82, 0xd5, 0x34, 0xfb, 0x01, 0xee, 0x13, 0x9a, 0x7b, + 0x45, 0xdb, 0x9a, 0x24, 0x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, 0x2b, 0x5d, 0x86, 0x7c, 0x58, + 0x40, 0x39, 0x09, 0x3e, 0x00, 0xe5, 0x33, 0xec, 0x7a, 0xc4, 0xc9, 0x9e, 0x8d, 0x9d, 0x37, 0xd0, + 0x0f, 0x28, 0xf0, 0x61, 0x01, 0x65, 0x14, 0xc1, 0x07, 0xb7, 0x32, 0x49, 0xf8, 0x29, 0x58, 0x19, + 0x61, 0x2f, 0x26, 0xd9, 0x24, 0xe6, 0xde, 0x03, 0x7a, 0x2c, 0x23, 0x56, 0x86, 0x0d, 0x50, 0x09, + 0xdd, 0xde, 0x00, 0x47, 0x71, 0x40, 0x6e, 0xde, 0x7e, 0x5a, 0x92, 0xd1, 0x0c, 0x36, 0xbb, 0xb8, + 0xb0, 0x0f, 0xca, 0xcc, 0x44, 0xda, 0x8f, 0x04, 0x81, 0x1f, 0xdc, 0xec, 0x47, 0x8f, 0x65, 0xc4, + 0xca, 0x33, 0xee, 0xec, 0x4b, 0x5b, 0x01, 0xa5, 0x30, 0xee, 0xdf, 0xfb, 0xb3, 0x04, 0xb6, 0x17, + 0x3d, 0x66, 0xf0, 0x31, 0x50, 0x9a, 0x9d, 0xce, 0xa1, 0xd1, 0x6a, 0x9a, 0xc6, 0xf1, 0x91, 0x75, + 0x68, 0x1c, 0x7d, 0x6f, 0x75, 0xcd, 0xa6, 0xa9, 0x5b, 0xc6, 0x91, 0x61, 0x1a, 0xcd, 0x43, 0xe3, + 0x89, 0xde, 0xb6, 0x4e, 0x8e, 0xba, 0x1d, 0xbd, 0x65, 0x1c, 0x18, 0x7a, 0xbb, 0x5a, 0x10, 0x76, + 0x2f, 0x2e, 0x25, 0x71, 0x91, 0x9a, 0x31, 0x70, 0x23, 0x17, 0x7b, 0xee, 0x2f, 0xc4, 0x81, 0x26, + 0xf8, 0x6c, 0x89, 0xf0, 0x23, 0x1d, 0x19, 0x07, 0xf9, 0x79, 0xd7, 0x6c, 0x22, 0x53, 0x6f, 0x57, + 0xb9, 0xa9, 0xea, 0x54, 0xed, 0x11, 0x09, 0xdc, 0xb3, 0xac, 0x45, 0x37, 0xc2, 0x41, 0x44, 0x1c, + 0xd8, 0x01, 0x77, 0xdf, 0x45, 0x55, 0x47, 0xe8, 0x18, 0x55, 0x8b, 0xc2, 0xce, 0xc5, 0xa5, 0x74, + 0x67, 0x99, 0xa6, 0x9e, 0x0e, 0xed, 0x9d, 0x7d, 0x9e, 0xb4, 0x5a, 0x7a, 0xb7, 0x5b, 0x2d, 0xbd, + 0xc5, 0x67, 0xb6, 0x22, 0xdf, 0x01, 0x69, 0x89, 0xaa, 0x69, 0xfc, 0xa0, 0xb7, 0xad, 0xe3, 0x13, + 0xb3, 0xca, 0x0b, 0x9f, 0x5c, 0x5c, 0x4a, 0xd2, 0x32, 0xa9, 0xf4, 0xfd, 0x74, 0x8e, 0xe3, 0x48, + 0xe0, 0x9f, 0xfd, 0x5e, 0x2f, 0x68, 0x27, 0x2f, 0xc7, 0x75, 0xee, 0xd5, 0xb8, 0xce, 0xfd, 0x3b, + 0xae, 0x73, 0xcf, 0xaf, 0xea, 0x85, 0x57, 0x57, 0xf5, 0xc2, 0xdf, 0x57, 0xf5, 0xc2, 0x93, 0x07, + 0x3d, 0x37, 0xfa, 0x31, 0x3e, 0x55, 0x6c, 0xbf, 0xaf, 0xb2, 0x85, 0xbe, 0xef, 0xe1, 0xd3, 0x30, + 0xfb, 0x56, 0x47, 0x5f, 0xaa, 0x3f, 0xcf, 0xfe, 0xd6, 0x3d, 0xd2, 0xc3, 0xf6, 0xb9, 0x3a, 0xfa, + 0x4a, 0x8d, 0xce, 0x87, 0x24, 0x3c, 0x2d, 0xd3, 0x47, 0xfe, 0x8b, 0xff, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x97, 0x5a, 0x38, 0x00, 0x00, 0x08, 0x00, 0x00, } func (this *ApplicationLink) Equal(that interface{}) bool { diff --git a/x/profiles/legacy/v5/types/models_chain_links.go b/x/profiles/legacy/v5/types/models_chain_links.go new file mode 100644 index 0000000000..1b140c59c7 --- /dev/null +++ b/x/profiles/legacy/v5/types/models_chain_links.go @@ -0,0 +1,563 @@ +package types + +// DONTCOVER + +import ( + "bytes" + "encoding/hex" + "fmt" + "strings" + "time" + + "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" + + "github.com/cosmos/cosmos-sdk/types/bech32" + "github.com/cosmos/cosmos-sdk/types/tx" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/tendermint/tendermint/crypto/tmhash" + + "github.com/btcsuite/btcd/btcec" + "github.com/ethereum/go-ethereum/crypto" + "github.com/gogo/protobuf/proto" + "github.com/mr-tron/base58" + + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/crypto/types/multisig" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// NewChainConfig allows to build a new ChainConfig instance +func NewChainConfig(name string) ChainConfig { + return ChainConfig{ + Name: name, + } +} + +// Validate checks the validity of the ChainConfig +func (c ChainConfig) Validate() error { + if strings.TrimSpace(c.Name) == "" { + return fmt.Errorf("chain name cannot be empty or blank") + } + if c.Name != strings.ToLower(c.Name) { + return fmt.Errorf("chain name must be lowercase") + } + return nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// NewProof is a constructor function for Proof +// nolint:interfacer +func NewProof(pubKey cryptotypes.PubKey, signature SignatureData, plainText string) Proof { + pubKeyAny, err := codectypes.NewAnyWithValue(pubKey) + if err != nil { + panic("failed to pack public key to any type") + } + + signatureAny, err := codectypes.NewAnyWithValue(signature) + if err != nil { + panic("failed to pack signature data to any type") + } + + return Proof{ + PubKey: pubKeyAny, + Signature: signatureAny, + PlainText: plainText, + } +} + +// Validate checks the validity of the Proof +func (p Proof) Validate() error { + if p.PubKey == nil { + return fmt.Errorf("public key field cannot be nil") + } + + if p.Signature == nil { + return fmt.Errorf("signature field cannot be nil") + } + + if strings.TrimSpace(p.PlainText) == "" { + return fmt.Errorf("plain text cannot be empty or blank") + } + + _, err := hex.DecodeString(p.PlainText) + if err != nil { + return fmt.Errorf("invalid hex-encoded plain text") + } + + return nil +} + +// Verify verifies the signature using the given plain text and public key. +// It returns and error if something is invalid. +func (p Proof) Verify(cdc codec.BinaryCodec, legacyAmino *codec.LegacyAmino, owner string, address AddressData) error { + value, err := hex.DecodeString(p.PlainText) + if err != nil { + return fmt.Errorf("error while decoding proof text: %s", err) + } + + // Make sure the signed value is valid, if it's a transaction + isValidTextSig := IsValidTextSig(value, owner) + isValidDirectTxSig := IsValidDirectTxSig(value, owner, cdc) + isValidAminoTxSig := IsValidAminoTxSig(value, owner, legacyAmino) + + if !isValidTextSig && !isValidDirectTxSig && !isValidAminoTxSig { + return fmt.Errorf("proof signed value must either be the user address or a transaction containing it as the memo") + } + + var sigData SignatureData + err = cdc.UnpackAny(p.Signature, &sigData) + if err != nil { + return fmt.Errorf("failed to unpack the signature") + } + + // Convert the signature data to the Cosmos type + cosmosSigData, err := SignatureDataToCosmosSignatureData(cdc, sigData) + if err != nil { + return err + } + + // Verify the signature + var pubkey cryptotypes.PubKey + switch sigData := cosmosSigData.(type) { + case *signing.SingleSignatureData: + err = cdc.UnpackAny(p.PubKey, &pubkey) + if err != nil { + return fmt.Errorf("failed to unpack the public key") + } + if !pubkey.VerifySignature(value, sigData.Signature) { + return fmt.Errorf("failed to verify the signature") + } + + case *signing.MultiSignatureData: + var multiPubkey multisig.PubKey + err = cdc.UnpackAny(p.PubKey, &multiPubkey) + if err != nil { + return fmt.Errorf("failed to unpack the public key") + } + err = multiPubkey.VerifyMultisignature( + func(mode signing.SignMode) ([]byte, error) { + return value, nil + }, + sigData, + ) + if err != nil { + return err + } + pubkey = multiPubkey + } + + // Verify the public key + valid, err := address.VerifyPubKey(pubkey) + if err != nil { + return err + } + if !valid { + return fmt.Errorf("invalid address and public key combination provided") + } + + return nil +} + +// IsValidTextSig tells whether the given value has been generated using SIGN_MODE_TEXTUAL +// and signing the given expected value +func IsValidTextSig(value []byte, expectedValue string) bool { + return string(value) == expectedValue +} + +// IsValidDirectTxSig tells whether the given value has been generated using SIGN_MODE_DIRECT and signing +// a transaction that contains a memo field equals to the given expected value +func IsValidDirectTxSig(value []byte, expectedMemo string, cdc codec.BinaryCodec) bool { + // Unmarshal the SignDoc + var signDoc tx.SignDoc + err := cdc.Unmarshal(value, &signDoc) + if err != nil { + return false + } + + // Check to make sure the value was a SignDoc. If that's not the case, the two arrays will not match + if !bytes.Equal(value, cdc.MustMarshal(&signDoc)) { + return false + } + + // Get the TxBody + var txBody tx.TxBody + err = cdc.Unmarshal(signDoc.BodyBytes, &txBody) + if err != nil { + return false + } + + // Check memo + return txBody.Memo == expectedMemo +} + +// IsValidAminoTxSig tells whether the given value has been generated using SIGN_MODE_AMINO_JSON and signing +// a transaction that contains a memo field equals to the given expected value +func IsValidAminoTxSig(value []byte, expectedMemo string, cdc *codec.LegacyAmino) bool { + // Unmarshal the StdSignDoc + var signDoc legacytx.StdSignDoc + err := cdc.UnmarshalJSON(value, &signDoc) + if err != nil { + return false + } + + // Check the memo field + return signDoc.Memo == expectedMemo +} + +// UnpackInterfaces implements codectypes.UnpackInterfacesMessage +func (p *Proof) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + var pubKey cryptotypes.PubKey + err := unpacker.UnpackAny(p.PubKey, &pubKey) + if err != nil { + return err + } + + var signatureData SignatureData + return unpacker.UnpackAny(p.Signature, &signatureData) +} + +// -------------------------------------------------------------------------------------------------------------------- + +// SignatureData represents a generic single- or multi- signature data +type SignatureData interface { + proto.Message + + isSignatureData() +} + +// SignatureDataToCosmosSignatureData allows to convert the given SignatureData to a Cosmos SignatureData instance +// unpacking the proto.Any instance using the given unpacker. +func SignatureDataToCosmosSignatureData(unpacker codectypes.AnyUnpacker, s SignatureData) (signing.SignatureData, error) { + switch data := s.(type) { + case *SingleSignatureData: + return &signing.SingleSignatureData{ + Signature: data.Signature, + SignMode: data.Mode, + }, nil + + case *MultiSignatureData: + sigs, err := unpackSignatures(unpacker, data.Signatures) + if err != nil { + return nil, err + } + + return &signing.MultiSignatureData{ + BitArray: data.BitArray, + Signatures: sigs, + }, nil + } + + return nil, fmt.Errorf("signature type not supported: %T", s) +} + +// SignatureDataFromCosmosSignatureData allows to create a SignatureData instance from the given Cosmos SignatureData +func SignatureDataFromCosmosSignatureData(data signing.SignatureData) (SignatureData, error) { + switch data := data.(type) { + case *signing.SingleSignatureData: + return &SingleSignatureData{ + Mode: data.SignMode, + Signature: data.Signature, + }, nil + + case *signing.MultiSignatureData: + sigAnys := make([]*codectypes.Any, len(data.Signatures)) + for i, data := range data.Signatures { + sigData, err := SignatureDataFromCosmosSignatureData(data) + if err != nil { + return nil, err + } + sigAny, err := codectypes.NewAnyWithValue(sigData) + if err != nil { + return nil, err + } + sigAnys[i] = sigAny + } + return &MultiSignatureData{ + BitArray: data.BitArray, + Signatures: sigAnys, + }, nil + default: + return nil, fmt.Errorf("unexpected case %+v", data) + } +} + +// unpackSignatures unpacks the given signatures using the provided unpacker +func unpackSignatures(unpacker codectypes.AnyUnpacker, sigs []*codectypes.Any) ([]signing.SignatureData, error) { + var signatures = make([]signing.SignatureData, len(sigs)) + for i, sig := range sigs { + var signatureData SignatureData + if err := unpacker.UnpackAny(sig, &signatureData); err != nil { + return nil, err + } + + cosmosSigData, err := SignatureDataToCosmosSignatureData(unpacker, signatureData) + if err != nil { + return nil, err + } + signatures[i] = cosmosSigData + } + + return signatures, nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +var _ SignatureData = &SingleSignatureData{} + +// isSignatureData implements SignatureData +func (s *SingleSignatureData) isSignatureData() {} + +// -------------------------------------------------------------------------------------------------------------------- + +var _ SignatureData = &MultiSignatureData{} + +// isSignatureData implements SignatureData +func (s *MultiSignatureData) isSignatureData() {} + +// UnpackInterfaces implements codectypes.UnpackInterfacesMessage +func (s *MultiSignatureData) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + for _, signature := range s.Signatures { + var signatureData SignatureData + err := unpacker.UnpackAny(signature, &signatureData) + if err != nil { + return err + } + } + + return nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// AddressData is an interface representing a generic external chain address +type AddressData interface { + proto.Message + + // Validate checks the validity of the AddressData + Validate() error + + // GetValue returns the address value + GetValue() string + + // VerifyPubKey verifies that the given public key is associated with this address data + VerifyPubKey(key cryptotypes.PubKey) (bool, error) +} + +// -------------------------------------------------------------------------------------------------------------------- + +var _ AddressData = &Bech32Address{} + +// NewBech32Address returns a new Bech32Address instance +func NewBech32Address(value, prefix string) *Bech32Address { + return &Bech32Address{Value: value, Prefix: prefix} +} + +// Validate implements AddressData +func (b Bech32Address) Validate() error { + if strings.TrimSpace(b.Value) == "" { + return fmt.Errorf("value cannot be empty or blank") + } + + if strings.TrimSpace(b.Prefix) == "" { + return fmt.Errorf("prefix cannot be empty or blank") + } + + _, err := sdk.GetFromBech32(b.Value, b.Prefix) + if err != nil { + return fmt.Errorf("invalid Bech32 value or wrong prefix") + } + + return nil +} + +// GetValue implements AddressData +func (b Bech32Address) GetValue() string { + return b.Value +} + +// VerifyPubKey implements AddressData +func (b Bech32Address) VerifyPubKey(key cryptotypes.PubKey) (bool, error) { + _, bz, err := bech32.DecodeAndConvert(b.Value) + if err != nil { + return false, err + } + return bytes.Equal(bz, key.Address().Bytes()), nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +var _ AddressData = &Base58Address{} + +// NewBase58Address returns a new Base58Address instance +func NewBase58Address(value string) *Base58Address { + return &Base58Address{Value: value} +} + +// Validate implements AddressData +func (b Base58Address) Validate() error { + if strings.TrimSpace(b.Value) == "" { + return fmt.Errorf("address cannot be empty or blank") + } + + if _, err := base58.Decode(b.Value); err != nil { + return fmt.Errorf("invalid Base58 address") + } + + return nil +} + +// GetValue implements AddressData +func (b Base58Address) GetValue() string { + return b.Value +} + +// VerifyPubKey implements AddressData +func (b Base58Address) VerifyPubKey(key cryptotypes.PubKey) (bool, error) { + bz, err := base58.Decode(b.Value) + return bytes.Equal(tmhash.SumTruncated(bz), key.Address().Bytes()), err +} + +// -------------------------------------------------------------------------------------------------------------------- + +var _ AddressData = &HexAddress{} + +// NewHexAddress returns a new HexAddress instance +func NewHexAddress(value, prefix string) *HexAddress { + return &HexAddress{Value: value, Prefix: prefix} +} + +// Validate implements AddressData +func (h HexAddress) Validate() error { + if strings.TrimSpace(h.Value) == "" { + return fmt.Errorf("value cannot be empty or blank") + } + + if len(h.Value) <= len(h.Prefix) { + return fmt.Errorf("address cannot be smaller than prefix") + } + + prefix, addrWithoutPrefix := h.Value[:len(h.Prefix)], h.Value[len(h.Prefix):] + if prefix != h.Prefix { + return fmt.Errorf("prefix does not match") + } + + if _, err := hex.DecodeString(addrWithoutPrefix); err != nil { + return fmt.Errorf("invalid hex address") + } + return nil +} + +// GetValue implements AddressData +func (h HexAddress) GetValue() string { + return h.Value +} + +// VerifyPubKey implements AddressData +func (h HexAddress) VerifyPubKey(key cryptotypes.PubKey) (bool, error) { + addr := h.Value[len(h.Prefix):] + bz, err := hex.DecodeString(addr) + if err != nil { + return false, err + } + pubKey, err := btcec.ParsePubKey(key.Bytes(), btcec.S256()) + if err != nil { + return false, err + } + uncompressedPubKey := pubKey.SerializeUncompressed() + return bytes.Equal(crypto.Keccak256(uncompressedPubKey[1:])[12:], bz), err +} + +// -------------------------------------------------------------------------------------------------------------------- + +// UnpackAddressData deserializes the given any type value as an address data using the provided unpacker +func UnpackAddressData(unpacker codectypes.AnyUnpacker, addressAny *codectypes.Any) (AddressData, error) { + var address AddressData + if err := unpacker.UnpackAny(addressAny, &address); err != nil { + return nil, err + } + return address, nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// NewChainLink returns a new ChainLink instance +// nolint:interfacer +func NewChainLink(user string, address AddressData, proof Proof, chainConfig ChainConfig, creationTime time.Time) ChainLink { + addressAny, err := codectypes.NewAnyWithValue(address) + if err != nil { + panic("failed to pack address data to any type") + } + return ChainLink{ + User: user, + Address: addressAny, + Proof: proof, + ChainConfig: chainConfig, + CreationTime: creationTime, + } +} + +// GetAddressData returns the AddressData associated with this chain link +func (link ChainLink) GetAddressData() AddressData { + return link.Address.GetCachedValue().(AddressData) +} + +// Validate checks the validity of the ChainLink +func (link ChainLink) Validate() error { + if _, err := sdk.AccAddressFromBech32(link.User); err != nil { + return fmt.Errorf("invalid creator address: %s", link.User) + } + + if link.Address == nil { + return fmt.Errorf("address cannot be nil") + } + + err := link.Proof.Validate() + if err != nil { + return err + } + + err = link.ChainConfig.Validate() + if err != nil { + return err + } + + if link.CreationTime.IsZero() { + return fmt.Errorf("creation time cannot be zero") + } + + return nil +} + +// UnpackInterfaces implements codectypes.UnpackInterfacesMessage +func (link *ChainLink) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + if link.Address != nil { + var address AddressData + err := unpacker.UnpackAny(link.Address, &address) + if err != nil { + return err + } + } + + err := link.Proof.UnpackInterfaces(unpacker) + if err != nil { + return err + } + + return nil +} + +// MustMarshalChainLink serializes the given chain link using the provided BinaryCodec +func MustMarshalChainLink(cdc codec.BinaryCodec, link ChainLink) []byte { + return cdc.MustMarshal(&link) +} + +// MustUnmarshalChainLink deserializes the given byte array as a chain link using +// the provided BinaryCodec +func MustUnmarshalChainLink(codec codec.BinaryCodec, bz []byte) ChainLink { + var link ChainLink + codec.MustUnmarshal(bz, &link) + return link +} diff --git a/x/profiles/legacy/v5/types/models_chain_links.pb.go b/x/profiles/legacy/v5/types/models_chain_links.pb.go new file mode 100644 index 0000000000..21362ed668 --- /dev/null +++ b/x/profiles/legacy/v5/types/models_chain_links.pb.go @@ -0,0 +1,2237 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v2/models_chain_links.proto + +package types + +import ( + bytes "bytes" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + types1 "github.com/cosmos/cosmos-sdk/crypto/types" + signing "github.com/cosmos/cosmos-sdk/types/tx/signing" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/regen-network/cosmos-proto" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// ChainLink contains the data representing either an inter- or cross- chain +// link +type ChainLink struct { + // User defines the destination profile address to link + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty" yaml:"user"` + // Address contains the data of the external chain address to be connected + // with the Desmos profile + Address *types.Any `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` + // Proof contains the ownership proof of the external chain address + Proof Proof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof" yaml:"proof"` + // ChainConfig contains the configuration of the external chain + ChainConfig ChainConfig `protobuf:"bytes,4,opt,name=chain_config,json=chainConfig,proto3" json:"chain_config" yaml:"chain_config"` + // CreationTime represents the time in which the link has been created + CreationTime time.Time `protobuf:"bytes,5,opt,name=creation_time,json=creationTime,proto3,stdtime" json:"creation_time" yaml:"creation_time"` +} + +func (m *ChainLink) Reset() { *m = ChainLink{} } +func (m *ChainLink) String() string { return proto.CompactTextString(m) } +func (*ChainLink) ProtoMessage() {} +func (*ChainLink) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{0} +} +func (m *ChainLink) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChainLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChainLink.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ChainLink) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainLink.Merge(m, src) +} +func (m *ChainLink) XXX_Size() int { + return m.Size() +} +func (m *ChainLink) XXX_DiscardUnknown() { + xxx_messageInfo_ChainLink.DiscardUnknown(m) +} + +var xxx_messageInfo_ChainLink proto.InternalMessageInfo + +// ChainConfig contains the data of the chain with which the link is made. +type ChainConfig struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` +} + +func (m *ChainConfig) Reset() { *m = ChainConfig{} } +func (m *ChainConfig) String() string { return proto.CompactTextString(m) } +func (*ChainConfig) ProtoMessage() {} +func (*ChainConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{1} +} +func (m *ChainConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChainConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChainConfig.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ChainConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainConfig.Merge(m, src) +} +func (m *ChainConfig) XXX_Size() int { + return m.Size() +} +func (m *ChainConfig) XXX_DiscardUnknown() { + xxx_messageInfo_ChainConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_ChainConfig proto.InternalMessageInfo + +// Proof contains all the data used to verify a signature when linking an +// account to a profile +type Proof struct { + // PubKey represents the public key associated with the address for which to + // prove the ownership + PubKey *types.Any `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty" yaml:"pub_key"` + // Signature represents the hex-encoded signature of the PlainText value + Signature *types.Any `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" yaml:"signature"` + // PlainText represents the hex-encoded value signed in order to produce the + // Signature + PlainText string `protobuf:"bytes,3,opt,name=plain_text,json=plainText,proto3" json:"plain_text,omitempty" yaml:"plain_text"` +} + +func (m *Proof) Reset() { *m = Proof{} } +func (m *Proof) String() string { return proto.CompactTextString(m) } +func (*Proof) ProtoMessage() {} +func (*Proof) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{2} +} +func (m *Proof) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Proof.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Proof) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proof.Merge(m, src) +} +func (m *Proof) XXX_Size() int { + return m.Size() +} +func (m *Proof) XXX_DiscardUnknown() { + xxx_messageInfo_Proof.DiscardUnknown(m) +} + +var xxx_messageInfo_Proof proto.InternalMessageInfo + +// Bech32Address represents a Bech32-encoded address +type Bech32Address struct { + // Value represents the Bech-32 encoded address value + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" yaml:"value"` + // Prefix represents the HRP of the Bech32 address + Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty" yaml:"prefix"` +} + +func (m *Bech32Address) Reset() { *m = Bech32Address{} } +func (m *Bech32Address) String() string { return proto.CompactTextString(m) } +func (*Bech32Address) ProtoMessage() {} +func (*Bech32Address) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{3} +} +func (m *Bech32Address) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Bech32Address) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Bech32Address.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Bech32Address) XXX_Merge(src proto.Message) { + xxx_messageInfo_Bech32Address.Merge(m, src) +} +func (m *Bech32Address) XXX_Size() int { + return m.Size() +} +func (m *Bech32Address) XXX_DiscardUnknown() { + xxx_messageInfo_Bech32Address.DiscardUnknown(m) +} + +var xxx_messageInfo_Bech32Address proto.InternalMessageInfo + +// Base58Address represents a Base58-encoded address +type Base58Address struct { + // Value contains the Base58-encoded address + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" yaml:"value"` +} + +func (m *Base58Address) Reset() { *m = Base58Address{} } +func (m *Base58Address) String() string { return proto.CompactTextString(m) } +func (*Base58Address) ProtoMessage() {} +func (*Base58Address) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{4} +} +func (m *Base58Address) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Base58Address) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Base58Address.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Base58Address) XXX_Merge(src proto.Message) { + xxx_messageInfo_Base58Address.Merge(m, src) +} +func (m *Base58Address) XXX_Size() int { + return m.Size() +} +func (m *Base58Address) XXX_DiscardUnknown() { + xxx_messageInfo_Base58Address.DiscardUnknown(m) +} + +var xxx_messageInfo_Base58Address proto.InternalMessageInfo + +// HexAddress represents an Hex-encoded address +// NOTE: Currently it only supports keccak256-uncompressed addresses +type HexAddress struct { + // Value represents the hex address value + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" yaml:"value"` + // Prefix represents the optional prefix used during address encoding (e.g. + // 0x) + Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty" yaml:"prefix"` +} + +func (m *HexAddress) Reset() { *m = HexAddress{} } +func (m *HexAddress) String() string { return proto.CompactTextString(m) } +func (*HexAddress) ProtoMessage() {} +func (*HexAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{5} +} +func (m *HexAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HexAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HexAddress.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HexAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_HexAddress.Merge(m, src) +} +func (m *HexAddress) XXX_Size() int { + return m.Size() +} +func (m *HexAddress) XXX_DiscardUnknown() { + xxx_messageInfo_HexAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_HexAddress proto.InternalMessageInfo + +// SingleSignatureData is the signature data for a single signer +type SingleSignatureData struct { + // Mode is the signing mode of the single signer + Mode signing.SignMode `protobuf:"varint,1,opt,name=mode,proto3,enum=cosmos.tx.signing.v1beta1.SignMode" json:"mode,omitempty"` + // Signature is the raw signature bytes + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *SingleSignatureData) Reset() { *m = SingleSignatureData{} } +func (m *SingleSignatureData) String() string { return proto.CompactTextString(m) } +func (*SingleSignatureData) ProtoMessage() {} +func (*SingleSignatureData) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{6} +} +func (m *SingleSignatureData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SingleSignatureData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SingleSignatureData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SingleSignatureData) XXX_Merge(src proto.Message) { + xxx_messageInfo_SingleSignatureData.Merge(m, src) +} +func (m *SingleSignatureData) XXX_Size() int { + return m.Size() +} +func (m *SingleSignatureData) XXX_DiscardUnknown() { + xxx_messageInfo_SingleSignatureData.DiscardUnknown(m) +} + +var xxx_messageInfo_SingleSignatureData proto.InternalMessageInfo + +// MultiSignatureData is the signature data for a multisig public key +type MultiSignatureData struct { + // Bitarray specifies which keys within the multisig are signing + BitArray *types1.CompactBitArray `protobuf:"bytes,1,opt,name=bit_array,json=bitArray,proto3" json:"bit_array,omitempty"` + // Signatures is the signatures of the multi-signature + Signatures []*types.Any `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` +} + +func (m *MultiSignatureData) Reset() { *m = MultiSignatureData{} } +func (m *MultiSignatureData) String() string { return proto.CompactTextString(m) } +func (*MultiSignatureData) ProtoMessage() {} +func (*MultiSignatureData) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{7} +} +func (m *MultiSignatureData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MultiSignatureData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MultiSignatureData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MultiSignatureData) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiSignatureData.Merge(m, src) +} +func (m *MultiSignatureData) XXX_Size() int { + return m.Size() +} +func (m *MultiSignatureData) XXX_DiscardUnknown() { + xxx_messageInfo_MultiSignatureData.DiscardUnknown(m) +} + +var xxx_messageInfo_MultiSignatureData proto.InternalMessageInfo + +func init() { + proto.RegisterType((*ChainLink)(nil), "desmos.profiles.v2.ChainLink") + proto.RegisterType((*ChainConfig)(nil), "desmos.profiles.v2.ChainConfig") + proto.RegisterType((*Proof)(nil), "desmos.profiles.v2.Proof") + proto.RegisterType((*Bech32Address)(nil), "desmos.profiles.v2.Bech32Address") + proto.RegisterType((*Base58Address)(nil), "desmos.profiles.v2.Base58Address") + proto.RegisterType((*HexAddress)(nil), "desmos.profiles.v2.HexAddress") + proto.RegisterType((*SingleSignatureData)(nil), "desmos.profiles.v2.SingleSignatureData") + proto.RegisterType((*MultiSignatureData)(nil), "desmos.profiles.v2.MultiSignatureData") +} + +func init() { + proto.RegisterFile("desmos/profiles/v2/models_chain_links.proto", fileDescriptor_1deb25c5b4df9624) +} + +var fileDescriptor_1deb25c5b4df9624 = []byte{ + // 803 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0x8e, 0x69, 0xd3, 0x25, 0x93, 0x64, 0xd9, 0x9d, 0x0d, 0x52, 0xda, 0x45, 0x71, 0xf1, 0x4a, + 0xb0, 0x08, 0xd5, 0xa3, 0xcd, 0x6e, 0x05, 0x0a, 0x17, 0xe2, 0x82, 0x54, 0x89, 0x56, 0x02, 0xb7, + 0x5c, 0xb8, 0x44, 0x63, 0x67, 0xe2, 0x8e, 0x6a, 0x7b, 0x2c, 0x7b, 0x1c, 0xc5, 0x12, 0x12, 0x47, + 0x38, 0xf6, 0xc8, 0x81, 0x43, 0xff, 0x07, 0xf8, 0x23, 0x2a, 0x4e, 0x15, 0xa7, 0x9e, 0x02, 0x6a, + 0x2f, 0x9c, 0xf3, 0x17, 0xa0, 0xf9, 0xe1, 0x24, 0x4d, 0x69, 0x25, 0x4e, 0xdc, 0x3c, 0xef, 0x7d, + 0xdf, 0x37, 0xdf, 0x9b, 0xf7, 0xf4, 0x0c, 0x3e, 0x1e, 0x92, 0x2c, 0x62, 0x19, 0x4a, 0x52, 0x36, + 0xa2, 0x21, 0xc9, 0xd0, 0xb8, 0x8b, 0x22, 0x36, 0x24, 0x61, 0x36, 0xf0, 0x4f, 0x30, 0x8d, 0x07, + 0x21, 0x8d, 0x4f, 0x33, 0x3b, 0x49, 0x19, 0x67, 0x10, 0x2a, 0xb0,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8a, 0xcb, 0x41, 0x46, 0xa5, 0x1b, + 0xb5, 0xf4, 0xec, 0xf9, 0x8e, 0x2b, 0x2d, 0xed, 0xb1, 0x28, 0xc1, 0x3e, 0x77, 0x28, 0xef, 0x0b, + 0x9a, 0xfb, 0xb6, 0xa7, 0xbf, 0xc4, 0x1c, 0xce, 0xcd, 0x88, 0x7d, 0xb6, 0x76, 0xdf, 0x48, 0xbb, + 0x4b, 0xb8, 0x07, 0x5c, 0x3b, 0xdf, 0x5e, 0x5c, 0x77, 0x8c, 0xcb, 0xeb, 0x8e, 0xf1, 0xd7, 0x75, + 0xc7, 0x38, 0xbb, 0xe9, 0x54, 0x2e, 0x6f, 0x3a, 0x95, 0xab, 0x9b, 0x4e, 0xe5, 0xbb, 0xcf, 0x02, + 0xca, 0x4f, 0x72, 0xcf, 0xf6, 0x59, 0x84, 0xd4, 0x46, 0xda, 0x09, 0xb1, 0x97, 0xe9, 0x6f, 0x34, + 0x7e, 0x83, 0x26, 0x8b, 0x9f, 0x51, 0x48, 0x02, 0xec, 0x17, 0x68, 0xbc, 0x8b, 0x78, 0x91, 0x90, + 0xcc, 0xdb, 0x90, 0x5e, 0x5e, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0x97, 0x38, 0x95, 0xbe, 0xb6, + 0x06, 0x00, 0x00, +} + +func (this *ChainLink) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ChainLink) + if !ok { + that2, ok := that.(ChainLink) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.User != that1.User { + return false + } + if !this.Address.Equal(that1.Address) { + return false + } + if !this.Proof.Equal(&that1.Proof) { + return false + } + if !this.ChainConfig.Equal(&that1.ChainConfig) { + return false + } + if !this.CreationTime.Equal(that1.CreationTime) { + return false + } + return true +} +func (this *ChainConfig) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ChainConfig) + if !ok { + that2, ok := that.(ChainConfig) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + return true +} +func (this *Proof) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Proof) + if !ok { + that2, ok := that.(Proof) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.PubKey.Equal(that1.PubKey) { + return false + } + if !this.Signature.Equal(that1.Signature) { + return false + } + if this.PlainText != that1.PlainText { + return false + } + return true +} +func (this *Bech32Address) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Bech32Address) + if !ok { + that2, ok := that.(Bech32Address) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Value != that1.Value { + return false + } + if this.Prefix != that1.Prefix { + return false + } + return true +} +func (this *Base58Address) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Base58Address) + if !ok { + that2, ok := that.(Base58Address) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Value != that1.Value { + return false + } + return true +} +func (this *HexAddress) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*HexAddress) + if !ok { + that2, ok := that.(HexAddress) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Value != that1.Value { + return false + } + if this.Prefix != that1.Prefix { + return false + } + return true +} +func (this *SingleSignatureData) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SingleSignatureData) + if !ok { + that2, ok := that.(SingleSignatureData) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Mode != that1.Mode { + return false + } + if !bytes.Equal(this.Signature, that1.Signature) { + return false + } + return true +} +func (this *MultiSignatureData) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MultiSignatureData) + if !ok { + that2, ok := that.(MultiSignatureData) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.BitArray.Equal(that1.BitArray) { + return false + } + if len(this.Signatures) != len(that1.Signatures) { + return false + } + for i := range this.Signatures { + if !this.Signatures[i].Equal(that1.Signatures[i]) { + return false + } + } + return true +} +func (m *ChainLink) 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 *ChainLink) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChainLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintModelsChainLinks(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x2a + { + size, err := m.ChainConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ChainConfig) 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 *ChainConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChainConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Proof) 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 *Proof) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PlainText) > 0 { + i -= len(m.PlainText) + copy(dAtA[i:], m.PlainText) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.PlainText))) + i-- + dAtA[i] = 0x1a + } + if m.Signature != nil { + { + size, err := m.Signature.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Bech32Address) 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 *Bech32Address) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Bech32Address) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Prefix) > 0 { + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Prefix))) + i-- + dAtA[i] = 0x12 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Base58Address) 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 *Base58Address) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Base58Address) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HexAddress) 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 *HexAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HexAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Prefix) > 0 { + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Prefix))) + i-- + dAtA[i] = 0x12 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SingleSignatureData) 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 *SingleSignatureData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SingleSignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x12 + } + if m.Mode != 0 { + i = encodeVarintModelsChainLinks(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MultiSignatureData) 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 *MultiSignatureData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MultiSignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signatures) > 0 { + for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Signatures[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.BitArray != nil { + { + size, err := m.BitArray.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsChainLinks(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsChainLinks(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ChainLink) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.User) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + l = m.Proof.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + l = m.ChainConfig.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime) + n += 1 + l + sovModelsChainLinks(uint64(l)) + return n +} + +func (m *ChainConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + return n +} + +func (m *Proof) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + if m.Signature != nil { + l = m.Signature.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + l = len(m.PlainText) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + return n +} + +func (m *Bech32Address) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + l = len(m.Prefix) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + return n +} + +func (m *Base58Address) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + return n +} + +func (m *HexAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + l = len(m.Prefix) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + return n +} + +func (m *SingleSignatureData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Mode != 0 { + n += 1 + sovModelsChainLinks(uint64(m.Mode)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + return n +} + +func (m *MultiSignatureData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BitArray != nil { + l = m.BitArray.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + if len(m.Signatures) > 0 { + for _, e := range m.Signatures { + l = e.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + } + return n +} + +func sovModelsChainLinks(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsChainLinks(x uint64) (n int) { + return sovModelsChainLinks(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ChainLink) 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 ErrIntOverflowModelsChainLinks + } + 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: ChainLink: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChainLink: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + 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 ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.User = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &types.Any{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ChainConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChainConfig) 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 ErrIntOverflowModelsChainLinks + } + 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: ChainConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChainConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + 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 ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Proof) 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 ErrIntOverflowModelsChainLinks + } + 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: Proof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Proof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PubKey == nil { + m.PubKey = &types.Any{} + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Signature == nil { + m.Signature = &types.Any{} + } + if err := m.Signature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PlainText", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + 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 ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PlainText = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Bech32Address) 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 ErrIntOverflowModelsChainLinks + } + 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: Bech32Address: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Bech32Address: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + 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 ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + 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 ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Base58Address) 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 ErrIntOverflowModelsChainLinks + } + 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: Base58Address: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Base58Address: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + 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 ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HexAddress) 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 ErrIntOverflowModelsChainLinks + } + 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: HexAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HexAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + 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 ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + 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 ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SingleSignatureData) 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 ErrIntOverflowModelsChainLinks + } + 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: SingleSignatureData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SingleSignatureData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + m.Mode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Mode |= signing.SignMode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MultiSignatureData) 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 ErrIntOverflowModelsChainLinks + } + 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: MultiSignatureData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MultiSignatureData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BitArray", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BitArray == nil { + m.BitArray = &types1.CompactBitArray{} + } + if err := m.BitArray.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signatures = append(m.Signatures, &types.Any{}) + if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsChainLinks(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, ErrIntOverflowModelsChainLinks + } + 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, ErrIntOverflowModelsChainLinks + } + 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, ErrIntOverflowModelsChainLinks + } + 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, ErrInvalidLengthModelsChainLinks + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsChainLinks + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsChainLinks + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsChainLinks = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsChainLinks = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsChainLinks = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v5/types/models_dtag_requests.go b/x/profiles/legacy/v5/types/models_dtag_requests.go new file mode 100644 index 0000000000..c481c46a14 --- /dev/null +++ b/x/profiles/legacy/v5/types/models_dtag_requests.go @@ -0,0 +1,51 @@ +package types + +// DONTCOVER + +import ( + "fmt" + "strings" + + "github.com/cosmos/cosmos-sdk/codec" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func NewDTagTransferRequest(dTagToTrade string, sender, receiver string) DTagTransferRequest { + return DTagTransferRequest{ + DTagToTrade: dTagToTrade, + Receiver: receiver, + Sender: sender, + } +} + +// Validate checks the request validity +func (request DTagTransferRequest) Validate() error { + _, err := sdk.AccAddressFromBech32(request.Sender) + if err != nil { + return fmt.Errorf("invalid DTag transfer request sender address: %s", request.Sender) + } + + _, err = sdk.AccAddressFromBech32(request.Receiver) + if err != nil { + return fmt.Errorf("invalid receiver address: %s", request.Receiver) + } + + if request.Receiver == request.Sender { + return fmt.Errorf("the sender and receiver must be different") + } + + if strings.TrimSpace(request.DTagToTrade) == "" { + return fmt.Errorf("invalid DTag to trade: %s", request.DTagToTrade) + } + + return nil +} + +// MustUnmarshalDTagTransferRequest unmarshalls the given byte array as a DTagTransferRequest +// using the provided marshaller +func MustUnmarshalDTagTransferRequest(cdc codec.BinaryCodec, bz []byte) DTagTransferRequest { + var request DTagTransferRequest + cdc.MustUnmarshal(bz, &request) + return request +} diff --git a/x/profiles/legacy/v5/types/models_dtag_requests.pb.go b/x/profiles/legacy/v5/types/models_dtag_requests.pb.go new file mode 100644 index 0000000000..fbf96f5bca --- /dev/null +++ b/x/profiles/legacy/v5/types/models_dtag_requests.pb.go @@ -0,0 +1,449 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v2/models_dtag_requests.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/regen-network/cosmos-proto" + _ "google.golang.org/protobuf/types/known/timestamppb" + 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 + +// DTagTransferRequest represent a DTag transfer request between two users +type DTagTransferRequest struct { + // DTagToTrade contains the value of the DTag that should be transferred from + // the receiver of the request to the sender + DTagToTrade string `protobuf:"bytes,1,opt,name=dtag_to_trade,json=dtagToTrade,proto3" json:"dtag_to_trade,omitempty" yaml:"dtag_to_trade"` + // Sender represents the address of the account that sent the request + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` + // Receiver represents the receiver of the request that, if accepted, will + // give to the sender their DTag + Receiver string `protobuf:"bytes,3,opt,name=receiver,proto3" json:"receiver,omitempty" yaml:"receiver"` +} + +func (m *DTagTransferRequest) Reset() { *m = DTagTransferRequest{} } +func (m *DTagTransferRequest) String() string { return proto.CompactTextString(m) } +func (*DTagTransferRequest) ProtoMessage() {} +func (*DTagTransferRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_3722cfac854d7654, []int{0} +} +func (m *DTagTransferRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DTagTransferRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DTagTransferRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DTagTransferRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DTagTransferRequest.Merge(m, src) +} +func (m *DTagTransferRequest) XXX_Size() int { + return m.Size() +} +func (m *DTagTransferRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DTagTransferRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DTagTransferRequest proto.InternalMessageInfo + +func init() { + proto.RegisterType((*DTagTransferRequest)(nil), "desmos.profiles.v2.DTagTransferRequest") +} + +func init() { + proto.RegisterFile("desmos/profiles/v2/models_dtag_requests.proto", fileDescriptor_3722cfac854d7654) +} + +var fileDescriptor_3722cfac854d7654 = []byte{ + // 349 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x91, 0xb1, 0x4e, 0xe3, 0x40, + 0x10, 0x40, 0xbd, 0x77, 0x52, 0x74, 0xe7, 0x5c, 0x74, 0x3a, 0x27, 0x45, 0x2e, 0x85, 0x17, 0xb9, + 0x01, 0x8a, 0x78, 0xa5, 0x00, 0x4d, 0xe8, 0x22, 0x3a, 0x3a, 0x2b, 0x34, 0x34, 0xd6, 0xda, 0x9e, + 0x2c, 0x96, 0xec, 0xac, 0xd9, 0xdd, 0x58, 0xf8, 0x0f, 0x28, 0x29, 0x29, 0xf3, 0x39, 0x14, 0x14, + 0x29, 0xa9, 0x2c, 0xe4, 0x34, 0xd4, 0xf9, 0x02, 0x64, 0xaf, 0x03, 0x82, 0x6e, 0x66, 0xde, 0x9b, + 0xd9, 0xd1, 0xac, 0x39, 0x8e, 0x40, 0xa6, 0x5c, 0x92, 0x4c, 0xf0, 0x45, 0x9c, 0x80, 0x24, 0xf9, + 0x84, 0xa4, 0x3c, 0x82, 0x44, 0xfa, 0x91, 0xa2, 0xcc, 0x17, 0x70, 0xbb, 0x02, 0xa9, 0xa4, 0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, 0x6d, 0xbc, 0x6c, 0x6d, 0xe3, 0xfa, 0x9c, 0xc5, 0xea, 0x66, 0x15, 0xb8, + 0x21, 0x4f, 0x89, 0x3e, 0xfa, 0x38, 0xa1, 0x81, 0x6c, 0x63, 0x92, 0x9f, 0x92, 0xbb, 0xcf, 0x4f, + 0x4b, 0x80, 0xd1, 0xb0, 0x20, 0xf9, 0x19, 0x51, 0x45, 0x06, 0x32, 0xe8, 0x34, 0xc7, 0x3a, 0x79, + 0x0f, 0x00, 0x00, 0xff, 0xff, 0xc6, 0x16, 0xdc, 0xe8, 0xde, 0x01, 0x00, 0x00, +} + +func (this *DTagTransferRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DTagTransferRequest) + if !ok { + that2, ok := that.(DTagTransferRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.DTagToTrade != that1.DTagToTrade { + return false + } + if this.Sender != that1.Sender { + return false + } + if this.Receiver != that1.Receiver { + return false + } + return true +} +func (m *DTagTransferRequest) 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 *DTagTransferRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DTagTransferRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintModelsDtagRequests(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x1a + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintModelsDtagRequests(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x12 + } + if len(m.DTagToTrade) > 0 { + i -= len(m.DTagToTrade) + copy(dAtA[i:], m.DTagToTrade) + i = encodeVarintModelsDtagRequests(dAtA, i, uint64(len(m.DTagToTrade))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsDtagRequests(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsDtagRequests(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *DTagTransferRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DTagToTrade) + if l > 0 { + n += 1 + l + sovModelsDtagRequests(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovModelsDtagRequests(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovModelsDtagRequests(uint64(l)) + } + return n +} + +func sovModelsDtagRequests(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsDtagRequests(x uint64) (n int) { + return sovModelsDtagRequests(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *DTagTransferRequest) 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 ErrIntOverflowModelsDtagRequests + } + 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: DTagTransferRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DTagTransferRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DTagToTrade", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + 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 ErrInvalidLengthModelsDtagRequests + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DTagToTrade = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + 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 ErrInvalidLengthModelsDtagRequests + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + 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 ErrInvalidLengthModelsDtagRequests + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsDtagRequests(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsDtagRequests(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, ErrIntOverflowModelsDtagRequests + } + 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, ErrIntOverflowModelsDtagRequests + } + 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, ErrIntOverflowModelsDtagRequests + } + 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, ErrInvalidLengthModelsDtagRequests + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsDtagRequests + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsDtagRequests + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsDtagRequests = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsDtagRequests = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsDtagRequests = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v5/models_params.pb.go b/x/profiles/legacy/v5/types/models_params.pb.go similarity index 88% rename from x/profiles/legacy/v5/models_params.pb.go rename to x/profiles/legacy/v5/types/models_params.pb.go index 0f21d6ddf9..31efb7de5a 100644 --- a/x/profiles/legacy/v5/models_params.pb.go +++ b/x/profiles/legacy/v5/types/models_params.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: desmos/profiles/v2/models_params.proto -package v5 +package types import ( fmt "fmt" @@ -252,51 +252,52 @@ func init() { } var fileDescriptor_1b093f5fee9c9f7d = []byte{ - // 702 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xd3, 0x4e, - 0x14, 0xc6, 0x73, 0x71, 0xa3, 0x78, 0xd2, 0xff, 0xa5, 0x56, 0x81, 0x50, 0x84, 0x1d, 0xcd, 0xa2, - 0xca, 0xa6, 0xb6, 0x1a, 0xa8, 0x90, 0x2a, 0xb1, 0xc0, 0x69, 0x85, 0x2a, 0x01, 0xa9, 0x0c, 0x12, - 0x12, 0x1b, 0x6b, 0xec, 0x4c, 0x5d, 0x2b, 0xb6, 0xc7, 0xf2, 0x38, 0x51, 0xba, 0x62, 0xcb, 0x92, - 0x27, 0x40, 0xac, 0x11, 0x0f, 0xd2, 0x15, 0xea, 0x12, 0xb1, 0x30, 0x28, 0x7d, 0x83, 0x3c, 0x01, - 0x9a, 0x4b, 0x2e, 0x2d, 0x95, 0x28, 0x20, 0x56, 0x39, 0x9e, 0x73, 0xbe, 0xdf, 0x99, 0x39, 0x9f, - 0x3d, 0x01, 0x9b, 0x7d, 0x4c, 0x63, 0x42, 0xad, 0x34, 0x23, 0x47, 0x61, 0x84, 0xa9, 0x35, 0xea, - 0x58, 0x31, 0xe9, 0xe3, 0x88, 0xba, 0x29, 0xca, 0x50, 0x4c, 0xcd, 0x34, 0x23, 0x39, 0xd1, 0x34, - 0x51, 0x67, 0xce, 0xea, 0xcc, 0x51, 0x67, 0x63, 0x3d, 0x20, 0x01, 0xe1, 0x69, 0x8b, 0x45, 0xa2, - 0x72, 0x43, 0xf7, 0x09, 0x27, 0x7a, 0x88, 0x62, 0x6b, 0xb4, 0xed, 0xe1, 0x1c, 0x6d, 0x5b, 0x3e, - 0x09, 0x13, 0x91, 0x87, 0x9f, 0x2a, 0xa0, 0x76, 0xc8, 0xd1, 0xda, 0x4b, 0x50, 0x4f, 0x42, 0x7f, - 0x90, 0xa0, 0x18, 0x37, 0xcb, 0xad, 0x72, 0xbb, 0xd1, 0x81, 0xe6, 0x8f, 0x7d, 0xcc, 0x67, 0xb2, - 0x46, 0xa8, 0xec, 0x5b, 0xa7, 0x85, 0x51, 0x9a, 0x16, 0xc6, 0x7f, 0x27, 0x28, 0x8e, 0x76, 0xe1, - 0x8c, 0x00, 0x9d, 0x39, 0x4c, 0xeb, 0x01, 0xa5, 0x9f, 0xa3, 0xa0, 0x59, 0xe1, 0x50, 0xfd, 0x2a, - 0xe8, 0xde, 0x0b, 0x14, 0x48, 0xe0, 0x1d, 0x06, 0x9c, 0x14, 0x86, 0xc2, 0xd6, 0xa6, 0x85, 0xd1, - 0x10, 0x60, 0x46, 0x80, 0x0e, 0x07, 0x69, 0x5d, 0x50, 0xf5, 0x42, 0xd2, 0xac, 0x72, 0xde, 0xdd, - 0xab, 0x78, 0x76, 0x48, 0x24, 0x4e, 0x93, 0xfb, 0x03, 0x02, 0xe3, 0x85, 0x04, 0x3a, 0x4c, 0xad, - 0xf5, 0x40, 0x8d, 0x64, 0xc8, 0x8f, 0x70, 0x53, 0xe1, 0x9c, 0xd6, 0x55, 0x9c, 0x1e, 0xaf, 0x90, - 0xa8, 0x1b, 0x12, 0xf5, 0x8f, 0x40, 0x09, 0x35,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82, 0x8a, 0x2b, 0x69, 0x2b, 0x42, 0x1e, 0x95, 0xb1, 0x35, 0xba, 0x6f, - 0x8d, 0x17, 0x7f, 0x10, 0x11, 0x0e, 0x90, 0x7f, 0x62, 0x8d, 0x76, 0xbc, 0x1a, 0xbf, 0xd0, 0xef, - 0x7d, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xaa, 0xa5, 0xcd, 0x44, 0x06, 0x00, 0x00, + // 705 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xd3, 0x4c, + 0x14, 0xc7, 0x73, 0x71, 0xa3, 0x78, 0xd2, 0xef, 0x83, 0x5a, 0x05, 0x42, 0x11, 0x76, 0x34, 0x8b, + 0x2a, 0x9b, 0xda, 0x6a, 0x00, 0x21, 0x15, 0xb1, 0xc0, 0x69, 0x85, 0x2a, 0x01, 0xad, 0x0c, 0x08, + 0x89, 0x8d, 0x35, 0x76, 0xa6, 0xae, 0x15, 0xdb, 0x63, 0x79, 0x9c, 0x28, 0x5d, 0xb1, 0x65, 0xc9, + 0x13, 0x20, 0xd6, 0x88, 0x07, 0xe9, 0x0a, 0x75, 0x89, 0x58, 0x18, 0x94, 0xbe, 0x41, 0x9e, 0x00, + 0xcd, 0x25, 0x97, 0x96, 0x4a, 0x14, 0x10, 0xab, 0x1c, 0xcf, 0x39, 0xff, 0xdf, 0x99, 0x39, 0x7f, + 0x7b, 0x02, 0xd6, 0x7b, 0x98, 0xc6, 0x84, 0x5a, 0x69, 0x46, 0x0e, 0xc2, 0x08, 0x53, 0x6b, 0xd8, + 0xb1, 0x62, 0xd2, 0xc3, 0x11, 0x75, 0x53, 0x94, 0xa1, 0x98, 0x9a, 0x69, 0x46, 0x72, 0xa2, 0x69, + 0xa2, 0xce, 0x9c, 0xd6, 0x99, 0xc3, 0xce, 0xda, 0x6a, 0x40, 0x02, 0xc2, 0xd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0xd9, 0xee, 0x32, 0xd6, 0xd7, 0xc2, 0x58, 0x0f, 0xc2, 0xfc, 0x70, 0xe0, + 0x99, 0x3e, 0x89, 0x2d, 0x69, 0x95, 0xf8, 0xd9, 0xa0, 0xbd, 0xbe, 0x95, 0x1f, 0xa5, 0x98, 0x9a, + 0xbb, 0x49, 0x3e, 0x29, 0x8c, 0x15, 0xd1, 0x75, 0x4e, 0x82, 0x8e, 0x1a, 0x87, 0xc9, 0x13, 0x1e, + 0xf3, 0x1e, 0x68, 0x34, 0xed, 0x51, 0xf9, 0xcb, 0x1e, 0x33, 0x12, 0xeb, 0x81, 0x46, 0xa2, 0x87, + 0x3c, 0xe0, 0xfb, 0x0a, 0x00, 0x73, 0xbb, 0xb4, 0x36, 0xa8, 0x65, 0x38, 0x70, 0xf1, 0x88, 0x1f, + 0x4c, 0xb5, 0x57, 0xe6, 0x03, 0x12, 0xeb, 0xd0, 0x59, 0xca, 0x70, 0xb0, 0x33, 0xd2, 0xc8, 0x99, + 0x31, 0x88, 0x2d, 0xee, 0xff, 0xde, 0x16, 0xc7, 0x85, 0xa1, 0x3e, 0x9d, 0x9e, 0xf9, 0x97, 0x33, + 0x21, 0x67, 0x66, 0x52, 0xfd, 0xe3, 0x86, 0xd3, 0x01, 0x5c, 0x72, 0x40, 0x03, 0xa0, 0xce, 0x5e, + 0xbf, 0x73, 0xbe, 0x54, 0xff, 0xa1, 0x2f, 0x9f, 0xaa, 0x60, 0x79, 0xf1, 0x75, 0xd5, 0x1e, 0x02, + 0x95, 0xfa, 0x59, 0x98, 0xe6, 0x6e, 0xd8, 0xe3, 0xe6, 0x28, 0x76, 0x6b, 0x5c, 0x18, 0xf5, 0xe7, + 0x7c, 0x71, 0x77, 0x7b, 0x52, 0x18, 0x57, 0x05, 0x77, 0x56, 0x06, 0x9d, 0xba, 0x88, 0x77, 0x7b, + 0xda, 0x26, 0x50, 0x11, 0xed, 0xbb, 0x3e, 0x19, 0x24, 0x39, 0x77, 0x4b, 0xb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x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xeb, 0x0c, 0x25, 0x06, 0x4a, 0x06, 0x00, + 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/legacy/v5/models.go b/x/profiles/legacy/v5/types/models_profile.go similarity index 79% rename from x/profiles/legacy/v5/models.go rename to x/profiles/legacy/v5/types/models_profile.go index 3630ae8d47..a97b8821e7 100644 --- a/x/profiles/legacy/v5/models.go +++ b/x/profiles/legacy/v5/types/models_profile.go @@ -1,11 +1,14 @@ -package v5 +package types // DONTCOVER import ( "encoding/json" + "fmt" "time" + "github.com/desmos-labs/desmos/v4/x/commons" + "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -13,6 +16,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/ghodss/yaml" + "github.com/gogo/protobuf/proto" ) var ( @@ -20,6 +24,41 @@ var ( _ exported.VestingAccount = (*Profile)(nil) ) +// NewProfile builds a new profile having the given DTag, creator and creation date +func NewProfile(dTag string, nickname, bio string, pictures Pictures, creationDate time.Time, account authtypes.AccountI) (*Profile, error) { + // Make sure myAccount is a proto.Message, e.g. a BaseAccount etc. + protoAccount, ok := account.(proto.Message) + if !ok { + return nil, fmt.Errorf("the given account cannot be serialized using Protobuf") + } + + myAccountAny, err := codectypes.NewAnyWithValue(protoAccount) + if err != nil { + return nil, err + } + + return &Profile{ + DTag: dTag, + Nickname: nickname, + Bio: bio, + Pictures: pictures, + CreationDate: creationDate, + Account: myAccountAny, + }, nil +} + +// NewProfileFromAccount allows to build a new Profile instance from a provided DTag, and account and a creation time +func NewProfileFromAccount(dTag string, account authtypes.AccountI, creationTime time.Time) (*Profile, error) { + return NewProfile( + dTag, + "", + "", + NewPictures("", ""), + creationTime, + account, + ) +} + // GetAccount returns the underlying account as an authtypes.AccountI instance func (p *Profile) GetAccount() authtypes.AccountI { return p.Account.GetCachedValue().(authtypes.AccountI) @@ -283,3 +322,32 @@ func (p *Profile) MarshalJSON() ([]byte, error) { CreationDate: p.CreationDate, }) } + +// ------------------------------------------------------------------------------------------------------------------- + +// NewPictures is a constructor function for Pictures +func NewPictures(profile, cover string) Pictures { + return Pictures{ + Profile: profile, + Cover: cover, + } +} + +// Validate check the validity of the Pictures +func (pic Pictures) Validate() error { + if pic.Profile != "" { + valid := commons.IsURIValid(pic.Profile) + if !valid { + return fmt.Errorf("invalid profile picture uri provided") + } + } + + if pic.Cover != "" { + valid := commons.IsURIValid(pic.Cover) + if !valid { + return fmt.Errorf("invalid profile cover uri provided") + } + } + + return nil +} diff --git a/x/profiles/legacy/v5/models_profile.pb.go b/x/profiles/legacy/v5/types/models_profile.pb.go similarity index 87% rename from x/profiles/legacy/v5/models_profile.pb.go rename to x/profiles/legacy/v5/types/models_profile.pb.go index 67703d69e2..75ac2c885d 100644 --- a/x/profiles/legacy/v5/models_profile.pb.go +++ b/x/profiles/legacy/v5/types/models_profile.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: desmos/profiles/v2/models_profile.proto -package v5 +package types import ( fmt "fmt" @@ -143,38 +143,38 @@ func init() { } var fileDescriptor_089dd63594c4b06b = []byte{ - // 485 bytes of a gzipped FileDescriptorProto + // 489 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0xb1, 0x6e, 0xd3, 0x40, 0x1c, 0xc6, 0x6d, 0x92, 0x36, 0xee, 0x35, 0x14, 0x74, 0x44, 0xaa, 0x89, 0x90, 0x2f, 0xba, 0x01, - 0x2a, 0x41, 0x7d, 0x52, 0xa0, 0x4b, 0xc4, 0x52, 0xab, 0x0b, 0x13, 0xc5, 0xea, 0xc4, 0x12, 0x9d, - 0x9d, 0xab, 0x31, 0xd8, 0xbe, 0xc8, 0xbe, 0x58, 0xe4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 0x99, 0x74, + 0xa9, 0x23, 0x99, 0xfa, 0x9f, 0x1d, 0x9f, 0xff, 0x46, 0xba, 0x3b, 0x54, 0x6f, 0xc7, 0x54, 0xb0, + 0x99, 0xf1, 0x7d, 0x85, 0xb4, 0x8b, 0x15, 0xd2, 0xf0, 0x67, 0x60, 0xa8, 0xdd, 0xe0, 0x0b, 0x30, + 0xe8, 0x76, 0x6e, 0xbf, 0xc4, 0x8e, 0x03, 0xeb, 0x0a, 0xed, 0x75, 0x8b, 0x4a, 0x01, 0xbb, 0x0a, + 0x81, 0x4f, 0xc1, 0x96, 0xcf, 0x0b, 0x96, 0x75, 0xd5, 0x3f, 0xac, 0x2b, 0x34, 0xec, 0xc6, 0x37, + 0xcf, 0xd8, 0x95, 0xf2, 0xcc, 0xb8, 0x58, 0x21, 0xfd, 0xef, 0x0a, 0xe9, 0xce, 0x87, 0xcb, 0xb5, + 0xa5, 0x5f, 0xad, 0x2d, 0xfd, 0xcf, 0xda, 0xd2, 0xcf, 0x37, 0x96, 0x76, 0xb5, 0xb1, 0xb4, 0x5f, + 0x1b, 0x4b, 0xfb, 0xf8, 0x26, 0x08, 0xc5, 0xa7, 0xa5, 0x67, 0xfb, 0x3c, 0x26, 0xb2, 0xbd, 0xc3, + 0x88, 0x7a, 0x79, 0x77, 0x26, 0xc5, 0x2b, 0xf2, 0xf5, 0xe6, 0xaf, 0x8e, 0x58, 0x40, 0xfd, 0x92, + 0x14, 0xaf, 0x89, 0x28, 0x53, 0x96, 0x7b, 0xdb, 0x6d, 0x21, 0x2f, 0xff, 0x05, 0x00, 0x00, 0xff, + 0xff, 0xb1, 0x85, 0xe1, 0x0d, 0xff, 0x02, 0x00, 0x00, } func (this *Pictures) Equal(that interface{}) bool { diff --git a/x/profiles/legacy/v6/store.go b/x/profiles/legacy/v6/store.go new file mode 100644 index 0000000000..344200983c --- /dev/null +++ b/x/profiles/legacy/v6/store.go @@ -0,0 +1,263 @@ +package v6 + +import ( + "fmt" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + + v5types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" + + "github.com/cosmos/cosmos-sdk/store/prefix" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + "github.com/desmos-labs/desmos/v4/x/profiles/types" +) + +// MigrateStore performs in-place store migrations from v5 to v6 +// The migration includes: +// +// - migrating all the profiles to have the proper Protobuf type +// - add the expiration date to all application links +func MigrateStore(ctx sdk.Context, ak authkeeper.AccountKeeper, storeKey sdk.StoreKey, amino *codec.LegacyAmino, cdc codec.BinaryCodec) error { + store := ctx.KVStore(storeKey) + + // Migrate the profiles + err := migrateProfiles(ctx, ak) + if err != nil { + return err + } + + // Migrate all the application links + err = migrateApplicationLinks(store, cdc) + if err != nil { + return err + } + + // Migrate all the chain links + err = migrateChainLinks(store, cdc) + if err != nil { + return err + } + + return nil +} + +// migrateProfiles migrates the profiles from v5 to v6 to properly update the Protobuf name +func migrateProfiles(ctx sdk.Context, ak authkeeper.AccountKeeper) error { + var profiles []*v5types.Profile + ak.IterateAccounts(ctx, func(account authtypes.AccountI) (stop bool) { + if profile, ok := account.(*v5types.Profile); ok { + profiles = append(profiles, profile) + } + return false + }) + + for _, profile := range profiles { + // Convert the profile + v6Profile, err := types.NewProfile( + profile.DTag, + profile.Nickname, + profile.Bio, + types.NewPictures(profile.Pictures.Profile, profile.Pictures.Cover), + profile.CreationDate, + profile.GetAccount(), + ) + if err != nil { + return err + } + + // Set the account + ak.SetAccount(ctx, v6Profile) + } + + return nil +} + +// migrateApplicationLinks migrates the application links from v5 to v6 adding the expiration date properly +func migrateApplicationLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { + appLinksStore := prefix.NewStore(store, types.ApplicationLinkPrefix) + iterator := appLinksStore.Iterator(nil, nil) + + var applicationLinks []v5types.ApplicationLink + for ; iterator.Valid(); iterator.Next() { + var applicationLink v5types.ApplicationLink + err := cdc.Unmarshal(iterator.Value(), &applicationLink) + if err != nil { + return err + } + applicationLinks = append(applicationLinks, applicationLink) + } + + for _, v5Link := range applicationLinks { + // Migrate the link + v6Link := types.NewApplicationLink( + v5Link.User, + convertApplicationLinkData(v5Link.Data), + convertApplicationLinkState(v5Link.State), + convertApplicationLinkOracleRequest(v5Link.OracleRequest), + convertApplicationLinkResult(v5Link.Result), + v5Link.CreationTime, + v5Link.CreationTime.Add(types.DefaultAppLinksValidityDuration), + ) + + // Store the application link + userApplicationLinkKey := types.UserApplicationLinkKey(v6Link.User, v6Link.Data.Application, v6Link.Data.Username) + store.Set(userApplicationLinkKey, cdc.MustMarshal(&v6Link)) + + // Store the expiration time + applicationLinkExpiringTimeKey := types.ApplicationLinkExpiringTimeKey(v6Link.ExpirationTime, v6Link.OracleRequest.ClientID) + store.Set(applicationLinkExpiringTimeKey, []byte(v6Link.OracleRequest.ClientID)) + } + + return nil +} + +func convertApplicationLinkData(v5Data v5types.Data) types.Data { + return types.NewData(v5Data.Application, v5Data.Username) +} + +func convertApplicationLinkState(v5State v5types.ApplicationLinkState) types.ApplicationLinkState { + switch v5State { + case v5types.ApplicationLinkStateInitialized: + return types.ApplicationLinkStateInitialized + case v5types.AppLinkStateVerificationStarted: + return types.AppLinkStateVerificationStarted + case v5types.AppLinkStateVerificationError: + return types.AppLinkStateVerificationError + case v5types.AppLinkStateVerificationSuccess: + return types.AppLinkStateVerificationSuccess + case v5types.AppLinkStateVerificationTimedOut: + return types.AppLinkStateVerificationTimedOut + default: + panic(fmt.Errorf("invalid application link state: %s", v5State)) + } +} + +func convertApplicationLinkOracleRequest(v5Request v5types.OracleRequest) types.OracleRequest { + return types.NewOracleRequest( + v5Request.ID, + v5Request.OracleScriptID, + types.NewOracleRequestCallData(v5Request.CallData.Application, v5Request.CallData.CallData), + v5Request.ClientID, + ) +} + +func convertApplicationLinkResult(v5Result *v5types.Result) *types.Result { + if v5Result == nil { + return nil + } + + switch result := v5Result.Sum.(type) { + case *v5types.Result_Success_: + return types.NewSuccessResult(result.Success.Value, result.Success.Signature) + + case *v5types.Result_Failed_: + return types.NewErrorResult(result.Failed.Error) + + default: + panic(fmt.Errorf("invalid result type: %T", v5Result.Sum)) + } +} + +// migrateChainLinks migrates the chain links from v5 to v6 by changing the various Protobuf interface types +func migrateChainLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { + appLinksStore := prefix.NewStore(store, types.ChainLinksPrefix) + iterator := appLinksStore.Iterator(nil, nil) + + var applicationLinks []v5types.ChainLink + for ; iterator.Valid(); iterator.Next() { + var applicationLink v5types.ChainLink + err := cdc.Unmarshal(iterator.Value(), &applicationLink) + if err != nil { + return err + } + applicationLinks = append(applicationLinks, applicationLink) + } + + for _, v5Link := range applicationLinks { + // Migrate the link + v6Link := types.NewChainLink( + v5Link.User, + convertChainLinkAddressData(v5Link.GetAddressData()), + convertChainLinkProof(v5Link.Proof, cdc), + types.NewChainConfig(v5Link.ChainConfig.Name), + v5Link.CreationTime, + ) + + // Store the chain link + userApplicationLinkKey := types.ChainLinksStoreKey(v6Link.User, v6Link.ChainConfig.Name, v6Link.GetAddressData().GetValue()) + store.Set(userApplicationLinkKey, cdc.MustMarshal(&v6Link)) + } + + return nil +} + +func convertChainLinkAddressData(v5Signature v5types.AddressData) types.AddressData { + switch address := v5Signature.(type) { + case *v5types.Bech32Address: + return types.NewBech32Address(address.Value, address.Prefix) + case *v5types.Base58Address: + return types.NewBase58Address(address.Value) + case *v5types.HexAddress: + return types.NewHexAddress(address.Value, address.Prefix) + default: + panic(fmt.Errorf("invalid signature type: %T", v5Signature)) + } +} + +func convertChainLinkProof(v5Proof v5types.Proof, cdc codec.BinaryCodec) types.Proof { + var pubKey cryptotypes.PubKey + err := cdc.UnpackAny(v5Proof.PubKey, &pubKey) + if err != nil { + panic(err) + } + + var v6Signature types.SignatureData + v6SignatureAny := convertChainLinkSignatureData(v5Proof.Signature, cdc) + err = cdc.UnpackAny(v6SignatureAny, &v6Signature) + if err != nil { + panic(err) + } + + return types.NewProof(pubKey, v6Signature, v5Proof.PlainText) + +} + +func convertChainLinkSignatureData(data *codectypes.Any, cdc codec.BinaryCodec) *codectypes.Any { + var v5Signature v5types.SignatureData + err := cdc.UnpackAny(data, &v5Signature) + if err != nil { + panic(err) + } + + var signatureAny *codectypes.Any + switch signature := v5Signature.(type) { + case *v5types.SingleSignatureData: + v6Signature := &types.SingleSignatureData{Signature: signature.Signature, Mode: signature.Mode} + signatureAny, err = codectypes.NewAnyWithValue(v6Signature) + if err != nil { + panic(err) + } + + case *v5types.MultiSignatureData: + sigsAnys := make([]*codectypes.Any, len(signature.Signatures)) + for i, signature := range signature.Signatures { + sigsAnys[i] = convertChainLinkSignatureData(signature, cdc) + } + + v6Signature := &types.MultiSignatureData{BitArray: signature.BitArray, Signatures: sigsAnys} + signatureAny, err = codectypes.NewAnyWithValue(v6Signature) + if err != nil { + panic(err) + } + + } + + return signatureAny + +} diff --git a/x/profiles/legacy/v6/store_test.go b/x/profiles/legacy/v6/store_test.go new file mode 100644 index 0000000000..ac18064561 --- /dev/null +++ b/x/profiles/legacy/v6/store_test.go @@ -0,0 +1,252 @@ +package v6_test + +import ( + "encoding/hex" + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + + v5types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" + v6 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v6" + + "github.com/desmos-labs/desmos/v4/testutil/profilestesting" + + "github.com/cosmos/cosmos-sdk/store" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + dbm "github.com/tendermint/tm-db" + + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/stretchr/testify/require" + + "github.com/desmos-labs/desmos/v4/app" + "github.com/desmos-labs/desmos/v4/x/profiles/types" +) + +func buildContext( + keys map[string]*sdk.KVStoreKey, tKeys map[string]*sdk.TransientStoreKey, memKeys map[string]*sdk.MemoryStoreKey, +) sdk.Context { + db := dbm.NewMemDB() + cms := store.NewCommitMultiStore(db) + for _, key := range keys { + cms.MountStoreWithDB(key, sdk.StoreTypeIAVL, db) + } + for _, tKey := range tKeys { + cms.MountStoreWithDB(tKey, sdk.StoreTypeTransient, db) + } + for _, memKey := range memKeys { + cms.MountStoreWithDB(memKey, sdk.StoreTypeMemory, nil) + } + + err := cms.LoadLatestVersion() + if err != nil { + panic(err) + } + + return sdk.NewContext(cms, tmproto.Header{}, false, log.NewNopLogger()) +} + +func TestMigrateStore(t *testing.T) { + cdc, legacyAmino := app.MakeCodecs() + + // Build all the necessary keys + keys := sdk.NewKVStoreKeys(authtypes.StoreKey, types.StoreKey) + tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + + // Build the x/auth keeper + paramsKeeper := paramskeeper.NewKeeper( + cdc, + legacyAmino, + keys[paramstypes.StoreKey], + tKeys[paramstypes.TStoreKey], + ) + authKeeper := authkeeper.NewAccountKeeper( + cdc, + keys[authtypes.StoreKey], + paramsKeeper.Subspace(authtypes.ModuleName), + authtypes.ProtoBaseAccount, + app.GetMaccPerms(), + ) + + pubKey := secp256k1.GenPrivKey().PubKey() + testCases := []struct { + name string + store func(ctx sdk.Context) + shouldErr bool + check func(ctx sdk.Context) + }{ + { + name: "profiles are migrated properly", + store: func(ctx sdk.Context) { + // Store a profile + profile, err := v5types.NewProfile( + "john_doe", + "John Doe", + "My name if John Doe", + v5types.Pictures{ + Profile: "", + Cover: "", + }, + time.Date(2020, 1, 1, 0, 0, 0, 00, time.UTC), + profilestesting.AccountFromAddr("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), + ) + require.NoError(t, err) + authKeeper.SetAccount(ctx, profile) + }, + check: func(ctx sdk.Context) { + // Check the profile to make sure it contains the same data + v6Profile, err := types.NewProfile( + "john_doe", + "John Doe", + "My name if John Doe", + types.NewPictures("", ""), + time.Date(2020, 1, 1, 0, 0, 0, 00, time.UTC), + profilestesting.AccountFromAddr("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), + ) + require.NoError(t, err) + + sdkAddr, err := sdk.AccAddressFromBech32("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf") + require.NoError(t, err) + + account := authKeeper.GetAccount(ctx, sdkAddr) + profile, ok := account.(*types.Profile) + require.True(t, ok) + require.Equal(t, v6Profile, profile) + }, + }, + { + name: "application links are migrated properly", + store: func(ctx sdk.Context) { + kvStore := ctx.KVStore(keys[types.StoreKey]) + + // Store an application link + link := v5types.NewApplicationLink( + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + v5types.NewData("twitter", "twitteruser"), + v5types.ApplicationLinkStateInitialized, + v5types.NewOracleRequest( + 0, + 1, + v5types.NewOracleRequestCallData("twitter", "calldata"), + "client_id", + ), + nil, + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), + ) + kvStore.Set(types.UserApplicationLinkKey("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", "twitter", "twitteruser"), cdc.MustMarshal(&link)) + }, + check: func(ctx sdk.Context) { + kvStore := ctx.KVStore(keys[types.StoreKey]) + + // Check the application links + linkKey := types.UserApplicationLinkKey( + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + "twitter", + "twitteruser", + ) + + var stored types.ApplicationLink + cdc.MustUnmarshal(kvStore.Get(linkKey), &stored) + require.Equal(t, types.NewApplicationLink( + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + types.NewData("twitter", "twitteruser"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("twitter", "calldata"), + "client_id", + ), + nil, + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + ), stored) + + // Check the application link expiration time + require.Equal(t, []byte("client_id"), kvStore.Get(types.ApplicationLinkExpiringTimeKey( + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + "client_id", + ))) + }, + }, + { + name: "chain links are migrated properly", + store: func(ctx sdk.Context) { + kvStore := ctx.KVStore(keys[types.StoreKey]) + + sig, err := hex.DecodeString("1234") + require.NoError(t, err) + + chainLink := v5types.NewChainLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + v5types.NewBech32Address("cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", "cosmos"), + v5types.NewProof( + pubKey, + &v5types.SingleSignatureData{ + Mode: signing.SignMode_SIGN_MODE_DIRECT, + Signature: sig, + }, + "plain_text", + ), + v5types.NewChainConfig("cosmos"), + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + ) + kvStore.Set( + types.ChainLinksStoreKey( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + "cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", + ), + cdc.MustMarshal(&chainLink), + ) + }, + shouldErr: false, + check: func(ctx sdk.Context) { + kvStore := ctx.KVStore(keys[types.StoreKey]) + + var stored types.ChainLink + cdc.MustUnmarshal(kvStore.Get(types.ChainLinksStoreKey( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + "cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", + )), &stored) + require.Equal(t, types.NewChainLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + types.NewBech32Address("cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", "cosmos"), + types.NewProof(pubKey, profilestesting.SingleSignatureProtoFromHex("1234"), "plain_text"), + types.NewChainConfig("cosmos"), + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + ), stored) + }, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + ctx := buildContext(keys, tKeys, memKeys) + if tc.store != nil { + tc.store(ctx) + } + + err := v6.MigrateStore(ctx, authKeeper, keys[types.StoreKey], legacyAmino, cdc) + if tc.shouldErr { + require.Error(t, err) + } else { + require.NoError(t, err) + if tc.check != nil { + tc.check(ctx) + } + } + }) + } +} diff --git a/x/profiles/module.go b/x/profiles/module.go index c479dbacea..7863f07182 100644 --- a/x/profiles/module.go +++ b/x/profiles/module.go @@ -6,6 +6,9 @@ import ( "fmt" "math/rand" + v4 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types" + v5 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" + feeskeeper "github.com/desmos-labs/desmos/v4/x/fees/keeper" "github.com/cosmos/cosmos-sdk/client" @@ -24,13 +27,12 @@ import ( "github.com/desmos-labs/desmos/v4/x/profiles/client/cli" "github.com/desmos-labs/desmos/v4/x/profiles/keeper" - v4 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4" "github.com/desmos-labs/desmos/v4/x/profiles/simulation" "github.com/desmos-labs/desmos/v4/x/profiles/types" ) const ( - consensusVersion = 6 + consensusVersion = 7 ) // type check to ensure the interface is properly implemented @@ -91,6 +93,7 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { // RegisterInterfaces registers interfaces and implementations of the profiles module. func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { v4.RegisterInterfaces(registry) + v5.RegisterInterfaces(registry) types.RegisterInterfaces(registry) } @@ -110,12 +113,16 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - m := keeper.NewMigrator(am.ak, am.keeper, cfg.QueryServer()) + m := keeper.NewMigrator(am.ak, am.keeper) err := cfg.RegisterMigration(types.ModuleName, 4, m.Migrate4to5) if err != nil { panic(err) } - err = cfg.RegisterMigration(types.ModuleName, 5, m.Migrate5To6) + err = cfg.RegisterMigration(types.ModuleName, 5, m.Migrate5to6) + if err != nil { + panic(err) + } + err = cfg.RegisterMigration(types.ModuleName, 6, m.Migrate6to7) if err != nil { panic(err) } diff --git a/x/profiles/types/models_dtag_requests.pb.go b/x/profiles/types/models_dtag_requests.pb.go index 4751d14be2..be2fb6c01b 100644 --- a/x/profiles/types/models_dtag_requests.pb.go +++ b/x/profiles/types/models_dtag_requests.pb.go @@ -80,30 +80,29 @@ func init() { } var fileDescriptor_3ee5a4443f48e795 = []byte{ - // 355 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xb1, 0x4e, 0xeb, 0x30, - 0x14, 0x86, 0xe3, 0x7b, 0xa5, 0xea, 0xde, 0x94, 0x0a, 0x91, 0x76, 0x28, 0x1d, 0x62, 0x94, 0x05, - 0x10, 0x6a, 0x2c, 0x54, 0xa6, 0x8e, 0x15, 0x5b, 0xb7, 0xa8, 0x13, 0x4b, 0xe4, 0x24, 0xa7, 0x69, - 0x44, 0x12, 0x07, 0xdb, 0x8d, 0xe8, 0x1b, 0x30, 0x32, 0x32, 0xf6, 0x71, 0x18, 0x18, 0x3a, 0x32, - 0x45, 0x28, 0x5d, 0x98, 0xfb, 0x04, 0x28, 0x71, 0x0a, 0x02, 0x89, 0xed, 0xfc, 0xe7, 0xff, 0xce, - 0xb1, 0xcf, 0xaf, 0x0f, 0x03, 0x10, 0x09, 0x13, 0x24, 0xe3, 0x6c, 0x1e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cb, 0xf9, 0x84, 0xc6, 0x07, 0x0f, 0x6b, 0xac, 0x3d, 0xad, 0x31, 0x7a, 0x5f, 0x63, - 0x34, 0x99, 0x3e, 0x97, 0x26, 0xda, 0x94, 0x26, 0x7a, 0x2b, 0x4d, 0xf4, 0xb8, 0x35, 0xb5, 0xcd, - 0xd6, 0xd4, 0x5e, 0xb7, 0xa6, 0x76, 0x73, 0x19, 0x46, 0x72, 0xb1, 0xf4, 0x6c, 0x9f, 0x25, 0x44, - 0x05, 0x34, 0x8c, 0xa9, 0x27, 0x9a, 0x9a, 0xe4, 0x57, 0xe4, 0xfe, 0x2b, 0x31, 0xb9, 0xca, 0x40, - 0x78, 0xad, 0x3a, 0xa2, 0xd1, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, 0x23, 0x2c, 0x3c, 0x01, - 0x02, 0x00, 0x00, + // 339 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x91, 0x31, 0x4f, 0xeb, 0x30, + 0x10, 0x80, 0xe3, 0xf7, 0xa4, 0xea, 0xbd, 0x94, 0x0a, 0x91, 0x76, 0x28, 0x1d, 0x62, 0x94, 0x05, + 0x18, 0x1a, 0x0b, 0x95, 0xa9, 0x63, 0xc5, 0xd6, 0x2d, 0xea, 0xc4, 0x12, 0x39, 0xcd, 0xd5, 0x44, + 0x4a, 0xea, 0x60, 0xbb, 0x11, 0xfd, 0x07, 0x8c, 0x8c, 0x8c, 0xfd, 0x39, 0x0c, 0x0c, 0x1d, 0x99, + 0x22, 0x94, 0x2e, 0xcc, 0xfd, 0x05, 0x28, 0x76, 0x0a, 0x82, 0xed, 0xee, 0xbe, 0xef, 0xce, 0xa7, + 0xb3, 0x3d, 0x8c, 0x41, 0x66, 0x5c, 0x92, 0x5c, 0xf0, 0x45, 0x92, 0x82, 0x24, 0xc5, 0x88, 0x64, + 0x3c, 0x86, 0x54, 0x86, 0xb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 0xb9, 0xe8, 0x69, 0xe7, 0x5a, 0xdb, + 0x9d, 0x6b, 0xbd, 0xed, 0x5c, 0xeb, 0xf6, 0x8a, 0x25, 0xea, 0x6e, 0x15, 0xf9, 0x73, 0x9e, 0x11, + 0x73, 0xf4, 0x61, 0x4a, 0x23, 0xd9, 0xc4, 0xa4, 0xb8, 0x26, 0x0f, 0xdf, 0x9f, 0xa6, 0xd6, 0x39, + 0xc8, 0xa8, 0xa5, 0x4f, 0x34, 0xfa, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x3c, 0xf2, 0x28, 0x40, 0xd4, + 0x01, 0x00, 0x00, } func (this *DTagTransferRequest) Equal(that interface{}) bool { diff --git a/x/profiles/types/models_params.go b/x/profiles/types/models_params.go index 85871b29fe..d4c8633769 100644 --- a/x/profiles/types/models_params.go +++ b/x/profiles/types/models_params.go @@ -24,7 +24,7 @@ var ( DefaultMinDTagLength = sdk.NewInt(3) DefaultMaxDTagLength = sdk.NewInt(30) DefaultMaxBioLength = sdk.NewInt(1000) - DefaultAppLinksValidityDuration = time.Hour*24*7*4*6 + FourteenDaysCorrectionFactor // This duration is equal to 5.9835 months time. Equivalent to 262080 minutes + DefaultAppLinksValidityDuration = time.Hour * 24 * 365 // 1 year ) // Parameters store keys diff --git a/x/relationships/legacy/v1/store_test.go b/x/relationships/legacy/v1/store_test.go index 918ab88d6b..ff90602a43 100644 --- a/x/relationships/legacy/v1/store_test.go +++ b/x/relationships/legacy/v1/store_test.go @@ -3,6 +3,8 @@ package v1_test import ( "testing" + v4types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types" + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -27,27 +29,27 @@ func TestMigrateStore(t *testing.T) { store: func(ctx sdk.Context) { store := ctx.KVStore(storeKey) - blockBz := cdc.MustMarshal(&profilesv4.UserBlock{ + blockBz := cdc.MustMarshal(&v4types.UserBlock{ Blocker: "blocker", Blocked: "blocked", Reason: "reason", SubspaceID: "", }) - store.Set(profilesv4.UserBlockStoreKey("blocker", "", "blocked"), blockBz) + store.Set(v4types.UserBlockStoreKey("blocker", "", "blocked"), blockBz) - relBz := cdc.MustMarshal(&profilesv4.Relationship{ + relBz := cdc.MustMarshal(&v4types.Relationship{ Creator: "user", Recipient: "recipient", SubspaceID: "", }) - store.Set(profilesv4.RelationshipsStoreKey("user", "", "recipient"), relBz) + store.Set(v4types.RelationshipsStoreKey("user", "", "recipient"), relBz) - relBz = cdc.MustMarshal(&profilesv4.Relationship{ + relBz = cdc.MustMarshal(&v4types.Relationship{ Creator: "user", Recipient: "recipient", SubspaceID: "2", }) - store.Set(profilesv4.RelationshipsStoreKey("user", "2", "recipient"), relBz) + store.Set(v4types.RelationshipsStoreKey("user", "2", "recipient"), relBz) }, shouldErr: false, check: func(ctx sdk.Context) { From 1cd567c635f368c091751732299b311c05d3fbd1 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 14 Jul 2022 16:37:00 +0800 Subject: [PATCH 103/112] test: fixed test sample of chain link cmd --- app/desmos/cmd/chainlink/create_json_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/desmos/cmd/chainlink/create_json_test.go b/app/desmos/cmd/chainlink/create_json_test.go index 7ec6bb08ee..5581d81e93 100644 --- a/app/desmos/cmd/chainlink/create_json_test.go +++ b/app/desmos/cmd/chainlink/create_json_test.go @@ -179,7 +179,7 @@ func (suite *CreateJSONChainLinkTestSuite) TestMultiSignatureAccount() { suite.GetPubKeyFromTxFile(txFile), profilestesting.MultiSignatureProtoFromAnyHex( suite.Codec, - "0a262f6465736d6f732e70726f66696c65732e76322e4d756c74695369676e61747572654461746112e9010a0508031201c0126f0a272f6465736d6f732e70726f66696c65732e76322e53696e676c655369676e6174757265446174611244087f124027fc4567818a29803ec13f429404c7131c818acc1954f512f3d71a3379e7ec741d25de8b142f61151652b06ef78aaeffd58707023e6e8dfbe98c990185016476126f0a272f6465736d6f732e70726f66696c65732e76322e53696e676c655369676e6174757265446174611244087f12409394c86630e7afb961899add8fc1a211d14b8cc38702c53caa701851557f35832c11e11510da4d676578a19b342865317547549b2b4bd78cdf809dafa55041f7", + "0a262f6465736d6f732e70726f66696c65732e76332e4d756c74695369676e61747572654461746112e9010a0508031201c0126f0a272f6465736d6f732e70726f66696c65732e76332e53696e676c655369676e6174757265446174611244087f124027fc4567818a29803ec13f429404c7131c818acc1954f512f3d71a3379e7ec741d25de8b142f61151652b06ef78aaeffd58707023e6e8dfbe98c990185016476126f0a272f6465736d6f732e70726f66696c65732e76332e53696e676c655369676e6174757265446174611244087f12409394c86630e7afb961899add8fc1a211d14b8cc38702c53caa701851557f35832c11e11510da4d676578a19b342865317547549b2b4bd78cdf809dafa55041f7", ), "7b226163636f756e745f6e756d626572223a2230222c22636861696e5f6964223a22636f736d6f73222c22666565223a7b22616d6f756e74223a5b5d2c22676173223a22323030303030227d2c226d656d6f223a226465736d6f73316e3833343574767a6b67336a756d6b6d3835397232717a3076367873633368656e7a6464636a222c226d736773223a5b7b2274797065223a22636f736d6f732d73646b2f4d7367566f7465222c2276616c7565223a7b226f7074696f6e223a312c2270726f706f73616c5f6964223a2231222c22766f746572223a22636f736d6f73316578646a6b6678756438797a7174767561336864643933787530676d656b356c343772387261227d7d5d2c2273657175656e6365223a2230227d", ), From 7e8cc9cd4b44fbf62d8805ff5468713a82538f5d Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Thu, 14 Jul 2022 11:47:25 +0200 Subject: [PATCH 104/112] fixed unit tests Signed-off-by: Riccardo Montagnin --- testutil/profilestesting/chain_links.go | 12 ++++++++++-- x/profiles/legacy/v5/store_test.go | 17 ++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/testutil/profilestesting/chain_links.go b/testutil/profilestesting/chain_links.go index 935329c776..36dac06577 100644 --- a/testutil/profilestesting/chain_links.go +++ b/testutil/profilestesting/chain_links.go @@ -35,20 +35,28 @@ func (a ChainLinkAccount) ChainName() string { return a.chainName } +func (a ChainLinkAccount) PubKey() cryptotypes.PubKey { + return a.pubKey +} + func (a ChainLinkAccount) PubKeyAny() *codectypes.Any { return NewAny(a.pubKey) } +func (a ChainLinkAccount) Sign(value string) []byte { + bech32Sig, _ := a.privKey.Sign([]byte(value)) + return bech32Sig +} + func (a ChainLinkAccount) Bech32Address() *types.Bech32Address { addr, _ := sdk.Bech32ifyAddressBytes(a.bech32Prefix, a.pubKey.Address()) return types.NewBech32Address(addr, a.bech32Prefix) } func (a ChainLinkAccount) Bech32SignatureData(signedValue string) types.SignatureData { - bech32Sig, _ := a.privKey.Sign([]byte(signedValue)) return &types.SingleSignatureData{ Mode: signing.SignMode_SIGN_MODE_TEXTUAL, - Signature: bech32Sig, + Signature: a.Sign(signedValue), } } diff --git a/x/profiles/legacy/v5/store_test.go b/x/profiles/legacy/v5/store_test.go index 21567c2395..91825e6c89 100644 --- a/x/profiles/legacy/v5/store_test.go +++ b/x/profiles/legacy/v5/store_test.go @@ -135,8 +135,19 @@ func TestMigrateStore(t *testing.T) { kvStore := ctx.KVStore(keys[types.StoreKey]) // Store the chain link - chainLink := account.GetBech32ChainLink( + addr, _ := sdk.Bech32ifyAddressBytes("cosmos", account.PubKey().Address()) + chainLink := v5types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + v5types.NewBech32Address(addr, "cosmos"), + v5types.NewProof( + account.PubKey(), + &v5types.SingleSignatureData{ + Mode: signing.SignMode_SIGN_MODE_TEXTUAL, + Signature: account.Sign("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + }, + hex.EncodeToString([]byte("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47")), + ), + v5types.NewChainConfig(account.ChainName()), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ) @@ -144,7 +155,7 @@ func TestMigrateStore(t *testing.T) { types.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", - "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", + account.Bech32Address().GetValue(), ), cdc.MustMarshal(&chainLink), ) @@ -154,7 +165,7 @@ func TestMigrateStore(t *testing.T) { key := types.ChainLinkOwnerKey( "cosmos", - "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", + account.Bech32Address().GetValue(), "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", ) require.Equal(t, []byte{0x01}, kvStore.Get(key)) From 189cfe1bbfed076b98db3c9af9b6474e4db53750 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 15 Jul 2022 07:54:18 +0200 Subject: [PATCH 105/112] updated ADR status Signed-off-by: Riccardo Montagnin --- docs/architecture/adr-004-application-links-expiration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture/adr-004-application-links-expiration.md b/docs/architecture/adr-004-application-links-expiration.md index df07a6e582..5c92e23ff1 100644 --- a/docs/architecture/adr-004-application-links-expiration.md +++ b/docs/architecture/adr-004-application-links-expiration.md @@ -11,7 +11,7 @@ ## Status -ACCEPTED Not Implemented +ACCEPTED Implemented ## Abstract From f0023540697ef8623ef42f6896c0d9179b4c0439 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 15 Jul 2022 08:00:06 +0200 Subject: [PATCH 106/112] slightly changed ADR Signed-off-by: Riccardo Montagnin --- docs/architecture/adr-004-application-links-expiration.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/architecture/adr-004-application-links-expiration.md b/docs/architecture/adr-004-application-links-expiration.md index 5c92e23ff1..b6c45c84e8 100644 --- a/docs/architecture/adr-004-application-links-expiration.md +++ b/docs/architecture/adr-004-application-links-expiration.md @@ -15,7 +15,7 @@ ACCEPTED Implemented ## Abstract -Currently when a user links a centralized application with their Desmos profile, the created link contains a timestamp of when it has been created. +Currently, when a user links a centralized application with their Desmos profile, the created link contains a timestamp of when it has been created. Since centralized applications' username can be switched and sold, we SHOULD implement an "expiration date" system on links. This means that after a certain amount of time passes, the link will be automatically marked deleted and the user has to connect it again in order to keep it valid. @@ -61,11 +61,10 @@ from the previous versions to the one that will include the additions contained (none known) -## Further Discussions - ## Test Cases [optional] + - The expired `AppLinks` are deleted correctly when they expire. -- + ## References - Issue [#516](https://github.com/desmos-labs/desmos/issues/516) From d41df0c3729c11ad6e1c299b5669f829c3687f7e Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 15 Jul 2022 09:03:44 +0200 Subject: [PATCH 107/112] added missing comments Signed-off-by: Riccardo Montagnin --- x/profiles/keeper/alias_functions.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go index f2fe0ab014..090022c63e 100644 --- a/x/profiles/keeper/alias_functions.go +++ b/x/profiles/keeper/alias_functions.go @@ -143,19 +143,32 @@ func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index i i := int64(0) for ; iterator.Valid(); iterator.Next() { + // This iterator has the following key and value structure: + // ExpiringAppLinkTimePrefix | Expiration Time | Client ID -> Client ID + // + // This means that in order to get the expired application links we need to: + // 1. Extract the Expiration Time from the iterator key + // 2. If the Expiration Time has passed, get the application link by using the Client ID from the iterator value + + // First, we remove the prefix from the key, so we are left with the Expiration Time and Client ID trimmedPrefixKey := bytes.TrimPrefix(iterator.Key(), types.ExpiringAppLinkTimePrefix) + + // Second, we remove the Client ID from the trimmed key, so we are left only with the Expiration Time expiringTime, err := sdk.ParseTimeBytes(bytes.TrimSuffix(trimmedPrefixKey, iterator.Value())) if err != nil { panic(err) } - // Skip if application link has been deleted already + // Third, we get the Client ID from the iterator value clientIDKey := types.ApplicationLinkClientIDKey(string(iterator.Value())) + + // Skip if application link has been deleted already if !store.Has(clientIDKey) { store.Delete(iterator.Key()) continue } + // Check if the expiration time has passed (the application link is expired) if ctx.BlockTime().After(expiringTime) { applicationKey := store.Get(clientIDKey) link := types.MustUnmarshalApplicationLink(k.cdc, store.Get(applicationKey)) From 95d22af40702a5df190be7095a496b1e34dd5c8d Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 15 Jul 2022 09:16:58 +0200 Subject: [PATCH 108/112] move benchmark tests Signed-off-by: Riccardo Montagnin --- ...per_app_links_benchmarks_test.go => abci_benchmarks_test.go} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename x/profiles/{keeper/keeper_app_links_benchmarks_test.go => abci_benchmarks_test.go} (99%) diff --git a/x/profiles/keeper/keeper_app_links_benchmarks_test.go b/x/profiles/abci_benchmarks_test.go similarity index 99% rename from x/profiles/keeper/keeper_app_links_benchmarks_test.go rename to x/profiles/abci_benchmarks_test.go index 4689c49071..7b976d176e 100644 --- a/x/profiles/keeper/keeper_app_links_benchmarks_test.go +++ b/x/profiles/abci_benchmarks_test.go @@ -1,4 +1,4 @@ -package keeper_test +package profiles_test import ( "math/rand" From 628932d7360e3552fc6ee0f6a37a909f0e4070e4 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 15 Jul 2022 09:38:31 +0200 Subject: [PATCH 109/112] fixed migration version comments Signed-off-by: Riccardo Montagnin --- x/profiles/legacy/v4/store.go | 2 +- x/profiles/legacy/v5/store.go | 2 +- x/profiles/legacy/v6/store.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x/profiles/legacy/v4/store.go b/x/profiles/legacy/v4/store.go index 882f0fae85..b2a1bdc255 100644 --- a/x/profiles/legacy/v4/store.go +++ b/x/profiles/legacy/v4/store.go @@ -18,7 +18,7 @@ import ( "github.com/desmos-labs/desmos/v4/x/profiles/types" ) -// MigrateStore performs in-place store migrations from v4 to v5 +// MigrateStore performs in-place store migrations from v4 to v5. // The migration includes: // // - migrating all the profiles to have the proper Protobuf type diff --git a/x/profiles/legacy/v5/store.go b/x/profiles/legacy/v5/store.go index bd8eba2927..091a20136a 100644 --- a/x/profiles/legacy/v5/store.go +++ b/x/profiles/legacy/v5/store.go @@ -10,7 +10,7 @@ import ( "github.com/desmos-labs/desmos/v4/x/profiles/types" ) -// MigrateStore performs in-place store migrations from v5 to v6 +// MigrateStore performs in-place store migrations from v5 to v6. // The migration includes: // // - add missing application links owner keys to allow reverse searches diff --git a/x/profiles/legacy/v6/store.go b/x/profiles/legacy/v6/store.go index 344200983c..9526dd513a 100644 --- a/x/profiles/legacy/v6/store.go +++ b/x/profiles/legacy/v6/store.go @@ -18,7 +18,7 @@ import ( "github.com/desmos-labs/desmos/v4/x/profiles/types" ) -// MigrateStore performs in-place store migrations from v5 to v6 +// MigrateStore performs in-place store migrations from v6 to v7. // The migration includes: // // - migrating all the profiles to have the proper Protobuf type From 25ced70cf860ad49bd546210b0a498ec144211b7 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 15 Jul 2022 10:02:33 +0200 Subject: [PATCH 110/112] improved migration comments Signed-off-by: Riccardo Montagnin --- x/profiles/legacy/v6/store.go | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/x/profiles/legacy/v6/store.go b/x/profiles/legacy/v6/store.go index 9526dd513a..9020d276bb 100644 --- a/x/profiles/legacy/v6/store.go +++ b/x/profiles/legacy/v6/store.go @@ -47,7 +47,8 @@ func MigrateStore(ctx sdk.Context, ak authkeeper.AccountKeeper, storeKey sdk.Sto return nil } -// migrateProfiles migrates the profiles from v5 to v6 to properly update the Protobuf name +// migrateProfiles migrates the profiles from v5 to v7 to properly update the Protobuf name. +// The migration from v5 to v6 is skipped because the two types are identical (from v5 to v6 no changes were made). func migrateProfiles(ctx sdk.Context, ak authkeeper.AccountKeeper) error { var profiles []*v5types.Profile ak.IterateAccounts(ctx, func(account authtypes.AccountI) (stop bool) { @@ -59,7 +60,7 @@ func migrateProfiles(ctx sdk.Context, ak authkeeper.AccountKeeper) error { for _, profile := range profiles { // Convert the profile - v6Profile, err := types.NewProfile( + v7Profile, err := types.NewProfile( profile.DTag, profile.Nickname, profile.Bio, @@ -72,13 +73,14 @@ func migrateProfiles(ctx sdk.Context, ak authkeeper.AccountKeeper) error { } // Set the account - ak.SetAccount(ctx, v6Profile) + ak.SetAccount(ctx, v7Profile) } return nil } -// migrateApplicationLinks migrates the application links from v5 to v6 adding the expiration date properly +// migrateApplicationLinks migrates the application links from v5 to v7 adding the expiration date properly. +// The migration from v5 to v6 is skipped because the two types are identical (from v5 to v6 no changes were made). func migrateApplicationLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { appLinksStore := prefix.NewStore(store, types.ApplicationLinkPrefix) iterator := appLinksStore.Iterator(nil, nil) @@ -95,7 +97,7 @@ func migrateApplicationLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { for _, v5Link := range applicationLinks { // Migrate the link - v6Link := types.NewApplicationLink( + v7Link := types.NewApplicationLink( v5Link.User, convertApplicationLinkData(v5Link.Data), convertApplicationLinkState(v5Link.State), @@ -106,12 +108,12 @@ func migrateApplicationLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { ) // Store the application link - userApplicationLinkKey := types.UserApplicationLinkKey(v6Link.User, v6Link.Data.Application, v6Link.Data.Username) - store.Set(userApplicationLinkKey, cdc.MustMarshal(&v6Link)) + userApplicationLinkKey := types.UserApplicationLinkKey(v7Link.User, v7Link.Data.Application, v7Link.Data.Username) + store.Set(userApplicationLinkKey, cdc.MustMarshal(&v7Link)) // Store the expiration time - applicationLinkExpiringTimeKey := types.ApplicationLinkExpiringTimeKey(v6Link.ExpirationTime, v6Link.OracleRequest.ClientID) - store.Set(applicationLinkExpiringTimeKey, []byte(v6Link.OracleRequest.ClientID)) + applicationLinkExpiringTimeKey := types.ApplicationLinkExpiringTimeKey(v7Link.ExpirationTime, v7Link.OracleRequest.ClientID) + store.Set(applicationLinkExpiringTimeKey, []byte(v7Link.OracleRequest.ClientID)) } return nil @@ -164,7 +166,8 @@ func convertApplicationLinkResult(v5Result *v5types.Result) *types.Result { } } -// migrateChainLinks migrates the chain links from v5 to v6 by changing the various Protobuf interface types +// migrateChainLinks migrates the chain links from v5 to v7 by changing the various Protobuf interface types. +// The migration from v5 to v6 is skipped because the two types are identical (from v5 to v6 no changes were made). func migrateChainLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { appLinksStore := prefix.NewStore(store, types.ChainLinksPrefix) iterator := appLinksStore.Iterator(nil, nil) @@ -181,7 +184,7 @@ func migrateChainLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { for _, v5Link := range applicationLinks { // Migrate the link - v6Link := types.NewChainLink( + v7Link := types.NewChainLink( v5Link.User, convertChainLinkAddressData(v5Link.GetAddressData()), convertChainLinkProof(v5Link.Proof, cdc), @@ -190,8 +193,8 @@ func migrateChainLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { ) // Store the chain link - userApplicationLinkKey := types.ChainLinksStoreKey(v6Link.User, v6Link.ChainConfig.Name, v6Link.GetAddressData().GetValue()) - store.Set(userApplicationLinkKey, cdc.MustMarshal(&v6Link)) + userApplicationLinkKey := types.ChainLinksStoreKey(v7Link.User, v7Link.ChainConfig.Name, v7Link.GetAddressData().GetValue()) + store.Set(userApplicationLinkKey, cdc.MustMarshal(&v7Link)) } return nil From f23948e71c52e9d0e0b2043c10e3480f2268965c Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 15 Jul 2022 10:40:23 +0200 Subject: [PATCH 111/112] Update x/profiles/legacy/v6/store_test.go Co-authored-by: Paul --- x/profiles/legacy/v6/store_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/profiles/legacy/v6/store_test.go b/x/profiles/legacy/v6/store_test.go index ac18064561..be1de5a710 100644 --- a/x/profiles/legacy/v6/store_test.go +++ b/x/profiles/legacy/v6/store_test.go @@ -104,7 +104,7 @@ func TestMigrateStore(t *testing.T) { }, check: func(ctx sdk.Context) { // Check the profile to make sure it contains the same data - v6Profile, err := types.NewProfile( + v7Profile, err := types.NewProfile( "john_doe", "John Doe", "My name if John Doe", From cd41847ef82130038bdbf0871e17fd4fecd3bf78 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 15 Jul 2022 10:40:36 +0200 Subject: [PATCH 112/112] Update x/profiles/legacy/v6/store_test.go Co-authored-by: Paul --- x/profiles/legacy/v6/store_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/profiles/legacy/v6/store_test.go b/x/profiles/legacy/v6/store_test.go index be1de5a710..740b3d49ee 100644 --- a/x/profiles/legacy/v6/store_test.go +++ b/x/profiles/legacy/v6/store_test.go @@ -120,7 +120,7 @@ func TestMigrateStore(t *testing.T) { account := authKeeper.GetAccount(ctx, sdkAddr) profile, ok := account.(*types.Profile) require.True(t, ok) - require.Equal(t, v6Profile, profile) + require.Equal(t, v7Profile, profile) }, }, {