From 8be0a266bc90123ff10ca6149678571e03a9b374 Mon Sep 17 00:00:00 2001 From: dadamu Date: Wed, 1 Jun 2022 18:35:38 +0800 Subject: [PATCH 01/64] Prepare proto --- proto/desmos/posts/v1/genesis.proto | 2 +- proto/desmos/profiles/v2/msg_server.proto | 5 + .../desmos/profiles/v2/msgs_chain_links.proto | 19 + proto/desmos/profiles/v2/query.proto | 7 + .../profiles/v2/query_chain_links.proto | 23 + x/posts/types/models.pb.go | 230 ++++--- x/profiles/types/msg_server.pb.go | 104 ++- x/profiles/types/msgs_chain_links.pb.go | 466 +++++++++++++- x/profiles/types/query.pb.go | 123 ++-- x/profiles/types/query.pb.gw.go | 80 +++ x/profiles/types/query_chain_links.pb.go | 597 +++++++++++++++++- 11 files changed, 1426 insertions(+), 230 deletions(-) diff --git a/proto/desmos/posts/v1/genesis.proto b/proto/desmos/posts/v1/genesis.proto index c3665ebb79..61dfc44dc0 100644 --- a/proto/desmos/posts/v1/genesis.proto +++ b/proto/desmos/posts/v1/genesis.proto @@ -55,5 +55,5 @@ message ActivePollData { uint64 post_id = 2 [ (gogoproto.customname) = "PostID" ]; uint32 poll_id = 3 [ (gogoproto.customname) = "PollID" ]; google.protobuf.Timestamp end_date = 4 - [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; } \ No newline at end of file diff --git a/proto/desmos/profiles/v2/msg_server.proto b/proto/desmos/profiles/v2/msg_server.proto index 87e6d251d7..6b1b2fdd3f 100644 --- a/proto/desmos/profiles/v2/msg_server.proto +++ b/proto/desmos/profiles/v2/msg_server.proto @@ -58,4 +58,9 @@ service Msg { // UnlinkApplication defines a method to remove a centralized application rpc UnlinkApplication(MsgUnlinkApplication) returns (MsgUnlinkApplicationResponse); + + // SetDefaultExternalAddress allows to set a specific external address as the + // default one for a given chain + rpc SetDefaultExternalAddress(MsgSetDefaultExternalAddress) + returns (MsgSetDefaultExternalAddressResponse); } \ No newline at end of file diff --git a/proto/desmos/profiles/v2/msgs_chain_links.proto b/proto/desmos/profiles/v2/msgs_chain_links.proto index 074e6506d0..7d9a488ed6 100644 --- a/proto/desmos/profiles/v2/msgs_chain_links.proto +++ b/proto/desmos/profiles/v2/msgs_chain_links.proto @@ -55,3 +55,22 @@ message MsgUnlinkChainAccount { // MsgUnlinkChainAccountResponse defines the Msg/UnlinkAccount response type. message MsgUnlinkChainAccountResponse {} + +// -------------------------------------------------------------------------------------------------------------------- + +// MsgSetDefaultExternalAddress represents the message used to set a default +// address for a specific chain +message MsgSetDefaultExternalAddress { + // Name of the chain for which to set the default address + string chain_name = 1; + + // Address to be set as the default one + string external_address = 2; + + // User signing the message + string signer = 3; +} + +// MsgSetDefaultExternalAddressResponse represents the +// Msg/SetDefaultExternalAddress response type +message MsgSetDefaultExternalAddressResponse {} \ No newline at end of file diff --git a/proto/desmos/profiles/v2/query.proto b/proto/desmos/profiles/v2/query.proto index 023aa98c37..64efae212d 100644 --- a/proto/desmos/profiles/v2/query.proto +++ b/proto/desmos/profiles/v2/query.proto @@ -43,6 +43,13 @@ service Query { option (google.api.http).get = "/desmos/profiles/v2/chain-links/owners"; } + // DefaultExternalAddresses queries the default addresses associated to the + // given user and (optionally) chain name + rpc DefaultExternalAddresses(QueryDefaultExternalAddressesRequest) + returns (QueryDefaultExternalAddressesResponse) { + option (google.api.http).get = "/desmos/profiles/v2/default-addresses"; + } + // ApplicationLinks queries the applications links associated to the given // user, if provided. Otherwise, it queries all the application links stored. rpc ApplicationLinks(QueryApplicationLinksRequest) diff --git a/proto/desmos/profiles/v2/query_chain_links.proto b/proto/desmos/profiles/v2/query_chain_links.proto index 336ce729cc..b48f5316c4 100644 --- a/proto/desmos/profiles/v2/query_chain_links.proto +++ b/proto/desmos/profiles/v2/query_chain_links.proto @@ -68,5 +68,28 @@ message QueryChainLinkOwnersResponse { repeated ChainLinkOwnerDetails owners = 1 [ (gogoproto.nullable) = false ]; // Pagination defines the pagination response + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDefaultExternalAddressesRequest is the request type for +// Query/DefaultExternalAddresses RPC method +message QueryDefaultExternalAddressesRequest { + // User for which to query the default addresses + string user = 1; + + // (optional) Chain name to query the default address for + string chain_name = 2; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryDefaultExternalAddressesResponse is the response type for +// Query/DefaultExternalAddresses RPC method +message QueryDefaultExternalAddressesResponse { + // List of default addresses, each one represented by the associated chain + // link + repeated ChainLink chain_links = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } \ No newline at end of file diff --git a/x/posts/types/models.pb.go b/x/posts/types/models.pb.go index 7db4b0fd9b..d7d27e49ce 100644 --- a/x/posts/types/models.pb.go +++ b/x/posts/types/models.pb.go @@ -74,26 +74,26 @@ type PostReference_Type int32 const ( // No reference specified TYPE_UNSPECIFIED PostReference_Type = 0 - // This post is a reply to the referenced post - TYPE_REPLIED_TO PostReference_Type = 1 - // This post is a quote to the referenced post - TYPE_QUOTED PostReference_Type = 2 - // This post is a report of the referenced post - TYPE_REPOSTED PostReference_Type = 3 + // This reference represents a reply to the specified post + TYPE_REPLY_TO PostReference_Type = 1 + // This reference represents a quote of the specified post + TYPE_QUOTE PostReference_Type = 2 + // This reference represents a repost of the specified post + TYPE_REPOST PostReference_Type = 3 ) var PostReference_Type_name = map[int32]string{ 0: "TYPE_UNSPECIFIED", - 1: "TYPE_REPLIED_TO", - 2: "TYPE_QUOTED", - 3: "TYPE_REPOSTED", + 1: "TYPE_REPLY_TO", + 2: "TYPE_QUOTE", + 3: "TYPE_REPOST", } var PostReference_Type_value = map[string]int32{ "TYPE_UNSPECIFIED": 0, - "TYPE_REPLIED_TO": 1, - "TYPE_QUOTED": 2, - "TYPE_REPOSTED": 3, + "TYPE_REPLY_TO": 1, + "TYPE_QUOTE": 2, + "TYPE_REPOST": 3, } func (x PostReference_Type) String() string { @@ -255,6 +255,9 @@ type PostReference struct { Type PostReference_Type `protobuf:"varint,1,opt,name=type,proto3,enum=desmos.posts.v1.PostReference_Type" json:"type,omitempty"` // Id of the referenced post PostID uint64 `protobuf:"varint,2,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` + // Position of the reference inside the post's text. This should be used only + // with the type set to TYPE_QUOTE + Position uint64 `protobuf:"varint,3,opt,name=position,proto3" json:"position,omitempty"` } func (m *PostReference) Reset() { *m = PostReference{} } @@ -304,6 +307,13 @@ func (m *PostReference) GetPostID() uint64 { return 0 } +func (m *PostReference) GetPosition() uint64 { + if m != nil { + return m.Position + } + return 0 +} + // Contains the details of entities parsed out of the post text type Entities struct { Hashtags []Tag `protobuf:"bytes,1,rep,name=hashtags,proto3" json:"hashtags"` @@ -1043,89 +1053,89 @@ func init() { func init() { proto.RegisterFile("desmos/posts/v1/models.proto", fileDescriptor_9cb993d391569998) } var fileDescriptor_9cb993d391569998 = []byte{ - // 1297 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xda, 0x8e, 0x63, 0x3f, 0xc7, 0x7f, 0x3a, 0x0d, 0xad, 0xeb, 0x52, 0x3b, 0x6d, 0x11, - 0x58, 0x08, 0xd6, 0x6a, 0x2a, 0x8a, 0x54, 0x0e, 0x90, 0xd4, 0x5b, 0x58, 0x94, 0xc4, 0xe9, 0xd8, - 0x06, 0x15, 0x0e, 0xab, 0x89, 0x77, 0xea, 0x2c, 0x1a, 0xef, 0x9a, 0x9d, 0x71, 0x6a, 0x7f, 0x01, - 0xc4, 0xb1, 0x47, 0x8e, 0x15, 0x7c, 0x05, 0xee, 0x5c, 0x7b, 0xec, 0x81, 0x03, 0xa7, 0x80, 0xdc, - 0x0b, 0x1f, 0x80, 0x23, 0x07, 0x34, 0x33, 0xbb, 0xce, 0x26, 0x69, 0x89, 0x7a, 0x40, 0xe2, 0x36, - 0xf3, 0xde, 0xef, 0xbd, 0x99, 0xf9, 0xbd, 0xb7, 0xbf, 0xb7, 0xf0, 0xa6, 0x4b, 0xf9, 0x28, 0xe0, - 0xad, 0x71, 0xc0, 0x05, 0x6f, 0x1d, 0xde, 0x6a, 0x8d, 0x02, 0x97, 0x32, 0x6e, 0x8e, 0xc3, 0x40, - 0x04, 0xa8, 0xac, 0xbd, 0xa6, 0xf2, 0x9a, 0x87, 0xb7, 0x6a, 0x6b, 0xc3, 0x60, 0x18, 0x28, 0x5f, - 0x4b, 0xae, 0x34, 0xac, 0x76, 0x65, 0x18, 0x04, 0x43, 0x46, 0x5b, 0x6a, 0xb7, 0x3f, 0x79, 0xd4, - 0x22, 0xfe, 0x2c, 0x72, 0x35, 0x4e, 0xbb, 0x84, 0x37, 0xa2, 0x5c, 0x90, 0xd1, 0x58, 0x03, 0x6e, - 0x7c, 0xb7, 0x0c, 0x99, 0xbd, 0x80, 0x0b, 0xd4, 0x82, 0x02, 0x9f, 0xec, 0xf3, 0x31, 0x19, 0x50, - 0xc7, 0x73, 0xab, 0xc6, 0xba, 0xd1, 0xcc, 0x6c, 0x95, 0xe6, 0x47, 0x0d, 0xe8, 0x46, 0x66, 0xbb, - 0x8d, 0x21, 0x86, 0xd8, 0x2e, 0x7a, 0x0f, 0x80, 0xd3, 0x81, 0xf0, 0x02, 0x5f, 0xe2, 0x53, 0xeb, - 0x46, 0xb3, 0xb8, 0x55, 0x9c, 0x1f, 0x35, 0xf2, 0x5d, 0x6d, 0xb5, 0xdb, 0x38, 0x1f, 0x01, 0x6c, - 0x17, 0x5d, 0x82, 0x94, 0xe7, 0x56, 0xd3, 0x2a, 0x6b, 0x76, 0x7e, 0xd4, 0x48, 0xd9, 0x6d, 0x9c, - 0xf2, 0x5c, 0x79, 0x2c, 0x9d, 0x0a, 0x1a, 0xfa, 0x84, 0xc9, 0x34, 0x99, 0x75, 0xa3, 0x99, 0xd7, - 0xc7, 0x5a, 0x91, 0x59, 0x1e, 0x1b, 0x43, 0x6c, 0x17, 0x21, 0xc8, 0x08, 0x3a, 0x15, 0xd5, 0x65, - 0x89, 0xc4, 0x6a, 0x8d, 0x3e, 0x80, 0x1c, 0xf5, 0x85, 0x27, 0x3c, 0xca, 0xab, 0xd9, 0x75, 0xa3, - 0x59, 0xd8, 0xb8, 0x62, 0x9e, 0xa2, 0xce, 0xb4, 0x22, 0x00, 0x5e, 0x40, 0xd1, 0x25, 0xc8, 0x92, - 0x89, 0x38, 0x08, 0xc2, 0xea, 0x8a, 0x4a, 0x16, 0xed, 0xd0, 0x47, 0x50, 0x1e, 0x04, 0xfe, 0x21, - 0x0d, 0x39, 0x89, 0x9f, 0x97, 0x53, 0x17, 0x47, 0xf3, 0xa3, 0x46, 0xe9, 0x5e, 0xc2, 0x65, 0xb7, - 0x71, 0x29, 0x09, 0xb5, 0x5d, 0xd4, 0x81, 0x4a, 0x48, 0x1f, 0xd1, 0x90, 0xfa, 0x03, 0xea, 0x3a, - 0xea, 0xf8, 0x6a, 0x7e, 0x3d, 0xdd, 0x2c, 0x6c, 0xd4, 0xcf, 0xdc, 0x49, 0x12, 0x8f, 0x63, 0xf0, - 0x56, 0xe6, 0xd9, 0x51, 0x63, 0x09, 0x97, 0x8f, 0xa3, 0xa5, 0x9b, 0xa3, 0x36, 0x94, 0x42, 0x3a, - 0x66, 0x33, 0x87, 0x53, 0x21, 0x3c, 0x7f, 0xc8, 0xab, 0xb0, 0x6e, 0x34, 0x4b, 0x1b, 0xd7, 0xce, - 0xa4, 0xc3, 0x12, 0xd6, 0xd5, 0x28, 0x5c, 0x0c, 0x13, 0x3b, 0x8e, 0x6c, 0x28, 0x0e, 0x42, 0xaa, - 0xdf, 0xe3, 0x12, 0x41, 0xab, 0x05, 0xc5, 0x53, 0xcd, 0xd4, 0x0d, 0x62, 0xc6, 0x0d, 0x62, 0xf6, - 0xe2, 0x06, 0xd9, 0xca, 0xc9, 0xfb, 0x3c, 0xf9, 0xbd, 0x61, 0xe0, 0xd5, 0x38, 0xb4, 0x4d, 0x04, - 0x45, 0x9f, 0x43, 0x85, 0x11, 0x2e, 0x1c, 0xea, 0x7a, 0x82, 0xba, 0x3a, 0xdb, 0xea, 0xb9, 0xd9, - 0x32, 0x2a, 0x53, 0x49, 0x46, 0x5a, 0x2a, 0x50, 0xe6, 0xba, 0x9b, 0xfb, 0xe1, 0x69, 0xc3, 0xf8, - 0xf3, 0x69, 0xc3, 0xb8, 0xf1, 0xab, 0x01, 0xc5, 0x13, 0x7c, 0xa0, 0x0f, 0x21, 0x23, 0x66, 0x63, - 0xaa, 0x5a, 0xb1, 0xb4, 0x71, 0xf3, 0xdf, 0xd9, 0x33, 0x7b, 0xb3, 0x31, 0xc5, 0x2a, 0x00, 0xdd, - 0x84, 0x15, 0x09, 0x8a, 0xdb, 0x32, 0xb3, 0x05, 0xf3, 0xa3, 0x46, 0x56, 0xc2, 0xed, 0x36, 0xce, - 0x4a, 0x97, 0xed, 0xde, 0xf8, 0x1a, 0x32, 0x32, 0x04, 0xad, 0x41, 0xa5, 0xf7, 0x70, 0xcf, 0x72, - 0xfa, 0xbb, 0xdd, 0x3d, 0xeb, 0x9e, 0x7d, 0xdf, 0xb6, 0xda, 0x95, 0x25, 0x74, 0x11, 0xca, 0xca, - 0x8a, 0xad, 0xbd, 0x6d, 0xdb, 0x6a, 0x3b, 0xbd, 0x4e, 0xc5, 0x40, 0x65, 0x28, 0x28, 0xe3, 0x83, - 0x7e, 0xa7, 0x67, 0xb5, 0x2b, 0x29, 0x74, 0x01, 0x8a, 0x31, 0xaa, 0xd3, 0x95, 0xa6, 0x74, 0x2d, - 0xf3, 0xfd, 0x4f, 0xf5, 0xa5, 0xc4, 0xb3, 0x7e, 0x36, 0x20, 0x17, 0xb7, 0x1e, 0xba, 0x03, 0xb9, - 0x03, 0xc2, 0x0f, 0x04, 0x19, 0xf2, 0xaa, 0xa1, 0x7a, 0x62, 0xed, 0xcc, 0xab, 0x7a, 0x64, 0x18, - 0x75, 0xc2, 0x02, 0x2b, 0xe3, 0x46, 0xb2, 0x6b, 0x03, 0x9f, 0x57, 0x53, 0xe7, 0xc7, 0xc5, 0x58, - 0x64, 0x42, 0x66, 0x12, 0x32, 0x5e, 0x4d, 0xbf, 0x22, 0xa6, 0x1f, 0xb2, 0x28, 0x46, 0xe1, 0x12, - 0xd7, 0xb6, 0x21, 0xdd, 0x23, 0x43, 0xb4, 0x06, 0xcb, 0x5c, 0x90, 0x50, 0x68, 0x39, 0xc0, 0x7a, - 0x83, 0x2a, 0x90, 0xa6, 0x7e, 0xc4, 0x2d, 0x96, 0x4b, 0x69, 0x11, 0x64, 0xa8, 0x3e, 0xef, 0x3c, - 0x96, 0xcb, 0x44, 0xaa, 0x6f, 0x20, 0xdd, 0x0f, 0xd9, 0xeb, 0xa4, 0x9a, 0x84, 0x2c, 0x4e, 0x35, - 0x09, 0x19, 0x6a, 0x40, 0xc1, 0xf5, 0xf8, 0x98, 0x91, 0x99, 0x23, 0x3d, 0x4a, 0x22, 0x30, 0x44, - 0xa6, 0x7e, 0xc8, 0x12, 0x67, 0xcd, 0x0d, 0x80, 0x4d, 0x21, 0xc8, 0xe0, 0x40, 0x72, 0xf0, 0x5f, - 0x6b, 0x5a, 0xa2, 0xcf, 0xd2, 0xaf, 0xea, 0xb3, 0x48, 0xf8, 0x32, 0x2a, 0x55, 0x52, 0xf8, 0x4c, - 0x58, 0x19, 0x04, 0xbe, 0xa0, 0xbe, 0x96, 0x32, 0x59, 0x9e, 0xd3, 0x1f, 0xcf, 0xa6, 0x3f, 0xc3, - 0x31, 0x28, 0xf1, 0xc8, 0x4f, 0x60, 0x79, 0x87, 0xba, 0x1e, 0xd1, 0x54, 0x79, 0xea, 0x9a, 0x8a, - 0x2a, 0x0f, 0x5d, 0x85, 0xfc, 0xc8, 0x1b, 0x51, 0x47, 0x7d, 0x37, 0x9a, 0xc2, 0x9c, 0x34, 0xc8, - 0x4e, 0x4f, 0x64, 0xf8, 0x2b, 0x2d, 0x45, 0x9f, 0x31, 0x54, 0x83, 0xdc, 0xb7, 0x13, 0xca, 0xe5, - 0x7b, 0x14, 0x3b, 0x79, 0xbc, 0xd8, 0xa3, 0x3e, 0x54, 0xc6, 0x61, 0x70, 0xe8, 0xb9, 0xd4, 0x75, - 0x88, 0xcf, 0x1f, 0xd3, 0x30, 0x6e, 0xbe, 0xb7, 0x5e, 0xf2, 0x29, 0x32, 0x66, 0xee, 0x45, 0xe8, - 0x4d, 0x05, 0x8e, 0xe5, 0x6c, 0x7c, 0xc2, 0xca, 0xd1, 0xc7, 0x52, 0xab, 0x23, 0xd5, 0x48, 0xbf, - 0x86, 0x06, 0xad, 0x50, 0x5f, 0x49, 0x06, 0xba, 0x03, 0x97, 0x09, 0x63, 0xc1, 0x63, 0xee, 0x8c, - 0x26, 0x4c, 0x78, 0x63, 0x46, 0x17, 0xd7, 0x93, 0x2c, 0xe7, 0xf0, 0x1b, 0xda, 0xbd, 0x13, 0x79, - 0xe3, 0x83, 0x4d, 0xb8, 0x18, 0xc5, 0x69, 0xb8, 0xd2, 0x2f, 0xae, 0xc8, 0xcf, 0xe1, 0x0b, 0xda, - 0xa5, 0xb1, 0x52, 0x9f, 0x38, 0x7a, 0x00, 0x17, 0x1f, 0x79, 0x72, 0x2c, 0x09, 0xc2, 0xd8, 0xcc, - 0x09, 0x29, 0x9f, 0x30, 0x11, 0xcf, 0x97, 0xeb, 0x2f, 0xa5, 0xa0, 0x27, 0x91, 0x58, 0x03, 0xf1, - 0x05, 0x15, 0x9d, 0x34, 0xd5, 0x38, 0x94, 0x4e, 0x92, 0xb4, 0x98, 0x66, 0x46, 0x62, 0x9a, 0xdd, - 0x83, 0x02, 0x59, 0xf4, 0x70, 0xcc, 0xf9, 0xd5, 0x33, 0x07, 0x1e, 0xf7, 0x79, 0x44, 0x75, 0x32, - 0xea, 0xb8, 0xd8, 0x89, 0xb2, 0xff, 0x6d, 0x00, 0xf4, 0x39, 0x0d, 0xa3, 0xb3, 0xff, 0x0f, 0x5f, - 0x87, 0x02, 0xb1, 0xc5, 0xe8, 0x2f, 0xc6, 0x20, 0xc6, 0x34, 0x88, 0xc9, 0x91, 0xff, 0x0e, 0x94, - 0xa3, 0x0a, 0x3b, 0x9e, 0xef, 0xd2, 0x29, 0x95, 0x55, 0x4b, 0x37, 0x8b, 0xb8, 0x14, 0x99, 0x6d, - 0x6d, 0x95, 0x6c, 0x4e, 0x38, 0x0d, 0x55, 0x8d, 0xf2, 0x58, 0xad, 0x13, 0xcf, 0xff, 0xc5, 0x80, - 0xca, 0xe9, 0x2a, 0xa1, 0x5d, 0x58, 0x89, 0x2b, 0xab, 0x15, 0xd9, 0x3c, 0xb7, 0xb2, 0xa6, 0xe6, - 0x4f, 0xef, 0x22, 0xee, 0xe3, 0x24, 0xb5, 0x07, 0xb0, 0x9a, 0x74, 0xa3, 0xeb, 0xb0, 0x1a, 0xb5, - 0x9b, 0xba, 0xba, 0x62, 0xb9, 0x88, 0x0b, 0xda, 0xa6, 0xee, 0x2d, 0x95, 0xf1, 0x30, 0x10, 0x94, - 0x47, 0x2a, 0xa8, 0x37, 0x2f, 0x2d, 0xe0, 0x5d, 0xc8, 0xee, 0x91, 0x90, 0x8c, 0x38, 0x7a, 0x1b, - 0xca, 0x23, 0x32, 0x75, 0x64, 0xbf, 0x38, 0x8c, 0xfa, 0x43, 0x71, 0x10, 0x65, 0x2e, 0x8e, 0xc8, - 0xb4, 0x47, 0xa7, 0x62, 0x5b, 0x19, 0x8f, 0x63, 0xdf, 0xfd, 0xd1, 0x80, 0xd5, 0xe4, 0x0f, 0x02, - 0xba, 0x06, 0x57, 0xe4, 0x74, 0x7b, 0xe8, 0x74, 0xad, 0x5e, 0xcf, 0xde, 0xfd, 0xf4, 0xd4, 0x04, - 0xac, 0xc1, 0xa5, 0x93, 0x6e, 0xeb, 0x0b, 0x0b, 0x3f, 0xec, 0xec, 0x5a, 0x15, 0x03, 0x5d, 0x85, - 0xcb, 0x27, 0x7d, 0xf7, 0x3b, 0xdb, 0xdb, 0x9d, 0x2f, 0x2d, 0xdc, 0xad, 0xa4, 0x50, 0x15, 0xd6, - 0x4e, 0x3a, 0x77, 0xfa, 0xbd, 0xfe, 0xe6, 0x76, 0x25, 0x7d, 0x36, 0xe5, 0x8e, 0xb5, 0xdb, 0xb3, - 0x3b, 0xbb, 0xdd, 0x4a, 0x46, 0xcf, 0xcd, 0xad, 0xcf, 0x9e, 0xcd, 0xeb, 0xc6, 0xf3, 0x79, 0xdd, - 0xf8, 0x63, 0x5e, 0x37, 0x9e, 0xbc, 0xa8, 0x2f, 0x3d, 0x7f, 0x51, 0x5f, 0xfa, 0xed, 0x45, 0x7d, - 0xe9, 0x2b, 0x73, 0xe8, 0x89, 0x83, 0xc9, 0xbe, 0x39, 0x08, 0x46, 0x2d, 0x5d, 0xa0, 0xf7, 0x19, - 0xd9, 0xe7, 0xd1, 0xba, 0x75, 0x78, 0xbb, 0x35, 0x8d, 0x7e, 0xa2, 0xa5, 0xf6, 0xf1, 0xfd, 0xac, - 0x12, 0x93, 0xdb, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x23, 0x4e, 0xeb, 0x80, 0x61, 0x0b, 0x00, - 0x00, + // 1305 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xc1, 0x6f, 0x1b, 0x45, + 0x17, 0xcf, 0xc6, 0x4e, 0x62, 0x3f, 0xc7, 0xce, 0x76, 0x9a, 0xaf, 0x75, 0xdd, 0xaf, 0x76, 0xda, + 0x7e, 0xfa, 0xb0, 0x10, 0xac, 0xd5, 0x54, 0x14, 0xa9, 0x1c, 0x20, 0xa9, 0xb7, 0xb0, 0x28, 0x89, + 0xd3, 0xf1, 0xba, 0xa8, 0x5c, 0x56, 0x13, 0xef, 0xd4, 0x59, 0x34, 0xde, 0x35, 0x3b, 0xe3, 0xd4, + 0xfe, 0x07, 0x10, 0xc7, 0x1e, 0x39, 0x56, 0xf0, 0x2f, 0x70, 0xe7, 0xda, 0x63, 0x8f, 0x9c, 0x02, + 0x72, 0x2f, 0x48, 0x5c, 0x39, 0x72, 0x40, 0x33, 0xb3, 0xeb, 0x6c, 0x92, 0x96, 0xaa, 0x07, 0x24, + 0x6e, 0x33, 0xef, 0xfd, 0xde, 0x9b, 0x99, 0xdf, 0x7b, 0xf3, 0x9b, 0x81, 0xff, 0xfa, 0x94, 0x0f, + 0x23, 0xde, 0x1a, 0x45, 0x5c, 0xf0, 0xd6, 0xd1, 0xad, 0xd6, 0x30, 0xf2, 0x29, 0xe3, 0xd6, 0x28, + 0x8e, 0x44, 0x84, 0xd6, 0xb4, 0xd7, 0x52, 0x5e, 0xeb, 0xe8, 0x56, 0x6d, 0x7d, 0x10, 0x0d, 0x22, + 0xe5, 0x6b, 0xc9, 0x91, 0x86, 0xd5, 0xae, 0x0c, 0xa2, 0x68, 0xc0, 0x68, 0x4b, 0xcd, 0x0e, 0xc6, + 0x8f, 0x5b, 0x24, 0x9c, 0x26, 0xae, 0xc6, 0x59, 0x97, 0x08, 0x86, 0x94, 0x0b, 0x32, 0x1c, 0x69, + 0xc0, 0x8d, 0x6f, 0x96, 0x20, 0xbf, 0x1f, 0x71, 0x81, 0x5a, 0x50, 0xe2, 0xe3, 0x03, 0x3e, 0x22, + 0x7d, 0xea, 0x05, 0x7e, 0xd5, 0xd8, 0x30, 0x9a, 0xf9, 0xed, 0xca, 0xec, 0xb8, 0x01, 0xdd, 0xc4, + 0xec, 0xb4, 0x31, 0xa4, 0x10, 0xc7, 0x47, 0xef, 0x01, 0x70, 0xda, 0x17, 0x41, 0x14, 0x4a, 0xfc, + 0xe2, 0x86, 0xd1, 0x2c, 0x6f, 0x97, 0x67, 0xc7, 0x8d, 0x62, 0x57, 0x5b, 0x9d, 0x36, 0x2e, 0x26, + 0x00, 0xc7, 0x47, 0x97, 0x60, 0x31, 0xf0, 0xab, 0x39, 0x95, 0x75, 0x79, 0x76, 0xdc, 0x58, 0x74, + 0xda, 0x78, 0x31, 0xf0, 0xe5, 0xb2, 0x74, 0x22, 0x68, 0x1c, 0x12, 0x26, 0xd3, 0xe4, 0x37, 0x8c, + 0x66, 0x51, 0x2f, 0x6b, 0x27, 0x66, 0xb9, 0x6c, 0x0a, 0x71, 0x7c, 0x84, 0x20, 0x2f, 0xe8, 0x44, + 0x54, 0x97, 0x24, 0x12, 0xab, 0x31, 0xfa, 0x00, 0x0a, 0x34, 0x14, 0x81, 0x08, 0x28, 0xaf, 0x2e, + 0x6f, 0x18, 0xcd, 0xd2, 0xe6, 0x15, 0xeb, 0x0c, 0x75, 0x96, 0x9d, 0x00, 0xf0, 0x1c, 0x8a, 0x2e, + 0xc1, 0x32, 0x19, 0x8b, 0xc3, 0x28, 0xae, 0xae, 0xa8, 0x64, 0xc9, 0x0c, 0x7d, 0x04, 0x6b, 0xfd, + 0x28, 0x3c, 0xa2, 0x31, 0x27, 0xe9, 0xf1, 0x0a, 0x6a, 0xe3, 0x68, 0x76, 0xdc, 0xa8, 0xdc, 0xcb, + 0xb8, 0x9c, 0x36, 0xae, 0x64, 0xa1, 0x8e, 0x8f, 0x3a, 0x60, 0xc6, 0xf4, 0x31, 0x8d, 0x69, 0xd8, + 0xa7, 0xbe, 0xa7, 0x96, 0xaf, 0x16, 0x37, 0x72, 0xcd, 0xd2, 0x66, 0xfd, 0xdc, 0x9e, 0x24, 0xf1, + 0x38, 0x05, 0x6f, 0xe7, 0x9f, 0x1f, 0x37, 0x16, 0xf0, 0xda, 0x49, 0xb4, 0x74, 0x73, 0xd4, 0x86, + 0x4a, 0x4c, 0x47, 0x6c, 0xea, 0x71, 0x2a, 0x44, 0x10, 0x0e, 0x78, 0x15, 0x36, 0x8c, 0x66, 0x65, + 0xf3, 0xda, 0xb9, 0x74, 0x58, 0xc2, 0xba, 0x1a, 0x85, 0xcb, 0x71, 0x66, 0xc6, 0x91, 0x03, 0xe5, + 0x7e, 0x4c, 0xf5, 0x79, 0x7c, 0x22, 0x68, 0xb5, 0xa4, 0x78, 0xaa, 0x59, 0xba, 0x41, 0xac, 0xb4, + 0x41, 0x2c, 0x37, 0x6d, 0x90, 0xed, 0x82, 0xdc, 0xcf, 0xd3, 0x5f, 0x1a, 0x06, 0x5e, 0x4d, 0x43, + 0xdb, 0x44, 0x50, 0xf4, 0x39, 0x98, 0x8c, 0x70, 0xe1, 0x51, 0x3f, 0x10, 0xd4, 0xd7, 0xd9, 0x56, + 0xdf, 0x98, 0x2d, 0xaf, 0x32, 0x55, 0x64, 0xa4, 0xad, 0x02, 0x65, 0xae, 0xbb, 0x85, 0xef, 0x9e, + 0x35, 0x8c, 0xdf, 0x9e, 0x35, 0x8c, 0x1b, 0xbf, 0x1b, 0x50, 0x3e, 0xc5, 0x07, 0xfa, 0x10, 0xf2, + 0x62, 0x3a, 0xa2, 0xaa, 0x15, 0x2b, 0x9b, 0x37, 0xff, 0x9e, 0x3d, 0xcb, 0x9d, 0x8e, 0x28, 0x56, + 0x01, 0xe8, 0x26, 0xac, 0x48, 0x50, 0xda, 0x96, 0xf9, 0x6d, 0x98, 0x1d, 0x37, 0x96, 0x25, 0xdc, + 0x69, 0xe3, 0x65, 0xe9, 0x72, 0x7c, 0x54, 0x83, 0xc2, 0x28, 0xe2, 0x81, 0x3c, 0x95, 0x6e, 0x4b, + 0x3c, 0x9f, 0xdf, 0x78, 0x08, 0x79, 0x99, 0x0e, 0xad, 0x83, 0xe9, 0x3e, 0xda, 0xb7, 0xbd, 0xde, + 0x5e, 0x77, 0xdf, 0xbe, 0xe7, 0xdc, 0x77, 0xec, 0xb6, 0xb9, 0x80, 0x2e, 0x40, 0x59, 0x59, 0xb1, + 0xbd, 0xbf, 0xf3, 0xc8, 0x73, 0x3b, 0xa6, 0x81, 0x2a, 0x00, 0xca, 0xf4, 0xa0, 0xd7, 0x71, 0x6d, + 0x73, 0x11, 0xad, 0x41, 0x29, 0x85, 0x74, 0xba, 0xae, 0x99, 0xab, 0xe5, 0xbf, 0xfd, 0xa1, 0xbe, + 0x90, 0x39, 0xed, 0x8f, 0x06, 0x14, 0xd2, 0x8e, 0x44, 0x77, 0xa0, 0x70, 0x48, 0xf8, 0xa1, 0x20, + 0x03, 0x5e, 0x35, 0x54, 0xab, 0xac, 0x9f, 0x3b, 0xac, 0x4b, 0x06, 0x49, 0x83, 0xcc, 0xb1, 0x32, + 0x6e, 0x28, 0x9b, 0x39, 0x0a, 0x79, 0x75, 0xf1, 0xcd, 0x71, 0x29, 0x16, 0x59, 0x90, 0x1f, 0xc7, + 0x8c, 0x57, 0x73, 0xaf, 0x89, 0xe9, 0xc5, 0x2c, 0x89, 0x51, 0xb8, 0xcc, 0xb6, 0x1d, 0xc8, 0xb9, + 0x64, 0x80, 0xd6, 0x61, 0x89, 0x0b, 0x12, 0x0b, 0xad, 0x12, 0x58, 0x4f, 0x90, 0x09, 0x39, 0x1a, + 0x26, 0x94, 0x63, 0x39, 0x94, 0x16, 0x41, 0x06, 0x8a, 0xde, 0x22, 0x96, 0xc3, 0x4c, 0xaa, 0xaf, + 0x20, 0xd7, 0x8b, 0xd9, 0xdb, 0xa4, 0x1a, 0xc7, 0x2c, 0x4d, 0x35, 0x8e, 0x19, 0x6a, 0x40, 0xc9, + 0x0f, 0xf8, 0x88, 0x91, 0xa9, 0x27, 0x3d, 0x4a, 0x39, 0x30, 0x24, 0xa6, 0x5e, 0xcc, 0x32, 0x6b, + 0xcd, 0x0c, 0x80, 0x2d, 0x21, 0x48, 0xff, 0x50, 0x72, 0xf0, 0x4f, 0x4b, 0x5d, 0xa6, 0xfd, 0x72, + 0xaf, 0x6d, 0x3f, 0xad, 0x87, 0x79, 0x95, 0x2a, 0xab, 0x87, 0x16, 0xac, 0xf4, 0xa3, 0x50, 0xd0, + 0x50, 0x2b, 0x9c, 0x2c, 0xcf, 0xd9, 0x3b, 0xb5, 0x15, 0x4e, 0x71, 0x0a, 0xca, 0x1c, 0xf2, 0x13, + 0x58, 0xda, 0xa5, 0x7e, 0x40, 0x34, 0x55, 0x81, 0xda, 0xa6, 0xa2, 0x2a, 0x40, 0x57, 0xa1, 0x38, + 0x0c, 0x86, 0xd4, 0x53, 0xd7, 0x49, 0x53, 0x58, 0x90, 0x06, 0xd9, 0xe4, 0x99, 0x0c, 0x7f, 0xe4, + 0xe4, 0x5b, 0xc0, 0x98, 0xbc, 0x1b, 0x5f, 0x8f, 0x29, 0x57, 0x77, 0xc3, 0xd0, 0xf0, 0x74, 0x8e, + 0x7a, 0x60, 0x8e, 0xe2, 0xe8, 0x28, 0xf0, 0xa9, 0xef, 0x91, 0x90, 0x3f, 0xa1, 0x71, 0xda, 0x7c, + 0xff, 0x7b, 0xc5, 0x0d, 0x65, 0xcc, 0xda, 0x4f, 0xd0, 0x5b, 0x0a, 0x9c, 0xaa, 0xdc, 0xe8, 0x94, + 0x95, 0xa3, 0x8f, 0xa5, 0x84, 0x27, 0x62, 0x92, 0x7b, 0x0b, 0x69, 0x5a, 0xa1, 0xa1, 0x52, 0x12, + 0x74, 0x07, 0x2e, 0x13, 0xc6, 0xa2, 0x27, 0xdc, 0x1b, 0x8e, 0x99, 0x08, 0x46, 0x8c, 0xce, 0xb7, + 0x27, 0x59, 0x2e, 0xe0, 0xff, 0x68, 0xf7, 0x6e, 0xe2, 0x4d, 0x17, 0xb6, 0xe0, 0x62, 0x12, 0xa7, + 0xe1, 0x4a, 0xd6, 0xb8, 0x22, 0xbf, 0x80, 0x2f, 0x68, 0x97, 0xc6, 0x4a, 0xd9, 0xe2, 0xe8, 0x01, + 0x5c, 0x7c, 0x1c, 0xc8, 0xd7, 0x4a, 0x10, 0xc6, 0xa6, 0x5e, 0x4c, 0xf9, 0x98, 0x89, 0xf4, 0xd9, + 0xb9, 0xfe, 0x4a, 0x0a, 0x5c, 0x89, 0xc4, 0x1a, 0x88, 0x2f, 0xa8, 0xe8, 0xac, 0xa9, 0xc6, 0xa1, + 0x72, 0x9a, 0xa4, 0xf9, 0x23, 0x67, 0x64, 0x1e, 0xb9, 0x7b, 0x50, 0x22, 0xf3, 0x1e, 0x4e, 0x39, + 0xbf, 0x7a, 0x6e, 0xc1, 0x93, 0x3e, 0x4f, 0xa8, 0xce, 0x46, 0x9d, 0x14, 0x3b, 0x53, 0xf6, 0x3f, + 0x0d, 0x80, 0x1e, 0xa7, 0x71, 0xb2, 0xf6, 0xbf, 0xe1, 0x76, 0x28, 0x10, 0x9b, 0xff, 0x08, 0xca, + 0x29, 0x88, 0x31, 0x0d, 0x62, 0xf2, 0x27, 0xf0, 0x0e, 0xac, 0x25, 0x15, 0xf6, 0x82, 0xd0, 0xa7, + 0x13, 0x2a, 0xab, 0x96, 0x6b, 0x96, 0x71, 0x25, 0x31, 0x3b, 0xda, 0x2a, 0xd9, 0x1c, 0x73, 0x1a, + 0xab, 0x1a, 0x15, 0xb1, 0x1a, 0x67, 0x8e, 0xff, 0x93, 0x01, 0xe6, 0xd9, 0x2a, 0xa1, 0x3d, 0x58, + 0x49, 0x2b, 0xab, 0x15, 0xd9, 0x7a, 0x63, 0x65, 0x2d, 0xcd, 0x9f, 0x9e, 0x25, 0xdc, 0xa7, 0x49, + 0x6a, 0x0f, 0x60, 0x35, 0xeb, 0x46, 0xd7, 0x61, 0x35, 0x69, 0x37, 0xb5, 0x75, 0xc5, 0x72, 0x19, + 0x97, 0xb4, 0x4d, 0xed, 0x5b, 0x2a, 0xe3, 0x51, 0x24, 0x28, 0x4f, 0x54, 0x50, 0x4f, 0x5e, 0x59, + 0xc0, 0xbb, 0xb0, 0xbc, 0x4f, 0x62, 0x32, 0xe4, 0xe8, 0xff, 0xb0, 0x36, 0x24, 0x13, 0x4f, 0xf6, + 0x8b, 0xc7, 0x68, 0x38, 0x10, 0x87, 0x49, 0xe6, 0xf2, 0x90, 0x4c, 0x5c, 0x3a, 0x11, 0x3b, 0xca, + 0x78, 0x12, 0xfb, 0xee, 0xf7, 0x06, 0xac, 0x66, 0xff, 0x0d, 0xe8, 0x1a, 0x5c, 0xd1, 0x0f, 0x5b, + 0xd7, 0x76, 0x5d, 0x67, 0xef, 0xd3, 0x33, 0x8f, 0x5f, 0x0d, 0x2e, 0x9d, 0x76, 0xdb, 0x0f, 0x6d, + 0xfc, 0xa8, 0xb3, 0x67, 0x9b, 0x06, 0xba, 0x0a, 0x97, 0x4f, 0xfb, 0xee, 0x77, 0x76, 0x76, 0x3a, + 0x5f, 0xd8, 0xb8, 0x6b, 0x2e, 0xa2, 0x2a, 0xac, 0x9f, 0x76, 0xee, 0xf6, 0xdc, 0xde, 0xd6, 0x8e, + 0x99, 0x3b, 0x9f, 0x72, 0xd7, 0xde, 0x73, 0x9d, 0xce, 0x5e, 0xd7, 0xcc, 0xeb, 0x77, 0x73, 0xfb, + 0xb3, 0xe7, 0xb3, 0xba, 0xf1, 0x62, 0x56, 0x37, 0x7e, 0x9d, 0xd5, 0x8d, 0xa7, 0x2f, 0xeb, 0x0b, + 0x2f, 0x5e, 0xd6, 0x17, 0x7e, 0x7e, 0x59, 0x5f, 0xf8, 0xd2, 0x1a, 0x04, 0xe2, 0x70, 0x7c, 0x60, + 0xf5, 0xa3, 0x61, 0x4b, 0x17, 0xe8, 0x7d, 0x46, 0x0e, 0x78, 0x32, 0x6e, 0x1d, 0xdd, 0x6e, 0x4d, + 0x92, 0xbf, 0xb5, 0xd4, 0x3e, 0x7e, 0xb0, 0xac, 0xc4, 0xe4, 0xf6, 0x5f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x0c, 0xf7, 0x48, 0x84, 0x78, 0x0b, 0x00, 0x00, } func (this *Post) Equal(that interface{}) bool { @@ -1219,6 +1229,9 @@ func (this *PostReference) Equal(that interface{}) bool { if this.PostID != that1.PostID { return false } + if this.Position != that1.Position { + return false + } return true } func (this *Entities) Equal(that interface{}) bool { @@ -1725,6 +1738,11 @@ func (m *PostReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Position != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Position)) + i-- + dAtA[i] = 0x18 + } if m.PostID != 0 { i = encodeVarintModels(dAtA, i, uint64(m.PostID)) i-- @@ -2351,6 +2369,9 @@ func (m *PostReference) Size() (n int) { if m.PostID != 0 { n += 1 + sovModels(uint64(m.PostID)) } + if m.Position != 0 { + n += 1 + sovModels(uint64(m.Position)) + } return n } @@ -3042,6 +3063,25 @@ func (m *PostReference) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + m.Position = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Position |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipModels(dAtA[iNdEx:]) diff --git a/x/profiles/types/msg_server.pb.go b/x/profiles/types/msg_server.pb.go index 56c214e1c5..2dc20c52ba 100644 --- a/x/profiles/types/msg_server.pb.go +++ b/x/profiles/types/msg_server.pb.go @@ -33,37 +33,39 @@ func init() { } var fileDescriptor_c2fd53889ce3d02c = []byte{ - // 476 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, 0xd6, 0x5d, 0xb8, 0x96, 0xed, 0x06, 0x93, 0x50, 0x19, 0x17, 0x24, 0x54, 0xb9, 0xee, 0xaf, - 0x5e, 0x34, 0xd7, 0x36, 0xb1, 0x13, 0xb1, 0x27, 0xe0, 0xca, 0x03, 0xf0, 0x40, 0x1c, 0x77, 0xe4, - 0x88, 0xda, 0x17, 0x41, 0x89, 0xdb, 0x90, 0x76, 0x71, 0x97, 0xde, 0xec, 0xfc, 0x3e, 0xdf, 0x3f, - 0xb6, 0x14, 0xa3, 0xa7, 0x63, 0xb0, 0x53, 0x6d, 0xa9, 0x49, 0xf5, 0x24, 0x91, 0x60, 0x69, 0xde, - 0xa3, 0x53, 0x2b, 0x86, 0x16, 0xd2, 0x1c, 0xd2, 0xd8, 0xa4, 0xda, 0x69, 0x8c, 0x3d, 0x14, 0x2f, - 0xa1, 0x38, 0xef, 0x91, 0xc7, 0x42, 0x0b, 0x5d, 0x8e, 0x69, 0xb1, 0xf2, 0x24, 0xd9, 0x11, 0x5a, - 0x0b, 0x09, 0xb4, 0xdc, 0x8d, 0xb2, 0x09, 0x65, 0xea, 0x72, 0x39, 0xe2, 0xba, 0x30, 0x19, 0x7a, - 0x8d, 0xdf, 0x2c, 0x46, 0xbb, 0x4d, 0x25, 0xf4, 0x18, 0x64, 0x49, 0x17, 0x9f, 0x16, 0xe0, 0x7e, - 0x18, 0x1c, 0x3b, 0x26, 0x86, 0x29, 0x7c, 0xcb, 0xc0, 0xba, 0xa5, 0xef, 0xf3, 0xe6, 0xc3, 0xad, - 0xbb, 0xbe, 0x0e, 0x61, 0x4d, 0x9e, 0x7b, 0x21, 0x98, 0x9f, 0xb3, 0x44, 0x0d, 0x65, 0xa2, 0x2e, - 0x36, 0x1e, 0xab, 0x40, 0x99, 0x31, 0x75, 0xb0, 0xf7, 0xeb, 0x0e, 0xba, 0x75, 0x6a, 0x05, 0xfe, - 0x8a, 0xee, 0x7e, 0x62, 0x39, 0x7c, 0xf4, 0x3c, 0x7e, 0x12, 0x5f, 0xbf, 0xf7, 0xf8, 0xd4, 0x8a, - 0x1a, 0x43, 0x5e, 0xdd, 0xcc, 0x0c, 0xc0, 0x1a, 0xad, 0x2c, 0x60, 0x8e, 0xee, 0x9d, 0x80, 0x04, - 0x57, 0x05, 0x3c, 0x0b, 0x88, 0x57, 0x28, 0xf2, 0xa6, 0x0d, 0x55, 0x85, 0x64, 0xe8, 0xd1, 0xc0, - 0xdf, 0xd8, 0xc9, 0x19, 0x13, 0x67, 0x29, 0x53, 0x76, 0x02, 0x29, 0x0e, 0xf5, 0x6c, 0x60, 0x49, - 0xaf, 0x3d, 0x5b, 0xc5, 0xfe, 0xe8, 0xa2, 0x9d, 0x63, 0xa6, 0x38, 0xc8, 0xd5, 0x71, 0xa9, 0xc0, - 0x07, 0x01, 0xc7, 0xa0, 0x82, 0xbc, 0xdd, 0x56, 0xb1, 0xd2, 0xa4, 0xcf, 0x39, 0x18, 0xb7, 0x4d, - 0x93, 0xa0, 0x22, 0xd8, 0x24, 0xa8, 0x58, 0x69, 0x32, 0x80, 0x49, 0x66, 0x61, 0x9b, 0x26, 0x41, - 0x45, 0xb0, 0x49, 0x50, 0x51, 0x35, 0x91, 0xe8, 0xc1, 0x87, 0x44, 0x5d, 0x1c, 0x17, 0xbf, 0x48, - 0x9f, 0x73, 0x9d, 0x29, 0x87, 0x77, 0x03, 0x6e, 0xeb, 0x20, 0xa1, 0x2d, 0xc1, 0x2a, 0x2d, 0x45, - 0xf8, 0xb3, 0x92, 0xeb, 0x79, 0x7b, 0x01, 0x9b, 0xeb, 0x28, 0x39, 0x6c, 0x8d, 0x56, 0x99, 0x09, - 0xba, 0x5f, 0xf4, 0xe9, 0x1b, 0x23, 0x13, 0xce, 0x5c, 0xa2, 0x15, 0x7e, 0xb1, 0xa1, 0x77, 0x8d, - 0x23, 0x71, 0x3b, 0xae, 0x8a, 0xd2, 0xe8, 0xa1, 0x2f, 0x52, 0x0f, 0x7b, 0xb9, 0xb1, 0x72, 0x3d, - 0xee, 0xa0, 0x2d, 0xb9, 0x0c, 0x7c, 0xf7, 0xfe, 0xf7, 0x2c, 0xea, 0x5e, 0xcd, 0xa2, 0xee, 0xdf, - 0x59, 0xd4, 0xfd, 0x39, 0x8f, 0x3a, 0x57, 0xf3, 0xa8, 0xf3, 0x67, 0x1e, 0x75, 0xbe, 0x1c, 0x8a, - 0xc4, 0x9d, 0x67, 0xa3, 0x98, 0xeb, 0x29, 0xf5, 0xae, 0xfb, 0x92, 0x8d, 0xec, 0x62, 0x4d, 0xf3, - 0x23, 0xfa, 0xfd, 0xff, 0xeb, 0xe7, 0x2e, 0x0d, 0xd8, 0xd1, 0xed, 0xf2, 0xc9, 0x3b, 0xfa, 0x17, - 0x00, 0x00, 0xff, 0xff, 0x95, 0x63, 0x6c, 0x1a, 0x79, 0x06, 0x00, 0x00, + // 506 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4d, 0x6f, 0xd3, 0x30, + 0x18, 0xc7, 0x5b, 0x21, 0x71, 0x30, 0x42, 0x80, 0xe1, 0xb2, 0x1c, 0x72, 0xe0, 0x6d, 0x0c, 0x58, + 0xbc, 0x75, 0x17, 0xae, 0x65, 0xe5, 0x04, 0x93, 0x50, 0x37, 0x2e, 0x48, 0xa8, 0x72, 0xdd, 0xa7, + 0x5e, 0x34, 0xd7, 0x0e, 0xb6, 0x53, 0x6d, 0x9f, 0x80, 0x2b, 0x9f, 0x82, 0xcf, 0xc2, 0x71, 0x47, + 0x8e, 0xa8, 0xfd, 0x22, 0x28, 0x49, 0x1b, 0x92, 0xae, 0x4f, 0x97, 0xde, 0xe2, 0x3e, 0xbf, 0xff, + 0x8b, 0x2d, 0xd7, 0xe4, 0xd9, 0x08, 0xdc, 0xc4, 0x38, 0x96, 0x58, 0x33, 0x8e, 0x15, 0x38, 0x36, + 0xed, 0xb0, 0x89, 0x93, 0x03, 0x07, 0x76, 0x0a, 0x36, 0x4a, 0xac, 0xf1, 0x86, 0xd2, 0x02, 0x8a, + 0x96, 0x50, 0x34, 0xed, 0x04, 0x4f, 0xa4, 0x91, 0x26, 0x1f, 0xb3, 0xec, 0xab, 0x20, 0x83, 0x1d, + 0x69, 0x8c, 0x54, 0xc0, 0xf2, 0xd5, 0x30, 0x1d, 0x33, 0xae, 0xaf, 0x96, 0x23, 0x61, 0x32, 0x93, + 0x41, 0xa1, 0x29, 0x16, 0x8b, 0xd1, 0xee, 0xba, 0x12, 0x66, 0x04, 0x2a, 0xa7, 0xb3, 0x9f, 0x16, + 0xe0, 0x3e, 0x0e, 0x8e, 0x3c, 0x97, 0x03, 0x0b, 0xdf, 0x53, 0x70, 0x7e, 0xe9, 0xfb, 0x62, 0xfd, + 0xe6, 0x56, 0x5d, 0xdf, 0x60, 0xd8, 0x3a, 0xcf, 0x3d, 0x0c, 0x16, 0xe7, 0x3c, 0xd6, 0x03, 0x15, + 0xeb, 0x8b, 0x8d, 0xdb, 0xca, 0x50, 0x9e, 0x24, 0x55, 0xb0, 0xf3, 0x8b, 0x90, 0x3b, 0x27, 0x4e, + 0xd2, 0x6f, 0xe4, 0xde, 0x29, 0x9f, 0xc2, 0xe7, 0x82, 0xa7, 0x4f, 0xa3, 0x9b, 0xe7, 0x1e, 0x9d, + 0x38, 0x59, 0x61, 0x82, 0xd7, 0xb7, 0x33, 0x7d, 0x70, 0x89, 0xd1, 0x0e, 0xa8, 0x20, 0xf7, 0x7b, + 0xa0, 0xc0, 0x97, 0x01, 0xcf, 0x11, 0x71, 0x8d, 0x0a, 0xde, 0x36, 0xa1, 0xca, 0x90, 0x94, 0x3c, + 0xee, 0x17, 0x27, 0xd6, 0x3b, 0xe3, 0xf2, 0xcc, 0x72, 0xed, 0xc6, 0x60, 0x29, 0xd6, 0x73, 0x0d, + 0x1b, 0x74, 0x9a, 0xb3, 0x65, 0xec, 0x8f, 0x36, 0xd9, 0x39, 0xe6, 0x5a, 0x80, 0xaa, 0x8f, 0x73, + 0x05, 0x3d, 0x40, 0x1c, 0x51, 0x45, 0xf0, 0x6e, 0x5b, 0x45, 0xad, 0x49, 0x57, 0x08, 0x48, 0xfc, + 0x36, 0x4d, 0x50, 0x05, 0xda, 0x04, 0x55, 0xd4, 0x9a, 0xf4, 0x61, 0x9c, 0x3a, 0xd8, 0xa6, 0x09, + 0xaa, 0x40, 0x9b, 0xa0, 0x8a, 0xb2, 0x89, 0x22, 0x0f, 0x3f, 0xc5, 0xfa, 0xe2, 0x38, 0xfb, 0x8b, + 0x74, 0x85, 0x30, 0xa9, 0xf6, 0x74, 0x17, 0x71, 0x5b, 0x05, 0x03, 0xd6, 0x10, 0x2c, 0xd3, 0x2c, + 0xa1, 0x5f, 0xb4, 0x5a, 0xcd, 0xdb, 0x43, 0x6c, 0x6e, 0xa2, 0xc1, 0x61, 0x63, 0xb4, 0xcc, 0x8c, + 0xc9, 0x83, 0xac, 0x4f, 0x37, 0x49, 0x54, 0x2c, 0xb8, 0x8f, 0x8d, 0xa6, 0x2f, 0x37, 0xf4, 0xae, + 0x70, 0x41, 0xd4, 0x8c, 0x2b, 0xa3, 0x0c, 0x79, 0x54, 0x14, 0xa9, 0x86, 0xbd, 0xda, 0x58, 0xb9, + 0x1a, 0x77, 0xd0, 0x94, 0xac, 0xdd, 0xa3, 0x53, 0xf0, 0x3d, 0x18, 0xf3, 0x54, 0xf9, 0x0f, 0x97, + 0x1e, 0xac, 0xe6, 0xaa, 0x3b, 0x1a, 0x59, 0x70, 0x0e, 0xbd, 0x47, 0xa8, 0x02, 0xbd, 0x47, 0xa8, + 0x62, 0xd9, 0xe4, 0xfd, 0xc7, 0xdf, 0xb3, 0xb0, 0x7d, 0x3d, 0x0b, 0xdb, 0x7f, 0x67, 0x61, 0xfb, + 0xe7, 0x3c, 0x6c, 0x5d, 0xcf, 0xc3, 0xd6, 0x9f, 0x79, 0xd8, 0xfa, 0x7a, 0x28, 0x63, 0x7f, 0x9e, + 0x0e, 0x23, 0x61, 0x26, 0xac, 0x70, 0xdf, 0x57, 0x7c, 0xe8, 0x16, 0xdf, 0x6c, 0x7a, 0xc4, 0x2e, + 0xff, 0xbf, 0xc3, 0xfe, 0x2a, 0x01, 0x37, 0xbc, 0x9b, 0x3f, 0xbe, 0x47, 0xff, 0x02, 0x00, 0x00, + 0xff, 0xff, 0x76, 0x93, 0x0b, 0x07, 0x03, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -105,6 +107,9 @@ type MsgClient interface { LinkApplication(ctx context.Context, in *MsgLinkApplication, opts ...grpc.CallOption) (*MsgLinkApplicationResponse, error) // UnlinkApplication defines a method to remove a centralized application UnlinkApplication(ctx context.Context, in *MsgUnlinkApplication, opts ...grpc.CallOption) (*MsgUnlinkApplicationResponse, error) + // SetDefaultExternalAddress allows to set a specific external address as the + // default one for a given chain + SetDefaultExternalAddress(ctx context.Context, in *MsgSetDefaultExternalAddress, opts ...grpc.CallOption) (*MsgSetDefaultExternalAddressResponse, error) } type msgClient struct { @@ -205,6 +210,15 @@ func (c *msgClient) UnlinkApplication(ctx context.Context, in *MsgUnlinkApplicat return out, nil } +func (c *msgClient) SetDefaultExternalAddress(ctx context.Context, in *MsgSetDefaultExternalAddress, opts ...grpc.CallOption) (*MsgSetDefaultExternalAddressResponse, error) { + out := new(MsgSetDefaultExternalAddressResponse) + err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/SetDefaultExternalAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // SaveProfile defines the method to save a profile @@ -234,6 +248,9 @@ type MsgServer interface { LinkApplication(context.Context, *MsgLinkApplication) (*MsgLinkApplicationResponse, error) // UnlinkApplication defines a method to remove a centralized application UnlinkApplication(context.Context, *MsgUnlinkApplication) (*MsgUnlinkApplicationResponse, error) + // SetDefaultExternalAddress allows to set a specific external address as the + // default one for a given chain + SetDefaultExternalAddress(context.Context, *MsgSetDefaultExternalAddress) (*MsgSetDefaultExternalAddressResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -270,6 +287,9 @@ func (*UnimplementedMsgServer) LinkApplication(ctx context.Context, req *MsgLink func (*UnimplementedMsgServer) UnlinkApplication(ctx context.Context, req *MsgUnlinkApplication) (*MsgUnlinkApplicationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UnlinkApplication not implemented") } +func (*UnimplementedMsgServer) SetDefaultExternalAddress(ctx context.Context, req *MsgSetDefaultExternalAddress) (*MsgSetDefaultExternalAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetDefaultExternalAddress not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -455,6 +475,24 @@ func _Msg_UnlinkApplication_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Msg_SetDefaultExternalAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetDefaultExternalAddress) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetDefaultExternalAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/desmos.profiles.v2.Msg/SetDefaultExternalAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetDefaultExternalAddress(ctx, req.(*MsgSetDefaultExternalAddress)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "desmos.profiles.v2.Msg", HandlerType: (*MsgServer)(nil), @@ -499,6 +537,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UnlinkApplication", Handler: _Msg_UnlinkApplication_Handler, }, + { + MethodName: "SetDefaultExternalAddress", + Handler: _Msg_SetDefaultExternalAddress_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "desmos/profiles/v2/msg_server.proto", diff --git a/x/profiles/types/msgs_chain_links.pb.go b/x/profiles/types/msgs_chain_links.pb.go index 0a28bebd37..9771efb244 100644 --- a/x/profiles/types/msgs_chain_links.pb.go +++ b/x/profiles/types/msgs_chain_links.pb.go @@ -240,11 +240,116 @@ func (m *MsgUnlinkChainAccountResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnlinkChainAccountResponse proto.InternalMessageInfo +// MsgSetDefaultExternalAddress represents the message used to set a default +// address for a specific chain +type MsgSetDefaultExternalAddress struct { + // Name of the chain for which to set the default address + ChainName string `protobuf:"bytes,1,opt,name=chain_name,json=chainName,proto3" json:"chain_name,omitempty"` + // Address to be set as the default one + ExternalAddress string `protobuf:"bytes,2,opt,name=external_address,json=externalAddress,proto3" json:"external_address,omitempty"` + // User signing the message + Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgSetDefaultExternalAddress) Reset() { *m = MsgSetDefaultExternalAddress{} } +func (m *MsgSetDefaultExternalAddress) String() string { return proto.CompactTextString(m) } +func (*MsgSetDefaultExternalAddress) ProtoMessage() {} +func (*MsgSetDefaultExternalAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_d28c3718ad31f8ee, []int{4} +} +func (m *MsgSetDefaultExternalAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetDefaultExternalAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetDefaultExternalAddress.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 *MsgSetDefaultExternalAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetDefaultExternalAddress.Merge(m, src) +} +func (m *MsgSetDefaultExternalAddress) XXX_Size() int { + return m.Size() +} +func (m *MsgSetDefaultExternalAddress) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetDefaultExternalAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetDefaultExternalAddress proto.InternalMessageInfo + +func (m *MsgSetDefaultExternalAddress) GetChainName() string { + if m != nil { + return m.ChainName + } + return "" +} + +func (m *MsgSetDefaultExternalAddress) GetExternalAddress() string { + if m != nil { + return m.ExternalAddress + } + return "" +} + +func (m *MsgSetDefaultExternalAddress) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +// MsgSetDefaultExternalAddressResponse represents the +// Msg/SetDefaultExternalAddress response type +type MsgSetDefaultExternalAddressResponse struct { +} + +func (m *MsgSetDefaultExternalAddressResponse) Reset() { *m = MsgSetDefaultExternalAddressResponse{} } +func (m *MsgSetDefaultExternalAddressResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetDefaultExternalAddressResponse) ProtoMessage() {} +func (*MsgSetDefaultExternalAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d28c3718ad31f8ee, []int{5} +} +func (m *MsgSetDefaultExternalAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetDefaultExternalAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetDefaultExternalAddressResponse.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 *MsgSetDefaultExternalAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetDefaultExternalAddressResponse.Merge(m, src) +} +func (m *MsgSetDefaultExternalAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetDefaultExternalAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetDefaultExternalAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetDefaultExternalAddressResponse 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((*MsgSetDefaultExternalAddress)(nil), "desmos.profiles.v2.MsgSetDefaultExternalAddress") + proto.RegisterType((*MsgSetDefaultExternalAddressResponse)(nil), "desmos.profiles.v2.MsgSetDefaultExternalAddressResponse") } func init() { @@ -252,38 +357,42 @@ func init() { } var fileDescriptor_d28c3718ad31f8ee = []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, 0xd3, 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, - 0x0b, 0x23, 0xae, 0xc8, 0x62, 0x48, 0x62, 0x25, 0xd4, 0x98, 0xdd, 0xd1, 0x50, 0x8e, 0xa3, 0x50, - 0xde, 0x2b, 0x2f, 0x49, 0x21, 0x03, 0xdb, 0x36, 0x54, 0xaf, 0xa6, 0x7a, 0x8b, 0x61, 0xff, 0x58, - 0x80, 0x00, 0x0d, 0x93, 0x32, 0x32, 0xcc, 0xfe, 0x89, 0x00, 0x10, 0x11, 0x27, 0x3a, 0x9b, 0xcc, - 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, 0x78, 0xec, 0x19, 0x4b, 0x5e, 0x6d, 0xc9, 0x1b, 0xc9, 0xa5, - 0x3f, 0x28, 0x72, 0xb7, 0xbb, 0xa4, 0x71, 0xf4, 0x16, 0x2b, 0x98, 0xa7, 0x8c, 0xd7, 0x5d, 0xf8, - 0xe7, 0x8f, 0xcb, 0xce, 0xc8, 0xc4, 0xef, 0x68, 0x46, 0x83, 0x7d, 0x2d, 0x5a, 0x55, 0xec, 0x1b, - 0xb4, 0x9b, 0xa4, 0x00, 0xb3, 0xde, 0x8e, 0x16, 0x3f, 0xf1, 0x9e, 0x5e, 0xc6, 0xfb, 0x58, 0x12, - 0xfc, 0xd3, 0x87, 0xdc, 0x6d, 0x15, 0xb9, 0x7b, 0xb4, 0x35, 0x45, 0x37, 0xe3, 0xc0, 0x88, 0xd8, - 0x33, 0x64, 0xd4, 0xc7, 0x0c, 0xe4, 0x2c, 0x14, 0xbd, 0x67, 0x5a, 0xd4, 0x6d, 0x12, 0xd5, 0xab, - 0x5e, 0x6b, 0x9a, 0x8f, 0x2b, 0xe9, 0xfe, 0x96, 0xf4, 0xbf, 0x4a, 0x38, 0xe8, 0xb0, 0x4d, 0x83, - 0x7d, 0x81, 0xf6, 0x54, 0x28, 0x24, 0x4f, 0x7b, 0xcf, 0xcf, 0xad, 0x41, 0xdb, 0x3f, 0x2c, 0x72, - 0xf7, 0xa0, 0x6a, 0xd6, 0x75, 0x1c, 0x54, 0x04, 0x7c, 0x86, 0x4e, 0x1b, 0x8e, 0x1b, 0x70, 0x95, - 0x80, 0x54, 0x1c, 0x7f, 0xb7, 0x50, 0xf7, 0x56, 0x89, 0x4f, 0x32, 0xfa, 0xff, 0xfc, 0x2f, 0xd1, - 0x2e, 0x7c, 0x29, 0x47, 0x58, 0x7a, 0xc4, 0x8b, 0x22, 0x77, 0xf7, 0xcd, 0x08, 0x5d, 0xc6, 0x81, - 0x81, 0xed, 0x37, 0x08, 0x19, 0xa7, 0x92, 0xc6, 0x5c, 0x9f, 0xb1, 0xed, 0x77, 0x8b, 0xdc, 0x3d, - 0x34, 0xe4, 0x0d, 0x86, 0x83, 0xb6, 0x4e, 0x3e, 0xd0, 0x98, 0x97, 0x1b, 0x64, 0x34, 0x15, 0x3c, - 0xd3, 0x37, 0xda, 0xda, 0xc0, 0xd4, 0x71, 0x50, 0x11, 0xb0, 0x8b, 0xce, 0x1a, 0x1d, 0xd6, 0x3b, - 0xf8, 0xef, 0x1f, 0x56, 0x8e, 0xf5, 0xb8, 0x72, 0xac, 0x3f, 0x2b, 0xc7, 0xfa, 0xb6, 0x76, 0x5a, - 0x8f, 0x6b, 0xa7, 0xf5, 0x6b, 0xed, 0xb4, 0x3e, 0xbf, 0x16, 0x61, 0x76, 0x37, 0x9f, 0x78, 0x0c, - 0x62, 0x62, 0xde, 0xe0, 0x32, 0xa2, 0x13, 0x55, 0xc5, 0x64, 0x71, 0x45, 0xbe, 0x6e, 0xfe, 0x68, - 0xb6, 0x4c, 0xb8, 0x9a, 0xec, 0xe9, 0x6f, 0x75, 0xf5, 0x37, 0x00, 0x00, 0xff, 0xff, 0xe1, 0x46, - 0x2b, 0x52, 0x4e, 0x03, 0x00, 0x00, + // 547 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x41, 0x6e, 0xd3, 0x40, + 0x14, 0x8d, 0x0b, 0xad, 0x94, 0x49, 0x2b, 0x5a, 0xb7, 0x41, 0x69, 0x4a, 0xec, 0x6a, 0x84, 0xaa, + 0x54, 0xa8, 0xb6, 0x48, 0x59, 0xb1, 0x8b, 0x5b, 0x56, 0x34, 0x08, 0x19, 0xb1, 0x61, 0x13, 0x4d, + 0x9c, 0xf1, 0xd4, 0xaa, 0x3d, 0x13, 0x79, 0x26, 0xa1, 0xd9, 0x71, 0x04, 0x8e, 0xc0, 0x21, 0x38, + 0x44, 0xc5, 0xaa, 0x4b, 0x24, 0x24, 0x0b, 0x25, 0x37, 0xf0, 0x09, 0x90, 0x67, 0xec, 0x04, 0x17, + 0x8b, 0xdd, 0xcc, 0xff, 0xef, 0xbf, 0xff, 0xde, 0xb3, 0x07, 0x9c, 0x8e, 0x31, 0x8f, 0x18, 0xb7, + 0x27, 0x31, 0xf3, 0x83, 0x10, 0x73, 0x7b, 0xd6, 0xb3, 0x23, 0x4e, 0xf8, 0xd0, 0xbb, 0x46, 0x01, + 0x1d, 0x86, 0x01, 0xbd, 0xe1, 0xd6, 0x24, 0x66, 0x82, 0xe9, 0xba, 0x82, 0x5a, 0x05, 0xd4, 0x9a, + 0xf5, 0xda, 0x07, 0x84, 0x11, 0x26, 0xdb, 0x76, 0x76, 0x52, 0xc8, 0xf6, 0x21, 0x61, 0x8c, 0x84, + 0xd8, 0x96, 0xb7, 0xd1, 0xd4, 0xb7, 0x11, 0x9d, 0x17, 0x2d, 0x8f, 0x65, 0x24, 0x43, 0x35, 0xa3, + 0x2e, 0x79, 0xeb, 0x45, 0x95, 0x14, 0x36, 0xc6, 0x61, 0x85, 0x18, 0xf8, 0x6b, 0x03, 0xec, 0x0f, + 0x38, 0xb9, 0x0a, 0xe8, 0xcd, 0x45, 0xd6, 0xec, 0x7b, 0x1e, 0x9b, 0x52, 0xa1, 0x7b, 0x60, 0x47, + 0x81, 0xd1, 0x78, 0x1c, 0x63, 0xce, 0x5b, 0xda, 0xb1, 0xd6, 0x6d, 0xf4, 0x0e, 0x2c, 0x25, 0xc9, + 0x2a, 0x24, 0x59, 0x7d, 0x3a, 0x77, 0xba, 0x69, 0x62, 0x36, 0xe7, 0x28, 0x0a, 0x5f, 0x43, 0xce, + 0xa6, 0xb1, 0x87, 0x8b, 0x29, 0xf8, 0xe3, 0xfb, 0x59, 0xa3, 0xaf, 0xce, 0x97, 0x48, 0x20, 0x77, + 0x5b, 0x92, 0xe6, 0x15, 0xfd, 0x0a, 0x6c, 0x4e, 0x62, 0xc6, 0xfc, 0xd6, 0x86, 0x24, 0x3f, 0xb4, + 0xfe, 0x4d, 0xc6, 0x7a, 0x9f, 0x01, 0x9c, 0xa3, 0xbb, 0xc4, 0xac, 0xa5, 0x89, 0xb9, 0x5f, 0xda, + 0x22, 0x87, 0xa1, 0xab, 0x48, 0x74, 0x1f, 0x28, 0xf6, 0xa1, 0xc7, 0xa8, 0x1f, 0x90, 0xd6, 0x23, + 0x49, 0x6a, 0x56, 0x91, 0x4a, 0xab, 0x17, 0x12, 0xe6, 0xc0, 0x9c, 0xba, 0x5d, 0xa2, 0xfe, 0x9b, + 0x09, 0xba, 0x0d, 0x6f, 0x3d, 0xa0, 0x9f, 0x82, 0x2d, 0x1e, 0x10, 0x8a, 0xe3, 0xd6, 0xe3, 0x63, + 0xad, 0x5b, 0x77, 0xf6, 0xd2, 0xc4, 0xdc, 0xc9, 0x87, 0x65, 0x1d, 0xba, 0x39, 0x00, 0x76, 0xc0, + 0x51, 0x45, 0xb8, 0x2e, 0xe6, 0x13, 0x46, 0x39, 0x86, 0xdf, 0x34, 0xd0, 0x1c, 0x70, 0xf2, 0x91, + 0x86, 0x0f, 0xe3, 0x3f, 0x01, 0x9b, 0xec, 0x73, 0xb6, 0x42, 0x93, 0x2b, 0x76, 0xd3, 0xc4, 0xdc, + 0x56, 0x2b, 0x64, 0x19, 0xba, 0xaa, 0xad, 0xbf, 0x02, 0x40, 0x29, 0xa5, 0x28, 0xc2, 0x32, 0xc6, + 0xba, 0xd3, 0x4c, 0x13, 0x73, 0x4f, 0x81, 0xd7, 0x3d, 0xe8, 0xd6, 0xe5, 0xe5, 0x1d, 0x8a, 0x70, + 0xe6, 0x40, 0xa0, 0x98, 0x60, 0x21, 0x33, 0x2a, 0x39, 0x50, 0x75, 0xe8, 0xe6, 0x00, 0x68, 0x82, + 0x4e, 0xa5, 0xc2, 0x95, 0x87, 0x2f, 0x1a, 0x78, 0x36, 0xe0, 0xe4, 0x03, 0x16, 0x97, 0xd8, 0x47, + 0xd3, 0x50, 0xbc, 0xb9, 0x15, 0x38, 0xa6, 0x28, 0x2c, 0x3e, 0x72, 0xa7, 0x24, 0x51, 0xfa, 0x29, + 0x6b, 0xd9, 0xc5, 0xf9, 0xc4, 0xea, 0x5f, 0x93, 0x3e, 0xdc, 0x27, 0xf8, 0x01, 0xd3, 0xd3, 0x55, + 0xf0, 0x52, 0xf6, 0x2a, 0xe5, 0x13, 0xf0, 0xfc, 0x7f, 0x0a, 0x0a, 0xa9, 0xce, 0xdb, 0xbb, 0x85, + 0xa1, 0xdd, 0x2f, 0x0c, 0xed, 0xf7, 0xc2, 0xd0, 0xbe, 0x2e, 0x8d, 0xda, 0xfd, 0xd2, 0xa8, 0xfd, + 0x5c, 0x1a, 0xb5, 0x4f, 0x2f, 0x49, 0x20, 0xae, 0xa7, 0x23, 0xcb, 0x63, 0x91, 0xad, 0x7e, 0x97, + 0xb3, 0x10, 0x8d, 0x78, 0x7e, 0xb6, 0x67, 0xe7, 0xf6, 0xed, 0xfa, 0x39, 0x89, 0xf9, 0x04, 0xf3, + 0xd1, 0x96, 0x7c, 0x01, 0xe7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x44, 0xba, 0x43, 0xf9, + 0x03, 0x00, 0x00, } func (m *MsgLinkChainAccount) Marshal() (dAtA []byte, err error) { @@ -438,6 +547,73 @@ func (m *MsgUnlinkChainAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgSetDefaultExternalAddress) 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 *MsgSetDefaultExternalAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetDefaultExternalAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintMsgsChainLinks(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if len(m.ExternalAddress) > 0 { + i -= len(m.ExternalAddress) + copy(dAtA[i:], m.ExternalAddress) + i = encodeVarintMsgsChainLinks(dAtA, i, uint64(len(m.ExternalAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.ChainName) > 0 { + i -= len(m.ChainName) + copy(dAtA[i:], m.ChainName) + i = encodeVarintMsgsChainLinks(dAtA, i, uint64(len(m.ChainName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetDefaultExternalAddressResponse) 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 *MsgSetDefaultExternalAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetDefaultExternalAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintMsgsChainLinks(dAtA []byte, offset int, v uint64) int { offset -= sovMsgsChainLinks(v) base := offset @@ -509,6 +685,36 @@ func (m *MsgUnlinkChainAccountResponse) Size() (n int) { return n } +func (m *MsgSetDefaultExternalAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainName) + if l > 0 { + n += 1 + l + sovMsgsChainLinks(uint64(l)) + } + l = len(m.ExternalAddress) + if l > 0 { + n += 1 + l + sovMsgsChainLinks(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovMsgsChainLinks(uint64(l)) + } + return n +} + +func (m *MsgSetDefaultExternalAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovMsgsChainLinks(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -945,6 +1151,202 @@ func (m *MsgUnlinkChainAccountResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSetDefaultExternalAddress) 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 ErrIntOverflowMsgsChainLinks + } + 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: MsgSetDefaultExternalAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetDefaultExternalAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgsChainLinks + } + 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 ErrInvalidLengthMsgsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExternalAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgsChainLinks + } + 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 ErrInvalidLengthMsgsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExternalAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgsChainLinks + } + 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 ErrInvalidLengthMsgsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetDefaultExternalAddressResponse) 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 ErrIntOverflowMsgsChainLinks + } + 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: MsgSetDefaultExternalAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetDefaultExternalAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipMsgsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipMsgsChainLinks(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/profiles/types/query.pb.go b/x/profiles/types/query.pb.go index dbc86efcdf..82a46f5360 100644 --- a/x/profiles/types/query.pb.go +++ b/x/profiles/types/query.pb.go @@ -33,46 +33,49 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("desmos/profiles/v2/query.proto", fileDescriptor_fba4df0d7bde4d7c) } var fileDescriptor_fba4df0d7bde4d7c = []byte{ - // 614 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x4f, 0x6b, 0x13, 0x4f, - 0x18, 0xc7, 0xbb, 0x3f, 0xf8, 0x55, 0x98, 0x8b, 0x32, 0xe8, 0x21, 0x21, 0x6e, 0xb1, 0x9a, 0x3f, - 0xa4, 0xc9, 0x8e, 0x49, 0x50, 0xa8, 0xe8, 0xc1, 0xb6, 0x97, 0xa2, 0x60, 0x95, 0x9e, 0xbc, 0x84, - 0xd9, 0xcd, 0x64, 0x3b, 0xb8, 0x99, 0x99, 0xee, 0x6c, 0xa2, 0xa1, 0xe4, 0xe2, 0xcd, 0x8b, 0x08, - 0xde, 0x3d, 0xf9, 0x12, 0x7c, 0x09, 0x1e, 0xbc, 0x88, 0x05, 0x2f, 0x1e, 0x25, 0xf1, 0x85, 0xc8, - 0xce, 0x9f, 0x86, 0xc6, 0x6c, 0x92, 0xf6, 0xb6, 0xbb, 0xf3, 0xf9, 0xce, 0xf3, 0x79, 0x66, 0x1f, - 0x06, 0xb8, 0x1d, 0x22, 0x7b, 0x5c, 0x22, 0x11, 0xf3, 0x2e, 0x8d, 0x88, 0x44, 0x83, 0x26, 0x3a, - 0xee, 0x93, 0x78, 0xe8, 0x89, 0x98, 0x27, 0x1c, 0x42, 0xbd, 0xee, 0xd9, 0x75, 0x6f, 0xd0, 0xcc, - 0x5f, 0x0f, 0x79, 0xc8, 0xd5, 0x32, 0x4a, 0x9f, 0x34, 0x99, 0x2f, 0x84, 0x9c, 0x87, 0x11, 0x41, - 0x58, 0x50, 0x84, 0x19, 0xe3, 0x09, 0x4e, 0x28, 0x67, 0xd2, 0xac, 0xe6, 0xcc, 0xaa, 0x7a, 0xf3, - 0xfb, 0x5d, 0x84, 0x99, 0x29, 0x91, 0x2f, 0x65, 0x29, 0xb4, 0xcd, 0x17, 0xc3, 0xd5, 0x32, 0xb9, - 0x4e, 0x82, 0xc3, 0x76, 0x4c, 0x8e, 0xfb, 0x44, 0x26, 0xb6, 0x60, 0x31, 0x7b, 0x57, 0x1c, 0xe3, - 0x9e, 0xc5, 0xaa, 0x99, 0x58, 0x70, 0x84, 0x29, 0x6b, 0x47, 0x94, 0xbd, 0xb2, 0x6c, 0x25, 0x93, - 0xc5, 0x42, 0x9c, 0x23, 0x73, 0x01, 0x4f, 0xc9, 0xb6, 0x3e, 0x24, 0xfd, 0x62, 0x0b, 0xea, 0x37, - 0xe4, 0x63, 0x49, 0x74, 0x1a, 0x0d, 0x1a, 0x3e, 0x49, 0x70, 0x03, 0x09, 0x1c, 0x52, 0xa6, 0x4e, - 0x4d, 0xb3, 0xcd, 0xaf, 0x00, 0xfc, 0xff, 0x3c, 0x45, 0xe0, 0x3b, 0x07, 0x5c, 0x39, 0xd0, 0x65, - 0x61, 0xd9, 0xfb, 0xf7, 0x9f, 0x78, 0x0a, 0x33, 0xc4, 0x0b, 0x7d, 0x12, 0xf9, 0xca, 0x72, 0x50, - 0x0a, 0xce, 0x24, 0xd9, 0xdc, 0x7a, 0xfb, 0xf3, 0xcf, 0xc7, 0xff, 0x8a, 0xf0, 0x36, 0x9a, 0xd3, - 0xe2, 0xd9, 0xf3, 0x49, 0x5f, 0x92, 0x78, 0x04, 0x7f, 0x38, 0xa0, 0xb0, 0xcf, 0x02, 0xde, 0xa3, - 0x2c, 0xdc, 0x3b, 0xc4, 0xe1, 0x61, 0x8c, 0x99, 0xec, 0x92, 0xd8, 0x94, 0x95, 0xf0, 0x61, 0x66, - 0xdd, 0x45, 0x31, 0x6b, 0xfd, 0xe8, 0x92, 0x69, 0xd3, 0x4a, 0x53, 0xb5, 0x52, 0x83, 0xd5, 0x79, - 0xad, 0xa4, 0x83, 0x52, 0x4f, 0x4c, 0xb4, 0x6e, 0x27, 0x06, 0xbe, 0x77, 0x00, 0xd8, 0x4d, 0x7f, - 0xf7, 0xd3, 0xf4, 0x1f, 0xc2, 0x6a, 0xa6, 0xc1, 0x14, 0xb2, 0xb6, 0x5b, 0x2b, 0xb1, 0xc6, 0xad, - 0xac, 0xdc, 0x6e, 0xc1, 0x8d, 0x79, 0x6e, 0x6a, 0xde, 0xea, 0x6a, 0x8a, 0xe0, 0x67, 0x07, 0x5c, - 0x3d, 0xcb, 0x3f, 0x7b, 0xcd, 0x48, 0x2c, 0x21, 0x5a, 0x5e, 0x49, 0x93, 0x56, 0xed, 0xee, 0xea, - 0x01, 0xe3, 0xe7, 0x29, 0xbf, 0x0a, 0x2c, 0x2d, 0xf1, 0x43, 0x5c, 0x2b, 0x7d, 0x72, 0xc0, 0xb5, - 0xc7, 0x42, 0x44, 0x34, 0x50, 0x53, 0xab, 0x4f, 0x2f, 0xbb, 0xec, 0x2c, 0x6a, 0x45, 0x1b, 0x17, - 0x48, 0x18, 0xd3, 0xa2, 0x32, 0xdd, 0x80, 0x37, 0xe7, 0x99, 0x62, 0x21, 0xcc, 0x39, 0x7e, 0x77, - 0x40, 0x6e, 0x66, 0x8f, 0x9d, 0xe1, 0x6e, 0x44, 0x09, 0x4b, 0xf6, 0xf7, 0xe0, 0xf6, 0xaa, 0x75, - 0xa7, 0x19, 0xab, 0xfc, 0xe0, 0x32, 0x51, 0xe3, 0xbe, 0xad, 0xdc, 0x5b, 0xb0, 0xb1, 0xd0, 0x1d, - 0x05, 0x2a, 0x27, 0xd1, 0x89, 0x7e, 0x68, 0xd3, 0xce, 0x08, 0x7e, 0x71, 0xc0, 0x8d, 0x99, 0x02, - 0x66, 0x3a, 0xee, 0xad, 0x2a, 0x74, 0x7e, 0x46, 0xee, 0x5f, 0x34, 0x66, 0x7a, 0xa8, 0xa9, 0x1e, - 0x4a, 0xf0, 0xce, 0xe2, 0x1e, 0xcc, 0x9c, 0x8c, 0xc0, 0xfa, 0x81, 0xba, 0x74, 0x61, 0x29, 0xfb, - 0x4a, 0x52, 0x80, 0xf5, 0x2a, 0x2f, 0xe5, 0x8c, 0xc8, 0xa6, 0x12, 0x29, 0xc0, 0xfc, 0xdc, 0x9b, - 0x4b, 0xb1, 0x3b, 0x4f, 0xbe, 0x8d, 0x5d, 0xe7, 0x74, 0xec, 0x3a, 0xbf, 0xc7, 0xae, 0xf3, 0x61, - 0xe2, 0xae, 0x9d, 0x4e, 0xdc, 0xb5, 0x5f, 0x13, 0x77, 0xed, 0x65, 0x23, 0xa4, 0xc9, 0x51, 0xdf, - 0xf7, 0x02, 0xde, 0x33, 0xf9, 0x7a, 0x84, 0x7d, 0x69, 0xf7, 0x1a, 0xb4, 0xd0, 0x9b, 0xe9, 0x86, - 0xc9, 0x50, 0x10, 0xe9, 0xaf, 0xab, 0xab, 0xb9, 0xf5, 0x37, 0x00, 0x00, 0xff, 0xff, 0xe6, 0x22, - 0xf5, 0xbf, 0x39, 0x07, 0x00, 0x00, + // 665 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x95, 0x4f, 0x6b, 0x13, 0x41, + 0x18, 0xc6, 0xbb, 0x82, 0x15, 0x06, 0x41, 0x19, 0x14, 0x6c, 0xa8, 0x5b, 0xac, 0x26, 0x29, 0x6d, + 0x77, 0xc7, 0xa4, 0x28, 0x56, 0xf4, 0xd0, 0x3f, 0x1e, 0x8a, 0x82, 0x55, 0x7a, 0xf2, 0x12, 0x66, + 0x37, 0x93, 0xed, 0xe2, 0x66, 0x66, 0xba, 0x33, 0x1b, 0x5b, 0x4a, 0x2f, 0x82, 0x07, 0x2f, 0x22, + 0x78, 0xf7, 0xe4, 0x47, 0xf0, 0xec, 0xd9, 0x8b, 0x58, 0xf0, 0xe2, 0x51, 0x5a, 0x3f, 0x88, 0xec, + 0xfc, 0x69, 0x69, 0xdc, 0x4d, 0xd2, 0xdc, 0x76, 0x32, 0xcf, 0x33, 0xcf, 0xef, 0x9d, 0xf7, 0xcd, + 0x2e, 0x70, 0xdb, 0x44, 0x74, 0x99, 0x40, 0x3c, 0x65, 0x9d, 0x38, 0x21, 0x02, 0xf5, 0x9a, 0x68, + 0x27, 0x23, 0xe9, 0x9e, 0xcf, 0x53, 0x26, 0x19, 0x84, 0x7a, 0xdf, 0xb7, 0xfb, 0x7e, 0xaf, 0x59, + 0xb9, 0x16, 0xb1, 0x88, 0xa9, 0x6d, 0x94, 0x3f, 0x69, 0x65, 0x65, 0x3a, 0x62, 0x2c, 0x4a, 0x08, + 0xc2, 0x3c, 0x46, 0x98, 0x52, 0x26, 0xb1, 0x8c, 0x19, 0x15, 0x66, 0x77, 0xca, 0xec, 0xaa, 0x55, + 0x90, 0x75, 0x10, 0xa6, 0x26, 0xa2, 0x52, 0x2b, 0x43, 0x68, 0x99, 0x5f, 0x8c, 0x6e, 0xb1, 0x54, + 0xd7, 0x96, 0x38, 0x6a, 0xa5, 0x64, 0x27, 0x23, 0x42, 0xda, 0xc0, 0x6a, 0xf9, 0xa9, 0x38, 0xc5, + 0x5d, 0x2b, 0x9b, 0x2f, 0x95, 0x85, 0xdb, 0x38, 0xa6, 0xad, 0x24, 0xa6, 0xaf, 0xad, 0x76, 0xae, + 0x54, 0x8b, 0x39, 0x3f, 0xa3, 0x9c, 0x0a, 0x59, 0xae, 0x6c, 0xe9, 0x4b, 0xd2, 0x0b, 0x1b, 0xa8, + 0x57, 0x28, 0xc0, 0x82, 0x68, 0x37, 0xea, 0x35, 0x02, 0x22, 0x71, 0x03, 0x71, 0x1c, 0xc5, 0x54, + 0xdd, 0x9a, 0xd6, 0x36, 0xdf, 0x5d, 0x06, 0x17, 0x5f, 0xe4, 0x12, 0xf8, 0xde, 0x01, 0x97, 0x36, + 0x75, 0x2c, 0xac, 0xfb, 0xff, 0xf7, 0xc4, 0x57, 0x32, 0xa3, 0x78, 0xa9, 0x6f, 0xa2, 0x32, 0x37, + 0x5c, 0x28, 0x38, 0xa3, 0x82, 0xcc, 0x2e, 0xbc, 0xfd, 0xf5, 0xf7, 0xd3, 0x85, 0x2a, 0xbc, 0x8d, + 0x0a, 0x4a, 0x3c, 0x79, 0xde, 0xcf, 0x04, 0x49, 0x0f, 0xe0, 0x4f, 0x07, 0x4c, 0x6f, 0xd0, 0x90, + 0x75, 0x63, 0x1a, 0xad, 0x6f, 0xe1, 0x68, 0x2b, 0xc5, 0x54, 0x74, 0x48, 0x6a, 0x62, 0x05, 0x7c, + 0x54, 0x9a, 0x3b, 0xc8, 0x66, 0xa9, 0x1f, 0x8f, 0xe9, 0x36, 0xa5, 0x34, 0x55, 0x29, 0x8b, 0x70, + 0xbe, 0xa8, 0x94, 0x7c, 0x50, 0x3c, 0x69, 0xac, 0x9e, 0x9d, 0x18, 0xf8, 0xc1, 0x01, 0x60, 0x2d, + 0x6f, 0xf7, 0xb3, 0xbc, 0x87, 0x70, 0xbe, 0x94, 0xe0, 0x54, 0x64, 0x69, 0x17, 0x46, 0xd2, 0x1a, + 0xb6, 0xba, 0x62, 0xbb, 0x05, 0x67, 0x8a, 0xd8, 0xd4, 0xbc, 0x79, 0x6a, 0x8a, 0xe0, 0x17, 0x07, + 0x5c, 0x39, 0xf1, 0x3f, 0x7f, 0x43, 0x49, 0x2a, 0x20, 0x1a, 0x9e, 0xa4, 0x95, 0x16, 0xed, 0xee, + 0xe8, 0x06, 0xc3, 0xe7, 0x2b, 0xbe, 0x39, 0x58, 0x1b, 0xc2, 0x87, 0x98, 0x46, 0xfa, 0xe6, 0x80, + 0x1b, 0xeb, 0xa4, 0x83, 0xb3, 0x44, 0x3e, 0xd9, 0x95, 0x24, 0xa5, 0x38, 0x59, 0x69, 0xb7, 0x53, + 0x22, 0x04, 0x11, 0xf0, 0x41, 0x69, 0x7c, 0x99, 0xc5, 0x82, 0x2f, 0x8f, 0xe1, 0x34, 0x15, 0x78, + 0xaa, 0x82, 0x3a, 0xac, 0x16, 0x76, 0x5f, 0xbb, 0x3d, 0x7c, 0xc2, 0xf8, 0xd9, 0x01, 0x57, 0x57, + 0x38, 0x4f, 0xe2, 0x50, 0xfd, 0xed, 0x74, 0xfb, 0xcb, 0xef, 0xad, 0x5f, 0x6a, 0x81, 0x1b, 0xe7, + 0x70, 0x18, 0xd0, 0xaa, 0x02, 0x9d, 0x81, 0x37, 0x8b, 0x40, 0x31, 0xe7, 0x66, 0x10, 0x7e, 0x38, + 0x60, 0xaa, 0xef, 0x8c, 0xd5, 0xbd, 0xb5, 0x24, 0x26, 0x54, 0x6e, 0xac, 0xc3, 0xe5, 0x51, 0x73, + 0x4f, 0x3d, 0x16, 0xf9, 0xe1, 0x38, 0x56, 0xc3, 0xbe, 0xac, 0xd8, 0x97, 0x60, 0x63, 0x20, 0x3b, + 0x0a, 0x95, 0x4f, 0xa0, 0x7d, 0xfd, 0xd0, 0x8a, 0xdb, 0x07, 0xf0, 0xab, 0x03, 0xae, 0xf7, 0x05, + 0x98, 0xf1, 0xbe, 0x37, 0x2a, 0xd0, 0xd9, 0x21, 0xbf, 0x7f, 0x5e, 0x9b, 0xa9, 0x61, 0x51, 0xd5, + 0x50, 0x83, 0x77, 0x06, 0xd7, 0x60, 0x06, 0xfd, 0x00, 0x4c, 0x6e, 0xaa, 0xaf, 0x06, 0xac, 0x95, + 0xbf, 0x53, 0x95, 0xc0, 0x72, 0xd5, 0x87, 0xea, 0x0c, 0xc8, 0xac, 0x02, 0x99, 0x86, 0x95, 0xc2, + 0x57, 0xaf, 0xd2, 0xae, 0x3e, 0xfd, 0x7e, 0xe4, 0x3a, 0x87, 0x47, 0xae, 0xf3, 0xe7, 0xc8, 0x75, + 0x3e, 0x1e, 0xbb, 0x13, 0x87, 0xc7, 0xee, 0xc4, 0xef, 0x63, 0x77, 0xe2, 0x55, 0x23, 0x8a, 0xe5, + 0x76, 0x16, 0xf8, 0x21, 0xeb, 0x1a, 0xbf, 0x97, 0xe0, 0x40, 0xd8, 0xb3, 0x7a, 0x4b, 0x68, 0xf7, + 0xf4, 0x40, 0xb9, 0xc7, 0x89, 0x08, 0x26, 0xd5, 0xb7, 0x65, 0xe9, 0x5f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xed, 0xf4, 0x31, 0x8f, 0xfa, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -100,6 +103,9 @@ type QueryClient interface { // ChainLinkOwners queries for the owners of chain links, optionally searching // for a specific chain name and external address ChainLinkOwners(ctx context.Context, in *QueryChainLinkOwnersRequest, opts ...grpc.CallOption) (*QueryChainLinkOwnersResponse, error) + // DefaultExternalAddresses queries the default addresses associated to the + // given user and (optionally) chain name + DefaultExternalAddresses(ctx context.Context, in *QueryDefaultExternalAddressesRequest, opts ...grpc.CallOption) (*QueryDefaultExternalAddressesResponse, error) // ApplicationLinks queries the applications links associated to the given // user, if provided. Otherwise, it queries all the application links stored. ApplicationLinks(ctx context.Context, in *QueryApplicationLinksRequest, opts ...grpc.CallOption) (*QueryApplicationLinksResponse, error) @@ -157,6 +163,15 @@ func (c *queryClient) ChainLinkOwners(ctx context.Context, in *QueryChainLinkOwn return out, nil } +func (c *queryClient) DefaultExternalAddresses(ctx context.Context, in *QueryDefaultExternalAddressesRequest, opts ...grpc.CallOption) (*QueryDefaultExternalAddressesResponse, error) { + out := new(QueryDefaultExternalAddressesResponse) + err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/DefaultExternalAddresses", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + 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...) @@ -208,6 +223,9 @@ type QueryServer interface { // ChainLinkOwners queries for the owners of chain links, optionally searching // for a specific chain name and external address ChainLinkOwners(context.Context, *QueryChainLinkOwnersRequest) (*QueryChainLinkOwnersResponse, error) + // DefaultExternalAddresses queries the default addresses associated to the + // given user and (optionally) chain name + DefaultExternalAddresses(context.Context, *QueryDefaultExternalAddressesRequest) (*QueryDefaultExternalAddressesResponse, error) // ApplicationLinks queries the applications links associated to the given // user, if provided. Otherwise, it queries all the application links stored. ApplicationLinks(context.Context, *QueryApplicationLinksRequest) (*QueryApplicationLinksResponse, error) @@ -237,6 +255,9 @@ func (*UnimplementedQueryServer) ChainLinks(ctx context.Context, req *QueryChain func (*UnimplementedQueryServer) ChainLinkOwners(ctx context.Context, req *QueryChainLinkOwnersRequest) (*QueryChainLinkOwnersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ChainLinkOwners not implemented") } +func (*UnimplementedQueryServer) DefaultExternalAddresses(ctx context.Context, req *QueryDefaultExternalAddressesRequest) (*QueryDefaultExternalAddressesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DefaultExternalAddresses not implemented") +} func (*UnimplementedQueryServer) ApplicationLinks(ctx context.Context, req *QueryApplicationLinksRequest) (*QueryApplicationLinksResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ApplicationLinks not implemented") } @@ -326,6 +347,24 @@ func _Query_ChainLinkOwners_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Query_DefaultExternalAddresses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDefaultExternalAddressesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DefaultExternalAddresses(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/desmos.profiles.v2.Query/DefaultExternalAddresses", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DefaultExternalAddresses(ctx, req.(*QueryDefaultExternalAddressesRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_ApplicationLinks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryApplicationLinksRequest) if err := dec(in); err != nil { @@ -418,6 +457,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "ChainLinkOwners", Handler: _Query_ChainLinkOwners_Handler, }, + { + MethodName: "DefaultExternalAddresses", + Handler: _Query_DefaultExternalAddresses_Handler, + }, { MethodName: "ApplicationLinks", Handler: _Query_ApplicationLinks_Handler, diff --git a/x/profiles/types/query.pb.gw.go b/x/profiles/types/query.pb.gw.go index 5ec0613d09..3a2b3833fa 100644 --- a/x/profiles/types/query.pb.gw.go +++ b/x/profiles/types/query.pb.gw.go @@ -193,6 +193,42 @@ func local_request_Query_ChainLinkOwners_0(ctx context.Context, marshaler runtim } +var ( + filter_Query_DefaultExternalAddresses_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_DefaultExternalAddresses_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDefaultExternalAddressesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DefaultExternalAddresses_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DefaultExternalAddresses(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DefaultExternalAddresses_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDefaultExternalAddressesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DefaultExternalAddresses_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DefaultExternalAddresses(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_ApplicationLinks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -423,6 +459,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_DefaultExternalAddresses_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DefaultExternalAddresses_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DefaultExternalAddresses_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_ApplicationLinks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -624,6 +680,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_DefaultExternalAddresses_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DefaultExternalAddresses_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DefaultExternalAddresses_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_ApplicationLinks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -716,6 +792,8 @@ var ( 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_DefaultExternalAddresses_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v2", "default-addresses"}, "", 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_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))) @@ -734,6 +812,8 @@ var ( forward_Query_ChainLinkOwners_0 = runtime.ForwardResponseMessage + forward_Query_DefaultExternalAddresses_0 = runtime.ForwardResponseMessage + forward_Query_ApplicationLinks_0 = runtime.ForwardResponseMessage forward_Query_ApplicationLinkByClientID_0 = runtime.ForwardResponseMessage diff --git a/x/profiles/types/query_chain_links.pb.go b/x/profiles/types/query_chain_links.pb.go index 57685aeeeb..bada14f354 100644 --- a/x/profiles/types/query_chain_links.pb.go +++ b/x/profiles/types/query_chain_links.pb.go @@ -348,12 +348,135 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) GetTarget() string return "" } +// QueryDefaultExternalAddressesRequest is the request type for +// Query/DefaultExternalAddresses RPC method +type QueryDefaultExternalAddressesRequest struct { + // User for which to query the default addresses + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + // (optional) Chain name to query the default address for + ChainName string `protobuf:"bytes,2,opt,name=chain_name,json=chainName,proto3" json:"chain_name,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDefaultExternalAddressesRequest) Reset() { *m = QueryDefaultExternalAddressesRequest{} } +func (m *QueryDefaultExternalAddressesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDefaultExternalAddressesRequest) ProtoMessage() {} +func (*QueryDefaultExternalAddressesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f3f86dba4268625b, []int{4} +} +func (m *QueryDefaultExternalAddressesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDefaultExternalAddressesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDefaultExternalAddressesRequest.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 *QueryDefaultExternalAddressesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDefaultExternalAddressesRequest.Merge(m, src) +} +func (m *QueryDefaultExternalAddressesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDefaultExternalAddressesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDefaultExternalAddressesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDefaultExternalAddressesRequest proto.InternalMessageInfo + +func (m *QueryDefaultExternalAddressesRequest) GetUser() string { + if m != nil { + return m.User + } + return "" +} + +func (m *QueryDefaultExternalAddressesRequest) GetChainName() string { + if m != nil { + return m.ChainName + } + return "" +} + +func (m *QueryDefaultExternalAddressesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryDefaultExternalAddressesResponse is the response type for +// Query/DefaultExternalAddresses RPC method +type QueryDefaultExternalAddressesResponse struct { + // List of default addresses, each one represented by the associated chain + // link + ChainLinks []ChainLink `protobuf:"bytes,1,rep,name=chain_links,json=chainLinks,proto3" json:"chain_links"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDefaultExternalAddressesResponse) Reset() { *m = QueryDefaultExternalAddressesResponse{} } +func (m *QueryDefaultExternalAddressesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDefaultExternalAddressesResponse) ProtoMessage() {} +func (*QueryDefaultExternalAddressesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f3f86dba4268625b, []int{5} +} +func (m *QueryDefaultExternalAddressesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDefaultExternalAddressesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDefaultExternalAddressesResponse.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 *QueryDefaultExternalAddressesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDefaultExternalAddressesResponse.Merge(m, src) +} +func (m *QueryDefaultExternalAddressesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDefaultExternalAddressesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDefaultExternalAddressesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDefaultExternalAddressesResponse proto.InternalMessageInfo + +func (m *QueryDefaultExternalAddressesResponse) GetChainLinks() []ChainLink { + if m != nil { + return m.ChainLinks + } + return nil +} + +func (m *QueryDefaultExternalAddressesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + 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((*QueryDefaultExternalAddressesRequest)(nil), "desmos.profiles.v2.QueryDefaultExternalAddressesRequest") + proto.RegisterType((*QueryDefaultExternalAddressesResponse)(nil), "desmos.profiles.v2.QueryDefaultExternalAddressesResponse") } func init() { @@ -361,37 +484,41 @@ func init() { } var fileDescriptor_f3f86dba4268625b = []byte{ - // 475 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, 0xdd, 0x89, 0xeb, 0x40, 0xe3, 0x00, 0xe2, 0x4f, 0x8f, 0x5c, 0x2a, 0xa7, 0x7d, 0x97, - 0x59, 0x24, 0x76, 0x16, 0x3b, 0x85, 0x7e, 0x0b, 0x3e, 0x00, 0x7c, 0x02, 0x4e, 0x7c, 0x8b, 0x1d, - 0x77, 0xe4, 0x84, 0x50, 0xfb, 0x45, 0x50, 0x6c, 0xb3, 0x11, 0x35, 0x0c, 0x09, 0xf5, 0xe6, 0xd7, - 0xef, 0x6b, 0xff, 0x9e, 0x3e, 0x8d, 0xf1, 0xe1, 0x0c, 0x74, 0xa6, 0x34, 0xcb, 0x0b, 0x75, 0x2a, - 0x52, 0xd0, 0x6c, 0x3e, 0x62, 0xe7, 0x25, 0x14, 0x8b, 0xc9, 0xf4, 0x8c, 0x0b, 0x39, 0x49, 0x85, - 0x7c, 0xaf, 0x69, 0x5e, 0x28, 0xa3, 0x08, 0x71, 0xb3, 0xf4, 0xf7, 0x2c, 0x9d, 0x8f, 0xc2, 0xdb, - 0x89, 0x4a, 0x94, 0x6d, 0xb3, 0x6a, 0xe5, 0x26, 0xc3, 0xbd, 0x44, 0xa9, 0x24, 0x05, 0xc6, 0x73, - 0xc1, 0xb8, 0x94, 0xca, 0x70, 0x23, 0x94, 0xf4, 0xf7, 0x84, 0xbb, 0xbe, 0x6b, 0xab, 0xb8, 0x3c, - 0x65, 0x5c, 0x2e, 0x7c, 0xeb, 0x51, 0x03, 0x4e, 0xa6, 0x66, 0x90, 0xea, 0x75, 0x9e, 0x70, 0x77, - 0xaa, 0xaa, 0xe1, 0x89, 0x8b, 0x77, 0x85, 0x6f, 0x1d, 0xba, 0x8a, 0xc5, 0x5c, 0x83, 0xfb, 0x3d, - 0x6c, 0x3e, 0x8c, 0xc1, 0xf0, 0x21, 0xcb, 0x79, 0x22, 0xa4, 0xe5, 0x71, 0xb3, 0x07, 0x5f, 0x11, - 0xde, 0x79, 0x5b, 0x8d, 0x3c, 0xad, 0x12, 0x5e, 0x56, 0x01, 0x63, 0x38, 0x2f, 0x41, 0x1b, 0x42, - 0x70, 0xb7, 0xd4, 0x50, 0x04, 0xa8, 0x8f, 0x06, 0x5b, 0x63, 0xbb, 0x26, 0xfb, 0x18, 0x3b, 0x14, - 0xc9, 0x33, 0x08, 0xda, 0xb6, 0xb3, 0x65, 0x77, 0x5e, 0xf1, 0x0c, 0xc8, 0x0e, 0xee, 0x19, 0x5e, - 0x24, 0x60, 0x82, 0x8e, 0x6d, 0xf9, 0x8a, 0x9c, 0x60, 0x7c, 0x9d, 0x1c, 0x74, 0xfb, 0x68, 0xb0, - 0x3d, 0x7a, 0x40, 0x3d, 0x74, 0x85, 0x49, 0x2d, 0x26, 0xf5, 0x98, 0xf4, 0x0d, 0x4f, 0xc0, 0x63, - 0x8c, 0xff, 0x38, 0x79, 0xf0, 0x05, 0xe1, 0xbb, 0x6b, 0xb4, 0x3a, 0x57, 0x52, 0x03, 0x79, 0x82, - 0x6f, 0x59, 0x3f, 0x01, 0xea, 0x77, 0x06, 0xdb, 0xa3, 0x7d, 0xba, 0xfe, 0x87, 0xd1, 0xab, 0x63, - 0xc7, 0xdd, 0x8b, 0x1f, 0xf7, 0x5b, 0x63, 0x77, 0x82, 0x3c, 0xaf, 0xe1, 0xb5, 0x2d, 0xde, 0xc3, - 0x7f, 0xe2, 0xb9, 0xdc, 0x1a, 0xdf, 0x67, 0x84, 0xef, 0xd5, 0xf9, 0x5e, 0x7f, 0x90, 0x50, 0x5c, - 0x29, 0xad, 0xeb, 0x43, 0x7f, 0xd7, 0xd7, 0xbe, 0x41, 0x5f, 0xe7, 0xbf, 0xf5, 0x7d, 0x6b, 0xe3, - 0xbd, 0x66, 0x3c, 0xef, 0x70, 0x86, 0x7b, 0xca, 0xee, 0x78, 0x89, 0x27, 0x4d, 0x12, 0x6f, 0xba, - 0x81, 0xd6, 0xf7, 0x9f, 0x81, 0xe1, 0x22, 0xd5, 0xde, 0xb6, 0xbf, 0x7b, 0x63, 0xba, 0xc3, 0x18, - 0xdf, 0x69, 0xcc, 0xdb, 0xe0, 0xa7, 0x7b, 0xfc, 0xe2, 0x62, 0x19, 0xa1, 0xcb, 0x65, 0x84, 0x7e, - 0x2e, 0x23, 0xf4, 0x69, 0x15, 0xb5, 0x2e, 0x57, 0x51, 0xeb, 0xfb, 0x2a, 0x6a, 0xbd, 0x1b, 0x26, - 0xc2, 0x9c, 0x95, 0x31, 0x9d, 0xaa, 0x8c, 0x39, 0x4d, 0x8f, 0x53, 0x1e, 0x6b, 0xbf, 0x66, 0xf3, - 0x23, 0xf6, 0xf1, 0xfa, 0x29, 0x9b, 0x45, 0x0e, 0x3a, 0xee, 0xd9, 0x47, 0x77, 0xf4, 0x2b, 0x00, - 0x00, 0xff, 0xff, 0xb5, 0xe1, 0xdb, 0xd4, 0x79, 0x04, 0x00, 0x00, + // 533 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xcd, 0x6e, 0x13, 0x3d, + 0x14, 0x86, 0xe3, 0x24, 0x5f, 0xa4, 0x3a, 0xbb, 0xd1, 0x47, 0x49, 0x87, 0x76, 0x88, 0x22, 0x7e, + 0xa2, 0x22, 0x6c, 0x25, 0x5d, 0xb1, 0xa4, 0x84, 0xb2, 0xa0, 0xe2, 0x27, 0x4b, 0x36, 0x91, 0x27, + 0x73, 0x32, 0x1d, 0x31, 0x63, 0x4f, 0xc7, 0x9e, 0xd0, 0xdc, 0x05, 0x17, 0x00, 0x0b, 0xd6, 0xac, + 0xd8, 0x70, 0x0d, 0x5d, 0x76, 0xc9, 0x0a, 0xa1, 0xe4, 0x46, 0xd0, 0xd8, 0xa6, 0xed, 0x28, 0xa1, + 0x15, 0x90, 0x9d, 0x8f, 0xcf, 0xb1, 0xdf, 0xc7, 0xaf, 0xed, 0x83, 0x77, 0x03, 0x90, 0x89, 0x90, + 0x34, 0xcd, 0xc4, 0x24, 0x8a, 0x41, 0xd2, 0x69, 0x9f, 0x1e, 0xe7, 0x90, 0xcd, 0x46, 0xe3, 0x23, + 0x16, 0xf1, 0x51, 0x1c, 0xf1, 0xb7, 0x92, 0xa4, 0x99, 0x50, 0xc2, 0x71, 0x4c, 0x2d, 0xf9, 0x55, + 0x4b, 0xa6, 0x7d, 0xf7, 0xff, 0x50, 0x84, 0x42, 0xa7, 0x69, 0x31, 0x32, 0x95, 0xee, 0x76, 0x28, + 0x44, 0x18, 0x03, 0x65, 0x69, 0x44, 0x19, 0xe7, 0x42, 0x31, 0x15, 0x09, 0x6e, 0xf7, 0x71, 0xb7, + 0x6c, 0x56, 0x47, 0x7e, 0x3e, 0xa1, 0x8c, 0xcf, 0x6c, 0xea, 0xc1, 0x0a, 0x9c, 0x44, 0x04, 0x10, + 0xcb, 0x65, 0x1e, 0x77, 0x6b, 0x2c, 0x8a, 0xe2, 0x91, 0x91, 0x37, 0x81, 0x4d, 0xed, 0x9a, 0x88, + 0xfa, 0x4c, 0x82, 0x39, 0x0f, 0x9d, 0xf6, 0x7c, 0x50, 0xac, 0x47, 0x53, 0x16, 0x46, 0x5c, 0xf3, + 0x98, 0xda, 0xce, 0x67, 0x84, 0x37, 0x5f, 0x17, 0x25, 0x4f, 0x0a, 0x85, 0xc3, 0x42, 0x60, 0x08, + 0xc7, 0x39, 0x48, 0xe5, 0x38, 0xb8, 0x9e, 0x4b, 0xc8, 0x5a, 0xa8, 0x8d, 0xba, 0x1b, 0x43, 0x3d, + 0x76, 0x76, 0x30, 0x36, 0x28, 0x9c, 0x25, 0xd0, 0xaa, 0xea, 0xcc, 0x86, 0x9e, 0x79, 0xc1, 0x12, + 0x70, 0x36, 0x71, 0x43, 0xb1, 0x2c, 0x04, 0xd5, 0xaa, 0xe9, 0x94, 0x8d, 0x9c, 0x03, 0x8c, 0x2f, + 0x94, 0x5b, 0xf5, 0x36, 0xea, 0x36, 0xfb, 0xf7, 0x88, 0x85, 0x2e, 0x30, 0x89, 0xc6, 0x24, 0x16, + 0x93, 0xbc, 0x62, 0x21, 0x58, 0x8c, 0xe1, 0xa5, 0x95, 0x9d, 0x8f, 0x08, 0xdf, 0x5c, 0xa2, 0x95, + 0xa9, 0xe0, 0x12, 0x9c, 0x47, 0xf8, 0x3f, 0xed, 0x4f, 0x0b, 0xb5, 0x6b, 0xdd, 0x66, 0x7f, 0x87, + 0x2c, 0x5f, 0x18, 0x39, 0x5f, 0xb6, 0x5f, 0x3f, 0xfd, 0x7e, 0xbb, 0x32, 0x34, 0x2b, 0x9c, 0x67, + 0x25, 0xbc, 0xaa, 0xc6, 0xbb, 0x7f, 0x2d, 0x9e, 0xd1, 0x2d, 0xf1, 0x7d, 0x40, 0xf8, 0x56, 0x99, + 0xef, 0xe5, 0x3b, 0x0e, 0xd9, 0xb9, 0xa5, 0x65, 0xfb, 0xd0, 0xef, 0xed, 0xab, 0x5e, 0x61, 0x5f, + 0xed, 0xaf, 0xed, 0xfb, 0x52, 0xc5, 0xdb, 0xab, 0xf1, 0xac, 0x87, 0x01, 0x6e, 0x08, 0x3d, 0x63, + 0x4d, 0x3c, 0x58, 0x65, 0xe2, 0x55, 0x3b, 0x90, 0xf2, 0xfc, 0x00, 0x14, 0x8b, 0x62, 0x69, 0xdd, + 0xb6, 0x7b, 0xaf, 0xcd, 0x6e, 0xd7, 0xc7, 0x37, 0x56, 0xea, 0xad, 0xf1, 0xe9, 0x76, 0x3e, 0x21, + 0x7c, 0x47, 0x9f, 0x78, 0x00, 0x13, 0x96, 0xc7, 0xea, 0xe9, 0x89, 0x82, 0x8c, 0xb3, 0xf8, 0x71, + 0x10, 0x64, 0x20, 0x25, 0xfc, 0xcb, 0x77, 0x59, 0xd7, 0xbd, 0x7e, 0x45, 0xf8, 0xee, 0x35, 0x8c, + 0xf6, 0x82, 0x07, 0xb8, 0x79, 0xa9, 0x95, 0xfc, 0xc9, 0x57, 0x31, 0x07, 0x39, 0x5c, 0xeb, 0x7f, + 0xd9, 0x7f, 0x7e, 0x3a, 0xf7, 0xd0, 0xd9, 0xdc, 0x43, 0x3f, 0xe6, 0x1e, 0x7a, 0xbf, 0xf0, 0x2a, + 0x67, 0x0b, 0xaf, 0xf2, 0x6d, 0xe1, 0x55, 0xde, 0xf4, 0xc2, 0x48, 0x1d, 0xe5, 0x3e, 0x19, 0x8b, + 0x84, 0x1a, 0xba, 0x87, 0x31, 0xf3, 0xa5, 0x1d, 0xd3, 0xe9, 0x1e, 0x3d, 0xb9, 0xe8, 0x93, 0x6a, + 0x96, 0x82, 0xf4, 0x1b, 0xba, 0xa3, 0xed, 0xfd, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x49, 0xcf, 0x58, + 0x14, 0xd6, 0x05, 0x00, 0x00, } func (m *QueryChainLinksRequest) Marshal() (dAtA []byte, err error) { @@ -641,6 +768,104 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) MarshalToSizedBuffe return len(dAtA) - i, nil } +func (m *QueryDefaultExternalAddressesRequest) 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 *QueryDefaultExternalAddressesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDefaultExternalAddressesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.ChainName) > 0 { + i -= len(m.ChainName) + copy(dAtA[i:], m.ChainName) + i = encodeVarintQueryChainLinks(dAtA, i, uint64(len(m.ChainName))) + i-- + dAtA[i] = 0x12 + } + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintQueryChainLinks(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDefaultExternalAddressesResponse) 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 *QueryDefaultExternalAddressesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDefaultExternalAddressesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ChainLinks) > 0 { + for iNdEx := len(m.ChainLinks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ChainLinks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQueryChainLinks(dAtA []byte, offset int, v uint64) int { offset -= sovQueryChainLinks(v) base := offset @@ -757,6 +982,46 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) Size() (n int) { return n } +func (m *QueryDefaultExternalAddressesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.User) + if l > 0 { + n += 1 + l + sovQueryChainLinks(uint64(l)) + } + l = len(m.ChainName) + if l > 0 { + n += 1 + l + sovQueryChainLinks(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQueryChainLinks(uint64(l)) + } + return n +} + +func (m *QueryDefaultExternalAddressesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ChainLinks) > 0 { + for _, e := range m.ChainLinks { + l = e.Size() + n += 1 + l + sovQueryChainLinks(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQueryChainLinks(uint64(l)) + } + return n +} + func sovQueryChainLinks(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1481,6 +1746,276 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) Unmarshal(dAtA []by } return nil } +func (m *QueryDefaultExternalAddressesRequest) 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 ErrIntOverflowQueryChainLinks + } + 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: QueryDefaultExternalAddressesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDefaultExternalAddressesRequest: 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 ErrIntOverflowQueryChainLinks + } + 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 ErrInvalidLengthQueryChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryChainLinks + } + 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 ChainName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryChainLinks + } + 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 ErrInvalidLengthQueryChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDefaultExternalAddressesResponse) 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 ErrIntOverflowQueryChainLinks + } + 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: QueryDefaultExternalAddressesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDefaultExternalAddressesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainLinks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryChainLinks + } + 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 + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQueryChainLinks(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 8eca61b3ae9c53a0589ef74894b3a0d23894fe15 Mon Sep 17 00:00:00 2001 From: dadamu Date: Wed, 1 Jun 2022 10:38:34 +0000 Subject: [PATCH 02/64] Updated Swagger definition --- client/docs/swagger-ui/swagger.yaml | 10683 +++++++++++++++----------- 1 file changed, 6093 insertions(+), 4590 deletions(-) diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index ff84df6e1b..1a8a7f5ee0 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -2329,843 +2329,642 @@ paths: format: boolean tags: - Query - /desmos/profiles/v2/dtag-transfer-requests: + /desmos/profiles/v2/default-addresses: get: - summary: >- - IncomingDTagTransferRequests queries all the DTag transfers requests - that - - have been made towards the user with the given address - operationId: IncomingDTagTransferRequests + summary: |- + DefaultExternalAddresses queries the default addresses associated to the + given user and (optionally) chain name + operationId: DefaultExternalAddresses responses: '200': description: A successful response. schema: type: object properties: - requests: + chain_links: type: array items: type: object properties: - dtag_to_trade: + user: type: string - title: >- - DTagToTrade contains the value of the DTag that should - be transferred from + title: User defines the destination profile address to link + address: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - the receiver of the request to the sender - sender: - type: string - title: >- - Sender represents the address of the account that sent - the request - receiver: - type: string - title: >- - Receiver represents the receiver of the request that, if - accepted, will + protocol buffer message. This string must contain at + least - give to the sender their DTag - title: >- - DTagTransferRequest represent a DTag transfer request - between two users - title: >- - Requests represent the list of all the DTag transfer requests - made towards + one "/" character. The last segment of the URL's + path must represent - the user - pagination: - title: Pagination defines the pagination response - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + the fully qualified name of the type (as in - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + `path/google.protobuf.Duration`). The name should be + in a canonical form - corresponding request message has used PageRequest. + (e.g., leading "." is not accepted). - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: >- - QueryIncomingDTagTransferRequestsResponse is the response type for - the - Query/IncomingDTagTransferRequests RPC method. - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + In practice, teams usually precompile into the + binary all types that they - protocol buffer message. This string must contain at - least + expect it to use in the context of Any. However, for + URLs which use the - one "/" character. The last segment of the URL's path - must represent + scheme `http`, `https`, or no scheme, one can + optionally set up a type - the fully qualified name of the type (as in + server that maps type URLs to message definitions as + follows: - `path/google.protobuf.Duration`). The name should be in - a canonical form - (e.g., leading "." is not accepted). + * If no scheme is provided, `https` is assumed. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - In practice, teams usually precompile into the binary - all types that they + Note: this functionality is not currently available + in the official - expect it to use in the context of Any. However, for - URLs which use the + protobuf release, and it is not used for type URLs + beginning with - scheme `http`, `https`, or no scheme, one can optionally - set up a type + type.googleapis.com. - server that maps type URLs to message definitions as - follows: + Schemes other than `http`, `https` (or the empty + scheme) might be - * If no scheme is provided, `https` is assumed. + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the + above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + URL that describes the type of the serialized message. - Note: this functionality is not currently available in - the official - protobuf release, and it is not used for type URLs - beginning with + Protobuf library provides support to pack/unpack Any + values in the form - type.googleapis.com. + of utility functions or additional generated methods of + the Any type. - Schemes other than `http`, `https` (or the empty scheme) - might be + Example 1: Pack and unpack a message in C++. - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - URL that describes the type of the serialized message. + Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Protobuf library provides support to pack/unpack Any values - in the form + Example 3: Pack and unpack a message in Python. - of utility functions or additional generated methods of the - Any type. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + Example 4: Pack and unpack a message in Go - Example 1: Pack and unpack a message in C++. + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + The pack methods provided by protobuf library will by + default use - Example 2: Pack and unpack a message in Java. + 'type.googleapis.com/full.type.name' as the type URL and + the unpack - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + methods only use the fully qualified type name after the + last '/' - Example 3: Pack and unpack a message in Python. + in the type URL, for example "foo.bar.com/x/y.z" will + yield type - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + name "y.z". - Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - The pack methods provided by protobuf library will by - default use + JSON - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + ==== - methods only use the fully qualified type name after the - last '/' + The JSON representation of an `Any` value uses the + regular - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + representation of the deserialized, embedded message, + with an - name "y.z". + additional field `@type` which contains the type URL. + Example: + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - JSON + If the embedded message type is well-known and has a + custom JSON - ==== + representation, that representation will be embedded + adding a field - The JSON representation of an `Any` value uses the regular + `value` which holds the custom JSON in addition to the + `@type` - representation of the deserialized, embedded message, with - an + field. Example (for message + [google.protobuf.Duration][]): - additional field `@type` which contains the type URL. - Example: + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + Address contains the data of the external chain address + to be connected - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + with the Desmos profile + proof: + title: >- + Proof contains the ownership proof of the external chain + address + type: object + properties: + pub_key: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + protocol buffer message. This string must + contain at least - If the embedded message type is well-known and has a custom - JSON + one "/" character. The last segment of the URL's + path must represent - representation, that representation will be embedded adding - a field + the fully qualified name of the type (as in - `value` which holds the custom JSON in addition to the - `@type` + `path/google.protobuf.Duration`). The name + should be in a canonical form - field. Example (for message [google.protobuf.Duration][]): + (e.g., leading "." is not accepted). - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: receiver - description: >- - (optional) Receiver represents the address of the user to which - query the - incoming requests for. - in: query - required: false - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + In practice, teams usually precompile into the + binary all types that they - It is less efficient than using key. Only one of offset or key - should + expect it to use in the context of Any. However, + for URLs which use the - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. + scheme `http`, `https`, or no scheme, one can + optionally set up a type - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + server that maps type URLs to message + definitions as follows: - a count of the total number of items available for pagination in - UIs. - count_total is only respected when offset is used. It is ignored - when key + * If no scheme is provided, `https` is assumed. - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup + results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently + available in the official - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean - tags: - - Query - /desmos/profiles/v2/params: - get: - summary: Params queries the profiles module params - operationId: ProfilesParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - type: object - properties: - nickname: - type: object - properties: - min_length: - type: string - format: byte - max_length: - type: string - format: byte - title: >- - NicknameParams defines the parameters related to the - profiles nicknames - dtag: - type: object - properties: - reg_ex: - type: string - min_length: - type: string - format: byte - max_length: - type: string - format: byte - title: DTagParams defines the parameters related to profile DTags - bio: - type: object - properties: - max_length: - type: string - format: byte - title: >- - BioParams defines the parameters related to profile - biography - oracle: - type: object - properties: - script_id: - type: string - format: uint64 - title: >- - ScriptID represents the ID of the oracle script to be - called to verify the + protobuf release, and it is not used for type + URLs beginning with - data - ask_count: - type: string - format: uint64 - title: >- - AskCount represents the number of oracles to which ask - to verify the data - min_count: - type: string - format: uint64 - title: >- - MinCount represents the minimum count of oracles that - should complete the + type.googleapis.com. - verification successfully - prepare_gas: - type: string - format: uint64 - title: >- - PrepareGas represents the amount of gas to be used - during the preparation - stage of the oracle script - execute_gas: - type: string - format: uint64 - title: >- - ExecuteGas represents the amount of gas to be used - during the execution of + Schemes other than `http`, `https` (or the empty + scheme) might be - the oracle script - fee_amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: + used with implementation specific semantics. + value: type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of + the above specified type. description: >- - Coin defines a token with a denomination and an - amount. - + `Any` contains an arbitrary serialized protocol + buffer message along with a - NOTE: The amount field is an Int which implements - the custom method + URL that describes the type of the serialized + message. - signatures required by gogoproto. - title: >- - FeeAmount represents the amount of fees to be payed in - order to execute the - oracle script - title: |- - 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 - title: Params contains the parameters for the profiles module - description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + Protobuf library provides support to pack/unpack Any + values in the form - protocol buffer message. This string must contain at - least + of utility functions or additional generated methods + of the Any type. - one "/" character. The last segment of the URL's path - must represent - the fully qualified name of the type (as in + Example 1: Pack and unpack a message in C++. - `path/google.protobuf.Duration`). The name should be in - a canonical form + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - (e.g., leading "." is not accepted). + Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - In practice, teams usually precompile into the binary - all types that they + Example 3: Pack and unpack a message in Python. - expect it to use in the context of Any. However, for - URLs which use the + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - scheme `http`, `https`, or no scheme, one can optionally - set up a type + Example 4: Pack and unpack a message in Go - server that maps type URLs to message definitions as - follows: + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + The pack methods provided by protobuf library will + by default use - * If no scheme is provided, `https` is assumed. + 'type.googleapis.com/full.type.name' as the type URL + and the unpack - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + methods only use the fully qualified type name after + the last '/' - Note: this functionality is not currently available in - the official + in the type URL, for example "foo.bar.com/x/y.z" + will yield type - protobuf release, and it is not used for type URLs - beginning with + name "y.z". - type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) - might be + JSON - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + ==== - URL that describes the type of the serialized message. + The JSON representation of an `Any` value uses the + regular + representation of the deserialized, embedded + message, with an - Protobuf library provides support to pack/unpack Any values - in the form + additional field `@type` which contains the type + URL. Example: - of utility functions or additional generated methods of the - Any type. + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - Example 1: Pack and unpack a message in C++. + If the embedded message type is well-known and has a + custom JSON - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + representation, that representation will be embedded + adding a field - Example 2: Pack and unpack a message in Java. + `value` which holds the custom JSON in addition to + the `@type` - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + field. Example (for message + [google.protobuf.Duration][]): - Example 3: Pack and unpack a message in Python. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + PubKey represents the public key associated with the + address for which to - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + prove the ownership + signature: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - Example 4: Pack and unpack a message in Go + protocol buffer message. This string must + contain at least - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + one "/" character. The last segment of the URL's + path must represent - The pack methods provided by protobuf library will by - default use + the fully qualified name of the type (as in - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + `path/google.protobuf.Duration`). The name + should be in a canonical form - methods only use the fully qualified type name after the - last '/' + (e.g., leading "." is not accepted). - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - name "y.z". + In practice, teams usually precompile into the + binary all types that they + expect it to use in the context of Any. However, + for URLs which use the + scheme `http`, `https`, or no scheme, one can + optionally set up a type - JSON + server that maps type URLs to message + definitions as follows: - ==== - The JSON representation of an `Any` value uses the regular + * If no scheme is provided, `https` is assumed. - representation of the deserialized, embedded message, with - an + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup + results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - additional field `@type` which contains the type URL. - Example: + Note: this functionality is not currently + available in the official - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + protobuf release, and it is not used for type + URLs beginning with - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + type.googleapis.com. - If the embedded message type is well-known and has a custom - JSON - representation, that representation will be embedded adding - a field + Schemes other than `http`, `https` (or the empty + scheme) might be - `value` which holds the custom JSON in addition to the - `@type` + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of + the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol + buffer message along with a - field. Example (for message [google.protobuf.Duration][]): + URL that describes the type of the serialized + message. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Query - '/desmos/profiles/v2/profiles/{user}': - get: - summary: >- - Profile queries the profile of a specific user given their DTag or - address. - If the queried user does not have a profile, the returned response will + Protobuf library provides support to pack/unpack Any + values in the form - contain a null profile. - operationId: Profile - responses: - '200': - description: A successful response. - schema: - type: object - properties: - profile: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + of utility functions or additional generated methods + of the Any type. - protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + Example 1: Pack and unpack a message in C++. - the fully qualified name of the type (as in + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - `path/google.protobuf.Duration`). The name should be in a - canonical form + Example 2: Pack and unpack a message in Java. - (e.g., leading "." is not accepted). + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. - In practice, teams usually precompile into the binary all - types that they + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - expect it to use in the context of Any. However, for URLs - which use the + Example 4: Pack and unpack a message in Go - scheme `http`, `https`, or no scheme, one can optionally - set up a type + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - server that maps type URLs to message definitions as - follows: + The pack methods provided by protobuf library will + by default use + 'type.googleapis.com/full.type.name' as the type URL + and the unpack - * If no scheme is provided, `https` is assumed. + methods only use the fully qualified type name after + the last '/' - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + in the type URL, for example "foo.bar.com/x/y.z" + will yield type - Note: this functionality is not currently available in the - official + name "y.z". - protobuf release, and it is not used for type URLs - beginning with - type.googleapis.com. + JSON - Schemes other than `http`, `https` (or the empty scheme) - might be + ==== - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + The JSON representation of an `Any` value uses the + regular - URL that describes the type of the serialized message. + representation of the deserialized, embedded + message, with an + additional field `@type` which contains the type + URL. Example: - Protobuf library provides support to pack/unpack Any values in - the form + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - of utility functions or additional generated methods of the - Any type. + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + If the embedded message type is well-known and has a + custom JSON - Example 1: Pack and unpack a message in C++. + representation, that representation will be embedded + adding a field - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + `value` which holds the custom JSON in addition to + the `@type` - Example 2: Pack and unpack a message in Java. + field. Example (for message + [google.protobuf.Duration][]): - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + Signature represents the hex-encoded signature of + the PlainText value + plain_text: + type: string + title: >- + PlainText represents the hex-encoded value signed in + order to produce the - Example 3: Pack and unpack a message in Python. + Signature + chain_config: + title: >- + ChainConfig contains the configuration of the external + chain + type: object + properties: + name: + type: string + description: >- + ChainConfig contains the data of the chain with which + the link is made. + creation_time: + type: string + format: date-time + title: >- + CreationTime represents the time in which the link has + been created + title: >- + ChainLink contains the data representing either an inter- or + cross- chain - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON + link + title: >- + List of default addresses, each one represented by the + associated chain - representation, that representation will be embedded adding a - field + link + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - `value` which holds the custom JSON in addition to the `@type` + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the - field. Example (for message [google.protobuf.Duration][]): + corresponding request message has used PageRequest. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - QueryProfileResponse is the response type for the Query/Profile - RPC method. + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryDefaultExternalAddressesResponse is the response type for + Query/DefaultExternalAddresses RPC method default: description: An unexpected error response schema: @@ -3357,55 +3156,121 @@ paths: } parameters: - name: user - description: Address or DTag of the user to query the profile for - in: path - required: true + description: User for which to query the default addresses. + in: query + required: false + type: string + - name: chain_name + description: (optional) Chain name to query the default address for. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean tags: - Query - /desmos/relationships/v1/blocks: + /desmos/profiles/v2/dtag-transfer-requests: get: - summary: |- - Blocks queries the blocks for the given user, if provided. - Otherwise, it queries all the stored blocks. - operationId: Blocks + summary: >- + IncomingDTagTransferRequests queries all the DTag transfers requests + that + + have been made towards the user with the given address + operationId: IncomingDTagTransferRequests responses: '200': description: A successful response. schema: type: object properties: - blocks: + requests: type: array items: type: object properties: - blocker: + dtag_to_trade: type: string title: >- - Blocker represents the address of the user blocking - another one - blocked: - type: string - title: Blocked represents the address of the blocked user - reason: + DTagToTrade contains the value of the DTag that should + be transferred from + + the receiver of the request to the sender + sender: type: string - description: >- - Reason represents the optional reason the user has been - blocked for. - subspace_id: + title: >- + Sender represents the address of the account that sent + the request + receiver: type: string - format: uint64 title: >- - SubspaceID represents the ID of the subspace inside - which the user should + Receiver represents the receiver of the request that, if + accepted, will - be blocked - description: >- - UserBlock represents the fact that the Blocker has blocked - the given Blocked + give to the sender their DTag + title: >- + DTagTransferRequest represent a DTag transfer request + between two users + title: >- + Requests represent the list of all the DTag transfer requests + made towards - user. + the user pagination: type: object properties: @@ -3433,9 +3298,12 @@ paths: repeated Bar results = 1; PageResponse page = 2; } - description: |- - QueryBlocksResponse is the response type for the Query/Blocks RPC - method. + title: Pagination defines the pagination response + description: >- + QueryIncomingDTagTransferRequestsResponse is the response type for + the + + Query/IncomingDTagTransferRequests RPC method. default: description: An unexpected error response schema: @@ -3626,23 +3494,12 @@ paths: "value": "1.212s" } parameters: - - name: subspace_id - description: subspace to query the blocks for. - in: query - required: false - type: string - format: uint64 - - name: blocker - description: optional address of the blocker to query the blocks for. - in: query - required: false - type: string - - name: blocked + - name: receiver description: >- - optional address of the blocked user to query the block for (used - only if + (optional) Receiver represents the address of the user to which + query the - the blocker is provided). + incoming requests for. in: query required: false type: string @@ -3706,74 +3563,124 @@ paths: format: boolean tags: - Query - /desmos/relationships/v1/relationships: + /desmos/profiles/v2/params: get: - summary: >- - Relationships queries all relationships present inside a specific - subspace - operationId: Relationships + summary: Params queries the profiles module params + operationId: ProfilesParams responses: '200': description: A successful response. schema: type: object properties: - relationships: - type: array - items: - type: object - properties: - creator: - type: string - title: Creator represents the creator of the relationship - counterparty: - type: string - title: >- - Counterparty represents the other user involved in the - relationship - subspace_id: - type: string - format: uint64 - title: >- - SubspaceID represents the id of the subspace for which - the relationship is - - valid - description: >- - Relationship is the struct of a relationship. - - It represent the concept of "follow" of traditional social - networks. - pagination: + params: type: object properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 + nickname: + type: object + properties: + min_length: + type: string + format: byte + max_length: + type: string + format: byte title: >- - total is total number of results available if - PageRequest.count_total + NicknameParams defines the parameters related to the + profiles nicknames + dtag: + type: object + properties: + reg_ex: + type: string + min_length: + type: string + format: byte + max_length: + type: string + format: byte + title: DTagParams defines the parameters related to profile DTags + bio: + type: object + properties: + max_length: + type: string + format: byte + title: >- + BioParams defines the parameters related to profile + biography + oracle: + type: object + properties: + script_id: + type: string + format: uint64 + title: >- + ScriptID represents the ID of the oracle script to be + called to verify the - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + data + ask_count: + type: string + format: uint64 + title: >- + AskCount represents the number of oracles to which ask + to verify the data + min_count: + type: string + format: uint64 + title: >- + MinCount represents the minimum count of oracles that + should complete the - corresponding request message has used PageRequest. + verification successfully + prepare_gas: + type: string + format: uint64 + title: >- + PrepareGas represents the amount of gas to be used + during the preparation - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: |- - QueryRelationshipsResponse is the response type for the - Query/Relationships RPC method. + stage of the oracle script + execute_gas: + type: string + format: uint64 + title: >- + ExecuteGas represents the amount of gas to be used + during the execution of + + the oracle script + fee_amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements + the custom method + + signatures required by gogoproto. + title: >- + FeeAmount represents the amount of fees to be payed in + order to execute the + + oracle script + title: |- + 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 + title: Params contains the parameters for the profiles module + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. default: description: An unexpected error response schema: @@ -3963,163 +3870,198 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - parameters: - - name: subspace_id - description: subspace to query the relationships for. - in: query - required: false - type: string - format: uint64 - - name: user - description: optional address of the user for which to query the relationships. - in: query - required: false - type: string - - name: counterparty - description: >- - optional address of the counterparty of the relationships (used only - if the - - user is provided). - in: query - required: false - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean tags: - Query - /desmos/subspaces/v1/subspaces: + '/desmos/profiles/v2/profiles/{user}': get: - summary: Subspaces queries all the subspaces inside Desmos - operationId: Subspaces + summary: >- + Profile queries the profile of a specific user given their DTag or + address. + + If the queried user does not have a profile, the returned response will + + contain a null profile. + operationId: Profile responses: '200': description: A successful response. schema: type: object properties: - subspaces: - type: array - items: - type: object - properties: - id: - type: string - format: uint64 - title: Unique id that identifies the subspace - name: - type: string - title: Human-readable name of the subspace - description: - type: string - title: Optional description of this subspace - treasury: - type: string - title: >- - Represents the account that is associated with the - subspace and - - should be used to connect external applications to - verify this subspace - owner: - type: string - title: Address of the user that owns the subspace - creator: - type: string - title: Address of the subspace creator - creation_time: - type: string - format: date-time - title: the creation time of the subspace - title: Subspace contains all the data of a Desmos subspace - pagination: + profile: type: object properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + type_url: type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - was set, its value is undefined otherwise + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. description: >- - PageResponse is to be embedded in gRPC response messages where - the + `Any` contains an arbitrary serialized protocol buffer message + along with a - corresponding request message has used PageRequest. + URL that describes the type of the serialized message. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QuerySubspacesResponse is the response type for the - Query/Subspaces RPC - method + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryProfileResponse is the response type for the Query/Profile + RPC method. default: description: An unexpected error response schema: @@ -4139,193 +4081,227 @@ paths: properties: type_url: type: string - value: - type: string - format: byte - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - It is less efficient than using key. Only one of offset or key - should + protocol buffer message. This string must contain at + least - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. + one "/" character. The last segment of the URL's path + must represent - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + the fully qualified name of the type (as in - a count of the total number of items available for pagination in - UIs. + `path/google.protobuf.Duration`). The name should be in + a canonical form - count_total is only respected when offset is used. It is ignored - when key + (e.g., leading "." is not accepted). - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + In practice, teams usually precompile into the binary + all types that they - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean - tags: - - Query - '/desmos/subspaces/v1/subspaces/{subspace_id}': - get: - summary: >- - Subspace queries all the information about the subspace with the given - id - operationId: Subspace - responses: - '200': - description: A successful response. - schema: - type: object - properties: - subspace: - type: object - properties: - id: - type: string - format: uint64 - title: Unique id that identifies the subspace - name: - type: string - title: Human-readable name of the subspace - description: - type: string - title: Optional description of this subspace - treasury: - type: string - title: >- - Represents the account that is associated with the - subspace and + expect it to use in the context of Any. However, for + URLs which use the - should be used to connect external applications to verify - this subspace - owner: - type: string - title: Address of the user that owns the subspace - creator: - type: string - title: Address of the subspace creator - creation_time: - type: string - format: date-time - title: the creation time of the subspace - title: Subspace contains all the data of a Desmos subspace - title: >- - QuerySubspaceResponse is the response type for the Query/Subspace - method - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. value: type: string format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } parameters: - - name: subspace_id + - name: user + description: Address or DTag of the user to query the profile for in: path required: true type: string - format: uint64 tags: - Query - '/desmos/subspaces/v1/subspaces/{subspace_id}/groups': + /desmos/relationships/v1/blocks: get: - summary: >- - UserGroups queries all the groups that are present inside the subspace - with - - the given id - operationId: UserGroups + summary: |- + Blocks queries the blocks for the given user, if provided. + Otherwise, it queries all the stored blocks. + operationId: Blocks responses: '200': description: A successful response. schema: type: object properties: - groups: + blocks: type: array items: type: object properties: + blocker: + type: string + title: >- + Blocker represents the address of the user blocking + another one + blocked: + type: string + title: Blocked represents the address of the blocked user + reason: + type: string + description: >- + Reason represents the optional reason the user has been + blocked for. subspace_id: type: string format: uint64 - title: ID of the subspace inside which this group exists - section_id: - type: integer - format: int64 - title: >- - (optional) Id of the section inside which this group is - valid - id: - type: integer - format: int64 - title: Unique id that identifies the group - name: - type: string - title: Human-readable name of the user group - description: - type: string - title: Optional description of this group - permissions: - type: integer - format: int64 title: >- - Permissions that will be granted to all the users part - of this group - title: UserGroup represents a group of users + SubspaceID represents the ID of the subspace inside + which the user should + + be blocked + description: >- + UserBlock represents the fact that the Blocker has blocked + the given Blocked + + user. pagination: type: object properties: @@ -4353,11 +4329,9 @@ paths: repeated Bar results = 1; PageResponse page = 2; } - title: >- - QueryUserGroupsResponse is the response type for the - Query/UserGroups RPC - - method + description: |- + QueryBlocksResponse is the response type for the Query/Blocks RPC + method. default: description: An unexpected error response schema: @@ -4377,22 +4351,197 @@ paths: properties: type_url: type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. value: type: string format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } parameters: - name: subspace_id - description: Id of the subspace to query the groups for - in: path - required: true + description: subspace to query the blocks for. + in: query + required: false type: string format: uint64 - - name: section_id - description: (optional) Section id to query the groups for. + - name: blocker + description: optional address of the blocker to query the blocks for. in: query required: false - type: integer - format: int64 + type: string + - name: blocked + description: >- + optional address of the blocked user to query the block for (used + only if + + the blocker is provided). + in: query + required: false + type: string - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -4453,102 +4602,44 @@ paths: format: boolean tags: - Query - '/desmos/subspaces/v1/subspaces/{subspace_id}/groups/{group_id}': + /desmos/relationships/v1/relationships: get: - summary: |- - UserGroup queries the user group having the given id inside the specific + summary: >- + Relationships queries all relationships present inside a specific subspace - operationId: UserGroup + operationId: Relationships responses: '200': description: A successful response. schema: type: object properties: - group: - type: object - properties: - subspace_id: - type: string - format: uint64 - title: ID of the subspace inside which this group exists - section_id: - type: integer - format: int64 - title: >- - (optional) Id of the section inside which this group is - valid - id: - type: integer - format: int64 - title: Unique id that identifies the group - name: - type: string - title: Human-readable name of the user group - description: - type: string - title: Optional description of this group - permissions: - type: integer - format: int64 - title: >- - Permissions that will be granted to all the users part of - this group - title: UserGroup represents a group of users - title: >- - QueryUserGroupResponse is the response type for the - Query/UserGroup RPC - - method - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: + relationships: type: array items: type: object properties: - type_url: + creator: type: string - value: + title: Creator represents the creator of the relationship + counterparty: type: string - format: byte - parameters: - - name: subspace_id - in: path - required: true - type: string - format: uint64 - - name: group_id - in: path - required: true - type: integer - format: int64 - tags: - - Query - '/desmos/subspaces/v1/subspaces/{subspace_id}/groups/{group_id}/members': - get: - summary: UserGroupMembers queries all the members of a given user group - operationId: UserGroupMembers - responses: - '200': - description: A successful response. - schema: - type: object - properties: - members: - type: array - items: - type: string + title: >- + Counterparty represents the other user involved in the + relationship + subspace_id: + type: string + format: uint64 + title: >- + SubspaceID represents the id of the subspace for which + the relationship is + + valid + description: >- + Relationship is the struct of a relationship. + + It represent the concept of "follow" of traditional social + networks. pagination: type: object properties: @@ -4576,9 +4667,9 @@ paths: repeated Bar results = 1; PageResponse page = 2; } - title: |- - QueryUserGroupMembersResponse is the response type for the - Query/UserGroupMembers RPC method + description: |- + QueryRelationshipsResponse is the response type for the + Query/Relationships RPC method. default: description: An unexpected error response schema: @@ -4598,206 +4689,301 @@ paths: properties: type_url: type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. value: type: string format: byte - parameters: - - name: subspace_id - in: path - required: true - type: string - format: uint64 - - name: group_id - in: path - required: true - type: integer - format: int64 - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - It is less efficient than using key. Only one of offset or key - should + URL that describes the type of the serialized message. - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + Protobuf library provides support to pack/unpack Any values + in the form - a count of the total number of items available for pagination in - UIs. + of utility functions or additional generated methods of the + Any type. - count_total is only respected when offset is used. It is ignored - when key - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + Example 1: Pack and unpack a message in C++. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean - tags: - - Query - '/desmos/subspaces/v1/subspaces/{subspace_id}/permissions/{user}': - get: - summary: UserPermissions queries the permissions for the given user - operationId: UserPermissions - responses: - '200': - description: A successful response. - schema: - type: object - properties: - permissions: - type: integer - format: int64 - details: - type: array - items: - type: object - properties: - subspace_id: - type: string - format: uint64 - title: Id of the subspace for which this permission is valid - section_id: - type: integer - format: int64 - title: Id of the section for which this permission is valid - user: - title: User represents a user permission - type: object - properties: - user: - type: string - title: User for which the permission was set - permission: - type: integer - format: int64 - title: Permission set to the user - group: - title: Group represents a group permission - type: object - properties: - group_id: - type: integer - format: int64 - title: Unique id of the group - permission: - type: integer - format: int64 - title: Permission set to the group - title: PermissionDetail contains the details data of a permission - title: |- - QueryUserPermissionsRequest is the response type for the - Query/UserPermissions method - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } parameters: - name: subspace_id - in: path - required: true + description: subspace to query the relationships for. + in: query + required: false type: string format: uint64 - name: user - in: path - required: true + description: optional address of the user for which to query the relationships. + in: query + required: false type: string - - name: section_id + - name: counterparty + description: >- + optional address of the counterparty of the relationships (used only + if the + + user is provided). in: query required: false - type: integer - format: int64 + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean tags: - Query - '/desmos/subspaces/v2/{subspace_id}/sections': + /desmos/subspaces/v1/subspaces: get: - summary: Sections allows to query for the sections of a specific subspace - operationId: Sections + summary: Subspaces queries all the subspaces inside Desmos + operationId: Subspaces responses: '200': description: A successful response. schema: type: object properties: - sections: + subspaces: type: array items: type: object properties: - subspace_id: + id: type: string format: uint64 - title: Id of the subspace inside which the section exists - id: - type: integer - format: int64 - title: Unique id of the section within the subspace - parent_id: - type: integer - format: int64 - title: (optional) Id of the parent section + title: Unique id that identifies the subspace name: type: string - title: Name of the section within the subspace + title: Human-readable name of the subspace description: type: string - title: (optional) Description of the section - title: Section contains the data of a single subspace section + title: Optional description of this subspace + treasury: + type: string + title: >- + Represents the account that is associated with the + subspace and + + should be used to connect external applications to + verify this subspace + owner: + type: string + title: Address of the user that owns the subspace + creator: + type: string + title: Address of the subspace creator + creation_time: + type: string + format: date-time + title: the creation time of the subspace + title: Subspace contains all the data of a Desmos subspace pagination: type: object properties: @@ -4826,7 +5012,9 @@ paths: PageResponse page = 2; } title: >- - QuerySectionsResponse is the response type for Query/Sections RPC + QuerySubspacesResponse is the response type for the + Query/Subspaces RPC + method default: description: An unexpected error response @@ -4851,12 +5039,6 @@ paths: type: string format: byte parameters: - - name: subspace_id - description: Id of the subspace to query the sections for - in: path - required: true - type: string - format: uint64 - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -4917,40 +5099,52 @@ paths: format: boolean tags: - Query - '/desmos/subspaces/v2/{subspace_id}/sections/{section_id}': + '/desmos/subspaces/v1/subspaces/{subspace_id}': get: - summary: Section queries all the information about the section with the given id - operationId: Section + summary: >- + Subspace queries all the information about the subspace with the given + id + operationId: Subspace responses: '200': description: A successful response. schema: type: object properties: - section: + subspace: type: object properties: - subspace_id: + id: type: string format: uint64 - title: Id of the subspace inside which the section exists - id: - type: integer - format: int64 - title: Unique id of the section within the subspace - parent_id: - type: integer - format: int64 - title: (optional) Id of the parent section + title: Unique id that identifies the subspace name: type: string - title: Name of the section within the subspace + title: Human-readable name of the subspace description: type: string - title: (optional) Description of the section - title: Section contains the data of a single subspace section + title: Optional description of this subspace + treasury: + type: string + title: >- + Represents the account that is associated with the + subspace and + + should be used to connect external applications to verify + this subspace + owner: + type: string + title: Address of the user that owns the subspace + creator: + type: string + title: Address of the subspace creator + creation_time: + type: string + format: date-time + title: the creation time of the subspace + title: Subspace contains all the data of a Desmos subspace title: >- - QuerySectionResponse is the response type for Query/Section RPC + QuerySubspaceResponse is the response type for the Query/Subspace method default: description: An unexpected error response @@ -4976,39 +5170,89 @@ paths: format: byte parameters: - name: subspace_id - description: Id of the subspace inside which to search for in: path required: true type: string format: uint64 - - name: section_id - description: Id of the searched section - in: path - required: true - type: integer - format: int64 tags: - Query - /desmos/posts/v1/params: + '/desmos/subspaces/v1/subspaces/{subspace_id}/groups': get: - summary: Params queries the module parameters - operationId: PostsParams + summary: >- + UserGroups queries all the groups that are present inside the subspace + with + + the given id + operationId: UserGroups responses: '200': description: A successful response. schema: type: object properties: - params: + groups: + type: array + items: + type: object + properties: + subspace_id: + type: string + format: uint64 + title: ID of the subspace inside which this group exists + section_id: + type: integer + format: int64 + title: >- + (optional) Id of the section inside which this group is + valid + id: + type: integer + format: int64 + title: Unique id that identifies the group + name: + type: string + title: Human-readable name of the user group + description: + type: string + title: Optional description of this group + permissions: + type: integer + format: int64 + title: >- + Permissions that will be granted to all the users part + of this group + title: UserGroup represents a group of users + pagination: type: object properties: - max_text_length: - type: integer - format: int64 - title: Maximum length of the post text - title: Params contains the parameters for the posts module + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } title: >- - QueryParamsResponse is the response type for the Query/Params RPC + QueryUserGroupsResponse is the response type for the + Query/UserGroups RPC + method default: description: An unexpected error response @@ -5029,816 +5273,456 @@ paths: properties: type_url: type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. value: type: string format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. + parameters: + - name: subspace_id + description: Id of the subspace to query the groups for + in: path + required: true + type: string + format: uint64 + - name: section_id + description: (optional) Section id to query the groups for. + in: query + required: false + type: integer + format: int64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + It is less efficient than using key. Only one of offset or key + should - Protobuf library provides support to pack/unpack Any values - in the form + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - of utility functions or additional generated methods of the - Any type. + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + a count of the total number of items available for pagination in + UIs. - Example 1: Pack and unpack a message in C++. + count_total is only respected when offset is used. It is ignored + when key - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean tags: - Query - '/desmos/posts/v1/{subspace_id}/posts': + '/desmos/subspaces/v1/subspaces/{subspace_id}/groups/{group_id}': get: - summary: SubspacePosts queries all the posts inside a given subspace - operationId: SubspacePosts + summary: |- + UserGroup queries the user group having the given id inside the specific + subspace + operationId: UserGroup responses: '200': description: A successful response. schema: type: object properties: - posts: + group: + type: object + properties: + subspace_id: + type: string + format: uint64 + title: ID of the subspace inside which this group exists + section_id: + type: integer + format: int64 + title: >- + (optional) Id of the section inside which this group is + valid + id: + type: integer + format: int64 + title: Unique id that identifies the group + name: + type: string + title: Human-readable name of the user group + description: + type: string + title: Optional description of this group + permissions: + type: integer + format: int64 + title: >- + Permissions that will be granted to all the users part of + this group + title: UserGroup represents a group of users + title: >- + QueryUserGroupResponse is the response type for the + Query/UserGroup RPC + + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: type: array items: type: object properties: - subspace_id: + type_url: type: string - format: uint64 - title: >- - Id of the subspace inside which the post has been - created - section_id: - type: integer - format: int64 - title: Id of the section inside which the post has been created - id: + value: type: string - format: uint64 - title: Unique id of the post - external_id: + format: byte + parameters: + - name: subspace_id + in: path + required: true + type: string + format: uint64 + - name: group_id + in: path + required: true + type: integer + format: int64 + tags: + - Query + '/desmos/subspaces/v1/subspaces/{subspace_id}/groups/{group_id}/members': + get: + summary: UserGroupMembers queries all the members of a given user group + operationId: UserGroupMembers + responses: + '200': + description: A successful response. + schema: + type: object + properties: + members: + type: array + items: + type: string + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryUserGroupMembersResponse is the response type for the + Query/UserGroupMembers RPC method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: type: string - title: (optional) External id for this post - text: + value: type: string - title: (optional) Text of the post - entities: - title: (optional) Entities connected to this post - type: object - properties: - hashtags: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag ends - tag: - type: string - title: >- - Tag reference (user address, hashtag value, - etc) - title: Tag represents a generic tag - mentions: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag ends - tag: - type: string - title: >- - Tag reference (user address, hashtag value, - etc) - title: Tag represents a generic tag - urls: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the URL starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the URL ends - url: - type: string - title: >- - Value of the URL where the user should be - redirected to - display_url: - type: string - title: (optional) Display value of the URL - title: Url contains the details of a generic URL - author: - type: string - title: Author of the post - conversation_id: - type: string - format: uint64 - title: (optional) Id of the original post of the conversation - referenced_posts: - type: array - items: - type: object - properties: - type: - title: Type of reference - type: string - enum: - - TYPE_UNSPECIFIED - - TYPE_REPLY_TO - - TYPE_QUOTE - - TYPE_REPOST - default: TYPE_UNSPECIFIED - description: |- - - TYPE_UNSPECIFIED: No reference specified - - TYPE_REPLY_TO: This reference represents a reply to the specified post - - TYPE_QUOTE: This reference represents a quote of the specified post - - TYPE_REPOST: This reference represents a repost of the specified post - post_id: - type: string - format: uint64 - title: Id of the referenced post - position: - type: string - format: uint64 - title: >- - Position of the reference inside the post's text. - This should be used only + format: byte + parameters: + - name: subspace_id + in: path + required: true + type: string + format: uint64 + - name: group_id + in: path + required: true + type: integer + format: int64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - with the type set to TYPE_QUOTE - title: PostReference contains the details of a post reference - title: >- - A list this posts references (either as a reply, repost - or quote) - reply_settings: - title: Reply settings of this post - type: string - enum: - - REPLY_SETTING_UNSPECIFIED - - REPLY_SETTING_EVERYONE - - REPLY_SETTING_FOLLOWERS - - REPLY_SETTING_MUTUAL - - REPLY_SETTING_MENTIONS - default: REPLY_SETTING_UNSPECIFIED - description: |- - - REPLY_SETTING_UNSPECIFIED: No reply setting specified - - REPLY_SETTING_EVERYONE: Everyone will be able to reply to this post - - REPLY_SETTING_FOLLOWERS: Only followers of the author will be able to reply to this post - - REPLY_SETTING_MUTUAL: Only the author mutual followers will be able to reply to this post - - REPLY_SETTING_MENTIONS: Only people mentioned inside this post will be able to reply - creation_date: - type: string - format: date-time - title: Creation date of the post - last_edited_date: - type: string - format: date-time - title: (optional) Last edited time of the post - title: Post contains all the information about a single post - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + It is less efficient than using key. Only one of offset or key + should - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - corresponding request message has used PageRequest. + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QuerySubspacePostsResponse is the response type for the - Query/SubspacePosts + a count of the total number of items available for pagination in + UIs. - RPC method - default: - description: An unexpected error response + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean + tags: + - Query + '/desmos/subspaces/v1/subspaces/{subspace_id}/permissions/{user}': + get: + summary: UserPermissions queries the permissions for the given user + operationId: UserPermissions + responses: + '200': + description: A successful response. schema: type: object properties: - error: - type: string - code: + permissions: type: integer - format: int32 - message: - type: string + format: int64 details: type: array items: type: object properties: - type_url: + subspace_id: + type: string + format: uint64 + title: Id of the subspace for which this permission is valid + section_id: + type: integer + format: int64 + title: Id of the section for which this permission is valid + user: + title: User represents a user permission + type: object + properties: + user: + type: string + title: User for which the permission was set + permission: + type: integer + format: int64 + title: Permission set to the user + group: + title: Group represents a group permission + type: object + properties: + group_id: + type: integer + format: int64 + title: Unique id of the group + permission: + type: integer + format: int64 + title: Permission set to the group + title: PermissionDetail contains the details data of a permission + title: |- + QueryUserPermissionsRequest is the response type for the + Query/UserPermissions method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. value: type: string format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } parameters: - name: subspace_id - description: Id of the subspace to query the posts for in: path required: true type: string format: uint64 - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false + - name: user + in: path + required: true type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. + - name: section_id in: query required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean + type: integer + format: int64 tags: - Query - '/desmos/posts/v1/{subspace_id}/posts/{post_id}': + '/desmos/subspaces/v2/{subspace_id}/sections': get: - summary: Post queries for a single post inside a given subspace - operationId: Post + summary: Sections allows to query for the sections of a specific subspace + operationId: Sections responses: '200': description: A successful response. schema: type: object properties: - post: + sections: + type: array + items: + type: object + properties: + subspace_id: + type: string + format: uint64 + title: Id of the subspace inside which the section exists + id: + type: integer + format: int64 + title: Unique id of the section within the subspace + parent_id: + type: integer + format: int64 + title: (optional) Id of the parent section + name: + type: string + title: Name of the section within the subspace + description: + type: string + title: (optional) Description of the section + title: Section contains the data of a single subspace section + pagination: type: object properties: - subspace_id: - type: string - format: uint64 - title: Id of the subspace inside which the post has been created - section_id: - type: integer - format: int64 - title: Id of the section inside which the post has been created - id: - type: string - format: uint64 - title: Unique id of the post - external_id: - type: string - title: (optional) External id for this post - text: - type: string - title: (optional) Text of the post - entities: - title: (optional) Entities connected to this post - type: object - properties: - hashtags: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at which - the tag starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at which - the tag ends - tag: - type: string - title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag - mentions: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at which - the tag starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at which - the tag ends - tag: - type: string - title: 'Tag reference (user address, hashtag value, etc)' - title: Tag represents a generic tag - urls: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at which - the URL starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at which - the URL ends - url: - type: string - title: >- - Value of the URL where the user should be - redirected to - display_url: - type: string - title: (optional) Display value of the URL - title: Url contains the details of a generic URL - author: + next_key: type: string - title: Author of the post - conversation_id: + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: type: string format: uint64 - title: (optional) Id of the original post of the conversation - referenced_posts: - type: array - items: - type: object - properties: - type: - title: Type of reference - type: string - enum: - - TYPE_UNSPECIFIED - - TYPE_REPLY_TO - - TYPE_QUOTE - - TYPE_REPOST - default: TYPE_UNSPECIFIED - description: |- - - TYPE_UNSPECIFIED: No reference specified - - TYPE_REPLY_TO: This reference represents a reply to the specified post - - TYPE_QUOTE: This reference represents a quote of the specified post - - TYPE_REPOST: This reference represents a repost of the specified post - post_id: - type: string - format: uint64 - title: Id of the referenced post - position: - type: string - format: uint64 - title: >- - Position of the reference inside the post's text. - This should be used only - - with the type set to TYPE_QUOTE - title: PostReference contains the details of a post reference title: >- - A list this posts references (either as a reply, repost or - quote) - reply_settings: - title: Reply settings of this post - type: string - enum: - - REPLY_SETTING_UNSPECIFIED - - REPLY_SETTING_EVERYONE - - REPLY_SETTING_FOLLOWERS - - REPLY_SETTING_MUTUAL - - REPLY_SETTING_MENTIONS - default: REPLY_SETTING_UNSPECIFIED - description: |- - - REPLY_SETTING_UNSPECIFIED: No reply setting specified - - REPLY_SETTING_EVERYONE: Everyone will be able to reply to this post - - REPLY_SETTING_FOLLOWERS: Only followers of the author will be able to reply to this post - - REPLY_SETTING_MUTUAL: Only the author mutual followers will be able to reply to this post - - REPLY_SETTING_MENTIONS: Only people mentioned inside this post will be able to reply - creation_date: - type: string - format: date-time - title: Creation date of the post - last_edited_date: - type: string - format: date-time - title: (optional) Last edited time of the post - title: Post contains all the information about a single post + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } title: >- - QueryPostResponse is the response type for the Query/Post RPC + QuerySectionsResponse is the response type for Query/Sections RPC method default: description: An unexpected error response @@ -5859,14 +5743,196 @@ paths: properties: type_url: type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + value: + type: string + format: byte + parameters: + - name: subspace_id + description: Id of the subspace to query the sections for + in: path + required: true + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - protocol buffer message. This string must contain at - least + It is less efficient than using key. Only one of offset or key + should - one "/" character. The last segment of the URL's path + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean + tags: + - Query + '/desmos/subspaces/v2/{subspace_id}/sections/{section_id}': + get: + summary: Section queries all the information about the section with the given id + operationId: Section + responses: + '200': + description: A successful response. + schema: + type: object + properties: + section: + type: object + properties: + subspace_id: + type: string + format: uint64 + title: Id of the subspace inside which the section exists + id: + type: integer + format: int64 + title: Unique id of the section within the subspace + parent_id: + type: integer + format: int64 + title: (optional) Id of the parent section + name: + type: string + title: Name of the section within the subspace + description: + type: string + title: (optional) Description of the section + title: Section contains the data of a single subspace section + title: >- + QuerySectionResponse is the response type for Query/Section RPC + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: subspace_id + description: Id of the subspace inside which to search for + in: path + required: true + type: string + format: uint64 + - name: section_id + description: Id of the searched section + in: path + required: true + type: integer + format: int64 + tags: + - Query + /desmos/posts/v1/params: + get: + summary: Params queries the module parameters + operationId: PostsParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + type: object + properties: + max_text_length: + type: integer + format: int64 + title: Maximum length of the post text + title: Params contains the parameters for the posts module + title: >- + QueryParamsResponse is the response type for the Query/Params RPC + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path must represent the fully qualified name of the type (as in @@ -6029,32 +6095,19 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - parameters: - - name: subspace_id - description: Id of the subspace inside which the post lies - in: path - required: true - type: string - format: uint64 - - name: post_id - description: Id of the post to query for - in: path - required: true - type: string - format: uint64 tags: - Query - '/desmos/posts/v1/{subspace_id}/posts/{post_id}/attachments': + '/desmos/posts/v1/{subspace_id}/posts': get: - summary: PostAttachments queries the attachments of the post having the given id - operationId: PostAttachments + summary: SubspacePosts queries all the posts inside a given subspace + operationId: SubspacePosts responses: '200': description: A successful response. schema: type: object properties: - attachments: + posts: type: array items: type: object @@ -6063,288 +6116,248 @@ paths: type: string format: uint64 title: >- - Id of the subspace inside which the post to which this - attachment should be - - connected is + Id of the subspace inside which the post has been + created section_id: type: integer format: int64 - title: >- - Id of the subspace section inside which the post to - which this attachment - - should be connected is - post_id: + title: Id of the section inside which the post has been created + id: type: string format: uint64 - title: >- - Id of the post to which this attachment should be - connected - id: - type: integer - format: int64 - title: If of this attachment - content: + title: Unique id of the post + external_id: + type: string + title: (optional) External id for this post + text: + type: string + title: (optional) Text of the post + entities: + title: (optional) Entities connected to this post type: object properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the - binary all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available - in the official + hashtags: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag ends + tag: + type: string + title: >- + Tag reference (user address, hashtag value, + etc) + title: Tag represents a generic tag + mentions: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag ends + tag: + type: string + title: >- + Tag reference (user address, hashtag value, + etc) + title: Tag represents a generic tag + urls: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the URL starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the URL ends + url: + type: string + title: >- + Value of the URL where the user should be + redirected to + display_url: + type: string + title: (optional) Display value of the URL + title: Url contains the details of a generic URL + author: + type: string + title: Author of the post + conversation_id: + type: string + format: uint64 + title: (optional) Id of the original post of the conversation + referenced_posts: + type: array + items: + type: object + properties: + type: + title: Type of reference + type: string + enum: + - TYPE_UNSPECIFIED + - TYPE_REPLY_TO + - TYPE_QUOTE + - TYPE_REPOST + default: TYPE_UNSPECIFIED + description: |- + - TYPE_UNSPECIFIED: No reference specified + - TYPE_REPLY_TO: This reference represents a reply to the specified post + - TYPE_QUOTE: This reference represents a quote of the specified post + - TYPE_REPOST: This reference represents a repost of the specified post + post_id: + type: string + format: uint64 + title: Id of the referenced post + position: + type: string + format: uint64 + title: >- + Position of the reference inside the post's text. + This should be used only - protobuf release, and it is not used for type URLs - beginning with + with the type set to TYPE_QUOTE + title: PostReference contains the details of a post reference + title: >- + A list this posts references (either as a reply, repost + or quote) + reply_settings: + title: Reply settings of this post + type: string + enum: + - REPLY_SETTING_UNSPECIFIED + - REPLY_SETTING_EVERYONE + - REPLY_SETTING_FOLLOWERS + - REPLY_SETTING_MUTUAL + - REPLY_SETTING_MENTIONS + default: REPLY_SETTING_UNSPECIFIED + description: |- + - REPLY_SETTING_UNSPECIFIED: No reply setting specified + - REPLY_SETTING_EVERYONE: Everyone will be able to reply to this post + - REPLY_SETTING_FOLLOWERS: Only followers of the author will be able to reply to this post + - REPLY_SETTING_MUTUAL: Only the author mutual followers will be able to reply to this post + - REPLY_SETTING_MENTIONS: Only people mentioned inside this post will be able to reply + creation_date: + type: string + format: date-time + title: Creation date of the post + last_edited_date: + type: string + format: date-time + title: (optional) Last edited time of the post + title: Post contains all the information about a single post + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - type.googleapis.com. + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + corresponding request message has used PageRequest. - Schemes other than `http`, `https` (or the empty - scheme) might be + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: >- + QuerySubspacePostsResponse is the response type for the + Query/SubspacePosts - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the - above specified type. + RPC method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + A URL/resource name that uniquely identifies the type of + the serialized - URL that describes the type of the serialized message. + protocol buffer message. This string must contain at + least + one "/" character. The last segment of the URL's path + must represent - Protobuf library provides support to pack/unpack Any - values in the form + the fully qualified name of the type (as in - of utility functions or additional generated methods of - the Any type. + `path/google.protobuf.Duration`). The name should be in + a canonical form + (e.g., leading "." is not accepted). - Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + In practice, teams usually precompile into the binary + all types that they - Example 2: Pack and unpack a message in Java. + expect it to use in the context of Any. However, for + URLs which use the - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + scheme `http`, `https`, or no scheme, one can optionally + set up a type - Example 3: Pack and unpack a message in Python. + server that maps type URLs to message definitions as + follows: - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: Content of the attachment - title: Attachment contains the data of a single post attachment - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: |- - QueryPostAttachmentsResponse is the response type for the - Query/PostAttachments RPC method - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] @@ -6485,13 +6498,7 @@ paths: } parameters: - name: subspace_id - description: Id of the subspace where the post is stored - in: path - required: true - type: string - format: uint64 - - name: post_id - description: Id of the post to query the attachments for + description: Id of the subspace to query the posts for in: path required: true type: string @@ -6556,107 +6563,203 @@ paths: format: boolean tags: - Query - '/desmos/posts/v1/{subspace_id}/posts/{post_id}/polls/{poll_id}/answers': + '/desmos/posts/v1/{subspace_id}/posts/{post_id}': get: - summary: PollAnswers queries the answers for the poll having the given id - operationId: PollAnswers + summary: Post queries for a single post inside a given subspace + operationId: Post responses: '200': description: A successful response. schema: type: object properties: - answers: - type: array - items: - type: object - properties: - subspace_id: - type: string - format: uint64 - title: >- - Subspace id inside which the post related to this - attachment is located - section_id: - type: integer - format: int64 - title: >- - Section id inside which the post related to this - attachment is located - post_id: - type: string - format: uint64 - title: Id of the post associated to this attachment - poll_id: - type: integer - format: int64 - title: Id of the poll to which this answer is associated - answers_indexes: - type: array - items: - type: integer - format: int64 - title: Indexes of the answers inside the ProvidedAnswers array - user: - type: string - title: Address of the user answering the poll - title: UserAnswer represents a user answer to a poll - pagination: + post: type: object properties: - next_key: + subspace_id: type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + format: uint64 + title: Id of the subspace inside which the post has been created + section_id: + type: integer + format: int64 + title: Id of the section inside which the post has been created + id: type: string format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QueryPollAnswersResponse is the response type for the - Query/PollAnswers RPC - - method - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at + title: Unique id of the post + external_id: + type: string + title: (optional) External id for this post + text: + type: string + title: (optional) Text of the post + entities: + title: (optional) Entities connected to this post + type: object + properties: + hashtags: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at which + the tag starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at which + the tag ends + tag: + type: string + title: 'Tag reference (user address, hashtag value, etc)' + title: Tag represents a generic tag + mentions: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at which + the tag starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at which + the tag ends + tag: + type: string + title: 'Tag reference (user address, hashtag value, etc)' + title: Tag represents a generic tag + urls: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at which + the URL starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at which + the URL ends + url: + type: string + title: >- + Value of the URL where the user should be + redirected to + display_url: + type: string + title: (optional) Display value of the URL + title: Url contains the details of a generic URL + author: + type: string + title: Author of the post + conversation_id: + type: string + format: uint64 + title: (optional) Id of the original post of the conversation + referenced_posts: + type: array + items: + type: object + properties: + type: + title: Type of reference + type: string + enum: + - TYPE_UNSPECIFIED + - TYPE_REPLY_TO + - TYPE_QUOTE + - TYPE_REPOST + default: TYPE_UNSPECIFIED + description: |- + - TYPE_UNSPECIFIED: No reference specified + - TYPE_REPLY_TO: This reference represents a reply to the specified post + - TYPE_QUOTE: This reference represents a quote of the specified post + - TYPE_REPOST: This reference represents a repost of the specified post + post_id: + type: string + format: uint64 + title: Id of the referenced post + position: + type: string + format: uint64 + title: >- + Position of the reference inside the post's text. + This should be used only + + with the type set to TYPE_QUOTE + title: PostReference contains the details of a post reference + title: >- + A list this posts references (either as a reply, repost or + quote) + reply_settings: + title: Reply settings of this post + type: string + enum: + - REPLY_SETTING_UNSPECIFIED + - REPLY_SETTING_EVERYONE + - REPLY_SETTING_FOLLOWERS + - REPLY_SETTING_MUTUAL + - REPLY_SETTING_MENTIONS + default: REPLY_SETTING_UNSPECIFIED + description: |- + - REPLY_SETTING_UNSPECIFIED: No reply setting specified + - REPLY_SETTING_EVERYONE: Everyone will be able to reply to this post + - REPLY_SETTING_FOLLOWERS: Only followers of the author will be able to reply to this post + - REPLY_SETTING_MUTUAL: Only the author mutual followers will be able to reply to this post + - REPLY_SETTING_MENTIONS: Only people mentioned inside this post will be able to reply + creation_date: + type: string + format: date-time + title: Creation date of the post + last_edited_date: + type: string + format: date-time + title: (optional) Last edited time of the post + title: Post contains all the information about a single post + title: >- + QueryPostResponse is the response type for the Query/Post RPC + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least one "/" character. The last segment of the URL's path @@ -6824,99 +6927,30 @@ paths: } parameters: - name: subspace_id - description: Id of the subspace where the post is stored + description: Id of the subspace inside which the post lies in: path required: true type: string format: uint64 - name: post_id - description: Id of the post that holds the poll - in: path - required: true - type: string - format: uint64 - - name: poll_id - description: Id of the poll to query the answers for + description: Id of the post to query for in: path required: true - type: integer - format: int64 - - name: user - description: (Optional) Address of the user to query the responses for. - in: query - required: false - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false type: string format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean tags: - Query - '/desmos/posts/v1/{subspace_id}/{section_id}/posts': + '/desmos/posts/v1/{subspace_id}/posts/{post_id}/attachments': get: - summary: SectionPosts queries all the posts inside a given section - operationId: SectionPosts + summary: PostAttachments queries the attachments of the post having the given id + operationId: PostAttachments responses: '200': description: A successful response. schema: type: object properties: - posts: + attachments: type: array items: type: object @@ -6925,244 +6959,284 @@ paths: type: string format: uint64 title: >- - Id of the subspace inside which the post has been - created + Id of the subspace inside which the post to which this + attachment should be + + connected is section_id: type: integer format: int64 - title: Id of the section inside which the post has been created - id: + title: >- + Id of the subspace section inside which the post to + which this attachment + + should be connected is + post_id: type: string format: uint64 - title: Unique id of the post - external_id: - type: string - title: (optional) External id for this post - text: - type: string - title: (optional) Text of the post - entities: - title: (optional) Entities connected to this post + title: >- + Id of the post to which this attachment should be + connected + id: + type: integer + format: int64 + title: If of this attachment + content: type: object properties: - hashtags: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag ends - tag: - type: string - title: >- - Tag reference (user address, hashtag value, - etc) - title: Tag represents a generic tag - mentions: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag ends - tag: - type: string - title: >- - Tag reference (user address, hashtag value, - etc) - title: Tag represents a generic tag - urls: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the URL starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the URL ends - url: - type: string - title: >- - Value of the URL where the user should be - redirected to - display_url: - type: string - title: (optional) Display value of the URL - title: Url contains the details of a generic URL - author: - type: string - title: Author of the post - conversation_id: - type: string - format: uint64 - title: (optional) Id of the original post of the conversation - referenced_posts: - type: array - items: - type: object - properties: - type: - title: Type of reference - type: string - enum: - - TYPE_UNSPECIFIED - - TYPE_REPLY_TO - - TYPE_QUOTE - - TYPE_REPOST - default: TYPE_UNSPECIFIED - description: |- - - TYPE_UNSPECIFIED: No reference specified - - TYPE_REPLY_TO: This reference represents a reply to the specified post - - TYPE_QUOTE: This reference represents a quote of the specified post - - TYPE_REPOST: This reference represents a repost of the specified post - post_id: - type: string - format: uint64 - title: Id of the referenced post - position: - type: string - format: uint64 - title: >- - Position of the reference inside the post's text. - This should be used only - - with the type set to TYPE_QUOTE - title: PostReference contains the details of a post reference - title: >- - A list this posts references (either as a reply, repost - or quote) - reply_settings: - title: Reply settings of this post - type: string - enum: - - REPLY_SETTING_UNSPECIFIED - - REPLY_SETTING_EVERYONE - - REPLY_SETTING_FOLLOWERS - - REPLY_SETTING_MUTUAL - - REPLY_SETTING_MENTIONS - default: REPLY_SETTING_UNSPECIFIED - description: |- - - REPLY_SETTING_UNSPECIFIED: No reply setting specified - - REPLY_SETTING_EVERYONE: Everyone will be able to reply to this post - - REPLY_SETTING_FOLLOWERS: Only followers of the author will be able to reply to this post - - REPLY_SETTING_MUTUAL: Only the author mutual followers will be able to reply to this post - - REPLY_SETTING_MENTIONS: Only people mentioned inside this post will be able to reply - creation_date: - type: string - format: date-time - title: Creation date of the post - last_edited_date: - type: string - format: date-time - title: (optional) Last edited time of the post - title: Post contains all the information about a single post - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - corresponding request message has used PageRequest. + protocol buffer message. This string must contain at + least - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QuerySectionPostsResponse is the response type for the - Query/SectionPosts RPC + one "/" character. The last segment of the URL's + path must represent - method - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + the fully qualified name of the type (as in - protocol buffer message. This string must contain at - least + `path/google.protobuf.Duration`). The name should be + in a canonical form - one "/" character. The last segment of the URL's path - must represent + (e.g., leading "." is not accepted). - the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in - a canonical form + In practice, teams usually precompile into the + binary all types that they - (e.g., leading "." is not accepted). + expect it to use in the context of Any. However, for + URLs which use the + scheme `http`, `https`, or no scheme, one can + optionally set up a type - In practice, teams usually precompile into the binary - all types that they + server that maps type URLs to message definitions as + follows: - expect it to use in the context of Any. However, for - URLs which use the - scheme `http`, `https`, or no scheme, one can optionally - set up a type + * If no scheme is provided, `https` is assumed. - server that maps type URLs to message definitions as + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the + above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: Content of the attachment + title: Attachment contains the data of a single post attachment + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryPostAttachmentsResponse is the response type for the + Query/PostAttachments RPC method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as follows: @@ -7201,926 +7275,2550 @@ paths: `Any` contains an arbitrary serialized protocol buffer message along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: subspace_id + description: Id of the subspace where the post is stored + in: path + required: true + type: string + format: uint64 + - name: post_id + description: Id of the post to query the attachments for + in: path + required: true + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean + tags: + - Query + '/desmos/posts/v1/{subspace_id}/posts/{post_id}/polls/{poll_id}/answers': + get: + summary: PollAnswers queries the answers for the poll having the given id + operationId: PollAnswers + responses: + '200': + description: A successful response. + schema: + type: object + properties: + answers: + type: array + items: + type: object + properties: + subspace_id: + type: string + format: uint64 + title: >- + Subspace id inside which the post related to this + attachment is located + section_id: + type: integer + format: int64 + title: >- + Section id inside which the post related to this + attachment is located + post_id: + type: string + format: uint64 + title: Id of the post associated to this attachment + poll_id: + type: integer + format: int64 + title: Id of the poll to which this answer is associated + answers_indexes: + type: array + items: + type: integer + format: int64 + title: Indexes of the answers inside the ProvidedAnswers array + user: + type: string + title: Address of the user answering the poll + title: UserAnswer represents a user answer to a poll + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: >- + QueryPollAnswersResponse is the response type for the + Query/PollAnswers RPC + + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: subspace_id + description: Id of the subspace where the post is stored + in: path + required: true + type: string + format: uint64 + - name: post_id + description: Id of the post that holds the poll + in: path + required: true + type: string + format: uint64 + - name: poll_id + description: Id of the poll to query the answers for + in: path + required: true + type: integer + format: int64 + - name: user + description: (Optional) Address of the user to query the responses for. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean + tags: + - Query + '/desmos/posts/v1/{subspace_id}/{section_id}/posts': + get: + summary: SectionPosts queries all the posts inside a given section + operationId: SectionPosts + responses: + '200': + description: A successful response. + schema: + type: object + properties: + posts: + type: array + items: + type: object + properties: + subspace_id: + type: string + format: uint64 + title: >- + Id of the subspace inside which the post has been + created + section_id: + type: integer + format: int64 + title: Id of the section inside which the post has been created + id: + type: string + format: uint64 + title: Unique id of the post + external_id: + type: string + title: (optional) External id for this post + text: + type: string + title: (optional) Text of the post + entities: + title: (optional) Entities connected to this post + type: object + properties: + hashtags: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag ends + tag: + type: string + title: >- + Tag reference (user address, hashtag value, + etc) + title: Tag represents a generic tag + mentions: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag ends + tag: + type: string + title: >- + Tag reference (user address, hashtag value, + etc) + title: Tag represents a generic tag + urls: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the URL starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the URL ends + url: + type: string + title: >- + Value of the URL where the user should be + redirected to + display_url: + type: string + title: (optional) Display value of the URL + title: Url contains the details of a generic URL + author: + type: string + title: Author of the post + conversation_id: + type: string + format: uint64 + title: (optional) Id of the original post of the conversation + referenced_posts: + type: array + items: + type: object + properties: + type: + title: Type of reference + type: string + enum: + - TYPE_UNSPECIFIED + - TYPE_REPLY_TO + - TYPE_QUOTE + - TYPE_REPOST + default: TYPE_UNSPECIFIED + description: |- + - TYPE_UNSPECIFIED: No reference specified + - TYPE_REPLY_TO: This reference represents a reply to the specified post + - TYPE_QUOTE: This reference represents a quote of the specified post + - TYPE_REPOST: This reference represents a repost of the specified post + post_id: + type: string + format: uint64 + title: Id of the referenced post + position: + type: string + format: uint64 + title: >- + Position of the reference inside the post's text. + This should be used only + + with the type set to TYPE_QUOTE + title: PostReference contains the details of a post reference + title: >- + A list this posts references (either as a reply, repost + or quote) + reply_settings: + title: Reply settings of this post + type: string + enum: + - REPLY_SETTING_UNSPECIFIED + - REPLY_SETTING_EVERYONE + - REPLY_SETTING_FOLLOWERS + - REPLY_SETTING_MUTUAL + - REPLY_SETTING_MENTIONS + default: REPLY_SETTING_UNSPECIFIED + description: |- + - REPLY_SETTING_UNSPECIFIED: No reply setting specified + - REPLY_SETTING_EVERYONE: Everyone will be able to reply to this post + - REPLY_SETTING_FOLLOWERS: Only followers of the author will be able to reply to this post + - REPLY_SETTING_MUTUAL: Only the author mutual followers will be able to reply to this post + - REPLY_SETTING_MENTIONS: Only people mentioned inside this post will be able to reply + creation_date: + type: string + format: date-time + title: Creation date of the post + last_edited_date: + type: string + format: date-time + title: (optional) Last edited time of the post + title: Post contains all the information about a single post + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: >- + QuerySectionPostsResponse is the response type for the + Query/SectionPosts RPC + + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: subspace_id + description: Id of the subspace to query the posts for + in: path + required: true + type: string + format: uint64 + - name: section_id + description: Id of the section to query the posts for + in: path + required: true + type: integer + format: int64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean + tags: + - Query + /desmos/fees/v1/params: + get: + summary: Params queries the fees module params + operationId: FeesParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + type: object + properties: + min_fees: + type: array + items: + type: object + properties: + message_type: + type: string + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements + the custom method + + signatures required by gogoproto. + title: >- + MinFee contains the minimum amount of coins that should + be paid as a fee for + + each message of the specific type sent + title: Params contains the parameters for the fees module + title: QueryParamsResponse is the response type for the Query/Params RPC + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query + '/desmos/supply/v1/circulating/{denom}': + get: + summary: >- + Circulating queries the amount of tokens circulating in the market of + the + + given denom + operationId: Circulating + responses: + '200': + description: A successful response. + schema: + type: object + properties: + circulating_supply: + type: string + title: >- + QueryCirculatingResponse is the response type for the + Query/Circulating RPC + + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: denom + description: coin denom to query the circulating supply for + in: path + required: true + type: string + - name: divider_exponent + description: >- + divider_exponent is a factor used to power the divider used to + convert the + + supply to the desired representation. + in: query + required: false + type: string + format: uint64 + tags: + - Query + '/desmos/supply/v1/total/{denom}': + get: + summary: Total queries the total supply of the given denom + operationId: Total + responses: + '200': + description: A successful response. + schema: + type: object + properties: + total_supply: + type: string + title: >- + QueryTotalResponse is the response type for the Query/Total RPC + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: denom + description: coin denom to query the circulating supply for + in: path + required: true + type: string + - name: divider_exponent + description: >- + divider_exponent is a factor used to power the divider used to + convert the + + supply to the desired representation. + in: query + required: false + type: string + format: uint64 + tags: + - Query +definitions: + cosmos.base.query.v1beta1.PageRequest: + type: object + properties: + key: + type: string + format: byte + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + offset: + type: string + format: uint64 + description: |- + offset is a numeric offset that can be used when key is unavailable. + It is less efficient than using key. Only one of offset or key should + be set. + limit: + type: string + format: uint64 + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + count_total: + type: boolean + format: boolean + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in UIs. + + count_total is only respected when offset is used. It is ignored when + key + + is set. + reverse: + type: boolean + format: boolean + description: >- + reverse is set to true if results are to be returned in the descending + order. + + + Since: cosmos-sdk 0.43 + description: |- + message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } + title: |- + PageRequest is to be embedded in gRPC request messages for efficient + pagination. Ex: + cosmos.base.query.v1beta1.PageResponse: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: |- + total is total number of results available if PageRequest.count_total + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + cosmos.base.v1beta1.Coin: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + desmos.profiles.v2.ApplicationLink: + type: object + properties: + user: + type: string + title: User to which the link is associated + data: + title: Data contains the details of this specific link + type: object + properties: + application: + type: string + title: 'The application name (eg. Twitter, GitHub, etc)' + username: + type: string + title: 'Username on the application (eg. Twitter tag, GitHub profile, etc)' + state: + title: State of the link + type: string + enum: + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + - APPLICATION_LINK_STATE_VERIFICATION_STARTED + - APPLICATION_LINK_STATE_VERIFICATION_ERROR + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS + - APPLICATION_LINK_STATE_TIMED_OUT + default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + description: >- + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has just been + initialized + - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified + - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully + - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification + oracle_request: + title: OracleRequest represents the request that has been made to the oracle + type: object + properties: + id: + type: string + format: uint64 + title: ID is the ID of the request + oracle_script_id: + type: string + format: uint64 + title: OracleScriptID is ID of an oracle script + call_data: + title: CallData contains the data used to perform the oracle request + type: object + properties: + application: + type: string + title: The application for which the ownership should be verified + call_data: + type: string + title: >- + The hex encoded call data that should be used to verify the + application + + account ownership + client_id: + type: string + title: >- + ClientID represents the ID of the client that has called the + oracle script + result: + title: |- + Data coming from the result of the verification. + Only available when the state is STATE_SUCCESS + type: object + properties: + success: + title: Success represents a successful verification + type: object + properties: + value: + type: string + title: Hex-encoded value that has be signed by the profile + signature: + type: string + title: >- + Hex-encoded signature that has been produced by signing the + value + failed: + title: Failed represents a failed verification + type: object + properties: + error: + type: string + title: Error that is associated with the failure + creation_time: + type: string + format: date-time + title: CreationTime represents the time in which the link was created + title: ApplicationLink contains the data of a link to a centralized application + desmos.profiles.v2.ApplicationLinkState: + type: string + enum: + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + - APPLICATION_LINK_STATE_VERIFICATION_STARTED + - APPLICATION_LINK_STATE_VERIFICATION_ERROR + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS + - APPLICATION_LINK_STATE_TIMED_OUT + default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + description: >- + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has just been + initialized + - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified + - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully + - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification + title: |- + ApplicationLinkState defines if an application link is in the following + states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT + desmos.profiles.v2.BioParams: + type: object + properties: + max_length: + type: string + format: byte + title: BioParams defines the parameters related to profile biography + desmos.profiles.v2.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: + type: object + properties: + user: + type: string + title: User defines the destination profile address to link + address: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must + represent - Protobuf library provides support to pack/unpack Any values - in the form + the fully qualified name of the type (as in - of utility functions or additional generated methods of the - Any type. + `path/google.protobuf.Duration`). The name should be in a + canonical form + (e.g., leading "." is not accepted). - Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + In practice, teams usually precompile into the binary all types + that they - Example 2: Pack and unpack a message in Java. + expect it to use in the context of Any. However, for URLs which + use the - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + scheme `http`, `https`, or no scheme, one can optionally set up a + type - Example 3: Pack and unpack a message in Python. + server that maps type URLs to message definitions as follows: - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + * If no scheme is provided, `https` is assumed. - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - The pack methods provided by protobuf library will by - default use + Note: this functionality is not currently available in the + official - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + protobuf release, and it is not used for type URLs beginning with - methods only use the fully qualified type name after the - last '/' + type.googleapis.com. - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - name "y.z". + Schemes other than `http`, `https` (or the empty scheme) might be + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + URL that describes the type of the serialized message. - JSON - ==== + Protobuf library provides support to pack/unpack Any values in the + form - The JSON representation of an `Any` value uses the regular + of utility functions or additional generated methods of the Any type. - representation of the deserialized, embedded message, with - an - additional field `@type` which contains the type URL. - Example: + Example 1: Pack and unpack a message in C++. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + Example 2: Pack and unpack a message in Java. - If the embedded message type is well-known and has a custom - JSON + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - representation, that representation will be embedded adding - a field + Example 3: Pack and unpack a message in Python. - `value` which holds the custom JSON in addition to the - `@type` + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - field. Example (for message [google.protobuf.Duration][]): + Example 4: Pack and unpack a message in Go - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: subspace_id - description: Id of the subspace to query the posts for - in: path - required: true - type: string - format: uint64 - - name: section_id - description: Id of the section to query the posts for - in: path - required: true - type: integer - format: int64 - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - It is less efficient than using key. Only one of offset or key - should + The pack methods provided by protobuf library will by default use - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. + 'type.googleapis.com/full.type.name' as the type URL and the unpack - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + methods only use the fully qualified type name after the last '/' - a count of the total number of items available for pagination in - UIs. + in the type URL, for example "foo.bar.com/x/y.z" will yield type - count_total is only respected when offset is used. It is ignored - when key + name "y.z". - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean - tags: - - Query - /desmos/fees/v1/params: - get: - summary: Params queries the fees module params - operationId: FeesParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - type: object - properties: - min_fees: - type: array - items: - type: object - properties: - message_type: - type: string - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. + JSON + ==== - NOTE: The amount field is an Int which implements - the custom method + The JSON representation of an `Any` value uses the regular - signatures required by gogoproto. - title: >- - MinFee contains the minimum amount of coins that should - be paid as a fee for + representation of the deserialized, embedded message, with an - each message of the specific type sent - title: Params contains the parameters for the fees module - title: QueryParamsResponse is the response type for the Query/Params RPC - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - tags: - - Query - '/desmos/supply/v1/circulating/{denom}': - get: - summary: >- - Circulating queries the amount of tokens circulating in the market of - the + additional field `@type` which contains the type URL. Example: - given denom - operationId: Circulating - responses: - '200': - description: A successful response. - schema: - type: object - properties: - circulating_supply: - type: string - title: >- - QueryCirculatingResponse is the response type for the - Query/Circulating RPC + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - method - default: - description: An unexpected error response - schema: + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + Address contains the data of the external chain address to be + connected + + with the Desmos profile + proof: + title: Proof contains the ownership proof of the external chain address + type: object + properties: + pub_key: type: object properties: - error: - type: string - code: - type: integer - format: int32 - message: + type_url: type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - the fully qualified name of the type (as in + protocol buffer message. This string must contain at least - `path/google.protobuf.Duration`). The name should be in - a canonical form + one "/" character. The last segment of the URL's path must + represent - (e.g., leading "." is not accepted). + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should be in a + canonical form - In practice, teams usually precompile into the binary - all types that they + (e.g., leading "." is not accepted). - expect it to use in the context of Any. However, for - URLs which use the - scheme `http`, `https`, or no scheme, one can optionally - set up a type + In practice, teams usually precompile into the binary all + types that they - server that maps type URLs to message definitions as - follows: + expect it to use in the context of Any. However, for URLs + which use the + scheme `http`, `https`, or no scheme, one can optionally set + up a type - * If no scheme is provided, `https` is assumed. + server that maps type URLs to message definitions as follows: - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - Note: this functionality is not currently available in - the official + * If no scheme is provided, `https` is assumed. - protobuf release, and it is not used for type URLs - beginning with + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - type.googleapis.com. + Note: this functionality is not currently available in the + official + protobuf release, and it is not used for type URLs beginning + with - Schemes other than `http`, `https` (or the empty scheme) - might be + type.googleapis.com. - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - URL that describes the type of the serialized message. + Schemes other than `http`, `https` (or the empty scheme) might + be + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - Protobuf library provides support to pack/unpack Any values - in the form + URL that describes the type of the serialized message. - of utility functions or additional generated methods of the - Any type. + Protobuf library provides support to pack/unpack Any values in the + form - Example 1: Pack and unpack a message in C++. + of utility functions or additional generated methods of the Any + type. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - Example 2: Pack and unpack a message in Java. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 3: Pack and unpack a message in Python. + Example 2: Pack and unpack a message in Java. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 4: Pack and unpack a message in Go + Example 3: Pack and unpack a message in Python. - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - The pack methods provided by protobuf library will by - default use + Example 4: Pack and unpack a message in Go - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - methods only use the fully qualified type name after the - last '/' + The pack methods provided by protobuf library will by default use - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - name "y.z". + methods only use the fully qualified type name after the last '/' + in the type URL, for example "foo.bar.com/x/y.z" will yield type + name "y.z". - JSON - ==== - The JSON representation of an `Any` value uses the regular + JSON - representation of the deserialized, embedded message, with - an + ==== - additional field `@type` which contains the type URL. - Example: + The JSON representation of an `Any` value uses the regular - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + representation of the deserialized, embedded message, with an - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + additional field `@type` which contains the type URL. Example: - If the embedded message type is well-known and has a custom - JSON + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - representation, that representation will be embedded adding - a field + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - `value` which holds the custom JSON in addition to the - `@type` + If the embedded message type is well-known and has a custom JSON - field. Example (for message [google.protobuf.Duration][]): + representation, that representation will be embedded adding a + field - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: denom - description: coin denom to query the circulating supply for - in: path - required: true - type: string - - name: divider_exponent - description: >- - divider_exponent is a factor used to power the divider used to - convert the + `value` which holds the custom JSON in addition to the `@type` - supply to the desired representation. - in: query - required: false - type: string - format: uint64 - tags: - - Query - '/desmos/supply/v1/total/{denom}': - get: - summary: Total queries the total supply of the given denom - operationId: Total - responses: - '200': - description: A successful response. - schema: - type: object - properties: - total_supply: - type: string + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } title: >- - QueryTotalResponse is the response type for the Query/Total RPC - method - default: - description: An unexpected error response - schema: + PubKey represents the public key associated with the address for + which to + + prove the ownership + signature: type: object properties: - error: - type: string - code: - type: integer - format: int32 - message: + type_url: type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - protocol buffer message. This string must contain at - least + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path - must represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in - a canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary - all types that they + In practice, teams usually precompile into the binary all + types that they - expect it to use in the context of Any. However, for - URLs which use the + expect it to use in the context of Any. However, for URLs + which use the - scheme `http`, `https`, or no scheme, one can optionally - set up a type + scheme `http`, `https`, or no scheme, one can optionally set + up a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in - the official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs - beginning with + protobuf release, and it is not used for type URLs beginning + with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) - might be + Schemes other than `http`, `https` (or the empty scheme) might + be - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values - in the form + Protobuf library provides support to pack/unpack Any values in the + form - of utility functions or additional generated methods of the - Any type. + of utility functions or additional generated methods of the Any + type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 2: Pack and unpack a message in Java. + Example 3: Pack and unpack a message in Python. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 3: Pack and unpack a message in Python. + Example 4: Pack and unpack a message in Go - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - Example 4: Pack and unpack a message in Go + The pack methods provided by protobuf library will by default use - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - The pack methods provided by protobuf library will by - default use + methods only use the fully qualified type name after the last '/' - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + in the type URL, for example "foo.bar.com/x/y.z" will yield type - methods only use the fully qualified type name after the - last '/' + name "y.z". - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - name "y.z". + JSON + ==== - JSON + The JSON representation of an `Any` value uses the regular - ==== + representation of the deserialized, embedded message, with an - The JSON representation of an `Any` value uses the regular + additional field `@type` which contains the type URL. Example: - representation of the deserialized, embedded message, with - an + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - additional field `@type` which contains the type URL. - Example: + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + If the embedded message type is well-known and has a custom JSON - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + representation, that representation will be embedded adding a + field - If the embedded message type is well-known and has a custom - JSON + `value` which holds the custom JSON in addition to the `@type` - representation, that representation will be embedded adding - a field + field. Example (for message [google.protobuf.Duration][]): - `value` which holds the custom JSON in addition to the - `@type` + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + Signature represents the hex-encoded signature of the PlainText + value + plain_text: + type: string + title: >- + PlainText represents the hex-encoded value signed in order to + produce the - field. Example (for message [google.protobuf.Duration][]): + Signature + chain_config: + title: ChainConfig contains the configuration of the external chain + type: object + properties: + name: + type: string + description: >- + ChainConfig contains the data of the chain with which the link is + made. + creation_time: + type: string + format: date-time + title: CreationTime represents the time in which the link has been created + title: |- + ChainLink contains the data representing either an inter- or cross- chain + link + desmos.profiles.v2.DTagParams: + type: object + properties: + reg_ex: + type: string + min_length: + type: string + format: byte + max_length: + type: string + format: byte + title: DTagParams defines the parameters related to profile DTags + desmos.profiles.v2.DTagTransferRequest: + type: object + properties: + dtag_to_trade: + type: string + title: >- + DTagToTrade contains the value of the DTag that should be transferred + from - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: denom - description: coin denom to query the circulating supply for - in: path - required: true - type: string - - name: divider_exponent - description: >- - divider_exponent is a factor used to power the divider used to - convert the + the receiver of the request to the sender + sender: + type: string + title: Sender represents the address of the account that sent the request + receiver: + type: string + title: >- + Receiver represents the receiver of the request that, if accepted, + will - supply to the desired representation. - in: query - required: false - type: string - format: uint64 - tags: - - Query -definitions: - cosmos.base.query.v1beta1.PageRequest: + give to the sender their DTag + title: DTagTransferRequest represent a DTag transfer request between two users + desmos.profiles.v2.Data: type: object properties: - key: + application: + type: string + title: 'The application name (eg. Twitter, GitHub, etc)' + username: + type: string + title: 'Username on the application (eg. Twitter tag, GitHub profile, etc)' + title: |- + Data contains the data associated to a specific user of a + generic centralized application + desmos.profiles.v2.NicknameParams: + type: object + properties: + min_length: type: string format: byte - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - offset: + max_length: type: string - format: uint64 - description: |- - offset is a numeric offset that can be used when key is unavailable. - It is less efficient than using key. Only one of offset or key should - be set. - limit: + format: byte + title: NicknameParams defines the parameters related to the profiles nicknames + desmos.profiles.v2.OracleParams: + type: object + properties: + script_id: type: string format: uint64 - description: >- - limit is the total number of results to be returned in the result - page. + title: >- + ScriptID represents the ID of the oracle script to be called to verify + the - If left empty it will default to a value to be set by each app. - count_total: - type: boolean - format: boolean - description: >- - count_total is set to true to indicate that the result set should - include + data + ask_count: + type: string + format: uint64 + title: >- + AskCount represents the number of oracles to which ask to verify the + data + min_count: + type: string + format: uint64 + title: >- + MinCount represents the minimum count of oracles that should complete + the - a count of the total number of items available for pagination in UIs. + verification successfully + prepare_gas: + type: string + format: uint64 + title: >- + PrepareGas represents the amount of gas to be used during the + preparation - count_total is only respected when offset is used. It is ignored when - key + stage of the oracle script + execute_gas: + type: string + format: uint64 + title: >- + ExecuteGas represents the amount of gas to be used during the + execution of - is set. - reverse: - type: boolean - format: boolean - description: >- - reverse is set to true if results are to be returned in the descending - order. + the oracle script + fee_amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: >- + FeeAmount represents the amount of fees to be payed in order to + execute the - Since: cosmos-sdk 0.43 - description: |- - message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } + oracle script title: |- - PageRequest is to be embedded in gRPC request messages for efficient - pagination. Ex: - cosmos.base.query.v1beta1.PageResponse: + 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: type: object properties: - next_key: + id: type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + format: uint64 + title: ID is the ID of the request + oracle_script_id: type: string format: uint64 - title: |- - total is total number of results available if PageRequest.count_total - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + title: OracleScriptID is ID of an oracle script + call_data: + title: CallData contains the data used to perform the oracle request + type: object + properties: + application: + type: string + title: The application for which the ownership should be verified + call_data: + type: string + title: >- + The hex encoded call data that should be used to verify the + application - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - cosmos.base.v1beta1.Coin: + account ownership + client_id: + type: string + title: >- + ClientID represents the ID of the client that has called the oracle + script + title: |- + OracleRequest represents a generic oracle request used to + verify the ownership of a centralized application account + desmos.profiles.v2.OracleRequest.CallData: type: object properties: - denom: + application: type: string - amount: + title: The application for which the ownership should be verified + call_data: type: string - description: |- - Coin defines a token with a denomination and an amount. + title: >- + The hex encoded call data that should be used to verify the + application - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - desmos.profiles.v2.ApplicationLink: + account ownership + 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: type: object properties: - user: - type: string - title: User to which the link is associated - data: - title: Data contains the details of this specific link + nickname: type: object properties: - application: + min_length: type: string - title: 'The application name (eg. Twitter, GitHub, etc)' - username: + format: byte + max_length: type: string - title: 'Username on the application (eg. Twitter tag, GitHub profile, etc)' - state: - title: State of the link - type: string - enum: - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - - APPLICATION_LINK_STATE_VERIFICATION_STARTED - - APPLICATION_LINK_STATE_VERIFICATION_ERROR - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS - - APPLICATION_LINK_STATE_TIMED_OUT - default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - description: >- - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has just been - initialized - - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified - - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully - - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification - oracle_request: - title: OracleRequest represents the request that has been made to the oracle + format: byte + title: >- + NicknameParams defines the parameters related to the profiles + nicknames + dtag: type: object properties: - id: + reg_ex: type: string - format: uint64 - title: ID is the ID of the request - oracle_script_id: + min_length: + type: string + format: byte + max_length: + type: string + format: byte + title: DTagParams defines the parameters related to profile DTags + bio: + type: object + properties: + max_length: + type: string + format: byte + title: BioParams defines the parameters related to profile biography + oracle: + type: object + properties: + script_id: type: string format: uint64 - title: OracleScriptID is ID of an oracle script - call_data: - title: CallData contains the data used to perform the oracle request - type: object - properties: - application: - type: string - title: The application for which the ownership should be verified - call_data: - type: string - title: >- - The hex encoded call data that should be used to verify the - application + title: >- + ScriptID represents the ID of the oracle script to be called to + verify the - account ownership - client_id: + data + ask_count: type: string + format: uint64 title: >- - ClientID represents the ID of the client that has called the - oracle script - result: - title: |- - Data coming from the result of the verification. - Only available when the state is STATE_SUCCESS - type: object - properties: - success: - title: Success represents a successful verification - type: object - properties: - value: - type: string - title: Hex-encoded value that has be signed by the profile - signature: - type: string - title: >- - Hex-encoded signature that has been produced by signing the - value - failed: - title: Failed represents a failed verification - type: object - properties: - error: - type: string - title: Error that is associated with the failure - creation_time: - type: string - format: date-time - title: CreationTime represents the time in which the link was created - title: ApplicationLink contains the data of a link to a centralized application - desmos.profiles.v2.ApplicationLinkState: - type: string - enum: - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - - APPLICATION_LINK_STATE_VERIFICATION_STARTED - - APPLICATION_LINK_STATE_VERIFICATION_ERROR - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS - - APPLICATION_LINK_STATE_TIMED_OUT - default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - description: >- - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has just been - initialized - - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified - - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully - - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification - title: |- - ApplicationLinkState defines if an application link is in the following - states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT - desmos.profiles.v2.BioParams: - type: object - properties: - max_length: - type: string - format: byte - title: BioParams defines the parameters related to profile biography - desmos.profiles.v2.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: + AskCount represents the number of oracles to which ask to verify + the data + min_count: + type: string + format: uint64 + title: >- + MinCount represents the minimum count of oracles that should + complete the + + verification successfully + prepare_gas: + type: string + format: uint64 + title: >- + PrepareGas represents the amount of gas to be used during the + preparation + + stage of the oracle script + execute_gas: + type: string + format: uint64 + title: >- + ExecuteGas represents the amount of gas to be used during the + execution of + + the oracle script + fee_amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: >- + FeeAmount represents the amount of fees to be payed in order to + execute the + + oracle script + title: |- + 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 + title: Params contains the parameters for the profiles module + desmos.profiles.v2.Proof: type: object properties: - user: - type: string - title: User defines the destination profile address to link - address: + pub_key: type: object properties: type_url: @@ -8280,1307 +9978,1118 @@ definitions: "value": "1.212s" } title: >- - Address contains the data of the external chain address to be - connected + PubKey represents the public key associated with the address for which + to - with the Desmos profile - proof: - title: Proof contains the ownership proof of the external chain address + prove the ownership + signature: type: object properties: - pub_key: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally set - up a type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning - with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) might - be - - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. + type_url: + type: string description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - PubKey represents the public key associated with the address for - which to - - prove the ownership - signature: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + A URL/resource name that uniquely identifies the type of the + serialized - protocol buffer message. This string must contain at least + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all - types that they + In practice, teams usually precompile into the binary all types + that they - expect it to use in the context of Any. However, for URLs - which use the + expect it to use in the context of Any. However, for URLs which + use the - scheme `http`, `https`, or no scheme, one can optionally set - up a type + scheme `http`, `https`, or no scheme, one can optionally set up a + type - server that maps type URLs to message definitions as follows: + server that maps type URLs to message definitions as follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in the - official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs beginning - with + protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) might - be + Schemes other than `http`, `https` (or the empty scheme) might be - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. + used with implementation specific semantics. + value: + type: string + format: byte description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values in the - form + Protobuf library provides support to pack/unpack Any values in the + form - of utility functions or additional generated methods of the Any - type. + of utility functions or additional generated methods of the Any type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - The pack methods provided by protobuf library will by default use + The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + 'type.googleapis.com/full.type.name' as the type URL and the unpack - methods only use the fully qualified type name after the last '/' + methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type + in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the regular + The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an + representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a custom JSON + If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a - field + representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` + `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: Signature represents the hex-encoded signature of the PlainText value + plain_text: + type: string + title: >- + PlainText represents the hex-encoded value signed in order to produce + the + + Signature + title: |- + Proof contains all the data used to verify a signature when linking an + account to a profile + desmos.profiles.v2.QueryApplicationLinkByClientIDResponse: + type: object + properties: + link: + type: object + properties: + user: + type: string + title: User to which the link is associated + data: + title: Data contains the details of this specific link + type: object + properties: + application: + type: string + title: 'The application name (eg. Twitter, GitHub, etc)' + username: + type: string + title: >- + Username on the application (eg. Twitter tag, GitHub profile, + etc) + state: + title: State of the link + type: string + enum: + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + - APPLICATION_LINK_STATE_VERIFICATION_STARTED + - APPLICATION_LINK_STATE_VERIFICATION_ERROR + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS + - APPLICATION_LINK_STATE_TIMED_OUT + default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + description: >- + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has just + been initialized + - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified + - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully + - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification + oracle_request: + title: >- + OracleRequest represents the request that has been made to the + oracle + type: object + properties: + id: + type: string + format: uint64 + title: ID is the ID of the request + oracle_script_id: + type: string + format: uint64 + title: OracleScriptID is ID of an oracle script + call_data: + title: CallData contains the data used to perform the oracle request + type: object + properties: + application: + type: string + title: The application for which the ownership should be verified + call_data: + type: string + title: >- + The hex encoded call data that should be used to verify + the application - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - Signature represents the hex-encoded signature of the PlainText - value - plain_text: + account ownership + client_id: + type: string + title: >- + ClientID represents the ID of the client that has called the + oracle script + result: + title: |- + Data coming from the result of the verification. + Only available when the state is STATE_SUCCESS + type: object + properties: + success: + title: Success represents a successful verification + type: object + properties: + value: + type: string + title: Hex-encoded value that has be signed by the profile + signature: + type: string + title: >- + Hex-encoded signature that has been produced by signing + the value + failed: + title: Failed represents a failed verification + type: object + properties: + error: + type: string + title: Error that is associated with the failure + creation_time: type: string - title: >- - PlainText represents the hex-encoded value signed in order to - produce the + format: date-time + title: CreationTime represents the time in which the link was created + 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: + type: object + properties: + owners: + type: array + items: + type: object + properties: + user: + type: string + application: + type: string + username: + type: string + title: >- + ApplicationLinkOwnerDetails contains the details of a single + application - Signature - chain_config: - title: ChainConfig contains the configuration of the external chain + link owner + title: Addresses of the application links owners + pagination: + title: Pagination defines the pagination response type: object properties: - name: + next_key: type: string - description: >- - ChainConfig contains the data of the chain with which the link is - made. - creation_time: - type: string - format: date-time - title: CreationTime represents the time in which the link has been created - title: |- - ChainLink contains the data representing either an inter- or cross- chain - link - desmos.profiles.v2.DTagParams: + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + description: >- + QueryApplicationLinkOwnersResponse contains the data returned by the + request + + allowing to get application link owners. + desmos.profiles.v2.QueryApplicationLinkOwnersResponse.ApplicationLinkOwnerDetails: type: object properties: - reg_ex: + user: type: string - min_length: + application: type: string - format: byte - max_length: + username: type: string - format: byte - title: DTagParams defines the parameters related to profile DTags - desmos.profiles.v2.DTagTransferRequest: + title: |- + ApplicationLinkOwnerDetails contains the details of a single application + link owner + desmos.profiles.v2.QueryApplicationLinksResponse: type: object properties: - dtag_to_trade: - type: string - title: >- - DTagToTrade contains the value of the DTag that should be transferred - from + links: + type: array + items: + type: object + properties: + user: + type: string + title: User to which the link is associated + data: + title: Data contains the details of this specific link + type: object + properties: + application: + type: string + title: 'The application name (eg. Twitter, GitHub, etc)' + username: + type: string + title: >- + Username on the application (eg. Twitter tag, GitHub + profile, etc) + state: + title: State of the link + type: string + enum: + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + - APPLICATION_LINK_STATE_VERIFICATION_STARTED + - APPLICATION_LINK_STATE_VERIFICATION_ERROR + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS + - APPLICATION_LINK_STATE_TIMED_OUT + default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + description: >- + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has + just been initialized + - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified + - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully + - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification + oracle_request: + title: >- + OracleRequest represents the request that has been made to the + oracle + type: object + properties: + id: + type: string + format: uint64 + title: ID is the ID of the request + oracle_script_id: + type: string + format: uint64 + title: OracleScriptID is ID of an oracle script + call_data: + title: >- + CallData contains the data used to perform the oracle + request + type: object + properties: + application: + type: string + title: >- + The application for which the ownership should be + verified + call_data: + type: string + title: >- + The hex encoded call data that should be used to verify + the application + + account ownership + client_id: + type: string + title: >- + ClientID represents the ID of the client that has called the + oracle script + result: + title: |- + Data coming from the result of the verification. + Only available when the state is STATE_SUCCESS + type: object + properties: + success: + title: Success represents a successful verification + type: object + properties: + value: + type: string + title: Hex-encoded value that has be signed by the profile + signature: + type: string + title: >- + Hex-encoded signature that has been produced by signing + the value + failed: + title: Failed represents a failed verification + type: object + properties: + error: + type: string + title: Error that is associated with the failure + creation_time: + type: string + format: date-time + title: CreationTime represents the time in which the link was created + title: >- + ApplicationLink contains the data of a link to a centralized + application + pagination: + title: Pagination defines the pagination response + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - the receiver of the request to the sender - sender: - type: string - title: Sender represents the address of the account that sent the request - receiver: - type: string - title: >- - Receiver represents the receiver of the request that, if accepted, - will + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. - give to the sender their DTag - title: DTagTransferRequest represent a DTag transfer request between two users - desmos.profiles.v2.Data: - type: object - properties: - application: - type: string - title: 'The application name (eg. Twitter, GitHub, etc)' - username: - type: string - title: 'Username on the application (eg. Twitter tag, GitHub profile, etc)' + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } title: |- - Data contains the data associated to a specific user of a - generic centralized application - desmos.profiles.v2.NicknameParams: - type: object - properties: - min_length: - type: string - format: byte - max_length: - type: string - format: byte - title: NicknameParams defines the parameters related to the profiles nicknames - desmos.profiles.v2.OracleParams: + QueryApplicationLinksResponse represents the response to the query used + to get the application links for a specific user + desmos.profiles.v2.QueryChainLinkOwnersResponse: type: object properties: - script_id: - type: string - format: uint64 - title: >- - ScriptID represents the ID of the oracle script to be called to verify - the - - data - ask_count: - type: string - format: uint64 - title: >- - AskCount represents the number of oracles to which ask to verify the - data - min_count: - type: string - format: uint64 - title: >- - MinCount represents the minimum count of oracles that should complete - the - - verification successfully - prepare_gas: - type: string - format: uint64 - title: >- - PrepareGas represents the amount of gas to be used during the - preparation - - stage of the oracle script - execute_gas: - type: string - format: uint64 - title: >- - ExecuteGas represents the amount of gas to be used during the - execution of - - the oracle script - fee_amount: + owners: type: array items: type: object properties: - denom: + user: type: string - amount: + chain_name: type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - title: >- - FeeAmount represents the amount of fees to be payed in order to - execute the - - oracle script - title: |- - 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: - type: object - properties: - id: - type: string - format: uint64 - title: ID is the ID of the request - oracle_script_id: - type: string - format: uint64 - title: OracleScriptID is ID of an oracle script - call_data: - title: CallData contains the data used to perform the oracle request + target: + type: string + title: >- + ChainLinkOwnerDetails contains the details of a single chain link + owner + title: Addresses of the chain links owners + pagination: + title: Pagination defines the pagination response type: object properties: - application: + next_key: type: string - title: The application for which the ownership should be verified - call_data: + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: type: string + format: uint64 title: >- - The hex encoded call data that should be used to verify the - application + total is total number of results available if + PageRequest.count_total - account ownership - client_id: - type: string - title: >- - ClientID represents the ID of the client that has called the oracle - script - title: |- - OracleRequest represents a generic oracle request used to - verify the ownership of a centralized application account - desmos.profiles.v2.OracleRequest.CallData: + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + description: |- + QueryChainLinkOwnersResponse contains the data returned by the request + allowing to get chain link owners. + desmos.profiles.v2.QueryChainLinkOwnersResponse.ChainLinkOwnerDetails: type: object properties: - application: + user: type: string - title: The application for which the ownership should be verified - call_data: + chain_name: type: string - title: >- - The hex encoded call data that should be used to verify the - application - - account ownership - 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: + target: + type: string + title: ChainLinkOwnerDetails contains the details of a single chain link owner + desmos.profiles.v2.QueryChainLinksResponse: type: object properties: - nickname: - type: object - properties: - min_length: - type: string - format: byte - max_length: - type: string - format: byte - title: >- - NicknameParams defines the parameters related to the profiles - nicknames - dtag: - type: object - properties: - reg_ex: - type: string - min_length: - type: string - format: byte - max_length: - type: string - format: byte - title: DTagParams defines the parameters related to profile DTags - bio: - type: object - properties: - max_length: - type: string - format: byte - title: BioParams defines the parameters related to profile biography - oracle: - type: object - properties: - script_id: - type: string - format: uint64 - title: >- - ScriptID represents the ID of the oracle script to be called to - verify the + links: + type: array + items: + type: object + properties: + user: + type: string + title: User defines the destination profile address to link + address: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the - data - ask_count: - type: string - format: uint64 - title: >- - AskCount represents the number of oracles to which ask to verify - the data - min_count: - type: string - format: uint64 - title: >- - MinCount represents the minimum count of oracles that should - complete the + scheme `http`, `https`, or no scheme, one can optionally set + up a type - verification successfully - prepare_gas: - type: string - format: uint64 - title: >- - PrepareGas represents the amount of gas to be used during the - preparation + server that maps type URLs to message definitions as + follows: - stage of the oracle script - execute_gas: - type: string - format: uint64 - title: >- - ExecuteGas represents the amount of gas to be used during the - execution of - the oracle script - fee_amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. description: >- - Coin defines a token with a denomination and an amount. + `Any` contains an arbitrary serialized protocol buffer message + along with a + URL that describes the type of the serialized message. - NOTE: The amount field is an Int which implements the custom - method - signatures required by gogoproto. - title: >- - FeeAmount represents the amount of fees to be payed in order to - execute the + Protobuf library provides support to pack/unpack Any values in + the form - oracle script - title: |- - 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 - title: Params contains the parameters for the profiles module - desmos.profiles.v2.Proof: - type: object - properties: - pub_key: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + of utility functions or additional generated methods of the Any + type. - protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + Example 1: Pack and unpack a message in C++. - the fully qualified name of the type (as in + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - `path/google.protobuf.Duration`). The name should be in a - canonical form + Example 2: Pack and unpack a message in Java. - (e.g., leading "." is not accepted). + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. - In practice, teams usually precompile into the binary all types - that they + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - expect it to use in the context of Any. However, for URLs which - use the + Example 4: Pack and unpack a message in Go - scheme `http`, `https`, or no scheme, one can optionally set up a - type + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - server that maps type URLs to message definitions as follows: + The pack methods provided by protobuf library will by default + use + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - * If no scheme is provided, `https` is assumed. + methods only use the fully qualified type name after the last + '/' - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + in the type URL, for example "foo.bar.com/x/y.z" will yield type - Note: this functionality is not currently available in the - official + name "y.z". - protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + JSON - Schemes other than `http`, `https` (or the empty scheme) might be + ==== - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above specified - type. - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + Address contains the data of the external chain address to be + connected + + with the Desmos profile + proof: + title: Proof contains the ownership proof of the external chain address + type: object + properties: + pub_key: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: - URL that describes the type of the serialized message. + * If no scheme is provided, `https` is assumed. - Protobuf library provides support to pack/unpack Any values in the - form + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - of utility functions or additional generated methods of the Any type. + Note: this functionality is not currently available in + the official + protobuf release, and it is not used for type URLs + beginning with - Example 1: Pack and unpack a message in C++. + type.googleapis.com. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - Example 2: Pack and unpack a message in Java. + Schemes other than `http`, `https` (or the empty scheme) + might be - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - Example 3: Pack and unpack a message in Python. + URL that describes the type of the serialized message. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Protobuf library provides support to pack/unpack Any values + in the form - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + of utility functions or additional generated methods of the + Any type. - The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the unpack + Example 1: Pack and unpack a message in C++. - methods only use the fully qualified type name after the last '/' + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - in the type URL, for example "foo.bar.com/x/y.z" will yield type + Example 2: Pack and unpack a message in Java. - name "y.z". + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - JSON + Example 4: Pack and unpack a message in Go - ==== + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - The JSON representation of an `Any` value uses the regular + The pack methods provided by protobuf library will by + default use - representation of the deserialized, embedded message, with an + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - additional field `@type` which contains the type URL. Example: + methods only use the fully qualified type name after the + last '/' - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + name "y.z". - If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` + JSON - field. Example (for message [google.protobuf.Duration][]): + ==== - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - PubKey represents the public key associated with the address for which - to + The JSON representation of an `Any` value uses the regular - prove the ownership - signature: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + representation of the deserialized, embedded message, with + an - protocol buffer message. This string must contain at least + additional field `@type` which contains the type URL. + Example: - one "/" character. The last segment of the URL's path must - represent + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - the fully qualified name of the type (as in + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - `path/google.protobuf.Duration`). The name should be in a - canonical form + If the embedded message type is well-known and has a custom + JSON - (e.g., leading "." is not accepted). + representation, that representation will be embedded adding + a field + `value` which holds the custom JSON in addition to the + `@type` - In practice, teams usually precompile into the binary all types - that they + field. Example (for message [google.protobuf.Duration][]): - expect it to use in the context of Any. However, for URLs which - use the + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + PubKey represents the public key associated with the address + for which to - scheme `http`, `https`, or no scheme, one can optionally set up a - type + prove the ownership + signature: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - server that maps type URLs to message definitions as follows: + protocol buffer message. This string must contain at + least + one "/" character. The last segment of the URL's path + must represent - * If no scheme is provided, `https` is assumed. + the fully qualified name of the type (as in - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + `path/google.protobuf.Duration`). The name should be in + a canonical form - Note: this functionality is not currently available in the - official + (e.g., leading "." is not accepted). - protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + In practice, teams usually precompile into the binary + all types that they + expect it to use in the context of Any. However, for + URLs which use the - Schemes other than `http`, `https` (or the empty scheme) might be + scheme `http`, `https`, or no scheme, one can optionally + set up a type - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above specified - type. - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + server that maps type URLs to message definitions as + follows: - URL that describes the type of the serialized message. + * If no scheme is provided, `https` is assumed. - Protobuf library provides support to pack/unpack Any values in the - form + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - of utility functions or additional generated methods of the Any type. + Note: this functionality is not currently available in + the official + protobuf release, and it is not used for type URLs + beginning with - Example 1: Pack and unpack a message in C++. + type.googleapis.com. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - Example 2: Pack and unpack a message in Java. + Schemes other than `http`, `https` (or the empty scheme) + might be - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - Example 3: Pack and unpack a message in Python. + URL that describes the type of the serialized message. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Protobuf library provides support to pack/unpack Any values + in the form - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + of utility functions or additional generated methods of the + Any type. - The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the unpack + Example 1: Pack and unpack a message in C++. - methods only use the fully qualified type name after the last '/' + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - in the type URL, for example "foo.bar.com/x/y.z" will yield type + Example 2: Pack and unpack a message in Java. - name "y.z". + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - JSON + Example 4: Pack and unpack a message in Go - ==== + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - The JSON representation of an `Any` value uses the regular + The pack methods provided by protobuf library will by + default use - representation of the deserialized, embedded message, with an + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - additional field `@type` which contains the type URL. Example: + methods only use the fully qualified type name after the + last '/' - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + name "y.z". - If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` + JSON - field. Example (for message [google.protobuf.Duration][]): + ==== - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: Signature represents the hex-encoded signature of the PlainText value - plain_text: - type: string - title: >- - PlainText represents the hex-encoded value signed in order to produce - the + The JSON representation of an `Any` value uses the regular - Signature - title: |- - Proof contains all the data used to verify a signature when linking an - account to a profile - desmos.profiles.v2.QueryApplicationLinkByClientIDResponse: - type: object - properties: - link: - type: object - properties: - user: - type: string - title: User to which the link is associated - data: - title: Data contains the details of this specific link - type: object - properties: - application: - type: string - title: 'The application name (eg. Twitter, GitHub, etc)' - username: - type: string - title: >- - Username on the application (eg. Twitter tag, GitHub profile, - etc) - state: - title: State of the link - type: string - enum: - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - - APPLICATION_LINK_STATE_VERIFICATION_STARTED - - APPLICATION_LINK_STATE_VERIFICATION_ERROR - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS - - APPLICATION_LINK_STATE_TIMED_OUT - default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - description: >- - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has just - been initialized - - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified - - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully - - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification - oracle_request: - title: >- - OracleRequest represents the request that has been made to the - oracle - type: object - properties: - id: - type: string - format: uint64 - title: ID is the ID of the request - oracle_script_id: - type: string - format: uint64 - title: OracleScriptID is ID of an oracle script - call_data: - title: CallData contains the data used to perform the oracle request - type: object - properties: - application: - type: string - title: The application for which the ownership should be verified - call_data: - type: string - title: >- - The hex encoded call data that should be used to verify - the application + representation of the deserialized, embedded message, with + an - account ownership - client_id: - type: string - title: >- - ClientID represents the ID of the client that has called the - oracle script - result: - title: |- - Data coming from the result of the verification. - Only available when the state is STATE_SUCCESS - type: object - properties: - success: - title: Success represents a successful verification - type: object - properties: - value: - type: string - title: Hex-encoded value that has be signed by the profile - signature: - type: string - title: >- - Hex-encoded signature that has been produced by signing - the value - failed: - title: Failed represents a failed verification - type: object - properties: - error: - type: string - title: Error that is associated with the failure - creation_time: - type: string - format: date-time - title: CreationTime represents the time in which the link was created - 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: - type: object - properties: - owners: - type: array - items: - type: object - properties: - user: - type: string - application: - type: string - username: - type: string - title: >- - ApplicationLinkOwnerDetails contains the details of a single - application + additional field `@type` which contains the type URL. + Example: - link owner - title: Addresses of the application links owners - pagination: - title: Pagination defines the pagination response - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: >- - QueryApplicationLinkOwnersResponse contains the data returned by the - request + If the embedded message type is well-known and has a custom + JSON - allowing to get application link owners. - desmos.profiles.v2.QueryApplicationLinkOwnersResponse.ApplicationLinkOwnerDetails: - type: object - properties: - user: - type: string - application: - type: string - username: - type: string - title: |- - ApplicationLinkOwnerDetails contains the details of a single application - link owner - desmos.profiles.v2.QueryApplicationLinksResponse: - type: object - properties: - links: - type: array - items: - type: object - properties: - user: - type: string - title: User to which the link is associated - data: - title: Data contains the details of this specific link - type: object - properties: - application: - type: string - title: 'The application name (eg. Twitter, GitHub, etc)' - username: - type: string + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } title: >- - Username on the application (eg. Twitter tag, GitHub - profile, etc) - state: - title: State of the link - type: string - enum: - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - - APPLICATION_LINK_STATE_VERIFICATION_STARTED - - APPLICATION_LINK_STATE_VERIFICATION_ERROR - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS - - APPLICATION_LINK_STATE_TIMED_OUT - default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - description: >- - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has - just been initialized - - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified - - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully - - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification - oracle_request: - title: >- - OracleRequest represents the request that has been made to the - oracle - type: object - properties: - id: - type: string - format: uint64 - title: ID is the ID of the request - oracle_script_id: + Signature represents the hex-encoded signature of the + PlainText value + plain_text: type: string - format: uint64 - title: OracleScriptID is ID of an oracle script - call_data: title: >- - CallData contains the data used to perform the oracle - request - type: object - properties: - application: - type: string - title: >- - The application for which the ownership should be - verified - call_data: - type: string - title: >- - The hex encoded call data that should be used to verify - the application + PlainText represents the hex-encoded value signed in order + to produce the - account ownership - client_id: - type: string - title: >- - ClientID represents the ID of the client that has called the - oracle script - result: - title: |- - Data coming from the result of the verification. - Only available when the state is STATE_SUCCESS + Signature + chain_config: + title: ChainConfig contains the configuration of the external chain type: object properties: - success: - title: Success represents a successful verification - type: object - properties: - value: - type: string - title: Hex-encoded value that has be signed by the profile - signature: - type: string - title: >- - Hex-encoded signature that has been produced by signing - the value - failed: - title: Failed represents a failed verification - type: object - properties: - error: - type: string - title: Error that is associated with the failure + name: + type: string + description: >- + ChainConfig contains the data of the chain with which the link + is made. creation_time: type: string format: date-time - title: CreationTime represents the time in which the link was created + title: >- + CreationTime represents the time in which the link has been + created title: >- - ApplicationLink contains the data of a link to a centralized - application - pagination: - title: Pagination defines the pagination response - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + ChainLink contains the data representing either an inter- or cross- + chain - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: |- - QueryApplicationLinksResponse represents the response to the query used - to get the application links for a specific user - desmos.profiles.v2.QueryChainLinkOwnersResponse: - type: object - properties: - owners: - type: array - items: - type: object - properties: - user: - type: string - chain_name: - type: string - target: - type: string - title: >- - ChainLinkOwnerDetails contains the details of a single chain link - owner - title: Addresses of the chain links owners + link pagination: title: Pagination defines the pagination response type: object @@ -9608,22 +11117,12 @@ definitions: PageResponse page = 2; } description: |- - QueryChainLinkOwnersResponse contains the data returned by the request - allowing to get chain link owners. - desmos.profiles.v2.QueryChainLinkOwnersResponse.ChainLinkOwnerDetails: - type: object - properties: - user: - type: string - chain_name: - type: string - target: - type: string - title: ChainLinkOwnerDetails contains the details of a single chain link owner - desmos.profiles.v2.QueryChainLinksResponse: + QueryChainLinksResponse is the response type for the + Query/ChainLinks RPC method. + desmos.profiles.v2.QueryDefaultExternalAddressesResponse: type: object properties: - links: + chain_links: type: array items: type: object @@ -10194,8 +11693,12 @@ definitions: chain link + title: >- + List of default addresses, each one represented by the associated + chain + + link pagination: - title: Pagination defines the pagination response type: object properties: next_key: @@ -10220,9 +11723,9 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - description: |- - QueryChainLinksResponse is the response type for the - Query/ChainLinks RPC method. + title: |- + QueryDefaultExternalAddressesResponse is the response type for + Query/DefaultExternalAddresses RPC method desmos.profiles.v2.QueryIncomingDTagTransferRequestsResponse: type: object properties: @@ -10259,7 +11762,6 @@ definitions: the user pagination: - title: Pagination defines the pagination response type: object properties: next_key: @@ -10284,6 +11786,7 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + title: Pagination defines the pagination response description: |- QueryIncomingDTagTransferRequestsResponse is the response type for the Query/IncomingDTagTransferRequests RPC method. From 035722462ed94a5f21cb8e5195bf8a62e62dc9fe Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 2 Jun 2022 11:53:05 +0800 Subject: [PATCH 03/64] Setup types and keys --- x/profiles/types/codec.go | 2 ++ x/profiles/types/keys.go | 11 +++++++ x/profiles/types/msgs_chain_links.go | 47 +++++++++++++++++++++++++++ x/profiles/types/query_chain_links.go | 9 +++++ 4 files changed, 69 insertions(+) diff --git a/x/profiles/types/codec.go b/x/profiles/types/codec.go index be65760aef..8de4ae41df 100644 --- a/x/profiles/types/codec.go +++ b/x/profiles/types/codec.go @@ -19,6 +19,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(MsgRefuseDTagTransferRequest{}, "desmos/MsgRefuseDTagTransferRequest", nil) cdc.RegisterConcrete(MsgLinkChainAccount{}, "desmos/MsgLinkChainAccount", nil) cdc.RegisterConcrete(MsgUnlinkChainAccount{}, "desmos/MsgUnlinkChainAccount", nil) + cdc.RegisterConcrete(MsgSetDefaultExternalAddress{}, "desmos/MsgSetDefaultExternalAddress", nil) cdc.RegisterConcrete(MsgLinkApplication{}, "desmos/MsgLinkApplication", nil) cdc.RegisterConcrete(MsgUnlinkApplication{}, "desmos/MsgUnlinkApplication", nil) @@ -63,6 +64,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgUnlinkChainAccount{}, &MsgLinkApplication{}, &MsgUnlinkApplication{}, + &MsgSetDefaultExternalAddress{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/profiles/types/keys.go b/x/profiles/types/keys.go index 31b284162f..027bdcbf39 100644 --- a/x/profiles/types/keys.go +++ b/x/profiles/types/keys.go @@ -22,6 +22,7 @@ const ( ActionUnlinkChainAccount = "unlink_chain_account" ActionLinkApplication = "link_application" ActionUnlinkApplication = "unlink_application" + ActionSetDefaultExternalAddress = "set_default_external_address" DoNotModify = "[do-not-modify]" @@ -43,6 +44,8 @@ var ( ChainLinkChainPrefix = []byte{0x15} ApplicationLinkAppPrefix = []byte{0x16} + + DefaultExternalAddressPrefix = []byte{0x17} ) // DTagStoreKey turns a DTag into the key used to store the address associated with it into the store @@ -146,3 +149,11 @@ func GetApplicationLinkOwnerData(key []byte) (application, username, owner strin values := bytes.Split(cleanedKey, Separator) return string(values[0]), string(values[1]), string(values[2]) } + +func UserDefaultExternalAddressPrefix(user string) []byte { + return append(DefaultExternalAddressPrefix, []byte(user)...) +} + +func DefaultExternalAddressKey(user, chainName string) []byte { + return append(UserDefaultExternalAddressPrefix(user), []byte(chainName)...) +} diff --git a/x/profiles/types/msgs_chain_links.go b/x/profiles/types/msgs_chain_links.go index b7d7f6c98d..cedbf27453 100644 --- a/x/profiles/types/msgs_chain_links.go +++ b/x/profiles/types/msgs_chain_links.go @@ -123,3 +123,50 @@ func (msg MsgUnlinkChainAccount) GetSigners() []sdk.AccAddress { signer, _ := sdk.AccAddressFromBech32(msg.Owner) return []sdk.AccAddress{signer} } + +// ___________________________________________________________________________________________________________________ + +func NewMsgSetDefaultExternalAddress(chainName, address, signer string) *MsgSetDefaultExternalAddress { + return &MsgSetDefaultExternalAddress{ + ChainName: chainName, + ExternalAddress: address, + Signer: signer, + } +} + +// Route should return the name of the module +func (msg MsgSetDefaultExternalAddress) Route() string { return RouterKey } + +// Type should return the action +func (msg MsgSetDefaultExternalAddress) Type() string { + return ActionSetDefaultExternalAddress +} + +// ValidateBasic runs stateless checks on the message +func (msg MsgSetDefaultExternalAddress) ValidateBasic() error { + if strings.TrimSpace(msg.ChainName) == "" { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "chain name cannot be empty or blank") + } + + if strings.TrimSpace(msg.ExternalAddress) == "" { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid external address") + } + + _, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid signer") + } + + return nil +} + +// GetSignBytes encodes the message for signing +func (msg MsgSetDefaultExternalAddress) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) +} + +// GetSigners defines whose signature is required +func (msg MsgSetDefaultExternalAddress) GetSigners() []sdk.AccAddress { + signer, _ := sdk.AccAddressFromBech32(msg.Signer) + return []sdk.AccAddress{signer} +} diff --git a/x/profiles/types/query_chain_links.go b/x/profiles/types/query_chain_links.go index 253a69c0e1..88aaa11abb 100644 --- a/x/profiles/types/query_chain_links.go +++ b/x/profiles/types/query_chain_links.go @@ -26,3 +26,12 @@ func NewQueryChainLinkOwnersRequest(chainName, target string, pageReq *query.Pag Pagination: pageReq, } } + +// NewQueryDefaultExternalAddressesRequest returns a new QueryDefaultExternalAddressesRequest instance +func NewQueryDefaultExternalAddressesRequest(user, chainName string, pageReq *query.PageRequest) *QueryDefaultExternalAddressesRequest { + return &QueryDefaultExternalAddressesRequest{ + User: user, + ChainName: chainName, + Pagination: pageReq, + } +} From 76397d21c67e77bbba95d67174492748b8b98519 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 2 Jun 2022 16:37:48 +0800 Subject: [PATCH 04/64] Implement keeper logic --- x/profiles/ibc_module.go | 6 +-- x/profiles/keeper/alias_functions.go | 16 ++++++ x/profiles/keeper/grpc_query.go | 4 ++ x/profiles/keeper/keeper_chain_links.go | 53 ++++++++++++++++++- x/profiles/keeper/msg_server_chain_link.go | 33 +++++++++--- .../keeper/msg_server_chain_link_test.go | 12 ++--- x/profiles/types/events.go | 6 +-- 7 files changed, 111 insertions(+), 19 deletions(-) diff --git a/x/profiles/ibc_module.go b/x/profiles/ibc_module.go index 8e442f7ca1..5971228a95 100644 --- a/x/profiles/ibc_module.go +++ b/x/profiles/ibc_module.go @@ -240,9 +240,9 @@ func handleLinkChainAccountPacketData( sdk.NewEvent( types.EventTypeLinkChainAccountPacket, sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), - sdk.NewAttribute(types.AttributeKeyChainLinkSourceAddress, address.GetValue()), - sdk.NewAttribute(types.AttributeKeyChainLinkSourceChainName, packetData.SourceChainConfig.Name), - sdk.NewAttribute(types.AttributeKeyChainLinkDestinationAddress, packetData.DestinationAddress), + sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, address.GetValue()), + sdk.NewAttribute(types.AttributeKeyChainLinkChainName, packetData.SourceChainConfig.Name), + sdk.NewAttribute(types.AttributeKeyChainLinkOwner, packetData.DestinationAddress), sdk.NewAttribute(types.AttributeKeyAckSuccess, fmt.Sprintf("%t", true)), ), ) diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go index cc9f54939b..d614deb6c3 100644 --- a/x/profiles/keeper/alias_functions.go +++ b/x/profiles/keeper/alias_functions.go @@ -169,6 +169,22 @@ func (k Keeper) IterateUserChainLinks(ctx sdk.Context, user string, fn func(inde } } +func (k Keeper) IterateUserChainLinksByChain(ctx sdk.Context, user string, chainName string, fn func(link types.ChainLink) (stop bool)) { + store := ctx.KVStore(k.storeKey) + + iterator := sdk.KVStorePrefixIterator(store, types.UserChainLinksChainPrefix(user, chainName)) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + link := types.MustUnmarshalChainLink(k.cdc, iterator.Value()) + + stop := fn(link) + if stop { + break + } + } +} + // GetChainLinks allows to returns the list of all stored chain links func (k Keeper) GetChainLinks(ctx sdk.Context) []types.ChainLink { var links []types.ChainLink diff --git a/x/profiles/keeper/grpc_query.go b/x/profiles/keeper/grpc_query.go index b4974c9e10..7c7cac6203 100644 --- a/x/profiles/keeper/grpc_query.go +++ b/x/profiles/keeper/grpc_query.go @@ -158,6 +158,10 @@ func (k Keeper) ChainLinkOwners(ctx context.Context, request *types.QueryChainLi return &types.QueryChainLinkOwnersResponse{Owners: owners, Pagination: pageRes}, nil } +func (k Keeper) DefaultExternalAddresses(ctx context.Context, request *types.QueryDefaultExternalAddressesRequest) (*types.QueryDefaultExternalAddressesResponse, error) { + return &types.QueryDefaultExternalAddressesResponse{}, nil +} + // ApplicationLinks implements the Query/ApplicationLinks gRPC method func (k Keeper) ApplicationLinks(ctx context.Context, request *types.QueryApplicationLinksRequest) (*types.QueryApplicationLinksResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) diff --git a/x/profiles/keeper/keeper_chain_links.go b/x/profiles/keeper/keeper_chain_links.go index 6c2edc67fc..93c8d1471c 100644 --- a/x/profiles/keeper/keeper_chain_links.go +++ b/x/profiles/keeper/keeper_chain_links.go @@ -50,8 +50,11 @@ func (k Keeper) SaveChainLink(ctx sdk.Context, link types.ChainLink) error { store.Set(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, target), types.MustMarshalChainLink(k.cdc, link)) store.Set(types.ChainLinkOwnerKey(link.ChainConfig.Name, target, link.User), []byte{0x01}) - k.AfterChainLinkSaved(ctx, link) + if !k.HasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { + k.SaveDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name, srcAddrData.GetValue()) + } + k.AfterChainLinkSaved(ctx, link) return nil } @@ -80,6 +83,11 @@ func (k Keeper) DeleteChainLink(ctx sdk.Context, link types.ChainLink) { store.Delete(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, link.GetAddressData().GetValue())) store.Delete(types.ChainLinkOwnerKey(link.ChainConfig.Name, link.GetAddressData().GetValue(), link.User)) + // Update default external address if the target chain link is the default + if k.IsDefaultExternalAddress(ctx, link) { + k.UpdateDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) + } + k.AfterChainLinkDeleted(ctx, link) } @@ -95,3 +103,46 @@ func (k Keeper) DeleteAllUserChainLinks(ctx sdk.Context, user string) { k.DeleteChainLink(ctx, link) } } + +func (k Keeper) GetOldestUserChainByChain(ctx sdk.Context, user, chainName string) (types.ChainLink, bool) { + var oldestLink types.ChainLink + + k.IterateUserChainLinksByChain(ctx, user, chainName, func(link types.ChainLink) (stop bool) { + if oldestLink.CreationTime.IsZero() || link.CreationTime.Before(oldestLink.CreationTime) { + oldestLink = link + } + return false + }) + + return oldestLink, oldestLink.CreationTime.IsZero() +} + +func (k Keeper) UpdateDefaultExternalAddress(ctx sdk.Context, user, chainName string) { + store := ctx.KVStore(k.storeKey) + link, found := k.GetOldestUserChainByChain(ctx, user, chainName) + if found { + k.SaveDefaultExternalAddress(ctx, user, chainName, link.GetAddressData().GetValue()) + return + } + + store.Delete(types.DefaultExternalAddressKey(user, chainName)) +} + +func (k Keeper) SaveDefaultExternalAddress(ctx sdk.Context, user, chainName, externalAddr string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.DefaultExternalAddressKey(user, chainName), []byte(externalAddr)) +} + +func (k Keeper) HasDefaultExternalAddress(ctx sdk.Context, user, chainName string) bool { + store := ctx.KVStore(k.storeKey) + return store.Has(types.DefaultExternalAddressKey(user, chainName)) +} + +func (k Keeper) IsDefaultExternalAddress(ctx sdk.Context, link types.ChainLink) bool { + store := ctx.KVStore(k.storeKey) + if !k.HasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { + return false + } + address := store.Get(types.DefaultExternalAddressKey(link.User, link.ChainConfig.Name)) + return string(address) == link.GetAddressData().GetValue() +} diff --git a/x/profiles/keeper/msg_server_chain_link.go b/x/profiles/keeper/msg_server_chain_link.go index bdb7d288c2..4ce66da0dc 100644 --- a/x/profiles/keeper/msg_server_chain_link.go +++ b/x/profiles/keeper/msg_server_chain_link.go @@ -34,9 +34,9 @@ func (k msgServer) LinkChainAccount(goCtx context.Context, msg *types.MsgLinkCha ), sdk.NewEvent( types.EventTypeLinkChainAccount, - sdk.NewAttribute(types.AttributeKeyChainLinkSourceAddress, srcAddrData.GetValue()), - sdk.NewAttribute(types.AttributeKeyChainLinkSourceChainName, msg.ChainConfig.Name), - sdk.NewAttribute(types.AttributeKeyChainLinkDestinationAddress, msg.Signer), + sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, srcAddrData.GetValue()), + sdk.NewAttribute(types.AttributeKeyChainLinkChainName, msg.ChainConfig.Name), + sdk.NewAttribute(types.AttributeKeyChainLinkOwner, msg.Signer), sdk.NewAttribute(types.AttributeKeyChainLinkCreationTime, link.CreationTime.Format(time.RFC3339Nano)), ), }) @@ -65,11 +65,32 @@ func (k msgServer) UnlinkChainAccount(goCtx context.Context, msg *types.MsgUnlin ), sdk.NewEvent( types.EventTypeUnlinkChainAccount, - sdk.NewAttribute(types.AttributeKeyChainLinkSourceAddress, msg.Target), - sdk.NewAttribute(types.AttributeKeyChainLinkSourceChainName, msg.ChainName), - sdk.NewAttribute(types.AttributeKeyChainLinkDestinationAddress, msg.Owner), + sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, msg.Target), + sdk.NewAttribute(types.AttributeKeyChainLinkChainName, msg.ChainName), + sdk.NewAttribute(types.AttributeKeyChainLinkOwner, msg.Owner), ), }) return &types.MsgUnlinkChainAccountResponse{}, nil } + +func (k msgServer) SetDefaultExternalAddress(goCtx context.Context, msg *types.MsgSetDefaultExternalAddress) (*types.MsgSetDefaultExternalAddressResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(msg)), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), + ), + sdk.NewEvent( + types.EventTypeUnlinkChainAccount, + sdk.NewAttribute(types.AttributeKeyChainLinkChainName, msg.ChainName), + sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, msg.ExternalAddress), + sdk.NewAttribute(types.AttributeKeyChainLinkOwner, msg.Signer), + ), + }) + + return &types.MsgSetDefaultExternalAddressResponse{}, nil +} diff --git a/x/profiles/keeper/msg_server_chain_link_test.go b/x/profiles/keeper/msg_server_chain_link_test.go index 833a1f34c7..250ce04317 100644 --- a/x/profiles/keeper/msg_server_chain_link_test.go +++ b/x/profiles/keeper/msg_server_chain_link_test.go @@ -115,9 +115,9 @@ func (suite *KeeperTestSuite) TestMsgServer_LinkChainAccount() { ), sdk.NewEvent( types.EventTypeLinkChainAccount, - sdk.NewAttribute(types.AttributeKeyChainLinkSourceAddress, srcAddr), - sdk.NewAttribute(types.AttributeKeyChainLinkSourceChainName, "cosmos"), - sdk.NewAttribute(types.AttributeKeyChainLinkDestinationAddress, destAddr), + sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, srcAddr), + sdk.NewAttribute(types.AttributeKeyChainLinkChainName, "cosmos"), + sdk.NewAttribute(types.AttributeKeyChainLinkOwner, destAddr), sdk.NewAttribute(types.AttributeKeyChainLinkCreationTime, blockTime.Format(time.RFC3339Nano)), ), }, @@ -212,9 +212,9 @@ func (suite *KeeperTestSuite) TestMsgServer_UnlinkChainAccount() { ), sdk.NewEvent( types.EventTypeUnlinkChainAccount, - sdk.NewAttribute(types.AttributeKeyChainLinkSourceAddress, "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), - sdk.NewAttribute(types.AttributeKeyChainLinkSourceChainName, "cosmos"), - sdk.NewAttribute(types.AttributeKeyChainLinkDestinationAddress, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), + sdk.NewAttribute(types.AttributeKeyChainLinkChainName, "cosmos"), + sdk.NewAttribute(types.AttributeKeyChainLinkOwner, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), ), }, check: func(ctx sdk.Context) { diff --git a/x/profiles/types/events.go b/x/profiles/types/events.go index 3c77c25d0b..853347be84 100644 --- a/x/profiles/types/events.go +++ b/x/profiles/types/events.go @@ -25,9 +25,9 @@ const ( 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" + AttributeKeyChainLinkExternalAddress = "chain_link_external_address" + AttributeKeyChainLinkOwner = "chain_link_owner" + AttributeKeyChainLinkChainName = "chain_link_chain_name" AttributeKeyChainLinkCreationTime = "chain_link_creation_time" AttributeKeyAckSuccess = "success" AttributeKeyUser = "user" From 743e8e284f3380492d90a25013c38c45baad99f3 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 6 Jun 2022 15:52:08 +0800 Subject: [PATCH 05/64] Implement msg server and grpc query --- x/profiles/keeper/grpc_query.go | 32 +++++++- x/profiles/keeper/keeper_chain_links.go | 12 +-- x/profiles/keeper/msg_server_chain_link.go | 10 ++- x/profiles/types/events.go | 29 +++---- x/profiles/types/keys.go | 14 +++- x/profiles/types/query_chain_links.pb.go | 91 +++++++++++----------- 6 files changed, 117 insertions(+), 71 deletions(-) diff --git a/x/profiles/keeper/grpc_query.go b/x/profiles/keeper/grpc_query.go index 7c7cac6203..53bcc3ca5e 100644 --- a/x/profiles/keeper/grpc_query.go +++ b/x/profiles/keeper/grpc_query.go @@ -158,8 +158,38 @@ func (k Keeper) ChainLinkOwners(ctx context.Context, request *types.QueryChainLi return &types.QueryChainLinkOwnersResponse{Owners: owners, Pagination: pageRes}, nil } +// DefaultExternalAddresses implements the Query/DefaultExternalAddresses gRPC method func (k Keeper) DefaultExternalAddresses(ctx context.Context, request *types.QueryDefaultExternalAddressesRequest) (*types.QueryDefaultExternalAddressesResponse, error) { - return &types.QueryDefaultExternalAddressesResponse{}, nil + sdkCtx := sdk.UnwrapSDKContext(ctx) + store := sdkCtx.KVStore(k.storeKey) + + defaultPrefix := types.DefaultExternalAddressPrefix + switch { + case request.User != "" && request.ChainName != "": + defaultPrefix = types.DefaultExternalAddressKey(request.User, request.ChainName) + case request.User != "": + defaultPrefix = types.ChainLinkChainKey(request.User) + } + + var links []types.ChainLink + defaultStore := prefix.NewStore(store, defaultPrefix) + pageRes, err := query.Paginate(defaultStore, request.Pagination, func(key []byte, value []byte) error { + // Re-add the prefix because the prefix store trims it out, and we need it to get the data + keyWithPrefix := append(defaultPrefix, key...) + owner, chainName := types.SplitDefaultExternalAddressKey(keyWithPrefix) + link, found := k.GetChainLink(sdkCtx, owner, chainName, string(value)) + if !found { + return sdkerrors.Wrap(sdkerrors.ErrNotFound, "chain link not found") + } + links = append(links, link) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryDefaultExternalAddressesResponse{Links: links, Pagination: pageRes}, nil } // ApplicationLinks implements the Query/ApplicationLinks gRPC method diff --git a/x/profiles/keeper/keeper_chain_links.go b/x/profiles/keeper/keeper_chain_links.go index 93c8d1471c..58cf6964f8 100644 --- a/x/profiles/keeper/keeper_chain_links.go +++ b/x/profiles/keeper/keeper_chain_links.go @@ -11,6 +11,7 @@ import ( // Chain links are stored using two keys: // 1. ChainLinkStoreKey (user + chain name + target) -> types.ChainLink // 2. ChainLinkOwnerKey (chain name + target + user) -> 0x01 +// The first chain link external address will be set as default external address func (k Keeper) SaveChainLink(ctx sdk.Context, link types.ChainLink) error { // Validate the chain link err := link.Validate() @@ -50,7 +51,7 @@ func (k Keeper) SaveChainLink(ctx sdk.Context, link types.ChainLink) error { store.Set(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, target), types.MustMarshalChainLink(k.cdc, link)) store.Set(types.ChainLinkOwnerKey(link.ChainConfig.Name, target, link.User), []byte{0x01}) - if !k.HasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { + if !k.hasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { k.SaveDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name, srcAddrData.GetValue()) } @@ -78,13 +79,14 @@ func (k Keeper) GetChainLink(ctx sdk.Context, owner, chainName, target string) ( } // DeleteChainLink deletes the link associated with the given address and chain name +// If the deleted chain link is default external address, the default external address will be updated to be oldest one func (k Keeper) DeleteChainLink(ctx sdk.Context, link types.ChainLink) { store := ctx.KVStore(k.storeKey) store.Delete(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, link.GetAddressData().GetValue())) store.Delete(types.ChainLinkOwnerKey(link.ChainConfig.Name, link.GetAddressData().GetValue(), link.User)) // Update default external address if the target chain link is the default - if k.IsDefaultExternalAddress(ctx, link) { + if k.isDefaultExternalAddress(ctx, link) { k.UpdateDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) } @@ -133,14 +135,14 @@ func (k Keeper) SaveDefaultExternalAddress(ctx sdk.Context, user, chainName, ext store.Set(types.DefaultExternalAddressKey(user, chainName), []byte(externalAddr)) } -func (k Keeper) HasDefaultExternalAddress(ctx sdk.Context, user, chainName string) bool { +func (k Keeper) hasDefaultExternalAddress(ctx sdk.Context, user, chainName string) bool { store := ctx.KVStore(k.storeKey) return store.Has(types.DefaultExternalAddressKey(user, chainName)) } -func (k Keeper) IsDefaultExternalAddress(ctx sdk.Context, link types.ChainLink) bool { +func (k Keeper) isDefaultExternalAddress(ctx sdk.Context, link types.ChainLink) bool { store := ctx.KVStore(k.storeKey) - if !k.HasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { + if !k.hasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { return false } address := store.Get(types.DefaultExternalAddressKey(link.User, link.ChainConfig.Name)) diff --git a/x/profiles/keeper/msg_server_chain_link.go b/x/profiles/keeper/msg_server_chain_link.go index 4ce66da0dc..da5c6de300 100644 --- a/x/profiles/keeper/msg_server_chain_link.go +++ b/x/profiles/keeper/msg_server_chain_link.go @@ -77,6 +77,14 @@ func (k msgServer) UnlinkChainAccount(goCtx context.Context, msg *types.MsgUnlin func (k msgServer) SetDefaultExternalAddress(goCtx context.Context, msg *types.MsgSetDefaultExternalAddress) (*types.MsgSetDefaultExternalAddressResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + // Get the chain link + _, found := k.GetChainLink(ctx, msg.Signer, msg.ChainName, msg.ExternalAddress) + if !found { + return nil, sdkerrors.Wrap(sdkerrors.ErrNotFound, "chain link not found") + } + + k.SaveDefaultExternalAddress(ctx, msg.Signer, msg.ChainName, msg.ExternalAddress) + ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( sdk.EventTypeMessage, @@ -85,7 +93,7 @@ func (k msgServer) SetDefaultExternalAddress(goCtx context.Context, msg *types.M sdk.NewAttribute(sdk.AttributeKeySender, msg.Signer), ), sdk.NewEvent( - types.EventTypeUnlinkChainAccount, + types.EventTypeSetDefaultExternalAddress, sdk.NewAttribute(types.AttributeKeyChainLinkChainName, msg.ChainName), sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, msg.ExternalAddress), sdk.NewAttribute(types.AttributeKeyChainLinkOwner, msg.Signer), diff --git a/x/profiles/types/events.go b/x/profiles/types/events.go index 853347be84..675b33f707 100644 --- a/x/profiles/types/events.go +++ b/x/profiles/types/events.go @@ -3,20 +3,21 @@ package types // DONTCOVER const ( - EventTypeProfileSaved = "save_profile" - EventTypeProfileDeleted = "delete_profile" - EventTypeDTagTransferRequest = "create_dtag_transfer_request" - EventTypeDTagTransferAccept = "accept_dtag_transfer_request" - EventTypeDTagTransferRefuse = "refuse_dtag_transfer_request" - EventTypeDTagTransferCancel = "cancel_dtag_transfer_request" - EventTypeLinkChainAccount = "link_chain_account" - EventTypeUnlinkChainAccount = "unlink_chain_account" - EventTypeLinkChainAccountPacket = "link_chain_account_packet" - EventTypePacket = "receive_profiles_verification_packet" - EventTypeTimeout = "timeout" - EventTypesApplicationLinkCreated = "link_application" - EventTypeApplicationLinkDeleted = "unlink_application" - EventTypesApplicationLinkSaved = "application_link_saved" + EventTypeProfileSaved = "save_profile" + EventTypeProfileDeleted = "delete_profile" + EventTypeDTagTransferRequest = "create_dtag_transfer_request" + EventTypeDTagTransferAccept = "accept_dtag_transfer_request" + EventTypeDTagTransferRefuse = "refuse_dtag_transfer_request" + EventTypeDTagTransferCancel = "cancel_dtag_transfer_request" + EventTypeLinkChainAccount = "link_chain_account" + EventTypeUnlinkChainAccount = "unlink_chain_account" + EventTypeSetDefaultExternalAddress = "set_default_external_address" + EventTypeLinkChainAccountPacket = "link_chain_account_packet" + EventTypePacket = "receive_profiles_verification_packet" + EventTypeTimeout = "timeout" + EventTypesApplicationLinkCreated = "link_application" + EventTypeApplicationLinkDeleted = "unlink_application" + EventTypesApplicationLinkSaved = "application_link_saved" AttributeKeyProfileDTag = "profile_dtag" AttributeKeyProfileCreator = "profile_creator" diff --git a/x/profiles/types/keys.go b/x/profiles/types/keys.go index 027bdcbf39..a8bc78e7d9 100644 --- a/x/profiles/types/keys.go +++ b/x/profiles/types/keys.go @@ -150,10 +150,16 @@ func GetApplicationLinkOwnerData(key []byte) (application, username, owner strin return string(values[0]), string(values[1]), string(values[2]) } -func UserDefaultExternalAddressPrefix(user string) []byte { - return append(DefaultExternalAddressPrefix, []byte(user)...) +func OwnerDefaultExternalAddressPrefix(owner string) []byte { + return append(DefaultExternalAddressPrefix, []byte(owner)...) } -func DefaultExternalAddressKey(user, chainName string) []byte { - return append(UserDefaultExternalAddressPrefix(user), []byte(chainName)...) +func DefaultExternalAddressKey(owner, chainName string) []byte { + return append(OwnerDefaultExternalAddressPrefix(owner), append(Separator, []byte(chainName)...)...) +} + +func SplitDefaultExternalAddressKey(key []byte) (owner string, chainName string) { + cleanedKey := bytes.TrimPrefix(key, DefaultExternalAddressPrefix) + values := bytes.Split(cleanedKey, Separator) + return string(values[0]), string(values[1]) } diff --git a/x/profiles/types/query_chain_links.pb.go b/x/profiles/types/query_chain_links.pb.go index bada14f354..4d550510e7 100644 --- a/x/profiles/types/query_chain_links.pb.go +++ b/x/profiles/types/query_chain_links.pb.go @@ -418,7 +418,7 @@ func (m *QueryDefaultExternalAddressesRequest) GetPagination() *query.PageReques type QueryDefaultExternalAddressesResponse struct { // List of default addresses, each one represented by the associated chain // link - ChainLinks []ChainLink `protobuf:"bytes,1,rep,name=chain_links,json=chainLinks,proto3" json:"chain_links"` + Links []ChainLink `protobuf:"bytes,1,rep,name=links,proto3" json:"links"` Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -455,9 +455,9 @@ func (m *QueryDefaultExternalAddressesResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryDefaultExternalAddressesResponse proto.InternalMessageInfo -func (m *QueryDefaultExternalAddressesResponse) GetChainLinks() []ChainLink { +func (m *QueryDefaultExternalAddressesResponse) GetLinks() []ChainLink { if m != nil { - return m.ChainLinks + return m.Links } return nil } @@ -484,41 +484,40 @@ func init() { } var fileDescriptor_f3f86dba4268625b = []byte{ - // 533 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xcd, 0x6e, 0x13, 0x3d, - 0x14, 0x86, 0xe3, 0x24, 0x5f, 0xa4, 0x3a, 0xbb, 0xd1, 0x47, 0x49, 0x87, 0x76, 0x88, 0x22, 0x7e, - 0xa2, 0x22, 0x6c, 0x25, 0x5d, 0xb1, 0xa4, 0x84, 0xb2, 0xa0, 0xe2, 0x27, 0x4b, 0x36, 0x91, 0x27, - 0x73, 0x32, 0x1d, 0x31, 0x63, 0x4f, 0xc7, 0x9e, 0xd0, 0xdc, 0x05, 0x17, 0x00, 0x0b, 0xd6, 0xac, - 0xd8, 0x70, 0x0d, 0x5d, 0x76, 0xc9, 0x0a, 0xa1, 0xe4, 0x46, 0xd0, 0xd8, 0xa6, 0xed, 0x28, 0xa1, - 0x15, 0x90, 0x9d, 0x8f, 0xcf, 0xb1, 0xdf, 0xc7, 0xaf, 0xed, 0x83, 0x77, 0x03, 0x90, 0x89, 0x90, - 0x34, 0xcd, 0xc4, 0x24, 0x8a, 0x41, 0xd2, 0x69, 0x9f, 0x1e, 0xe7, 0x90, 0xcd, 0x46, 0xe3, 0x23, - 0x16, 0xf1, 0x51, 0x1c, 0xf1, 0xb7, 0x92, 0xa4, 0x99, 0x50, 0xc2, 0x71, 0x4c, 0x2d, 0xf9, 0x55, - 0x4b, 0xa6, 0x7d, 0xf7, 0xff, 0x50, 0x84, 0x42, 0xa7, 0x69, 0x31, 0x32, 0x95, 0xee, 0x76, 0x28, - 0x44, 0x18, 0x03, 0x65, 0x69, 0x44, 0x19, 0xe7, 0x42, 0x31, 0x15, 0x09, 0x6e, 0xf7, 0x71, 0xb7, - 0x6c, 0x56, 0x47, 0x7e, 0x3e, 0xa1, 0x8c, 0xcf, 0x6c, 0xea, 0xc1, 0x0a, 0x9c, 0x44, 0x04, 0x10, - 0xcb, 0x65, 0x1e, 0x77, 0x6b, 0x2c, 0x8a, 0xe2, 0x91, 0x91, 0x37, 0x81, 0x4d, 0xed, 0x9a, 0x88, - 0xfa, 0x4c, 0x82, 0x39, 0x0f, 0x9d, 0xf6, 0x7c, 0x50, 0xac, 0x47, 0x53, 0x16, 0x46, 0x5c, 0xf3, - 0x98, 0xda, 0xce, 0x67, 0x84, 0x37, 0x5f, 0x17, 0x25, 0x4f, 0x0a, 0x85, 0xc3, 0x42, 0x60, 0x08, - 0xc7, 0x39, 0x48, 0xe5, 0x38, 0xb8, 0x9e, 0x4b, 0xc8, 0x5a, 0xa8, 0x8d, 0xba, 0x1b, 0x43, 0x3d, - 0x76, 0x76, 0x30, 0x36, 0x28, 0x9c, 0x25, 0xd0, 0xaa, 0xea, 0xcc, 0x86, 0x9e, 0x79, 0xc1, 0x12, - 0x70, 0x36, 0x71, 0x43, 0xb1, 0x2c, 0x04, 0xd5, 0xaa, 0xe9, 0x94, 0x8d, 0x9c, 0x03, 0x8c, 0x2f, - 0x94, 0x5b, 0xf5, 0x36, 0xea, 0x36, 0xfb, 0xf7, 0x88, 0x85, 0x2e, 0x30, 0x89, 0xc6, 0x24, 0x16, - 0x93, 0xbc, 0x62, 0x21, 0x58, 0x8c, 0xe1, 0xa5, 0x95, 0x9d, 0x8f, 0x08, 0xdf, 0x5c, 0xa2, 0x95, - 0xa9, 0xe0, 0x12, 0x9c, 0x47, 0xf8, 0x3f, 0xed, 0x4f, 0x0b, 0xb5, 0x6b, 0xdd, 0x66, 0x7f, 0x87, - 0x2c, 0x5f, 0x18, 0x39, 0x5f, 0xb6, 0x5f, 0x3f, 0xfd, 0x7e, 0xbb, 0x32, 0x34, 0x2b, 0x9c, 0x67, - 0x25, 0xbc, 0xaa, 0xc6, 0xbb, 0x7f, 0x2d, 0x9e, 0xd1, 0x2d, 0xf1, 0x7d, 0x40, 0xf8, 0x56, 0x99, - 0xef, 0xe5, 0x3b, 0x0e, 0xd9, 0xb9, 0xa5, 0x65, 0xfb, 0xd0, 0xef, 0xed, 0xab, 0x5e, 0x61, 0x5f, - 0xed, 0xaf, 0xed, 0xfb, 0x52, 0xc5, 0xdb, 0xab, 0xf1, 0xac, 0x87, 0x01, 0x6e, 0x08, 0x3d, 0x63, - 0x4d, 0x3c, 0x58, 0x65, 0xe2, 0x55, 0x3b, 0x90, 0xf2, 0xfc, 0x00, 0x14, 0x8b, 0x62, 0x69, 0xdd, - 0xb6, 0x7b, 0xaf, 0xcd, 0x6e, 0xd7, 0xc7, 0x37, 0x56, 0xea, 0xad, 0xf1, 0xe9, 0x76, 0x3e, 0x21, - 0x7c, 0x47, 0x9f, 0x78, 0x00, 0x13, 0x96, 0xc7, 0xea, 0xe9, 0x89, 0x82, 0x8c, 0xb3, 0xf8, 0x71, - 0x10, 0x64, 0x20, 0x25, 0xfc, 0xcb, 0x77, 0x59, 0xd7, 0xbd, 0x7e, 0x45, 0xf8, 0xee, 0x35, 0x8c, - 0xf6, 0x82, 0x07, 0xb8, 0x79, 0xa9, 0x95, 0xfc, 0xc9, 0x57, 0x31, 0x07, 0x39, 0x5c, 0xeb, 0x7f, - 0xd9, 0x7f, 0x7e, 0x3a, 0xf7, 0xd0, 0xd9, 0xdc, 0x43, 0x3f, 0xe6, 0x1e, 0x7a, 0xbf, 0xf0, 0x2a, - 0x67, 0x0b, 0xaf, 0xf2, 0x6d, 0xe1, 0x55, 0xde, 0xf4, 0xc2, 0x48, 0x1d, 0xe5, 0x3e, 0x19, 0x8b, - 0x84, 0x1a, 0xba, 0x87, 0x31, 0xf3, 0xa5, 0x1d, 0xd3, 0xe9, 0x1e, 0x3d, 0xb9, 0xe8, 0x93, 0x6a, - 0x96, 0x82, 0xf4, 0x1b, 0xba, 0xa3, 0xed, 0xfd, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x49, 0xcf, 0x58, - 0x14, 0xd6, 0x05, 0x00, 0x00, + // 518 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0xeb, 0xb6, 0x54, 0x9a, 0x77, 0x8b, 0x60, 0x64, 0x61, 0x0b, 0x55, 0xc5, 0x9f, 0x6a, + 0x08, 0x5b, 0xed, 0x4e, 0x1c, 0x19, 0x63, 0x1c, 0x40, 0xfc, 0xe9, 0x91, 0x4b, 0xe5, 0x34, 0x6f, + 0xb3, 0x88, 0xc4, 0xce, 0x62, 0xa7, 0xac, 0xdf, 0x82, 0x0f, 0x00, 0x07, 0xce, 0x3b, 0xf1, 0x2d, + 0x76, 0xdc, 0x91, 0x13, 0x42, 0xed, 0x17, 0x41, 0xb1, 0xcd, 0x46, 0xd4, 0xb2, 0x49, 0xd0, 0xc3, + 0x6e, 0x7e, 0xfd, 0x3e, 0xf6, 0xf3, 0xcb, 0xe3, 0xd8, 0x78, 0x27, 0x04, 0x99, 0x0a, 0x49, 0xb3, + 0x5c, 0x8c, 0xe3, 0x04, 0x24, 0x9d, 0xf4, 0xe9, 0x51, 0x01, 0xf9, 0x74, 0x38, 0x3a, 0x64, 0x31, + 0x1f, 0x26, 0x31, 0xff, 0x20, 0x49, 0x96, 0x0b, 0x25, 0x1c, 0xc7, 0x68, 0xc9, 0x6f, 0x2d, 0x99, + 0xf4, 0xbd, 0x9b, 0x91, 0x88, 0x84, 0x6e, 0xd3, 0x72, 0x64, 0x94, 0xde, 0x56, 0x24, 0x44, 0x94, + 0x00, 0x65, 0x59, 0x4c, 0x19, 0xe7, 0x42, 0x31, 0x15, 0x0b, 0x6e, 0xf7, 0xf1, 0x36, 0x6d, 0x57, + 0x57, 0x41, 0x31, 0xa6, 0x8c, 0x4f, 0x6d, 0xeb, 0xd1, 0x12, 0x9c, 0x54, 0x84, 0x90, 0xc8, 0x45, + 0x1e, 0x6f, 0x73, 0x24, 0x4a, 0xf1, 0xd0, 0xd8, 0x9b, 0xc2, 0xb6, 0x76, 0x4c, 0x45, 0x03, 0x26, + 0xc1, 0x7c, 0x0f, 0x9d, 0xf4, 0x02, 0x50, 0xac, 0x47, 0x33, 0x16, 0xc5, 0x5c, 0xf3, 0x18, 0x6d, + 0xe7, 0x04, 0xe1, 0x8d, 0x77, 0xa5, 0xe4, 0x59, 0xe9, 0xf0, 0xaa, 0x34, 0x18, 0xc0, 0x51, 0x01, + 0x52, 0x39, 0x0e, 0x6e, 0x16, 0x12, 0x72, 0x17, 0xb5, 0x51, 0x77, 0x6d, 0xa0, 0xc7, 0xce, 0x36, + 0xc6, 0x06, 0x85, 0xb3, 0x14, 0xdc, 0xba, 0xee, 0xac, 0xe9, 0x99, 0xd7, 0x2c, 0x05, 0x67, 0x03, + 0xb7, 0x14, 0xcb, 0x23, 0x50, 0x6e, 0x43, 0xb7, 0x6c, 0xe5, 0x1c, 0x60, 0x7c, 0xe1, 0xec, 0x36, + 0xdb, 0xa8, 0xbb, 0xde, 0x7f, 0x40, 0x2c, 0x74, 0x89, 0x49, 0x34, 0x26, 0xb1, 0x98, 0xe4, 0x2d, + 0x8b, 0xc0, 0x62, 0x0c, 0xfe, 0x58, 0xd9, 0xf9, 0x82, 0xf0, 0xed, 0x05, 0x5a, 0x99, 0x09, 0x2e, + 0xc1, 0x79, 0x82, 0x6f, 0xe8, 0x7c, 0x5c, 0xd4, 0x6e, 0x74, 0xd7, 0xfb, 0xdb, 0x64, 0xf1, 0xc0, + 0xc8, 0xf9, 0xb2, 0xbd, 0xe6, 0xe9, 0x8f, 0xbb, 0xb5, 0x81, 0x59, 0xe1, 0xbc, 0xa8, 0xe0, 0xd5, + 0x35, 0xde, 0xc3, 0x2b, 0xf1, 0x8c, 0x6f, 0x85, 0xef, 0x33, 0xc2, 0x77, 0xaa, 0x7c, 0x6f, 0x3e, + 0x72, 0xc8, 0xcf, 0x23, 0xad, 0xc6, 0x87, 0xfe, 0x1e, 0x5f, 0xfd, 0x92, 0xf8, 0x1a, 0xff, 0x1c, + 0xdf, 0xb7, 0x3a, 0xde, 0x5a, 0x8e, 0x67, 0x33, 0x0c, 0x71, 0x4b, 0xe8, 0x19, 0x1b, 0xe2, 0xc1, + 0xb2, 0x10, 0x2f, 0xdb, 0x81, 0x54, 0xe7, 0xf7, 0x41, 0xb1, 0x38, 0x91, 0x36, 0x6d, 0xbb, 0xf7, + 0xca, 0xe2, 0xf6, 0x02, 0x7c, 0x6b, 0xa9, 0xdf, 0x0a, 0x7f, 0xdd, 0xce, 0x57, 0x84, 0xef, 0xe9, + 0x2f, 0xde, 0x87, 0x31, 0x2b, 0x12, 0xf5, 0xfc, 0x58, 0x41, 0xce, 0x59, 0xf2, 0x34, 0x0c, 0x73, + 0x90, 0x12, 0xfe, 0xe7, 0xba, 0xac, 0xea, 0x5c, 0x4f, 0x10, 0xbe, 0x7f, 0x05, 0xe3, 0xf5, 0xb9, + 0x24, 0x7b, 0x2f, 0x4f, 0x67, 0x3e, 0x3a, 0x9b, 0xf9, 0xe8, 0xe7, 0xcc, 0x47, 0x9f, 0xe6, 0x7e, + 0xed, 0x6c, 0xee, 0xd7, 0xbe, 0xcf, 0xfd, 0xda, 0xfb, 0x5e, 0x14, 0xab, 0xc3, 0x22, 0x20, 0x23, + 0x91, 0x52, 0x03, 0xf6, 0x38, 0x61, 0x81, 0xb4, 0x63, 0x3a, 0xd9, 0xa5, 0xc7, 0x17, 0x8f, 0xa3, + 0x9a, 0x66, 0x20, 0x83, 0x96, 0x7e, 0xc6, 0x76, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xfc, 0xc7, + 0xc3, 0xeb, 0xcb, 0x05, 0x00, 0x00, } func (m *QueryChainLinksRequest) Marshal() (dAtA []byte, err error) { @@ -849,10 +848,10 @@ func (m *QueryDefaultExternalAddressesResponse) MarshalToSizedBuffer(dAtA []byte i-- dAtA[i] = 0x12 } - if len(m.ChainLinks) > 0 { - for iNdEx := len(m.ChainLinks) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Links) > 0 { + for iNdEx := len(m.Links) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.ChainLinks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Links[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1009,8 +1008,8 @@ func (m *QueryDefaultExternalAddressesResponse) Size() (n int) { } var l int _ = l - if len(m.ChainLinks) > 0 { - for _, e := range m.ChainLinks { + if len(m.Links) > 0 { + for _, e := range m.Links { l = e.Size() n += 1 + l + sovQueryChainLinks(uint64(l)) } @@ -1927,7 +1926,7 @@ func (m *QueryDefaultExternalAddressesResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainLinks", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Links", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1954,8 +1953,8 @@ func (m *QueryDefaultExternalAddressesResponse) Unmarshal(dAtA []byte) error { 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 { + m.Links = append(m.Links, ChainLink{}) + if err := m.Links[len(m.Links)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex From 687e5fb225cdc34b825cf72119df23dfbe3733bb Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 6 Jun 2022 20:07:59 +0800 Subject: [PATCH 06/64] Add types tests --- x/profiles/types/keys.go | 7 +- x/profiles/types/msgs_chain_links.go | 10 +-- x/profiles/types/msgs_chain_links.pb.go | 91 +++++++++++------------ x/profiles/types/msgs_chain_links_test.go | 81 ++++++++++++++++++++ 4 files changed, 137 insertions(+), 52 deletions(-) diff --git a/x/profiles/types/keys.go b/x/profiles/types/keys.go index a8bc78e7d9..9b2cd1d214 100644 --- a/x/profiles/types/keys.go +++ b/x/profiles/types/keys.go @@ -150,15 +150,20 @@ func GetApplicationLinkOwnerData(key []byte) (application, username, owner strin return string(values[0]), string(values[1]), string(values[2]) } +// OwnerDefaultExternalAddressPrefix returns the store prefix used to identify all the default external addresses +// for the given owner func OwnerDefaultExternalAddressPrefix(owner string) []byte { return append(DefaultExternalAddressPrefix, []byte(owner)...) } +// DefaultExternalAddressKey returns the key used to store the address of the chain link which is set as +// default external address func DefaultExternalAddressKey(owner, chainName string) []byte { return append(OwnerDefaultExternalAddressPrefix(owner), append(Separator, []byte(chainName)...)...) } -func SplitDefaultExternalAddressKey(key []byte) (owner string, chainName string) { +// GetDefaultExternalAddressData returns the owner, chain name from a given DefaultExternalAddressKey +func GetDefaultExternalAddressData(key []byte) (owner string, chainName string) { cleanedKey := bytes.TrimPrefix(key, DefaultExternalAddressPrefix) values := bytes.Split(cleanedKey, Separator) return string(values[0]), string(values[1]) diff --git a/x/profiles/types/msgs_chain_links.go b/x/profiles/types/msgs_chain_links.go index cedbf27453..8e53aec4d8 100644 --- a/x/profiles/types/msgs_chain_links.go +++ b/x/profiles/types/msgs_chain_links.go @@ -126,11 +126,11 @@ func (msg MsgUnlinkChainAccount) GetSigners() []sdk.AccAddress { // ___________________________________________________________________________________________________________________ -func NewMsgSetDefaultExternalAddress(chainName, address, signer string) *MsgSetDefaultExternalAddress { +func NewMsgSetDefaultExternalAddress(chainName, target, signer string) *MsgSetDefaultExternalAddress { return &MsgSetDefaultExternalAddress{ - ChainName: chainName, - ExternalAddress: address, - Signer: signer, + ChainName: chainName, + Target: target, + Signer: signer, } } @@ -148,7 +148,7 @@ func (msg MsgSetDefaultExternalAddress) ValidateBasic() error { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "chain name cannot be empty or blank") } - if strings.TrimSpace(msg.ExternalAddress) == "" { + if strings.TrimSpace(msg.Target) == "" { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid external address") } diff --git a/x/profiles/types/msgs_chain_links.pb.go b/x/profiles/types/msgs_chain_links.pb.go index 9771efb244..49703e5d57 100644 --- a/x/profiles/types/msgs_chain_links.pb.go +++ b/x/profiles/types/msgs_chain_links.pb.go @@ -246,7 +246,7 @@ type MsgSetDefaultExternalAddress struct { // Name of the chain for which to set the default address ChainName string `protobuf:"bytes,1,opt,name=chain_name,json=chainName,proto3" json:"chain_name,omitempty"` // Address to be set as the default one - ExternalAddress string `protobuf:"bytes,2,opt,name=external_address,json=externalAddress,proto3" json:"external_address,omitempty"` + Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` // User signing the message Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` } @@ -291,9 +291,9 @@ func (m *MsgSetDefaultExternalAddress) GetChainName() string { return "" } -func (m *MsgSetDefaultExternalAddress) GetExternalAddress() string { +func (m *MsgSetDefaultExternalAddress) GetTarget() string { if m != nil { - return m.ExternalAddress + return m.Target } return "" } @@ -357,42 +357,41 @@ func init() { } var fileDescriptor_d28c3718ad31f8ee = []byte{ - // 547 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x41, 0x6e, 0xd3, 0x40, - 0x14, 0x8d, 0x0b, 0xad, 0x94, 0x49, 0x2b, 0x5a, 0xb7, 0x41, 0x69, 0x4a, 0xec, 0x6a, 0x84, 0xaa, - 0x54, 0xa8, 0xb6, 0x48, 0x59, 0xb1, 0x8b, 0x5b, 0x56, 0x34, 0x08, 0x19, 0xb1, 0x61, 0x13, 0x4d, - 0x9c, 0xf1, 0xd4, 0xaa, 0x3d, 0x13, 0x79, 0x26, 0xa1, 0xd9, 0x71, 0x04, 0x8e, 0xc0, 0x21, 0x38, - 0x44, 0xc5, 0xaa, 0x4b, 0x24, 0x24, 0x0b, 0x25, 0x37, 0xf0, 0x09, 0x90, 0x67, 0xec, 0x04, 0x17, - 0x8b, 0xdd, 0xcc, 0xff, 0xef, 0xbf, 0xff, 0xde, 0xb3, 0x07, 0x9c, 0x8e, 0x31, 0x8f, 0x18, 0xb7, - 0x27, 0x31, 0xf3, 0x83, 0x10, 0x73, 0x7b, 0xd6, 0xb3, 0x23, 0x4e, 0xf8, 0xd0, 0xbb, 0x46, 0x01, - 0x1d, 0x86, 0x01, 0xbd, 0xe1, 0xd6, 0x24, 0x66, 0x82, 0xe9, 0xba, 0x82, 0x5a, 0x05, 0xd4, 0x9a, - 0xf5, 0xda, 0x07, 0x84, 0x11, 0x26, 0xdb, 0x76, 0x76, 0x52, 0xc8, 0xf6, 0x21, 0x61, 0x8c, 0x84, - 0xd8, 0x96, 0xb7, 0xd1, 0xd4, 0xb7, 0x11, 0x9d, 0x17, 0x2d, 0x8f, 0x65, 0x24, 0x43, 0x35, 0xa3, - 0x2e, 0x79, 0xeb, 0x45, 0x95, 0x14, 0x36, 0xc6, 0x61, 0x85, 0x18, 0xf8, 0x6b, 0x03, 0xec, 0x0f, - 0x38, 0xb9, 0x0a, 0xe8, 0xcd, 0x45, 0xd6, 0xec, 0x7b, 0x1e, 0x9b, 0x52, 0xa1, 0x7b, 0x60, 0x47, - 0x81, 0xd1, 0x78, 0x1c, 0x63, 0xce, 0x5b, 0xda, 0xb1, 0xd6, 0x6d, 0xf4, 0x0e, 0x2c, 0x25, 0xc9, - 0x2a, 0x24, 0x59, 0x7d, 0x3a, 0x77, 0xba, 0x69, 0x62, 0x36, 0xe7, 0x28, 0x0a, 0x5f, 0x43, 0xce, - 0xa6, 0xb1, 0x87, 0x8b, 0x29, 0xf8, 0xe3, 0xfb, 0x59, 0xa3, 0xaf, 0xce, 0x97, 0x48, 0x20, 0x77, - 0x5b, 0x92, 0xe6, 0x15, 0xfd, 0x0a, 0x6c, 0x4e, 0x62, 0xc6, 0xfc, 0xd6, 0x86, 0x24, 0x3f, 0xb4, - 0xfe, 0x4d, 0xc6, 0x7a, 0x9f, 0x01, 0x9c, 0xa3, 0xbb, 0xc4, 0xac, 0xa5, 0x89, 0xb9, 0x5f, 0xda, - 0x22, 0x87, 0xa1, 0xab, 0x48, 0x74, 0x1f, 0x28, 0xf6, 0xa1, 0xc7, 0xa8, 0x1f, 0x90, 0xd6, 0x23, - 0x49, 0x6a, 0x56, 0x91, 0x4a, 0xab, 0x17, 0x12, 0xe6, 0xc0, 0x9c, 0xba, 0x5d, 0xa2, 0xfe, 0x9b, - 0x09, 0xba, 0x0d, 0x6f, 0x3d, 0xa0, 0x9f, 0x82, 0x2d, 0x1e, 0x10, 0x8a, 0xe3, 0xd6, 0xe3, 0x63, - 0xad, 0x5b, 0x77, 0xf6, 0xd2, 0xc4, 0xdc, 0xc9, 0x87, 0x65, 0x1d, 0xba, 0x39, 0x00, 0x76, 0xc0, - 0x51, 0x45, 0xb8, 0x2e, 0xe6, 0x13, 0x46, 0x39, 0x86, 0xdf, 0x34, 0xd0, 0x1c, 0x70, 0xf2, 0x91, - 0x86, 0x0f, 0xe3, 0x3f, 0x01, 0x9b, 0xec, 0x73, 0xb6, 0x42, 0x93, 0x2b, 0x76, 0xd3, 0xc4, 0xdc, - 0x56, 0x2b, 0x64, 0x19, 0xba, 0xaa, 0xad, 0xbf, 0x02, 0x40, 0x29, 0xa5, 0x28, 0xc2, 0x32, 0xc6, - 0xba, 0xd3, 0x4c, 0x13, 0x73, 0x4f, 0x81, 0xd7, 0x3d, 0xe8, 0xd6, 0xe5, 0xe5, 0x1d, 0x8a, 0x70, - 0xe6, 0x40, 0xa0, 0x98, 0x60, 0x21, 0x33, 0x2a, 0x39, 0x50, 0x75, 0xe8, 0xe6, 0x00, 0x68, 0x82, - 0x4e, 0xa5, 0xc2, 0x95, 0x87, 0x2f, 0x1a, 0x78, 0x36, 0xe0, 0xe4, 0x03, 0x16, 0x97, 0xd8, 0x47, - 0xd3, 0x50, 0xbc, 0xb9, 0x15, 0x38, 0xa6, 0x28, 0x2c, 0x3e, 0x72, 0xa7, 0x24, 0x51, 0xfa, 0x29, - 0x6b, 0xd9, 0xc5, 0xf9, 0xc4, 0xea, 0x5f, 0x93, 0x3e, 0xdc, 0x27, 0xf8, 0x01, 0xd3, 0xd3, 0x55, - 0xf0, 0x52, 0xf6, 0x2a, 0xe5, 0x13, 0xf0, 0xfc, 0x7f, 0x0a, 0x0a, 0xa9, 0xce, 0xdb, 0xbb, 0x85, - 0xa1, 0xdd, 0x2f, 0x0c, 0xed, 0xf7, 0xc2, 0xd0, 0xbe, 0x2e, 0x8d, 0xda, 0xfd, 0xd2, 0xa8, 0xfd, - 0x5c, 0x1a, 0xb5, 0x4f, 0x2f, 0x49, 0x20, 0xae, 0xa7, 0x23, 0xcb, 0x63, 0x91, 0xad, 0x7e, 0x97, - 0xb3, 0x10, 0x8d, 0x78, 0x7e, 0xb6, 0x67, 0xe7, 0xf6, 0xed, 0xfa, 0x39, 0x89, 0xf9, 0x04, 0xf3, - 0xd1, 0x96, 0x7c, 0x01, 0xe7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x44, 0xba, 0x43, 0xf9, - 0x03, 0x00, 0x00, + // 540 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xd1, 0x6e, 0xd3, 0x30, + 0x14, 0x6d, 0x36, 0x36, 0xa9, 0xee, 0x26, 0xb1, 0x6c, 0x45, 0x5d, 0x47, 0x93, 0xc9, 0x42, 0x53, + 0x27, 0xb4, 0x44, 0x74, 0x3c, 0xf1, 0xd6, 0x6c, 0x3c, 0xb1, 0x22, 0x14, 0xc4, 0x0b, 0x2f, 0x95, + 0x9b, 0x3a, 0x5e, 0xb4, 0xc4, 0x8e, 0x62, 0xa7, 0xac, 0x7f, 0xc1, 0x27, 0xf0, 0x11, 0x7c, 0xc4, + 0xc4, 0xd3, 0x1e, 0x91, 0x90, 0x22, 0xd4, 0xfe, 0x41, 0xbe, 0x00, 0xc5, 0x4e, 0xd6, 0x15, 0x22, + 0xde, 0xec, 0x7b, 0xcf, 0x3d, 0xe7, 0xdc, 0x13, 0x07, 0x9c, 0x4e, 0x31, 0x8f, 0x18, 0xb7, 0xe3, + 0x84, 0xf9, 0x41, 0x88, 0xb9, 0x3d, 0x1b, 0xd8, 0x11, 0x27, 0x7c, 0xec, 0x5d, 0xa3, 0x80, 0x8e, + 0xc3, 0x80, 0xde, 0x70, 0x2b, 0x4e, 0x98, 0x60, 0xba, 0xae, 0xa0, 0x56, 0x05, 0xb5, 0x66, 0x83, + 0xee, 0x01, 0x61, 0x84, 0xc9, 0xb6, 0x5d, 0x9c, 0x14, 0xb2, 0x7b, 0x48, 0x18, 0x23, 0x21, 0xb6, + 0xe5, 0x6d, 0x92, 0xfa, 0x36, 0xa2, 0xf3, 0xaa, 0xe5, 0xb1, 0x82, 0x64, 0xac, 0x66, 0xd4, 0xa5, + 0x6c, 0xbd, 0xac, 0xb3, 0xc2, 0xa6, 0x38, 0xac, 0x31, 0x03, 0x7f, 0x6d, 0x80, 0xfd, 0x11, 0x27, + 0x57, 0x01, 0xbd, 0xb9, 0x28, 0x9a, 0x43, 0xcf, 0x63, 0x29, 0x15, 0xba, 0x07, 0x76, 0x15, 0x18, + 0x4d, 0xa7, 0x09, 0xe6, 0xbc, 0xa3, 0x1d, 0x6b, 0xfd, 0xd6, 0xe0, 0xc0, 0x52, 0x96, 0xac, 0xca, + 0x92, 0x35, 0xa4, 0x73, 0xa7, 0x9f, 0x67, 0x66, 0x7b, 0x8e, 0xa2, 0xf0, 0x0d, 0xe4, 0x2c, 0x4d, + 0x3c, 0x5c, 0x4d, 0xc1, 0x1f, 0xdf, 0xcf, 0x5a, 0x43, 0x75, 0xbe, 0x44, 0x02, 0xb9, 0x3b, 0x92, + 0xb4, 0xac, 0xe8, 0x57, 0x60, 0x2b, 0x4e, 0x18, 0xf3, 0x3b, 0x1b, 0x92, 0xfc, 0xd0, 0xfa, 0x37, + 0x19, 0xeb, 0x43, 0x01, 0x70, 0x8e, 0xee, 0x32, 0xb3, 0x91, 0x67, 0xe6, 0xfe, 0x9a, 0x8a, 0x1c, + 0x86, 0xae, 0x22, 0xd1, 0x7d, 0xa0, 0xd8, 0xc7, 0x1e, 0xa3, 0x7e, 0x40, 0x3a, 0x9b, 0x92, 0xd4, + 0xac, 0x23, 0x95, 0xab, 0x5e, 0x48, 0x98, 0x03, 0x4b, 0xea, 0xee, 0x1a, 0xf5, 0x63, 0x26, 0xe8, + 0xb6, 0xbc, 0xd5, 0x80, 0x7e, 0x0a, 0xb6, 0x79, 0x40, 0x28, 0x4e, 0x3a, 0x4f, 0x8e, 0xb5, 0x7e, + 0xd3, 0xd9, 0xcb, 0x33, 0x73, 0xb7, 0x1c, 0x96, 0x75, 0xe8, 0x96, 0x00, 0xd8, 0x03, 0x47, 0x35, + 0xe1, 0xba, 0x98, 0xc7, 0x8c, 0x72, 0x0c, 0xbf, 0x69, 0xa0, 0x3d, 0xe2, 0xe4, 0x13, 0x0d, 0xff, + 0x8e, 0xff, 0x04, 0x6c, 0xb1, 0x2f, 0x85, 0x84, 0x26, 0x25, 0x9e, 0xe6, 0x99, 0xb9, 0xa3, 0x24, + 0x64, 0x19, 0xba, 0xaa, 0xad, 0xbf, 0x06, 0x40, 0x39, 0xa5, 0x28, 0xc2, 0x32, 0xc6, 0xa6, 0xd3, + 0xce, 0x33, 0x73, 0x4f, 0x81, 0x57, 0x3d, 0xe8, 0x36, 0xe5, 0xe5, 0x3d, 0x8a, 0x70, 0xb1, 0x81, + 0x40, 0x09, 0xc1, 0x42, 0x66, 0xb4, 0xb6, 0x81, 0xaa, 0x43, 0xb7, 0x04, 0x40, 0x13, 0xf4, 0x6a, + 0x1d, 0x3e, 0xec, 0x10, 0x81, 0xe7, 0x23, 0x4e, 0x3e, 0x62, 0x71, 0x89, 0x7d, 0x94, 0x86, 0xe2, + 0xed, 0xad, 0xc0, 0x09, 0x45, 0x61, 0xf5, 0x8d, 0x7b, 0x6b, 0x0e, 0xe5, 0x3a, 0x8f, 0xad, 0x3c, + 0x7b, 0xb0, 0x22, 0xcd, 0x57, 0xba, 0x45, 0xbd, 0x0c, 0x79, 0x53, 0xd5, 0xcb, 0x44, 0x4f, 0xc0, + 0x8b, 0xff, 0xc9, 0x55, 0xb6, 0x9c, 0x77, 0x77, 0x0b, 0x43, 0xbb, 0x5f, 0x18, 0xda, 0xef, 0x85, + 0xa1, 0x7d, 0x5d, 0x1a, 0x8d, 0xfb, 0xa5, 0xd1, 0xf8, 0xb9, 0x34, 0x1a, 0x9f, 0x5f, 0x91, 0x40, + 0x5c, 0xa7, 0x13, 0xcb, 0x63, 0x91, 0xad, 0x9e, 0xc6, 0x59, 0x88, 0x26, 0xbc, 0x3c, 0xdb, 0xb3, + 0x73, 0xfb, 0x76, 0xf5, 0xeb, 0x88, 0x79, 0x8c, 0xf9, 0x64, 0x5b, 0xbe, 0xf6, 0xf3, 0x3f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x34, 0x3b, 0x5f, 0x2e, 0xe5, 0x03, 0x00, 0x00, } func (m *MsgLinkChainAccount) Marshal() (dAtA []byte, err error) { @@ -574,10 +573,10 @@ func (m *MsgSetDefaultExternalAddress) MarshalToSizedBuffer(dAtA []byte) (int, e i-- dAtA[i] = 0x1a } - if len(m.ExternalAddress) > 0 { - i -= len(m.ExternalAddress) - copy(dAtA[i:], m.ExternalAddress) - i = encodeVarintMsgsChainLinks(dAtA, i, uint64(len(m.ExternalAddress))) + if len(m.Target) > 0 { + i -= len(m.Target) + copy(dAtA[i:], m.Target) + i = encodeVarintMsgsChainLinks(dAtA, i, uint64(len(m.Target))) i-- dAtA[i] = 0x12 } @@ -695,7 +694,7 @@ func (m *MsgSetDefaultExternalAddress) Size() (n int) { if l > 0 { n += 1 + l + sovMsgsChainLinks(uint64(l)) } - l = len(m.ExternalAddress) + l = len(m.Target) if l > 0 { n += 1 + l + sovMsgsChainLinks(uint64(l)) } @@ -1214,7 +1213,7 @@ func (m *MsgSetDefaultExternalAddress) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExternalAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1242,7 +1241,7 @@ func (m *MsgSetDefaultExternalAddress) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ExternalAddress = string(dAtA[iNdEx:postIndex]) + m.Target = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { diff --git a/x/profiles/types/msgs_chain_links_test.go b/x/profiles/types/msgs_chain_links_test.go index 9ba7772fff..2d65bc0dc8 100644 --- a/x/profiles/types/msgs_chain_links_test.go +++ b/x/profiles/types/msgs_chain_links_test.go @@ -188,3 +188,84 @@ func TestMsgUnlinkChainAccount_GetSigners(t *testing.T) { addr, _ := sdk.AccAddressFromBech32(msgUnlinkChainAccount.Owner) require.Equal(t, []sdk.AccAddress{addr}, msgUnlinkChainAccount.GetSigners()) } + +// ___________________________________________________________________________________________________________________ + +var msgSetDefaultExternalAddress = types.NewMsgSetDefaultExternalAddress( + "cosmos", + "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", +) + +func TestMsgSetDefaultExternalAddress_Route(t *testing.T) { + require.Equal(t, "profiles", msgSetDefaultExternalAddress.Route()) +} + +func TestMsgSetDefaultExternalAddress_Type(t *testing.T) { + require.Equal(t, "set_default_external_address", msgSetDefaultExternalAddress.Type()) +} + +func TestMsgSetDefaultExternalAddress_ValidateBasic(t *testing.T) { + testCases := []struct { + name string + msg *types.MsgSetDefaultExternalAddress + shouldErr bool + }{ + { + name: "invalid chain name returns error", + msg: types.NewMsgSetDefaultExternalAddress( + "", + "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + ), + shouldErr: true, + }, + { + name: "invalid target returns error", + msg: types.NewMsgSetDefaultExternalAddress( + "cosmos", + "", + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + ), + shouldErr: true, + }, + { + name: "invalid owner returns error", + msg: types.NewMsgSetDefaultExternalAddress( + "cosmos", + "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", + "", + ), + shouldErr: true, + }, + { + name: "valid message returns no error", + msg: msgSetDefaultExternalAddress, + shouldErr: false, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + err := tc.msg.ValidateBasic() + + if tc.shouldErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestMsgSetDefaultExternalAddress_GetSignBytes(t *testing.T) { + actual := msgSetDefaultExternalAddress.GetSignBytes() + expected := `{"type":"desmos/MsgSetDefaultExternalAddress","value":{"chain_name":"cosmos","signer":"cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47","target":"cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"}}` + require.Equal(t, expected, string(actual)) +} + +func TestMsgSetDefaultExternalAddress_GetSigners(t *testing.T) { + addr, _ := sdk.AccAddressFromBech32(msgSetDefaultExternalAddress.Signer) + require.Equal(t, []sdk.AccAddress{addr}, msgSetDefaultExternalAddress.GetSigners()) +} From 4595492320800301b46178f6c92497135597a8dc Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 7 Jun 2022 18:10:41 +0800 Subject: [PATCH 07/64] Add keeper tests --- .../desmos/profiles/v2/msgs_chain_links.proto | 2 +- .../profiles/v2/query_chain_links.proto | 10 +- x/profiles/keeper/grpc_query.go | 10 +- x/profiles/keeper/grpc_query_test.go | 80 ++++++++++++ x/profiles/keeper/keeper_chain_links.go | 57 ++++++--- x/profiles/keeper/keeper_chain_links_test.go | 90 ++++++++++++++ x/profiles/keeper/msg_server_chain_link.go | 6 +- .../keeper/msg_server_chain_link_test.go | 117 ++++++++++++++++++ x/profiles/types/query_chain_links.go | 4 +- x/profiles/types/query_chain_links.pb.go | 88 ++++++------- 10 files changed, 384 insertions(+), 80 deletions(-) diff --git a/proto/desmos/profiles/v2/msgs_chain_links.proto b/proto/desmos/profiles/v2/msgs_chain_links.proto index 7d9a488ed6..a2a50df64f 100644 --- a/proto/desmos/profiles/v2/msgs_chain_links.proto +++ b/proto/desmos/profiles/v2/msgs_chain_links.proto @@ -65,7 +65,7 @@ message MsgSetDefaultExternalAddress { string chain_name = 1; // Address to be set as the default one - string external_address = 2; + string target = 2; // User signing the message string signer = 3; diff --git a/proto/desmos/profiles/v2/query_chain_links.proto b/proto/desmos/profiles/v2/query_chain_links.proto index b48f5316c4..0068991ed1 100644 --- a/proto/desmos/profiles/v2/query_chain_links.proto +++ b/proto/desmos/profiles/v2/query_chain_links.proto @@ -74,13 +74,13 @@ message QueryChainLinkOwnersResponse { // QueryDefaultExternalAddressesRequest is the request type for // Query/DefaultExternalAddresses RPC method message QueryDefaultExternalAddressesRequest { - // User for which to query the default addresses - string user = 1; + // (Optional) Owner for which to query the default addresses + string owner = 1; - // (optional) Chain name to query the default address for + // (Optional) Chain name to query the default address for string chain_name = 2; - // pagination defines an optional pagination for the request. + // Pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 3; } @@ -89,7 +89,7 @@ message QueryDefaultExternalAddressesRequest { message QueryDefaultExternalAddressesResponse { // List of default addresses, each one represented by the associated chain // link - repeated ChainLink chain_links = 1 [ (gogoproto.nullable) = false ]; + repeated ChainLink links = 1 [ (gogoproto.nullable) = false ]; cosmos.base.query.v1beta1.PageResponse pagination = 2; } \ No newline at end of file diff --git a/x/profiles/keeper/grpc_query.go b/x/profiles/keeper/grpc_query.go index 53bcc3ca5e..3b60bef98f 100644 --- a/x/profiles/keeper/grpc_query.go +++ b/x/profiles/keeper/grpc_query.go @@ -165,10 +165,10 @@ func (k Keeper) DefaultExternalAddresses(ctx context.Context, request *types.Que defaultPrefix := types.DefaultExternalAddressPrefix switch { - case request.User != "" && request.ChainName != "": - defaultPrefix = types.DefaultExternalAddressKey(request.User, request.ChainName) - case request.User != "": - defaultPrefix = types.ChainLinkChainKey(request.User) + case request.Owner != "" && request.ChainName != "": + defaultPrefix = types.DefaultExternalAddressKey(request.Owner, request.ChainName) + case request.Owner != "": + defaultPrefix = types.OwnerDefaultExternalAddressPrefix(request.Owner) } var links []types.ChainLink @@ -176,7 +176,7 @@ func (k Keeper) DefaultExternalAddresses(ctx context.Context, request *types.Que pageRes, err := query.Paginate(defaultStore, request.Pagination, func(key []byte, value []byte) error { // Re-add the prefix because the prefix store trims it out, and we need it to get the data keyWithPrefix := append(defaultPrefix, key...) - owner, chainName := types.SplitDefaultExternalAddressKey(keyWithPrefix) + owner, chainName := types.GetDefaultExternalAddressData(keyWithPrefix) link, found := k.GetChainLink(sdkCtx, owner, chainName, string(value)) if !found { return sdkerrors.Wrap(sdkerrors.ErrNotFound, "chain link not found") diff --git a/x/profiles/keeper/grpc_query_test.go b/x/profiles/keeper/grpc_query_test.go index 8bb8dbdc5e..220fd34e52 100644 --- a/x/profiles/keeper/grpc_query_test.go +++ b/x/profiles/keeper/grpc_query_test.go @@ -624,6 +624,86 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinkOwners() { } } +func (suite *KeeperTestSuite) TestQueryServer_DefaultExternalAddresses() { + firstAccount := testutil.GetChainLinkAccount("cosmos", "cosmos") + firstChainLink := firstAccount.GetBech32ChainLink( + "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", + time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), + ) + + secondAccount := testutil.GetChainLinkAccount("likecoin", "cosmos") + secondChainLink := secondAccount.GetBech32ChainLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), + ) + + testCases := []struct { + name string + store func(ctx sdk.Context) + request *types.QueryDefaultExternalAddressesRequest + shouldErr bool + expected []types.ChainLink + }{ + { + name: "query without any data returns everything", + store: func(ctx sdk.Context) { + suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) + + suite.Require().NoError(suite.k.SaveChainLink(ctx, firstChainLink)) + suite.Require().NoError(suite.k.SaveChainLink(ctx, secondChainLink)) + }, + request: types.NewQueryDefaultExternalAddressesRequest("", "", nil), + shouldErr: false, + expected: []types.ChainLink{firstChainLink, secondChainLink}, + }, + { + name: "query with owner returns correct data", + store: func(ctx sdk.Context) { + suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) + + suite.Require().NoError(suite.k.SaveChainLink(ctx, firstChainLink)) + suite.Require().NoError(suite.k.SaveChainLink(ctx, secondChainLink)) + }, + request: types.NewQueryDefaultExternalAddressesRequest("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "", nil), + shouldErr: false, + expected: []types.ChainLink{firstChainLink}, + }, + { + name: "query with owner and chain name returns correct data", + store: func(ctx sdk.Context) { + suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) + + suite.Require().NoError(suite.k.SaveChainLink(ctx, firstChainLink)) + suite.Require().NoError(suite.k.SaveChainLink(ctx, secondChainLink)) + }, + request: types.NewQueryDefaultExternalAddressesRequest("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos", nil), + shouldErr: false, + expected: []types.ChainLink{firstChainLink}, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + ctx, _ := suite.ctx.CacheContext() + if tc.store != nil { + tc.store(ctx) + } + + res, err := suite.k.DefaultExternalAddresses(sdk.WrapSDKContext(ctx), tc.request) + if tc.shouldErr { + suite.Require().Error(err) + } else { + suite.Require().NoError(err) + suite.Require().Equal(tc.expected, res.Links) + } + }) + } +} + func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { testCases := []struct { name string diff --git a/x/profiles/keeper/keeper_chain_links.go b/x/profiles/keeper/keeper_chain_links.go index 58cf6964f8..96eaf8b7b7 100644 --- a/x/profiles/keeper/keeper_chain_links.go +++ b/x/profiles/keeper/keeper_chain_links.go @@ -11,7 +11,6 @@ import ( // Chain links are stored using two keys: // 1. ChainLinkStoreKey (user + chain name + target) -> types.ChainLink // 2. ChainLinkOwnerKey (chain name + target + user) -> 0x01 -// The first chain link external address will be set as default external address func (k Keeper) SaveChainLink(ctx sdk.Context, link types.ChainLink) error { // Validate the chain link err := link.Validate() @@ -51,7 +50,8 @@ func (k Keeper) SaveChainLink(ctx sdk.Context, link types.ChainLink) error { store.Set(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, target), types.MustMarshalChainLink(k.cdc, link)) store.Set(types.ChainLinkOwnerKey(link.ChainConfig.Name, target, link.User), []byte{0x01}) - if !k.hasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { + // The first chain link of each chain for the owner will be set as default external address + if !k.HasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { k.SaveDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name, srcAddrData.GetValue()) } @@ -85,11 +85,10 @@ func (k Keeper) DeleteChainLink(ctx sdk.Context, link types.ChainLink) { store.Delete(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, link.GetAddressData().GetValue())) store.Delete(types.ChainLinkOwnerKey(link.ChainConfig.Name, link.GetAddressData().GetValue(), link.User)) - // Update default external address if the target chain link is the default + // If the deleted chain link is the default external address, update the default external address for owner if k.isDefaultExternalAddress(ctx, link) { - k.UpdateDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) + k.updateOwnerDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) } - k.AfterChainLinkDeleted(ctx, link) } @@ -106,45 +105,63 @@ func (k Keeper) DeleteAllUserChainLinks(ctx sdk.Context, user string) { } } -func (k Keeper) GetOldestUserChainByChain(ctx sdk.Context, user, chainName string) (types.ChainLink, bool) { +// getOldestUserChainByChain returns the oldest chain link of the given owner associated to the given chain name +// If the such the chain link is not exists, return false instead. +func (k Keeper) getOldestUserChainByChain(ctx sdk.Context, owner, chainName string) (types.ChainLink, bool) { var oldestLink types.ChainLink + found := false + k.IterateUserChainLinksByChain(ctx, owner, chainName, func(link types.ChainLink) (stop bool) { + if !found { + oldestLink = link + found = true + return false + } - k.IterateUserChainLinksByChain(ctx, user, chainName, func(link types.ChainLink) (stop bool) { - if oldestLink.CreationTime.IsZero() || link.CreationTime.Before(oldestLink.CreationTime) { + if link.CreationTime.Before(oldestLink.CreationTime) { oldestLink = link } return false }) - return oldestLink, oldestLink.CreationTime.IsZero() + return oldestLink, found } -func (k Keeper) UpdateDefaultExternalAddress(ctx sdk.Context, user, chainName string) { +// updateOwnerDefaultExternalAddress updates the default external address of the given chain name for the given owner +// It must be performed after deleting the default external address chain link +func (k Keeper) updateOwnerDefaultExternalAddress(ctx sdk.Context, owner, chainName string) { store := ctx.KVStore(k.storeKey) - link, found := k.GetOldestUserChainByChain(ctx, user, chainName) + link, found := k.getOldestUserChainByChain(ctx, owner, chainName) if found { - k.SaveDefaultExternalAddress(ctx, user, chainName, link.GetAddressData().GetValue()) + srcAddrData, err := types.UnpackAddressData(k.cdc, link.Address) + if err != nil { + panic(err) + } + k.SaveDefaultExternalAddress(ctx, owner, chainName, srcAddrData.GetValue()) return } - store.Delete(types.DefaultExternalAddressKey(user, chainName)) + // If owner has no chain link on the given chain name, then delete the key + store.Delete(types.DefaultExternalAddressKey(owner, chainName)) } -func (k Keeper) SaveDefaultExternalAddress(ctx sdk.Context, user, chainName, externalAddr string) { +// SaveDefaultExternalAddress stores the given address as a default external address +func (k Keeper) SaveDefaultExternalAddress(ctx sdk.Context, owner, chainName, target string) { store := ctx.KVStore(k.storeKey) - store.Set(types.DefaultExternalAddressKey(user, chainName), []byte(externalAddr)) + store.Set(types.DefaultExternalAddressKey(owner, chainName), []byte(target)) } -func (k Keeper) hasDefaultExternalAddress(ctx sdk.Context, user, chainName string) bool { +// HasDefaultExternalAddress tells whether the given owner has a default external address on the given chain name or not +func (k Keeper) HasDefaultExternalAddress(ctx sdk.Context, owner, chainName string) bool { store := ctx.KVStore(k.storeKey) - return store.Has(types.DefaultExternalAddressKey(user, chainName)) + return store.Has(types.DefaultExternalAddressKey(owner, chainName)) } +// isDefaultExternalAddress tells whether the given chain link is a default external address or not func (k Keeper) isDefaultExternalAddress(ctx sdk.Context, link types.ChainLink) bool { store := ctx.KVStore(k.storeKey) - if !k.hasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { + if !k.HasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { return false } - address := store.Get(types.DefaultExternalAddressKey(link.User, link.ChainConfig.Name)) - return string(address) == link.GetAddressData().GetValue() + addressBz := store.Get(types.DefaultExternalAddressKey(link.User, link.ChainConfig.Name)) + return string(addressBz) == link.GetAddressData().GetValue() } diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index b3a5c59a81..27494efacb 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -270,6 +270,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetChainLink() { func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { account := testutil.GetChainLinkAccount("cosmos", "cosmos") + olderAccount := testutil.GetChainLinkAccount("cosmos", "cosmos") testCases := []struct { name string store func(ctx sdk.Context) @@ -299,6 +300,15 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { "cosmos", account.Bech32Address().GetValue(), )) + + // Check default external address key + suite.Require().True( + suite.k.HasDefaultExternalAddress( + ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + ), + ) }, }, { @@ -324,6 +334,15 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { "cosmos", account.Bech32Address().GetValue(), )) + + // Check default external address key + suite.Require().True( + suite.k.HasDefaultExternalAddress( + ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + ), + ) }, }, { @@ -349,6 +368,15 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { "cosmos", account.Bech32Address().GetValue(), )) + + // Check default external address key + suite.Require().True( + suite.k.HasDefaultExternalAddress( + ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + ), + ) }, }, { @@ -379,6 +407,66 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { account.Bech32Address().GetValue(), "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", ))) + + // Check default external address is deleted properly + suite.Require().False( + suite.k.HasDefaultExternalAddress( + ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + ), + ) + }, + }, + { + name: "proper data delete the link - update default external address", + store: func(ctx sdk.Context) { + suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x"))) + err := suite.k.SaveChainLink(ctx, account.GetBech32ChainLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + )) + suite.Require().NoError(err) + + err = suite.k.SaveChainLink(ctx, olderAccount.GetBech32ChainLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + )) + suite.Require().NoError(err) + }, + link: account.GetBech32ChainLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + ), + check: func(ctx sdk.Context) { + suite.Require().False(suite.k.HasChainLink(ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + account.Bech32Address().GetValue(), + )) + + // Check the additional keys + store := ctx.KVStore(suite.storeKey) + suite.Require().False(store.Has(types.ChainLinkOwnerKey( + "cosmos", + account.Bech32Address().GetValue(), + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + ))) + + // Check default external address key is updated properly + suite.Require().True( + suite.k.HasDefaultExternalAddress( + ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + ), + ) + suite.Require().Equal( + olderAccount.Bech32Address().Value, + string(store.Get( + types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos"), + )), + ) }, }, } @@ -487,3 +575,5 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteAllUserChainLinks() { }) } } + +func (suite *KeeperTestSuite) TestKeeper_SaveDefaultExternalAddress() {} diff --git a/x/profiles/keeper/msg_server_chain_link.go b/x/profiles/keeper/msg_server_chain_link.go index da5c6de300..64892a019f 100644 --- a/x/profiles/keeper/msg_server_chain_link.go +++ b/x/profiles/keeper/msg_server_chain_link.go @@ -78,12 +78,12 @@ func (k msgServer) SetDefaultExternalAddress(goCtx context.Context, msg *types.M ctx := sdk.UnwrapSDKContext(goCtx) // Get the chain link - _, found := k.GetChainLink(ctx, msg.Signer, msg.ChainName, msg.ExternalAddress) + _, found := k.GetChainLink(ctx, msg.Signer, msg.ChainName, msg.Target) if !found { return nil, sdkerrors.Wrap(sdkerrors.ErrNotFound, "chain link not found") } - k.SaveDefaultExternalAddress(ctx, msg.Signer, msg.ChainName, msg.ExternalAddress) + k.SaveDefaultExternalAddress(ctx, msg.Signer, msg.ChainName, msg.Target) ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( @@ -95,7 +95,7 @@ func (k msgServer) SetDefaultExternalAddress(goCtx context.Context, msg *types.M sdk.NewEvent( types.EventTypeSetDefaultExternalAddress, sdk.NewAttribute(types.AttributeKeyChainLinkChainName, msg.ChainName), - sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, msg.ExternalAddress), + sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, msg.Target), sdk.NewAttribute(types.AttributeKeyChainLinkOwner, msg.Signer), ), }) diff --git a/x/profiles/keeper/msg_server_chain_link_test.go b/x/profiles/keeper/msg_server_chain_link_test.go index 250ce04317..6967bd0425 100644 --- a/x/profiles/keeper/msg_server_chain_link_test.go +++ b/x/profiles/keeper/msg_server_chain_link_test.go @@ -128,6 +128,11 @@ func (suite *KeeperTestSuite) TestMsgServer_LinkChainAccount() { _, found, err := suite.k.GetProfile(ctx, destAddr) suite.Require().NoError(err) suite.Require().True(found) + + // check the default address is set properly + store := ctx.KVStore(suite.storeKey) + defaultAddr := store.Get(types.DefaultExternalAddressKey(destAddr, "cosmos")) + suite.Require().True(true, string(defaultAddr) == srcAddr) }, }, } @@ -196,6 +201,12 @@ func (suite *KeeperTestSuite) TestMsgServer_UnlinkChainAccount() { types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, link.GetAddressData().GetValue()), suite.cdc.MustMarshal(&link), ) + + // Set the default external address + store.Set( + types.DefaultExternalAddressKey(link.ChainConfig.Name, link.User), + []byte(link.GetAddressData().GetValue()), + ) }, msg: types.NewMsgUnlinkChainAccount( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", @@ -218,6 +229,7 @@ func (suite *KeeperTestSuite) TestMsgServer_UnlinkChainAccount() { ), }, check: func(ctx sdk.Context) { + store := ctx.KVStore(suite.storeKey) _, found := suite.k.GetChainLink( ctx, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", @@ -225,6 +237,11 @@ func (suite *KeeperTestSuite) TestMsgServer_UnlinkChainAccount() { "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) suite.Require().False(found) + + // Check the default external address is removed properly + suite.Require().False( + store.Has(types.DefaultExternalAddressKey("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos")), + ) }, }, } @@ -253,3 +270,103 @@ func (suite *KeeperTestSuite) TestMsgServer_UnlinkChainAccount() { }) } } + +func (suite *KeeperTestSuite) TestMsgServer_SetDefaultExternalAddress() { + testCases := []struct { + name string + store func(ctx sdk.Context) + msg *types.MsgSetDefaultExternalAddress + shouldErr bool + expEvents sdk.Events + check func(ctx sdk.Context) + }{ + { + name: "non existent link exists returns error", + msg: types.NewMsgSetDefaultExternalAddress( + "cosmos", + "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + ), + shouldErr: true, + expEvents: sdk.EmptyEvents(), + }, + { + name: "found link returns no error", + store: func(ctx sdk.Context) { + store := ctx.KVStore(suite.storeKey) + link := types.NewChainLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), + types.NewProof( + testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + "74657874", + ), + types.NewChainConfig("cosmos"), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + ) + store.Set( + types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, link.GetAddressData().GetValue()), + suite.cdc.MustMarshal(&link), + ) + + // Set the default external address + store.Set( + types.DefaultExternalAddressKey(link.ChainConfig.Name, link.User), + []byte(link.GetAddressData().GetValue()), + ) + }, + msg: types.NewMsgSetDefaultExternalAddress( + "cosmos", + "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + ), + shouldErr: false, + expEvents: sdk.Events{ + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeyAction, sdk.MsgTypeURL(&types.MsgSetDefaultExternalAddress{})), + sdk.NewAttribute(sdk.AttributeKeySender, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + ), + sdk.NewEvent( + types.EventTypeSetDefaultExternalAddress, + sdk.NewAttribute(types.AttributeKeyChainLinkChainName, "cosmos"), + sdk.NewAttribute(types.AttributeKeyChainLinkExternalAddress, "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), + sdk.NewAttribute(types.AttributeKeyChainLinkOwner, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + ), + }, + check: func(ctx sdk.Context) { + store := ctx.KVStore(suite.storeKey) + external := store.Get(types.DefaultExternalAddressKey("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos")) + suite.Require().True( + string(external) == "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", + ) + }, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + ctx, _ := suite.ctx.CacheContext() + if tc.store != nil { + tc.store(ctx) + } + + server := keeper.NewMsgServerImpl(suite.k) + _, err := server.SetDefaultExternalAddress(sdk.WrapSDKContext(ctx), tc.msg) + suite.Require().Equal(tc.expEvents, ctx.EventManager().Events()) + + if tc.shouldErr { + suite.Require().Error(err) + } else { + suite.Require().NoError(err) + + if tc.check != nil { + tc.check(ctx) + } + } + }) + } +} diff --git a/x/profiles/types/query_chain_links.go b/x/profiles/types/query_chain_links.go index 88aaa11abb..1c21e9c88c 100644 --- a/x/profiles/types/query_chain_links.go +++ b/x/profiles/types/query_chain_links.go @@ -28,9 +28,9 @@ func NewQueryChainLinkOwnersRequest(chainName, target string, pageReq *query.Pag } // NewQueryDefaultExternalAddressesRequest returns a new QueryDefaultExternalAddressesRequest instance -func NewQueryDefaultExternalAddressesRequest(user, chainName string, pageReq *query.PageRequest) *QueryDefaultExternalAddressesRequest { +func NewQueryDefaultExternalAddressesRequest(owner, chainName string, pageReq *query.PageRequest) *QueryDefaultExternalAddressesRequest { return &QueryDefaultExternalAddressesRequest{ - User: user, + Owner: owner, ChainName: chainName, Pagination: pageReq, } diff --git a/x/profiles/types/query_chain_links.pb.go b/x/profiles/types/query_chain_links.pb.go index 4d550510e7..8434cdbaae 100644 --- a/x/profiles/types/query_chain_links.pb.go +++ b/x/profiles/types/query_chain_links.pb.go @@ -351,8 +351,8 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) GetTarget() string // QueryDefaultExternalAddressesRequest is the request type for // Query/DefaultExternalAddresses RPC method type QueryDefaultExternalAddressesRequest struct { - // User for which to query the default addresses - User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + // Owner for which to query the default addresses + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` // (optional) Chain name to query the default address for ChainName string `protobuf:"bytes,2,opt,name=chain_name,json=chainName,proto3" json:"chain_name,omitempty"` // pagination defines an optional pagination for the request. @@ -392,9 +392,9 @@ func (m *QueryDefaultExternalAddressesRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryDefaultExternalAddressesRequest proto.InternalMessageInfo -func (m *QueryDefaultExternalAddressesRequest) GetUser() string { +func (m *QueryDefaultExternalAddressesRequest) GetOwner() string { if m != nil { - return m.User + return m.Owner } return "" } @@ -484,40 +484,40 @@ func init() { } var fileDescriptor_f3f86dba4268625b = []byte{ - // 518 bytes of a gzipped FileDescriptorProto + // 527 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0x4f, 0x6f, 0xd3, 0x30, - 0x18, 0xc6, 0xeb, 0xb6, 0x54, 0x9a, 0x77, 0x8b, 0x60, 0x64, 0x61, 0x0b, 0x55, 0xc5, 0x9f, 0x6a, - 0x08, 0x5b, 0xed, 0x4e, 0x1c, 0x19, 0x63, 0x1c, 0x40, 0xfc, 0xe9, 0x91, 0x4b, 0xe5, 0x34, 0x6f, - 0xb3, 0x88, 0xc4, 0xce, 0x62, 0xa7, 0xac, 0xdf, 0x82, 0x0f, 0x00, 0x07, 0xce, 0x3b, 0xf1, 0x2d, - 0x76, 0xdc, 0x91, 0x13, 0x42, 0xed, 0x17, 0x41, 0xb1, 0xcd, 0x46, 0xd4, 0xb2, 0x49, 0xd0, 0xc3, - 0x6e, 0x7e, 0xfd, 0x3e, 0xf6, 0xf3, 0xcb, 0xe3, 0xd8, 0x78, 0x27, 0x04, 0x99, 0x0a, 0x49, 0xb3, - 0x5c, 0x8c, 0xe3, 0x04, 0x24, 0x9d, 0xf4, 0xe9, 0x51, 0x01, 0xf9, 0x74, 0x38, 0x3a, 0x64, 0x31, - 0x1f, 0x26, 0x31, 0xff, 0x20, 0x49, 0x96, 0x0b, 0x25, 0x1c, 0xc7, 0x68, 0xc9, 0x6f, 0x2d, 0x99, - 0xf4, 0xbd, 0x9b, 0x91, 0x88, 0x84, 0x6e, 0xd3, 0x72, 0x64, 0x94, 0xde, 0x56, 0x24, 0x44, 0x94, - 0x00, 0x65, 0x59, 0x4c, 0x19, 0xe7, 0x42, 0x31, 0x15, 0x0b, 0x6e, 0xf7, 0xf1, 0x36, 0x6d, 0x57, - 0x57, 0x41, 0x31, 0xa6, 0x8c, 0x4f, 0x6d, 0xeb, 0xd1, 0x12, 0x9c, 0x54, 0x84, 0x90, 0xc8, 0x45, - 0x1e, 0x6f, 0x73, 0x24, 0x4a, 0xf1, 0xd0, 0xd8, 0x9b, 0xc2, 0xb6, 0x76, 0x4c, 0x45, 0x03, 0x26, - 0xc1, 0x7c, 0x0f, 0x9d, 0xf4, 0x02, 0x50, 0xac, 0x47, 0x33, 0x16, 0xc5, 0x5c, 0xf3, 0x18, 0x6d, - 0xe7, 0x04, 0xe1, 0x8d, 0x77, 0xa5, 0xe4, 0x59, 0xe9, 0xf0, 0xaa, 0x34, 0x18, 0xc0, 0x51, 0x01, - 0x52, 0x39, 0x0e, 0x6e, 0x16, 0x12, 0x72, 0x17, 0xb5, 0x51, 0x77, 0x6d, 0xa0, 0xc7, 0xce, 0x36, - 0xc6, 0x06, 0x85, 0xb3, 0x14, 0xdc, 0xba, 0xee, 0xac, 0xe9, 0x99, 0xd7, 0x2c, 0x05, 0x67, 0x03, - 0xb7, 0x14, 0xcb, 0x23, 0x50, 0x6e, 0x43, 0xb7, 0x6c, 0xe5, 0x1c, 0x60, 0x7c, 0xe1, 0xec, 0x36, - 0xdb, 0xa8, 0xbb, 0xde, 0x7f, 0x40, 0x2c, 0x74, 0x89, 0x49, 0x34, 0x26, 0xb1, 0x98, 0xe4, 0x2d, - 0x8b, 0xc0, 0x62, 0x0c, 0xfe, 0x58, 0xd9, 0xf9, 0x82, 0xf0, 0xed, 0x05, 0x5a, 0x99, 0x09, 0x2e, - 0xc1, 0x79, 0x82, 0x6f, 0xe8, 0x7c, 0x5c, 0xd4, 0x6e, 0x74, 0xd7, 0xfb, 0xdb, 0x64, 0xf1, 0xc0, - 0xc8, 0xf9, 0xb2, 0xbd, 0xe6, 0xe9, 0x8f, 0xbb, 0xb5, 0x81, 0x59, 0xe1, 0xbc, 0xa8, 0xe0, 0xd5, - 0x35, 0xde, 0xc3, 0x2b, 0xf1, 0x8c, 0x6f, 0x85, 0xef, 0x33, 0xc2, 0x77, 0xaa, 0x7c, 0x6f, 0x3e, - 0x72, 0xc8, 0xcf, 0x23, 0xad, 0xc6, 0x87, 0xfe, 0x1e, 0x5f, 0xfd, 0x92, 0xf8, 0x1a, 0xff, 0x1c, - 0xdf, 0xb7, 0x3a, 0xde, 0x5a, 0x8e, 0x67, 0x33, 0x0c, 0x71, 0x4b, 0xe8, 0x19, 0x1b, 0xe2, 0xc1, - 0xb2, 0x10, 0x2f, 0xdb, 0x81, 0x54, 0xe7, 0xf7, 0x41, 0xb1, 0x38, 0x91, 0x36, 0x6d, 0xbb, 0xf7, - 0xca, 0xe2, 0xf6, 0x02, 0x7c, 0x6b, 0xa9, 0xdf, 0x0a, 0x7f, 0xdd, 0xce, 0x57, 0x84, 0xef, 0xe9, - 0x2f, 0xde, 0x87, 0x31, 0x2b, 0x12, 0xf5, 0xfc, 0x58, 0x41, 0xce, 0x59, 0xf2, 0x34, 0x0c, 0x73, - 0x90, 0x12, 0xfe, 0xe7, 0xba, 0xac, 0xea, 0x5c, 0x4f, 0x10, 0xbe, 0x7f, 0x05, 0xe3, 0xf5, 0xb9, - 0x24, 0x7b, 0x2f, 0x4f, 0x67, 0x3e, 0x3a, 0x9b, 0xf9, 0xe8, 0xe7, 0xcc, 0x47, 0x9f, 0xe6, 0x7e, - 0xed, 0x6c, 0xee, 0xd7, 0xbe, 0xcf, 0xfd, 0xda, 0xfb, 0x5e, 0x14, 0xab, 0xc3, 0x22, 0x20, 0x23, - 0x91, 0x52, 0x03, 0xf6, 0x38, 0x61, 0x81, 0xb4, 0x63, 0x3a, 0xd9, 0xa5, 0xc7, 0x17, 0x8f, 0xa3, - 0x9a, 0x66, 0x20, 0x83, 0x96, 0x7e, 0xc6, 0x76, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xfc, 0xc7, - 0xc3, 0xeb, 0xcb, 0x05, 0x00, 0x00, + 0x18, 0xc6, 0xeb, 0xb6, 0xab, 0x34, 0xef, 0x16, 0x8d, 0xd1, 0x85, 0x2d, 0x54, 0x15, 0x7f, 0xaa, + 0x21, 0x6c, 0xb5, 0x3b, 0x71, 0x64, 0x8c, 0x71, 0x00, 0xf1, 0xa7, 0x47, 0x2e, 0x95, 0xd3, 0xbc, + 0xcd, 0x22, 0x12, 0x3b, 0x8b, 0x9d, 0xb2, 0x7e, 0x0b, 0x3e, 0x00, 0x9c, 0x38, 0xee, 0xc4, 0xb7, + 0xd8, 0x71, 0x47, 0x4e, 0x08, 0xb5, 0x5f, 0x04, 0xc5, 0x36, 0x1d, 0x51, 0xcb, 0x2a, 0xa1, 0x1e, + 0xb8, 0xf9, 0xf5, 0xfb, 0xd8, 0xcf, 0xcf, 0x8f, 0x13, 0xe3, 0x83, 0x00, 0x64, 0x22, 0x24, 0x4d, + 0x33, 0x31, 0x8a, 0x62, 0x90, 0x74, 0xdc, 0xa3, 0x67, 0x39, 0x64, 0x93, 0xc1, 0xf0, 0x94, 0x45, + 0x7c, 0x10, 0x47, 0xfc, 0x83, 0x24, 0x69, 0x26, 0x94, 0x70, 0x1c, 0xa3, 0x25, 0xbf, 0xb5, 0x64, + 0xdc, 0x73, 0xb7, 0x43, 0x11, 0x0a, 0xdd, 0xa6, 0xc5, 0xc8, 0x28, 0xdd, 0xbd, 0x50, 0x88, 0x30, + 0x06, 0xca, 0xd2, 0x88, 0x32, 0xce, 0x85, 0x62, 0x2a, 0x12, 0xdc, 0xee, 0xe3, 0xee, 0xda, 0xae, + 0xae, 0xfc, 0x7c, 0x44, 0x19, 0x9f, 0xd8, 0xd6, 0xa3, 0x25, 0x38, 0x89, 0x08, 0x20, 0x96, 0x8b, + 0x3c, 0xee, 0xee, 0x50, 0x14, 0xe2, 0x81, 0xb1, 0x37, 0x85, 0x6d, 0x1d, 0x98, 0x8a, 0xfa, 0x4c, + 0x82, 0x39, 0x0f, 0x1d, 0x77, 0x7d, 0x50, 0xac, 0x4b, 0x53, 0x16, 0x46, 0x5c, 0xf3, 0x18, 0x6d, + 0xfb, 0x02, 0xe1, 0x9d, 0x77, 0x85, 0xe4, 0x59, 0xe1, 0xf0, 0xaa, 0x30, 0xe8, 0xc3, 0x59, 0x0e, + 0x52, 0x39, 0x0e, 0xae, 0xe7, 0x12, 0xb2, 0x26, 0x6a, 0xa1, 0xce, 0x66, 0x5f, 0x8f, 0x9d, 0x7d, + 0x8c, 0x0d, 0x0a, 0x67, 0x09, 0x34, 0xab, 0xba, 0xb3, 0xa9, 0x67, 0x5e, 0xb3, 0x04, 0x9c, 0x1d, + 0xdc, 0x50, 0x2c, 0x0b, 0x41, 0x35, 0x6b, 0xba, 0x65, 0x2b, 0xe7, 0x04, 0xe3, 0x6b, 0xe7, 0x66, + 0xbd, 0x85, 0x3a, 0x5b, 0xbd, 0x07, 0xc4, 0x42, 0x17, 0x98, 0x44, 0x63, 0x12, 0x8b, 0x49, 0xde, + 0xb2, 0x10, 0x2c, 0x46, 0xff, 0x8f, 0x95, 0xed, 0x2f, 0x08, 0xdf, 0x5e, 0xa0, 0x95, 0xa9, 0xe0, + 0x12, 0x9c, 0x27, 0x78, 0x43, 0xe7, 0xd3, 0x44, 0xad, 0x5a, 0x67, 0xab, 0xb7, 0x4f, 0x16, 0x2f, + 0x8c, 0xcc, 0x97, 0x1d, 0xd5, 0x2f, 0x7f, 0xdc, 0xad, 0xf4, 0xcd, 0x0a, 0xe7, 0x45, 0x09, 0xaf, + 0xaa, 0xf1, 0x1e, 0xae, 0xc4, 0x33, 0xbe, 0x25, 0xbe, 0xcf, 0x08, 0xdf, 0x29, 0xf3, 0xbd, 0xf9, + 0xc8, 0x21, 0x9b, 0x47, 0x5a, 0x8e, 0x0f, 0xfd, 0x3d, 0xbe, 0xea, 0x0d, 0xf1, 0xd5, 0xfe, 0x39, + 0xbe, 0x6f, 0x55, 0xbc, 0xb7, 0x1c, 0xcf, 0x66, 0x18, 0xe0, 0x86, 0xd0, 0x33, 0x36, 0xc4, 0x93, + 0x65, 0x21, 0xde, 0xb4, 0x03, 0x29, 0xcf, 0x1f, 0x83, 0x62, 0x51, 0x2c, 0x6d, 0xda, 0x76, 0xef, + 0xb5, 0xc5, 0xed, 0xfa, 0xf8, 0xd6, 0x52, 0xbf, 0x35, 0x7e, 0xba, 0xed, 0xaf, 0x08, 0xdf, 0xd3, + 0x27, 0x3e, 0x86, 0x11, 0xcb, 0x63, 0xf5, 0xfc, 0x5c, 0x41, 0xc6, 0x59, 0xfc, 0x34, 0x08, 0x32, + 0x90, 0x12, 0xe6, 0x77, 0xbb, 0x8d, 0x37, 0xf4, 0xf9, 0xac, 0xa9, 0x29, 0x56, 0xb9, 0xae, 0xeb, + 0x66, 0x2f, 0x10, 0xbe, 0xbf, 0x82, 0xf2, 0xff, 0xf9, 0x4d, 0x8e, 0x5e, 0x5e, 0x4e, 0x3d, 0x74, + 0x35, 0xf5, 0xd0, 0xcf, 0xa9, 0x87, 0x3e, 0xcd, 0xbc, 0xca, 0xd5, 0xcc, 0xab, 0x7c, 0x9f, 0x79, + 0x95, 0xf7, 0xdd, 0x30, 0x52, 0xa7, 0xb9, 0x4f, 0x86, 0x22, 0xa1, 0x06, 0xec, 0x71, 0xcc, 0x7c, + 0x69, 0xc7, 0x74, 0x7c, 0x48, 0xcf, 0xaf, 0x9f, 0x47, 0x35, 0x49, 0x41, 0xfa, 0x0d, 0xfd, 0x90, + 0x1d, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x33, 0x2a, 0xaa, 0xa3, 0xcd, 0x05, 0x00, 0x00, } func (m *QueryChainLinksRequest) Marshal() (dAtA []byte, err error) { @@ -806,10 +806,10 @@ func (m *QueryDefaultExternalAddressesRequest) MarshalToSizedBuffer(dAtA []byte) i-- dAtA[i] = 0x12 } - if len(m.User) > 0 { - i -= len(m.User) - copy(dAtA[i:], m.User) - i = encodeVarintQueryChainLinks(dAtA, i, uint64(len(m.User))) + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintQueryChainLinks(dAtA, i, uint64(len(m.Owner))) i-- dAtA[i] = 0xa } @@ -987,7 +987,7 @@ func (m *QueryDefaultExternalAddressesRequest) Size() (n int) { } var l int _ = l - l = len(m.User) + l = len(m.Owner) if l > 0 { n += 1 + l + sovQueryChainLinks(uint64(l)) } @@ -1776,7 +1776,7 @@ func (m *QueryDefaultExternalAddressesRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1804,7 +1804,7 @@ func (m *QueryDefaultExternalAddressesRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.User = string(dAtA[iNdEx:postIndex]) + m.Owner = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { From 1ee397c72cf04970989acc621e4fcfd346560660 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 7 Jun 2022 18:44:46 +0800 Subject: [PATCH 08/64] Implement cli command --- x/profiles/client/cli/cli_chain_links.go | 78 +++++++++ x/profiles/client/cli/cli_chain_links_test.go | 149 ++++++++++++++++++ x/profiles/client/cli/query.go | 1 + 3 files changed, 228 insertions(+) diff --git a/x/profiles/client/cli/cli_chain_links.go b/x/profiles/client/cli/cli_chain_links.go index 0bc5594ea1..e6f5c74cdb 100644 --- a/x/profiles/client/cli/cli_chain_links.go +++ b/x/profiles/client/cli/cli_chain_links.go @@ -108,6 +108,33 @@ func GetCmdUnlinkChainAccount() *cobra.Command { return cmd } +// GetCmdSetDefaultExternalAddress returns the command allowing to set a default external address for a user +func GetCmdSetDefaultExternalAddress() *cobra.Command { + cmd := &cobra.Command{ + Use: "set-default-external-address [chain-name] [target]", + Short: "Set the default external account having the given chain name and external address", + Example: fmt.Sprintf(`%s tx profiles set-default-external-address "cosmos" cosmos18xnmlzqrqr6zt526pnczxe65zk3f4xgmndpxn2`, version.AppName), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgSetDefaultExternalAddress(args[0], args[1], clientCtx.FromAddress.String()) + if err = msg.ValidateBasic(); err != nil { + return fmt.Errorf("message validation failed: %w", err) + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + // -------------------------------------------------------------------------------------------------------------------- // GetCmdQueryChainLinks returns the command allowing to query the chain links, optionally associated with a user @@ -217,3 +244,54 @@ func GetCmdQueryChainLinkOwners() *cobra.Command { return cmd } + +// GetCmdQueryDefaultExternalAddress returns the command allowing to query the default chain links, optionally associated with a owner and chain name +func GetCmdQueryDefaultExternalAddress() *cobra.Command { + cmd := &cobra.Command{ + Use: "default-external-address [[owner]] [[chain_name]]", + Short: "Retrieve all default chain links with optional owner, chain name and pagination", + Example: fmt.Sprintf(`%s query profiles chain-link-owners +%s query profiles default-external-address --page=2 --limit=100 +%s query profiles default-external-address "desmos13p5pamrljhza3fp4es5m3llgmnde5fzcpq6nud" +%s query profiles default-external-address "desmos13p5pamrljhza3fp4es5m3llgmnde5fzcpq6nud" "cosmos" +`, version.AppName, version.AppName, version.AppName, version.AppName), + Args: cobra.RangeArgs(0, 2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + var owner string + if len(args) > 0 { + owner = args[0] + } + + var chainName string + if len(args) > 1 { + chainName = args[1] + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + res, err := queryClient.DefaultExternalAddresses( + context.Background(), + types.NewQueryDefaultExternalAddressesRequest(owner, chainName, pageReq), + ) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, "default external address") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/profiles/client/cli/cli_chain_links_test.go b/x/profiles/client/cli/cli_chain_links_test.go index 5eb1e26d5d..ab74889bf7 100644 --- a/x/profiles/client/cli/cli_chain_links_test.go +++ b/x/profiles/client/cli/cli_chain_links_test.go @@ -197,6 +197,94 @@ func (s *IntegrationTestSuite) TestCmdQueryChainLinkOwners() { } } +func (s *IntegrationTestSuite) TestCmdQueryDefaultExternalAddress() { + val := s.network.Validators[0] + useCases := []struct { + name string + args []string + shouldErr bool + expectedOutput types.QueryDefaultExternalAddressesResponse + }{ + { + name: "All default chain links are returned properly", + args: []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + shouldErr: false, + expectedOutput: types.QueryDefaultExternalAddressesResponse{ + Links: []types.ChainLink{ + s.testChainLinkAccount.GetBech32ChainLink( + "cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", + time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), + ), + }, + Pagination: &query.PageResponse{ + NextKey: nil, + Total: 0, + }, + }, + }, + { + name: "empty array is returned properly", + args: []string{ + val.Address.String(), + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + shouldErr: false, + expectedOutput: types.QueryDefaultExternalAddressesResponse{ + Links: []types.ChainLink{}, + Pagination: &query.PageResponse{ + NextKey: nil, + Total: 0, + }, + }, + }, + { + name: "existing chain links of the given owner are returned properly", + args: []string{ + "cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + shouldErr: false, + expectedOutput: types.QueryDefaultExternalAddressesResponse{ + Links: []types.ChainLink{ + s.testChainLinkAccount.GetBech32ChainLink( + "cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", + time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), + ), + }, + Pagination: &query.PageResponse{ + NextKey: nil, + Total: 0, + }, + }, + }, + } + + for _, uc := range useCases { + uc := uc + + s.Run(uc.name, func() { + cmd := cli.GetCmdQueryDefaultExternalAddress() + clientCtx := val.ClientCtx + out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, uc.args) + + if uc.shouldErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + + var response types.QueryChainLinksResponse + s.Require().NoError(clientCtx.JSONCodec.UnmarshalJSON(out.Bytes(), &response), out.String()) + s.Require().Equal(uc.expectedOutput.Pagination, response.Pagination) + for i := range uc.expectedOutput.Links { + s.Require().True(uc.expectedOutput.Links[i].Equal(response.Links[i])) + } + } + }) + } +} + func (s *IntegrationTestSuite) TestCmdLinkChainAccount() { cliCtx := s.network.Validators[0].ClientCtx cliCtx.Keyring = s.keyBase @@ -319,3 +407,64 @@ func (s *IntegrationTestSuite) TestCmdUnlinkChainAccount() { }) } } + +func (s *IntegrationTestSuite) TestCmdSetDefaultExternalAddress() { + cliCtx := s.network.Validators[0].ClientCtx + cliCtx.Keyring = s.keyBase + src, err := s.keyBase.Key("src") + s.Require().NoError(err) + testCases := []struct { + name string + args []string + shouldErr bool + respType proto.Message + }{ + { + name: "empty chain name returns error", + args: []string{ + "", + src.GetAddress().String(), + }, + shouldErr: true, + respType: &sdk.TxResponse{}, + }, + { + name: "empty address returns error", + args: []string{ + "cosmos", + "", + }, + shouldErr: true, + respType: &sdk.TxResponse{}, + }, + { + name: "valid request works properly", + args: []string{ + "cosmos", + src.GetAddress().String(), + fmt.Sprintf("--%s=%s", flags.FlagFrom, dstKeyName), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + shouldErr: false, + respType: &sdk.TxResponse{}, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + cmd := cli.GetCmdSetDefaultExternalAddress() + out, err := clitestutil.ExecTestCLICmd(cliCtx, cmd, tc.args) + + if tc.shouldErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + s.Require().NoError(cliCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) + } + }) + } +} diff --git a/x/profiles/client/cli/query.go b/x/profiles/client/cli/query.go index 01e8545280..3f676158a3 100644 --- a/x/profiles/client/cli/query.go +++ b/x/profiles/client/cli/query.go @@ -25,6 +25,7 @@ func GetQueryCmd() *cobra.Command { GetCmdQueryParams(), GetCmdQueryChainLinks(), GetCmdQueryChainLinkOwners(), + GetCmdQueryDefaultExternalAddress(), GetCmdQueryApplicationsLinks(), GetCmdQueryApplicationLinkOwners(), ) From d48ec72f984ab4805cb4307f4e5801de5206f17e Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 7 Jun 2022 18:50:27 +0800 Subject: [PATCH 09/64] Update proto --- proto/desmos/profiles/v2/msg_server.proto | 10 +- x/profiles/types/msg_server.pb.go | 136 +++++++++++----------- x/profiles/types/query_chain_links.pb.go | 6 +- 3 files changed, 76 insertions(+), 76 deletions(-) diff --git a/proto/desmos/profiles/v2/msg_server.proto b/proto/desmos/profiles/v2/msg_server.proto index 6b1b2fdd3f..a8bf57dad8 100644 --- a/proto/desmos/profiles/v2/msg_server.proto +++ b/proto/desmos/profiles/v2/msg_server.proto @@ -51,6 +51,11 @@ service Msg { rpc UnlinkChainAccount(MsgUnlinkChainAccount) returns (MsgUnlinkChainAccountResponse); + // SetDefaultExternalAddress allows to set a specific external address as the + // default one for a given chain + rpc SetDefaultExternalAddress(MsgSetDefaultExternalAddress) + returns (MsgSetDefaultExternalAddressResponse); + // LinkApplication defines a method to create a centralized application // link rpc LinkApplication(MsgLinkApplication) returns (MsgLinkApplicationResponse); @@ -58,9 +63,4 @@ service Msg { // UnlinkApplication defines a method to remove a centralized application rpc UnlinkApplication(MsgUnlinkApplication) returns (MsgUnlinkApplicationResponse); - - // SetDefaultExternalAddress allows to set a specific external address as the - // default one for a given chain - rpc SetDefaultExternalAddress(MsgSetDefaultExternalAddress) - returns (MsgSetDefaultExternalAddressResponse); } \ No newline at end of file diff --git a/x/profiles/types/msg_server.pb.go b/x/profiles/types/msg_server.pb.go index 2dc20c52ba..11d41fac42 100644 --- a/x/profiles/types/msg_server.pb.go +++ b/x/profiles/types/msg_server.pb.go @@ -34,38 +34,38 @@ func init() { var fileDescriptor_c2fd53889ce3d02c = []byte{ // 506 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4d, 0x6f, 0xd3, 0x30, - 0x18, 0xc7, 0x5b, 0x21, 0x71, 0x30, 0x42, 0x80, 0xe1, 0xb2, 0x1c, 0x72, 0xe0, 0x6d, 0x0c, 0x58, - 0xbc, 0x75, 0x17, 0xae, 0x65, 0xe5, 0x04, 0x93, 0x50, 0x37, 0x2e, 0x48, 0xa8, 0x72, 0xdd, 0xa7, - 0x5e, 0x34, 0xd7, 0x0e, 0xb6, 0x53, 0x6d, 0x9f, 0x80, 0x2b, 0x9f, 0x82, 0xcf, 0xc2, 0x71, 0x47, - 0x8e, 0xa8, 0xfd, 0x22, 0x28, 0x49, 0x1b, 0x92, 0xae, 0x4f, 0x97, 0xde, 0xe2, 0x3e, 0xbf, 0xff, - 0x8b, 0x2d, 0xd7, 0xe4, 0xd9, 0x08, 0xdc, 0xc4, 0x38, 0x96, 0x58, 0x33, 0x8e, 0x15, 0x38, 0x36, - 0xed, 0xb0, 0x89, 0x93, 0x03, 0x07, 0x76, 0x0a, 0x36, 0x4a, 0xac, 0xf1, 0x86, 0xd2, 0x02, 0x8a, - 0x96, 0x50, 0x34, 0xed, 0x04, 0x4f, 0xa4, 0x91, 0x26, 0x1f, 0xb3, 0xec, 0xab, 0x20, 0x83, 0x1d, - 0x69, 0x8c, 0x54, 0xc0, 0xf2, 0xd5, 0x30, 0x1d, 0x33, 0xae, 0xaf, 0x96, 0x23, 0x61, 0x32, 0x93, - 0x41, 0xa1, 0x29, 0x16, 0x8b, 0xd1, 0xee, 0xba, 0x12, 0x66, 0x04, 0x2a, 0xa7, 0xb3, 0x9f, 0x16, - 0xe0, 0x3e, 0x0e, 0x8e, 0x3c, 0x97, 0x03, 0x0b, 0xdf, 0x53, 0x70, 0x7e, 0xe9, 0xfb, 0x62, 0xfd, - 0xe6, 0x56, 0x5d, 0xdf, 0x60, 0xd8, 0x3a, 0xcf, 0x3d, 0x0c, 0x16, 0xe7, 0x3c, 0xd6, 0x03, 0x15, - 0xeb, 0x8b, 0x8d, 0xdb, 0xca, 0x50, 0x9e, 0x24, 0x55, 0xb0, 0xf3, 0x8b, 0x90, 0x3b, 0x27, 0x4e, - 0xd2, 0x6f, 0xe4, 0xde, 0x29, 0x9f, 0xc2, 0xe7, 0x82, 0xa7, 0x4f, 0xa3, 0x9b, 0xe7, 0x1e, 0x9d, - 0x38, 0x59, 0x61, 0x82, 0xd7, 0xb7, 0x33, 0x7d, 0x70, 0x89, 0xd1, 0x0e, 0xa8, 0x20, 0xf7, 0x7b, - 0xa0, 0xc0, 0x97, 0x01, 0xcf, 0x11, 0x71, 0x8d, 0x0a, 0xde, 0x36, 0xa1, 0xca, 0x90, 0x94, 0x3c, - 0xee, 0x17, 0x27, 0xd6, 0x3b, 0xe3, 0xf2, 0xcc, 0x72, 0xed, 0xc6, 0x60, 0x29, 0xd6, 0x73, 0x0d, - 0x1b, 0x74, 0x9a, 0xb3, 0x65, 0xec, 0x8f, 0x36, 0xd9, 0x39, 0xe6, 0x5a, 0x80, 0xaa, 0x8f, 0x73, - 0x05, 0x3d, 0x40, 0x1c, 0x51, 0x45, 0xf0, 0x6e, 0x5b, 0x45, 0xad, 0x49, 0x57, 0x08, 0x48, 0xfc, - 0x36, 0x4d, 0x50, 0x05, 0xda, 0x04, 0x55, 0xd4, 0x9a, 0xf4, 0x61, 0x9c, 0x3a, 0xd8, 0xa6, 0x09, - 0xaa, 0x40, 0x9b, 0xa0, 0x8a, 0xb2, 0x89, 0x22, 0x0f, 0x3f, 0xc5, 0xfa, 0xe2, 0x38, 0xfb, 0x8b, - 0x74, 0x85, 0x30, 0xa9, 0xf6, 0x74, 0x17, 0x71, 0x5b, 0x05, 0x03, 0xd6, 0x10, 0x2c, 0xd3, 0x2c, - 0xa1, 0x5f, 0xb4, 0x5a, 0xcd, 0xdb, 0x43, 0x6c, 0x6e, 0xa2, 0xc1, 0x61, 0x63, 0xb4, 0xcc, 0x8c, - 0xc9, 0x83, 0xac, 0x4f, 0x37, 0x49, 0x54, 0x2c, 0xb8, 0x8f, 0x8d, 0xa6, 0x2f, 0x37, 0xf4, 0xae, - 0x70, 0x41, 0xd4, 0x8c, 0x2b, 0xa3, 0x0c, 0x79, 0x54, 0x14, 0xa9, 0x86, 0xbd, 0xda, 0x58, 0xb9, - 0x1a, 0x77, 0xd0, 0x94, 0xac, 0xdd, 0xa3, 0x53, 0xf0, 0x3d, 0x18, 0xf3, 0x54, 0xf9, 0x0f, 0x97, - 0x1e, 0xac, 0xe6, 0xaa, 0x3b, 0x1a, 0x59, 0x70, 0x0e, 0xbd, 0x47, 0xa8, 0x02, 0xbd, 0x47, 0xa8, - 0x62, 0xd9, 0xe4, 0xfd, 0xc7, 0xdf, 0xb3, 0xb0, 0x7d, 0x3d, 0x0b, 0xdb, 0x7f, 0x67, 0x61, 0xfb, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xcf, 0x6e, 0xd3, 0x30, + 0x1c, 0xc7, 0x5b, 0x21, 0x71, 0x30, 0x42, 0x80, 0xe1, 0xb2, 0x1c, 0x72, 0xe0, 0xdf, 0x18, 0xb0, + 0x78, 0xeb, 0x2e, 0x5c, 0xcb, 0xca, 0x09, 0x26, 0xa1, 0x6e, 0x5c, 0x90, 0x50, 0xe5, 0xba, 0xbf, + 0x7a, 0xd1, 0x5c, 0x3b, 0xd8, 0x4e, 0xb5, 0x3d, 0x01, 0x57, 0x9e, 0x82, 0x67, 0xe1, 0xb8, 0x23, + 0x47, 0xd4, 0xbe, 0x08, 0x4a, 0xd2, 0x86, 0xa4, 0xeb, 0xaf, 0x4b, 0x6f, 0x49, 0xfd, 0xf9, 0xfe, + 0xc9, 0x57, 0xaa, 0xc9, 0xb3, 0x11, 0xb8, 0x89, 0x71, 0x2c, 0xb1, 0x66, 0x1c, 0x2b, 0x70, 0x6c, + 0xda, 0x61, 0x13, 0x27, 0x07, 0x0e, 0xec, 0x14, 0x6c, 0x94, 0x58, 0xe3, 0x0d, 0xa5, 0x05, 0x14, + 0x2d, 0xa1, 0x68, 0xda, 0x09, 0x9e, 0x48, 0x23, 0x4d, 0x7e, 0xcc, 0xb2, 0xa7, 0x82, 0x0c, 0x76, + 0xa4, 0x31, 0x52, 0x01, 0xcb, 0xdf, 0x86, 0xe9, 0x98, 0x71, 0x7d, 0xb5, 0x3c, 0x12, 0x26, 0x33, + 0x19, 0x14, 0x9a, 0xe2, 0x65, 0x71, 0xb4, 0xbb, 0xae, 0x84, 0x19, 0x81, 0xca, 0xe9, 0xec, 0xa7, + 0x05, 0xb8, 0x8f, 0x83, 0x23, 0xcf, 0xe5, 0xc0, 0xc2, 0xf7, 0x14, 0x9c, 0x5f, 0xfa, 0xbe, 0x58, + 0xff, 0x71, 0xab, 0xae, 0x6f, 0x30, 0x6c, 0x9d, 0xe7, 0x1e, 0x06, 0x8b, 0x73, 0x1e, 0xeb, 0x81, + 0x8a, 0xf5, 0xc5, 0xc6, 0xcf, 0xca, 0x50, 0x9e, 0x24, 0x55, 0xb0, 0xf3, 0x8b, 0x90, 0x3b, 0x27, + 0x4e, 0xd2, 0x6f, 0xe4, 0xde, 0x29, 0x9f, 0xc2, 0xe7, 0x82, 0xa7, 0x4f, 0xa3, 0x9b, 0xbb, 0x47, + 0x27, 0x4e, 0x56, 0x98, 0xe0, 0xf5, 0xed, 0x4c, 0x1f, 0x5c, 0x62, 0xb4, 0x03, 0x2a, 0xc8, 0xfd, + 0x1e, 0x28, 0xf0, 0x65, 0xc0, 0x73, 0x44, 0x5c, 0xa3, 0x82, 0xb7, 0x4d, 0xa8, 0x32, 0x24, 0x25, + 0x8f, 0xfb, 0xc5, 0x62, 0xbd, 0x33, 0x2e, 0xcf, 0x2c, 0xd7, 0x6e, 0x0c, 0x96, 0x62, 0x3d, 0xd7, + 0xb0, 0x41, 0xa7, 0x39, 0x5b, 0xc6, 0xfe, 0x68, 0x93, 0x9d, 0x63, 0xae, 0x05, 0xa8, 0xfa, 0x71, + 0xae, 0xa0, 0x07, 0x88, 0x23, 0xaa, 0x08, 0xde, 0x6d, 0xab, 0xa8, 0x35, 0xe9, 0x0a, 0x01, 0x89, + 0xdf, 0xa6, 0x09, 0xaa, 0x40, 0x9b, 0xa0, 0x8a, 0x5a, 0x93, 0x3e, 0x8c, 0x53, 0x07, 0xdb, 0x34, + 0x41, 0x15, 0x68, 0x13, 0x54, 0x51, 0x36, 0x51, 0xe4, 0xe1, 0xa7, 0x58, 0x5f, 0x1c, 0x67, 0x7f, + 0x91, 0xae, 0x10, 0x26, 0xd5, 0x9e, 0xee, 0x22, 0x6e, 0xab, 0x60, 0xc0, 0x1a, 0x82, 0x65, 0x9a, + 0x25, 0xf4, 0x8b, 0x56, 0xab, 0x79, 0x7b, 0x88, 0xcd, 0x4d, 0x34, 0x38, 0x6c, 0x8c, 0xd6, 0xb6, + 0x3e, 0x05, 0xdf, 0x83, 0x31, 0x4f, 0x95, 0xff, 0x70, 0xe9, 0xc1, 0x6a, 0xae, 0xba, 0xa3, 0x91, + 0x05, 0xe7, 0xd0, 0xad, 0x51, 0x05, 0xba, 0x35, 0xaa, 0x28, 0x9b, 0xc4, 0xe4, 0x41, 0xb6, 0x4c, + 0x37, 0x49, 0x54, 0x2c, 0xb8, 0x8f, 0x8d, 0xa6, 0x2f, 0x37, 0x2c, 0x58, 0xe1, 0x82, 0xa8, 0x19, + 0x57, 0x46, 0x19, 0xf2, 0xa8, 0x98, 0xa4, 0x1a, 0xf6, 0x6a, 0xe3, 0x78, 0xd5, 0xb8, 0x83, 0xa6, + 0xe4, 0x32, 0xf0, 0xfd, 0xc7, 0xdf, 0xb3, 0xb0, 0x7d, 0x3d, 0x0b, 0xdb, 0x7f, 0x67, 0x61, 0xfb, 0xe7, 0x3c, 0x6c, 0x5d, 0xcf, 0xc3, 0xd6, 0x9f, 0x79, 0xd8, 0xfa, 0x7a, 0x28, 0x63, 0x7f, 0x9e, - 0x0e, 0x23, 0x61, 0x26, 0xac, 0x70, 0xdf, 0x57, 0x7c, 0xe8, 0x16, 0xdf, 0x6c, 0x7a, 0xc4, 0x2e, - 0xff, 0xbf, 0xc3, 0xfe, 0x2a, 0x01, 0x37, 0xbc, 0x9b, 0x3f, 0xbe, 0x47, 0xff, 0x02, 0x00, 0x00, - 0xff, 0xff, 0x76, 0x93, 0x0b, 0x07, 0x03, 0x07, 0x00, 0x00, + 0x0e, 0x23, 0x61, 0x26, 0xac, 0x70, 0xdd, 0x57, 0x7c, 0xe8, 0x16, 0xcf, 0x6c, 0x7a, 0xc4, 0x2e, + 0xff, 0xdf, 0xc3, 0xfe, 0x2a, 0x01, 0x37, 0xbc, 0x9b, 0x5f, 0xbe, 0x47, 0xff, 0x02, 0x00, 0x00, + 0xff, 0xff, 0xa9, 0xca, 0xd6, 0xd1, 0x03, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -102,14 +102,14 @@ type MsgClient interface { // UnlinkChainAccount defines a method to unlink an external chain account // from a profile UnlinkChainAccount(ctx context.Context, in *MsgUnlinkChainAccount, opts ...grpc.CallOption) (*MsgUnlinkChainAccountResponse, error) + // SetDefaultExternalAddress allows to set a specific external address as the + // default one for a given chain + SetDefaultExternalAddress(ctx context.Context, in *MsgSetDefaultExternalAddress, opts ...grpc.CallOption) (*MsgSetDefaultExternalAddressResponse, error) // LinkApplication defines a method to create a centralized application // link LinkApplication(ctx context.Context, in *MsgLinkApplication, opts ...grpc.CallOption) (*MsgLinkApplicationResponse, error) // UnlinkApplication defines a method to remove a centralized application UnlinkApplication(ctx context.Context, in *MsgUnlinkApplication, opts ...grpc.CallOption) (*MsgUnlinkApplicationResponse, error) - // SetDefaultExternalAddress allows to set a specific external address as the - // default one for a given chain - SetDefaultExternalAddress(ctx context.Context, in *MsgSetDefaultExternalAddress, opts ...grpc.CallOption) (*MsgSetDefaultExternalAddressResponse, error) } type msgClient struct { @@ -192,27 +192,27 @@ func (c *msgClient) UnlinkChainAccount(ctx context.Context, in *MsgUnlinkChainAc return out, nil } -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...) +func (c *msgClient) SetDefaultExternalAddress(ctx context.Context, in *MsgSetDefaultExternalAddress, opts ...grpc.CallOption) (*MsgSetDefaultExternalAddressResponse, error) { + out := new(MsgSetDefaultExternalAddressResponse) + err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/SetDefaultExternalAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } -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...) +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...) if err != nil { return nil, err } return out, nil } -func (c *msgClient) SetDefaultExternalAddress(ctx context.Context, in *MsgSetDefaultExternalAddress, opts ...grpc.CallOption) (*MsgSetDefaultExternalAddressResponse, error) { - out := new(MsgSetDefaultExternalAddressResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/SetDefaultExternalAddress", in, out, opts...) +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...) if err != nil { return nil, err } @@ -243,14 +243,14 @@ type MsgServer interface { // UnlinkChainAccount defines a method to unlink an external chain account // from a profile UnlinkChainAccount(context.Context, *MsgUnlinkChainAccount) (*MsgUnlinkChainAccountResponse, error) + // SetDefaultExternalAddress allows to set a specific external address as the + // default one for a given chain + SetDefaultExternalAddress(context.Context, *MsgSetDefaultExternalAddress) (*MsgSetDefaultExternalAddressResponse, error) // LinkApplication defines a method to create a centralized application // link LinkApplication(context.Context, *MsgLinkApplication) (*MsgLinkApplicationResponse, error) // UnlinkApplication defines a method to remove a centralized application UnlinkApplication(context.Context, *MsgUnlinkApplication) (*MsgUnlinkApplicationResponse, error) - // SetDefaultExternalAddress allows to set a specific external address as the - // default one for a given chain - SetDefaultExternalAddress(context.Context, *MsgSetDefaultExternalAddress) (*MsgSetDefaultExternalAddressResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -281,15 +281,15 @@ func (*UnimplementedMsgServer) LinkChainAccount(ctx context.Context, req *MsgLin func (*UnimplementedMsgServer) UnlinkChainAccount(ctx context.Context, req *MsgUnlinkChainAccount) (*MsgUnlinkChainAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UnlinkChainAccount not implemented") } +func (*UnimplementedMsgServer) SetDefaultExternalAddress(ctx context.Context, req *MsgSetDefaultExternalAddress) (*MsgSetDefaultExternalAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetDefaultExternalAddress not implemented") +} func (*UnimplementedMsgServer) LinkApplication(ctx context.Context, req *MsgLinkApplication) (*MsgLinkApplicationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LinkApplication not implemented") } func (*UnimplementedMsgServer) UnlinkApplication(ctx context.Context, req *MsgUnlinkApplication) (*MsgUnlinkApplicationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UnlinkApplication not implemented") } -func (*UnimplementedMsgServer) SetDefaultExternalAddress(ctx context.Context, req *MsgSetDefaultExternalAddress) (*MsgSetDefaultExternalAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetDefaultExternalAddress not implemented") -} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -439,56 +439,56 @@ func _Msg_UnlinkChainAccount_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } -func _Msg_LinkApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgLinkApplication) +func _Msg_SetDefaultExternalAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetDefaultExternalAddress) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).LinkApplication(ctx, in) + return srv.(MsgServer).SetDefaultExternalAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/LinkApplication", + FullMethod: "/desmos.profiles.v2.Msg/SetDefaultExternalAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).LinkApplication(ctx, req.(*MsgLinkApplication)) + return srv.(MsgServer).SetDefaultExternalAddress(ctx, req.(*MsgSetDefaultExternalAddress)) } return interceptor(ctx, in, info, handler) } -func _Msg_UnlinkApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUnlinkApplication) +func _Msg_LinkApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgLinkApplication) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).UnlinkApplication(ctx, in) + return srv.(MsgServer).LinkApplication(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/UnlinkApplication", + FullMethod: "/desmos.profiles.v2.Msg/LinkApplication", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UnlinkApplication(ctx, req.(*MsgUnlinkApplication)) + return srv.(MsgServer).LinkApplication(ctx, req.(*MsgLinkApplication)) } return interceptor(ctx, in, info, handler) } -func _Msg_SetDefaultExternalAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSetDefaultExternalAddress) +func _Msg_UnlinkApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUnlinkApplication) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).SetDefaultExternalAddress(ctx, in) + return srv.(MsgServer).UnlinkApplication(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/SetDefaultExternalAddress", + FullMethod: "/desmos.profiles.v2.Msg/UnlinkApplication", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SetDefaultExternalAddress(ctx, req.(*MsgSetDefaultExternalAddress)) + return srv.(MsgServer).UnlinkApplication(ctx, req.(*MsgUnlinkApplication)) } return interceptor(ctx, in, info, handler) } @@ -529,6 +529,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UnlinkChainAccount", Handler: _Msg_UnlinkChainAccount_Handler, }, + { + MethodName: "SetDefaultExternalAddress", + Handler: _Msg_SetDefaultExternalAddress_Handler, + }, { MethodName: "LinkApplication", Handler: _Msg_LinkApplication_Handler, @@ -537,10 +541,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UnlinkApplication", Handler: _Msg_UnlinkApplication_Handler, }, - { - MethodName: "SetDefaultExternalAddress", - Handler: _Msg_SetDefaultExternalAddress_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "desmos/profiles/v2/msg_server.proto", diff --git a/x/profiles/types/query_chain_links.pb.go b/x/profiles/types/query_chain_links.pb.go index 8434cdbaae..c8887be87d 100644 --- a/x/profiles/types/query_chain_links.pb.go +++ b/x/profiles/types/query_chain_links.pb.go @@ -351,11 +351,11 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) GetTarget() string // QueryDefaultExternalAddressesRequest is the request type for // Query/DefaultExternalAddresses RPC method type QueryDefaultExternalAddressesRequest struct { - // Owner for which to query the default addresses + // (Optional) Owner for which to query the default addresses Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // (optional) Chain name to query the default address for + // (Optional) Chain name to query the default address for ChainName string `protobuf:"bytes,2,opt,name=chain_name,json=chainName,proto3" json:"chain_name,omitempty"` - // pagination defines an optional pagination for the request. + // Pagination defines an optional pagination for the request. Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } From 43ab06eb8cd14372466b0541df9086a19eaf09e0 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 7 Jun 2022 19:27:54 +0800 Subject: [PATCH 10/64] Add migration script --- x/profiles/legacy/v6/store.go | 66 ++++++++++++++++++ x/profiles/legacy/v6/store_test.go | 103 +++++++++++++++++++++++++++++ 2 files changed, 169 insertions(+) create mode 100644 x/profiles/legacy/v6/store.go create mode 100644 x/profiles/legacy/v6/store_test.go diff --git a/x/profiles/legacy/v6/store.go b/x/profiles/legacy/v6/store.go new file mode 100644 index 0000000000..e506feeb80 --- /dev/null +++ b/x/profiles/legacy/v6/store.go @@ -0,0 +1,66 @@ +package v6 + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/desmos-labs/desmos/v3/x/profiles/types" +) + +// MigrateStore performs in-place store migrations from v6 to v7 +// The migration includes: +// +// - set the default external address to oldest chain link of each chain for each owner +// +func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, cdc codec.BinaryCodec) error { + store := ctx.KVStore(storeKey) + + // Set the default external addresses + err := setDefaultExternalAddresses(store, cdc) + if err != nil { + return err + } + + return nil +} + +// setDefaultExternalAddresses set the default external address of each chain for each owner +func setDefaultExternalAddresses(store sdk.KVStore, cdc codec.BinaryCodec) error { + chainLinkStore := prefix.NewStore(store, types.ChainLinksPrefix) + chainLinksIterator := chainLinkStore.Iterator(nil, nil) + + for ; chainLinksIterator.Valid(); chainLinksIterator.Next() { + var link types.ChainLink + err := cdc.Unmarshal(chainLinksIterator.Value(), &link) + if err != nil { + return err + } + + // Validate the source address + srcAddrData, err := types.UnpackAddressData(cdc, link.Address) + if err != nil { + return err + } + + // Update default external address if the key exists + if store.Has(types.DefaultExternalAddressKey(link.User, link.ChainConfig.Name)) { + addrBz := store.Get(types.DefaultExternalAddressKey(link.User, link.ChainConfig.Name)) + var defaultLink types.ChainLink + err := cdc.Unmarshal(store.Get(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, string(addrBz))), &defaultLink) + if err != nil { + return err + } + + // Skip if the new link is after the default one + if link.CreationTime.After(defaultLink.CreationTime) { + continue + } + } + + store.Set(types.DefaultExternalAddressKey(link.User, link.ChainConfig.Name), []byte(srcAddrData.GetValue())) + } + + chainLinksIterator.Close() + return nil +} diff --git a/x/profiles/legacy/v6/store_test.go b/x/profiles/legacy/v6/store_test.go new file mode 100644 index 0000000000..94dff77c5c --- /dev/null +++ b/x/profiles/legacy/v6/store_test.go @@ -0,0 +1,103 @@ +package v6_test + +import ( + "testing" + "time" + + "github.com/desmos-labs/desmos/v3/testutil" + v6 "github.com/desmos-labs/desmos/v3/x/profiles/legacy/v6" + profilestypes "github.com/desmos-labs/desmos/v3/x/profiles/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/require" + + "github.com/desmos-labs/desmos/v3/app" + "github.com/desmos-labs/desmos/v3/x/relationships/types" +) + +func TestMigrateStore(t *testing.T) { + cdc, _ := app.MakeCodecs() + + // Build all the necessary keys + keys := sdk.NewKVStoreKeys(authtypes.StoreKey, types.StoreKey) + tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + + olderChainAccount := testutil.GetChainLinkAccount("cosmos", "cosmos") + newerChainAccount := testutil.GetChainLinkAccount("cosmos", "cosmos") + + testCases := []struct { + name string + store func(ctx sdk.Context) + shouldErr bool + check func(ctx sdk.Context) + }{ + { + name: "default external addresses are set properly", + store: func(ctx sdk.Context) { + kvStore := ctx.KVStore(keys[types.StoreKey]) + + // Store the chain links + newerChainLink := newerChainAccount.GetBech32ChainLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + time.Date(2020, 1, 3, 00, 00, 00, 000, time.UTC), + ) + + kvStore.Set( + profilestypes.ChainLinksStoreKey( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + newerChainAccount.Bech32Address().Value, + ), + cdc.MustMarshal(&newerChainLink), + ) + + olderChainLink := olderChainAccount.GetBech32ChainLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + ) + + kvStore.Set( + profilestypes.ChainLinksStoreKey( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + olderChainAccount.Bech32Address().Value, + ), + cdc.MustMarshal(&olderChainLink), + ) + }, + check: func(ctx sdk.Context) { + kvStore := ctx.KVStore(keys[types.StoreKey]) + + key := profilestypes.DefaultExternalAddressKey( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + ) + require.Equal(t, []byte(olderChainAccount.Bech32Address().Value), kvStore.Get(key)) + }, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + ctx := testutil.BuildContext(keys, tKeys, memKeys) + if tc.store != nil { + tc.store(ctx) + } + + err := v6.MigrateStore(ctx, keys[types.StoreKey], cdc) + if tc.shouldErr { + require.Error(t, err) + } else { + require.NoError(t, err) + if tc.check != nil { + tc.check(ctx) + } + } + }) + } +} From 94d1c85c5d5dca427e0d4e02930704ed78ab52a9 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 8 Jun 2022 11:47:10 +0800 Subject: [PATCH 11/64] Add decoder --- x/profiles/client/cli/tx.go | 1 + x/profiles/simulation/decoder.go | 5 +++++ x/profiles/simulation/decoder_test.go | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/x/profiles/client/cli/tx.go b/x/profiles/client/cli/tx.go index 840936609b..ac5a3d83e1 100644 --- a/x/profiles/client/cli/tx.go +++ b/x/profiles/client/cli/tx.go @@ -29,6 +29,7 @@ func NewTxCmd() *cobra.Command { GetCmdCancelDTagTransfer(), GetCmdLinkChainAccount(), GetCmdUnlinkChainAccount(), + GetCmdSetDefaultExternalAddress(), GetCmdLinkApplication(), GetCmdUnlinkApplication(), ) diff --git a/x/profiles/simulation/decoder.go b/x/profiles/simulation/decoder.go index eed48ff5b0..ceb6360043 100644 --- a/x/profiles/simulation/decoder.go +++ b/x/profiles/simulation/decoder.go @@ -39,6 +39,11 @@ 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, &applicationLinkB) + case bytes.HasPrefix(kvA.Key, types.DefaultExternalAddressPrefix): + addressA := string(kvA.Value) + addressB := string(kvB.Value) + return fmt.Sprintf("ExternalAddressA: %s\nExternalAddressB: %s\n", addressA, addressB) + 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 35bfd715e9..2899d2394c 100644 --- a/x/profiles/simulation/decoder_test.go +++ b/x/profiles/simulation/decoder_test.go @@ -73,6 +73,13 @@ func TestDecodeStore(t *testing.T) { ), Value: cdc.MustMarshal(&applicationLink), }, + { + Key: types.DefaultExternalAddressKey( + "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", + "cosmos", + ), + Value: []byte("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), + }, { Key: []byte("invalid"), Value: []byte("value"), @@ -87,6 +94,7 @@ func TestDecodeStore(t *testing.T) { {"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)}, + {"External address", fmt.Sprintf("ExternalAddressA: %s\nExternalAddressB: %s\n", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns")}, {"other", ""}, } From 8f9427402945b0d5bd3e10aee1c13d24a41cf1e3 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 14:52:03 +0800 Subject: [PATCH 12/64] Improve testutil dependancy --- app/desmos/cmd/chainlink/create_json_test.go | 6 +- testutil/{ => profilestesting}/chain_links.go | 2 +- testutil/{ => profilestesting}/profiles.go | 2 +- testutil/{ => storetesting}/context.go | 2 +- x/posts/legacy/v2/store_test.go | 2 +- x/profiles/client/cli/cli_test.go | 7 +- x/profiles/client/utils/utils_test.go | 4 +- x/profiles/keeper/alias_functions_test.go | 20 +-- x/profiles/keeper/genesis_test.go | 24 ++-- x/profiles/keeper/grpc_query_test.go | 116 +++++++++--------- x/profiles/keeper/invariants_test.go | 6 +- x/profiles/keeper/keeper_app_links_test.go | 22 ++-- x/profiles/keeper/keeper_chain_links_test.go | 44 +++---- .../keeper/keeper_dtag_transfers_test.go | 28 ++--- x/profiles/keeper/keeper_test.go | 34 ++--- .../keeper/msg_server_chain_link_test.go | 14 +-- .../keeper/msg_server_dtag_transfers_test.go | 36 +++--- x/profiles/keeper/msgs_server_profile_test.go | 16 +-- x/profiles/keeper/relay_app_links_test.go | 22 ++-- x/profiles/keeper/relay_chain_links_test.go | 40 +++--- x/profiles/legacy/v4/store_test.go | 18 +-- x/profiles/legacy/v5/store_test.go | 10 +- x/profiles/types/account_test.go | 74 +++++------ x/profiles/types/genesis_test.go | 12 +- x/profiles/types/models_chain_links_test.go | 28 ++--- x/profiles/types/models_packets_test.go | 26 ++-- x/profiles/types/msgs_chain_links_test.go | 6 +- x/reports/legacy/v2/store_test.go | 4 +- x/subspaces/legacy/v2/store_test.go | 4 +- x/subspaces/legacy/v3/store_test.go | 4 +- 30 files changed, 318 insertions(+), 315 deletions(-) rename testutil/{ => profilestesting}/chain_links.go (98%) rename testutil/{ => profilestesting}/profiles.go (99%) rename testutil/{ => storetesting}/context.go (97%) diff --git a/app/desmos/cmd/chainlink/create_json_test.go b/app/desmos/cmd/chainlink/create_json_test.go index 73c7d68963..bb53ac1f7f 100644 --- a/app/desmos/cmd/chainlink/create_json_test.go +++ b/app/desmos/cmd/chainlink/create_json_test.go @@ -5,9 +5,9 @@ import ( "io/ioutil" "github.com/desmos-labs/desmos/v3/app/desmos/cmd/chainlink/builder" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" cmd "github.com/desmos-labs/desmos/v3/app/desmos/cmd/chainlink" - "github.com/desmos-labs/desmos/v3/testutil" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -64,7 +64,7 @@ func (suite *CreateJSONChainLinkTestSuite) TestSingleSignatureAccount() { profilestypes.NewBech32Address("cosmos13j7p6faa9jr8ty6lvqv0prldprr6m5xenmafnt", "cosmos"), profilestypes.NewProof( key.GetPubKey(), - testutil.SingleSignatureProtoFromHex(hex.EncodeToString(sig)), + profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(sig)), hex.EncodeToString([]byte(suite.Owner))), profilestypes.NewChainConfig("cosmos"), ) @@ -177,7 +177,7 @@ func (suite *CreateJSONChainLinkTestSuite) TestMultiSignatureAccount() { profilestypes.NewBech32Address("cosmos1exdjkfxud8yzqtvua3hdd93xu0gmek5l47r8ra", "cosmos"), profilestypes.NewProof( suite.GetPubKeyFromTxFile(txFile), - testutil.MultiSignatureProtoFromAnyHex( + profilestesting.MultiSignatureProtoFromAnyHex( suite.Codec, "0a262f6465736d6f732e70726f66696c65732e76322e4d756c74695369676e61747572654461746112e9010a0508031201c0126f0a272f6465736d6f732e70726f66696c65732e76322e53696e676c655369676e6174757265446174611244087f124027fc4567818a29803ec13f429404c7131c818acc1954f512f3d71a3379e7ec741d25de8b142f61151652b06ef78aaeffd58707023e6e8dfbe98c990185016476126f0a272f6465736d6f732e70726f66696c65732e76322e53696e676c655369676e6174757265446174611244087f12409394c86630e7afb961899add8fc1a211d14b8cc38702c53caa701851557f35832c11e11510da4d676578a19b342865317547549b2b4bd78cdf809dafa55041f7", ), diff --git a/testutil/chain_links.go b/testutil/profilestesting/chain_links.go similarity index 98% rename from testutil/chain_links.go rename to testutil/profilestesting/chain_links.go index 2dd9448c3e..2faa2a4d72 100644 --- a/testutil/chain_links.go +++ b/testutil/profilestesting/chain_links.go @@ -1,4 +1,4 @@ -package testutil +package profilestesting import ( "encoding/hex" diff --git a/testutil/profiles.go b/testutil/profilestesting/profiles.go similarity index 99% rename from testutil/profiles.go rename to testutil/profilestesting/profiles.go index e856185738..0f6609441a 100644 --- a/testutil/profiles.go +++ b/testutil/profilestesting/profiles.go @@ -1,4 +1,4 @@ -package testutil +package profilestesting import ( "encoding/hex" diff --git a/testutil/context.go b/testutil/storetesting/context.go similarity index 97% rename from testutil/context.go rename to testutil/storetesting/context.go index a9ac012733..a96cbd8118 100644 --- a/testutil/context.go +++ b/testutil/storetesting/context.go @@ -1,4 +1,4 @@ -package testutil +package storetesting import ( "github.com/cosmos/cosmos-sdk/store" diff --git a/x/posts/legacy/v2/store_test.go b/x/posts/legacy/v2/store_test.go index 0577ba500a..f2af7f3d71 100644 --- a/x/posts/legacy/v2/store_test.go +++ b/x/posts/legacy/v2/store_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" "github.com/desmos-labs/desmos/v3/app" - "github.com/desmos-labs/desmos/v3/testutil" + testutil "github.com/desmos-labs/desmos/v3/testutil/storetesting" v2 "github.com/desmos-labs/desmos/v3/x/posts/legacy/v2" "github.com/desmos-labs/desmos/v3/x/posts/types" subspaceskeeper "github.com/desmos-labs/desmos/v3/x/subspaces/keeper" diff --git a/x/profiles/client/cli/cli_test.go b/x/profiles/client/cli/cli_test.go index 8b7edcd851..1d43f4e48e 100644 --- a/x/profiles/client/cli/cli_test.go +++ b/x/profiles/client/cli/cli_test.go @@ -23,6 +23,7 @@ import ( "github.com/stretchr/testify/suite" "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" "github.com/desmos-labs/desmos/v3/x/profiles/types" ) @@ -43,7 +44,7 @@ type IntegrationTestSuite struct { network *network.Network keyBase keyring.Keyring keys Keys - testChainLinkAccount testutil.ChainLinkAccount + testChainLinkAccount profilestesting.ChainLinkAccount } func TestIntegrationTestSuite(t *testing.T) { @@ -133,7 +134,7 @@ func (s *IntegrationTestSuite) SetupSuite() { ), } - s.testChainLinkAccount = testutil.GetChainLinkAccount("cosmos", "cosmos") + s.testChainLinkAccount = profilestesting.GetChainLinkAccount("cosmos", "cosmos") profilesData.ChainLinks = []types.ChainLink{ s.testChainLinkAccount.GetBech32ChainLink( "cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", @@ -195,7 +196,7 @@ func (s *IntegrationTestSuite) writeChainLinkJSONFile(filePath string) { jsonData := utils.NewChainLinkJSON( types.NewBech32Address(addStr, "cosmos"), - types.NewProof(srcKey.PubKey(), testutil.SingleSignatureProtoFromHex(hex.EncodeToString(sigBz)), hex.EncodeToString([]byte(plainText))), + types.NewProof(srcKey.PubKey(), profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(sigBz)), hex.EncodeToString([]byte(plainText))), types.NewChainConfig("cosmos"), ) diff --git a/x/profiles/client/utils/utils_test.go b/x/profiles/client/utils/utils_test.go index cf158fdedf..37c4a8acd6 100644 --- a/x/profiles/client/utils/utils_test.go +++ b/x/profiles/client/utils/utils_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" "github.com/desmos-labs/desmos/v3/app" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" "github.com/desmos-labs/desmos/v3/x/profiles/client/utils" "github.com/desmos-labs/desmos/v3/x/profiles/types" ) @@ -34,7 +34,7 @@ func TestParseLinkAccountJSON(t *testing.T) { jsonData := utils.NewChainLinkJSON( types.NewBech32Address(addStr, "cosmos"), - types.NewProof(pubKey, testutil.SingleSignatureProtoFromHex(hex.EncodeToString(sigBz)), plainText), + types.NewProof(pubKey, profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(sigBz)), plainText), types.NewChainConfig("cosmos"), ) diff --git a/x/profiles/keeper/alias_functions_test.go b/x/profiles/keeper/alias_functions_test.go index 1f76b726e3..78c3eff91d 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/v3/testutil/profilestesting" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -79,11 +79,11 @@ func (suite *KeeperTestSuite) TestKeeper_GetProfiles() { { name: "non empty profiles list is returned properly", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") + profile := profilestesting.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, expProfiles: []*types.Profile{ - testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + profilestesting.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), }, }, { @@ -129,7 +129,7 @@ func (suite *KeeperTestSuite) TestKeeper_IterateUserIncomingDTagTransferRequests } for _, request := range requests { - profile := testutil.ProfileFromAddr(address) + profile := profilestesting.ProfileFromAddr(address) err := suite.k.SaveProfile(suite.ctx, profile) suite.Require().NoError(err) @@ -194,7 +194,7 @@ func (suite *KeeperTestSuite) TestKeeper_IterateUserApplicationLinks() { 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) @@ -256,7 +256,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetApplicationLinks() { 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) @@ -291,7 +291,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetChainLinks() { types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), - types.NewProof(pub1, testutil.SingleSignatureProtoFromHex("1234"), "plain_text"), + types.NewProof(pub1, profilestesting.SingleSignatureProtoFromHex("1234"), "plain_text"), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), @@ -304,7 +304,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetChainLinks() { types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", "cosmos"), - types.NewProof(pub2, testutil.SingleSignatureProtoFromHex("1234"), "plain_text"), + types.NewProof(pub2, profilestesting.SingleSignatureProtoFromHex("1234"), "plain_text"), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), @@ -315,14 +315,14 @@ func (suite *KeeperTestSuite) TestKeeper_GetChainLinks() { types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), - types.NewProof(pub1, testutil.SingleSignatureProtoFromHex("1234"), "plain_text"), + types.NewProof(pub1, profilestesting.SingleSignatureProtoFromHex("1234"), "plain_text"), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", "cosmos"), - types.NewProof(pub2, testutil.SingleSignatureProtoFromHex("1234"), "plain_text"), + types.NewProof(pub2, profilestesting.SingleSignatureProtoFromHex("1234"), "plain_text"), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), diff --git a/x/profiles/keeper/genesis_test.go b/x/profiles/keeper/genesis_test.go index caa90503aa..b279a643c4 100644 --- a/x/profiles/keeper/genesis_test.go +++ b/x/profiles/keeper/genesis_test.go @@ -4,7 +4,7 @@ import ( "encoding/hex" "time" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -13,7 +13,7 @@ import ( ) func (suite *KeeperTestSuite) Test_ExportGenesis() { - chainLinkAccount := testutil.GetChainLinkAccount("cosmos", "cosmos") + chainLinkAccount := profilestesting.GetChainLinkAccount("cosmos", "cosmos") testCases := []struct { name string store func(ctx sdk.Context) @@ -36,8 +36,8 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { name: "non-empty state", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") - otherProfile := testutil.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns") + profile := profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") + otherProfile := profilestesting.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns") err := suite.k.SaveProfile(suite.ctx, profile) suite.Require().NoError(err) @@ -76,7 +76,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { ), } for _, link := range chainLinks { - suite.ak.SetAccount(ctx, testutil.ProfileFromAddr(link.User)) + suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr(link.User)) suite.Require().NoError(suite.k.SaveChainLink(ctx, link)) } @@ -96,7 +96,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { ), } for _, link := range applicationLinks { - suite.ak.SetAccount(ctx, testutil.ProfileFromAddr(link.User)) + suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr(link.User)) suite.Require().NoError(suite.k.SaveApplicationLink(ctx, link)) } }, @@ -194,14 +194,14 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address(ext.GetAddress().String(), "cosmos"), - types.NewProof(ext.GetPubKey(), testutil.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign(ext.GetAddress()))), hex.EncodeToString([]byte(ext.GetAddress().String()))), + types.NewProof(ext.GetPubKey(), profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign(ext.GetAddress()))), hex.EncodeToString([]byte(ext.GetAddress().String()))), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address(ext.GetAddress().String(), "cosmos"), - types.NewProof(ext.GetPubKey(), testutil.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign(ext.GetAddress()))), hex.EncodeToString([]byte(ext.GetAddress().String()))), + types.NewProof(ext.GetPubKey(), profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign(ext.GetAddress()))), hex.EncodeToString([]byte(ext.GetAddress().String()))), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), @@ -213,10 +213,10 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { { name: "valid genesis does not panic", store: func(ctx sdk.Context) { - profile1 := testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") + profile1 := profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") suite.ak.SetAccount(ctx, profile1) - profile2 := testutil.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns") + profile2 := profilestesting.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns") suite.ak.SetAccount(ctx, profile2) err := suite.k.SaveProfile(suite.ctx, profile1) @@ -254,7 +254,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { types.NewBech32Address(ext.GetAddress().String(), "cosmos"), types.NewProof( ext.GetPubKey(), - testutil.SingleSignatureProtoFromHex( + profilestesting.SingleSignatureProtoFromHex( hex.EncodeToString(ext.Sign([]byte("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))), ), hex.EncodeToString([]byte("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47")), @@ -310,7 +310,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { types.NewBech32Address(ext.GetAddress().String(), "cosmos"), types.NewProof( ext.GetPubKey(), - testutil.SingleSignatureProtoFromHex( + profilestesting.SingleSignatureProtoFromHex( hex.EncodeToString(ext.Sign([]byte("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))), ), hex.EncodeToString([]byte("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47")), diff --git a/x/profiles/keeper/grpc_query_test.go b/x/profiles/keeper/grpc_query_test.go index 8bb8dbdc5e..1bfc0f9863 100644 --- a/x/profiles/keeper/grpc_query_test.go +++ b/x/profiles/keeper/grpc_query_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "time" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" @@ -38,27 +38,27 @@ func (suite *KeeperTestSuite) TestQueryServer_Profile() { { name: "found profile using DTag", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") + profile := profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") err := suite.k.SaveProfile(ctx, profile) suite.Require().NoError(err) }, req: types.NewQueryProfileRequest("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x-dtag"), shouldErr: false, expResponse: &types.QueryProfileResponse{ - Profile: testutil.NewAny(testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), + Profile: profilestesting.NewAny(profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), }, }, { name: "found profile using address", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") + profile := profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") err := suite.k.SaveProfile(ctx, profile) suite.Require().NoError(err) }, req: types.NewQueryProfileRequest("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x"), shouldErr: false, expResponse: &types.QueryProfileResponse{ - Profile: testutil.NewAny(testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), + Profile: profilestesting.NewAny(profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), }, }, } @@ -104,7 +104,7 @@ func (suite *KeeperTestSuite) TestQueryServer_IncomingDTagTransferRequests() { "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) request = types.NewDTagTransferRequest( @@ -112,7 +112,7 @@ func (suite *KeeperTestSuite) TestQueryServer_IncomingDTagTransferRequests() { "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) }, req: types.NewQueryIncomingDTagTransferRequestsRequest( @@ -132,7 +132,7 @@ func (suite *KeeperTestSuite) TestQueryServer_IncomingDTagTransferRequests() { name: "valid request with pagination", store: func(ctx sdk.Context) { receiver := "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x" - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(receiver))) request := types.NewDTagTransferRequest( "dtag", @@ -165,10 +165,10 @@ func (suite *KeeperTestSuite) TestQueryServer_IncomingDTagTransferRequests() { name: "valid request without user", store: func(ctx sdk.Context) { receiver1 := "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x" - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(receiver1))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(receiver1))) receiver2 := "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773" - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(receiver2))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(receiver2))) request := types.NewDTagTransferRequest( "dtag", @@ -239,8 +239,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -255,8 +255,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos19s242dxhxgzlsdmfjjg38jgfwhxca7569g84sw", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -277,8 +277,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos19s242dxhxgzlsdmfjjg38jgfwhxca7569g84sw", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -288,8 +288,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -305,8 +305,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -321,8 +321,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos19s242dxhxgzlsdmfjjg38jgfwhxca7569g84sw", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -337,8 +337,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos19s242dxhxgzlsdmfjjg38jgfwhxca7569g84sw", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("likecoin"), @@ -361,8 +361,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos19s242dxhxgzlsdmfjjg38jgfwhxca7569g84sw", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -372,8 +372,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -389,8 +389,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -405,8 +405,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos19s242dxhxgzlsdmfjjg38jgfwhxca7569g84sw", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -429,8 +429,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos19s242dxhxgzlsdmfjjg38jgfwhxca7569g84sw", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -447,8 +447,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -463,8 +463,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos19s242dxhxgzlsdmfjjg38jgfwhxca7569g84sw", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -486,8 +486,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos19s242dxhxgzlsdmfjjg38jgfwhxca7569g84sw", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), @@ -519,8 +519,8 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { } func (suite *KeeperTestSuite) TestQueryServer_ChainLinkOwners() { - firstAccount := testutil.GetChainLinkAccount("cosmos", "cosmos") - secondAccount := testutil.GetChainLinkAccount("likecoin", "cosmos") + firstAccount := profilestesting.GetChainLinkAccount("cosmos", "cosmos") + secondAccount := profilestesting.GetChainLinkAccount("likecoin", "cosmos") testCases := []struct { name string @@ -532,7 +532,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinkOwners() { { name: "query without any data returns everything", store: func(ctx sdk.Context) { - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) suite.Require().NoError(suite.k.SaveChainLink(ctx, firstAccount.GetBech32ChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), @@ -560,7 +560,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinkOwners() { { name: "query with chain name returns the correct data", store: func(ctx sdk.Context) { - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) suite.Require().NoError(suite.k.SaveChainLink(ctx, firstAccount.GetBech32ChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), @@ -583,7 +583,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinkOwners() { { name: "query with chain name and target returns the correct data", store: func(ctx sdk.Context) { - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) suite.Require().NoError(suite.k.SaveChainLink(ctx, firstAccount.GetBech32ChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), @@ -641,7 +641,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { { name: "valid request with application", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") + profile := profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") suite.ak.SetAccount(ctx, profile) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -712,7 +712,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { { name: "valid request with application and username", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") + profile := profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") suite.ak.SetAccount(ctx, profile) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -783,7 +783,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { { name: "valid request without pagination", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") + profile := profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") suite.ak.SetAccount(ctx, profile) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -868,7 +868,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { { name: "valid paginated request returns proper response", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") + profile := profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") suite.ak.SetAccount(ctx, profile) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -973,7 +973,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkByClientID() { { name: "valid request returns proper response", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") + profile := profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") suite.ak.SetAccount(ctx, profile) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -1047,7 +1047,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { { name: "query without any data returns everything", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") + profile := profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") suite.ak.SetAccount(ctx, profile) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -1070,7 +1070,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { )), ) - profile = testutil.ProfileFromAddr("cosmos1ngzeux3j0vfkps0779y0c8pnrmszlg0hekp5um") + profile = profilestesting.ProfileFromAddr("cosmos1ngzeux3j0vfkps0779y0c8pnrmszlg0hekp5um") suite.ak.SetAccount(ctx, profile) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -1111,7 +1111,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { { name: "query with application returns the correct data", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") + profile := profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") suite.ak.SetAccount(ctx, profile) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -1134,7 +1134,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { )), ) - profile = testutil.ProfileFromAddr("cosmos1ngzeux3j0vfkps0779y0c8pnrmszlg0hekp5um") + profile = profilestesting.ProfileFromAddr("cosmos1ngzeux3j0vfkps0779y0c8pnrmszlg0hekp5um") suite.ak.SetAccount(ctx, profile) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -1157,7 +1157,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { )), ) - profile = testutil.ProfileFromAddr("cosmos1pxsak5c7ke5tz3d8alawuzu3cayr9s65ce7njr") + profile = profilestesting.ProfileFromAddr("cosmos1pxsak5c7ke5tz3d8alawuzu3cayr9s65ce7njr") suite.ak.SetAccount(ctx, profile) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -1198,7 +1198,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { { name: "query with application and username returns the correct data", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") + profile := profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47") suite.ak.SetAccount(ctx, profile) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -1221,7 +1221,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { )), ) - profile = testutil.ProfileFromAddr("cosmos1ngzeux3j0vfkps0779y0c8pnrmszlg0hekp5um") + profile = profilestesting.ProfileFromAddr("cosmos1ngzeux3j0vfkps0779y0c8pnrmszlg0hekp5um") suite.ak.SetAccount(ctx, profile) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -1244,7 +1244,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { )), ) - profile = testutil.ProfileFromAddr("cosmos1mrmyggajlv0k3mlrhergjjnt75srn5y5u5a83x") + profile = profilestesting.ProfileFromAddr("cosmos1mrmyggajlv0k3mlrhergjjnt75srn5y5u5a83x") suite.ak.SetAccount(ctx, profile) suite.Require().NoError(suite.k.SaveApplicationLink( diff --git a/x/profiles/keeper/invariants_test.go b/x/profiles/keeper/invariants_test.go index 569cb9eee7..c53978c6f1 100644 --- a/x/profiles/keeper/invariants_test.go +++ b/x/profiles/keeper/invariants_test.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -32,7 +32,7 @@ func (suite *KeeperTestSuite) TestInvariants() { store: func(ctx sdk.Context) { profile, err := types.NewProfileFromAccount( "", - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), time.Now(), ) suite.Require().NoError(err) @@ -83,7 +83,7 @@ func (suite *KeeperTestSuite) TestInvariants() { link := types.NewChainLink( "user", types.NewBech32Address("value", "prefix"), - types.NewProof(key, testutil.SingleSignatureProtoFromHex("1234"), "value"), + types.NewProof(key, profilestesting.SingleSignatureProtoFromHex("1234"), "value"), types.NewChainConfig("chain_name"), time.Now(), ) diff --git a/x/profiles/keeper/keeper_app_links_test.go b/x/profiles/keeper/keeper_app_links_test.go index fb71f4f277..1b27d58115 100644 --- a/x/profiles/keeper/keeper_app_links_test.go +++ b/x/profiles/keeper/keeper_app_links_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "time" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" sdk "github.com/cosmos/cosmos-sdk/types" @@ -38,7 +38,7 @@ func (suite *KeeperTestSuite) Test_SaveApplicationLink() { { name: "correct requests returns no error", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") + profile := profilestesting.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, link: types.NewApplicationLink( @@ -123,7 +123,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { time.Date(2020, 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) }, @@ -150,7 +150,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { time.Date(2020, 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) }, @@ -177,7 +177,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { time.Date(2020, 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) }, @@ -204,7 +204,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { time.Date(2020, 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) }, @@ -280,7 +280,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLinkByClientID() { time.Date(2020, 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) @@ -351,7 +351,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { time.Date(2020, 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) }, @@ -394,7 +394,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { time.Date(2020, 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) }, @@ -437,7 +437,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { time.Date(2020, 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) }, @@ -480,7 +480,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { time.Date(2020, 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) }, diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index b3a5c59a81..6a7bb2b7a4 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -4,7 +4,7 @@ import ( "encoding/hex" "time" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -28,10 +28,10 @@ func (suite *KeeperTestSuite) TestKeeper_SaveChainLink() { { name: "invalid chain address packed value returns error", link: types.ChainLink{ - Address: testutil.NewAny(ext.privKey), + Address: profilestesting.NewAny(ext.privKey), Proof: types.NewProof( ext.GetPubKey(), - testutil.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("")))), + profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("")))), hex.EncodeToString([]byte("")), ), ChainConfig: types.NewChainConfig("cosmos"), @@ -46,7 +46,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveChainLink() { types.NewBech32Address("", "cosmos"), types.NewProof( ext.GetPubKey(), - testutil.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), + profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), hex.EncodeToString([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), ), types.NewChainConfig("cosmos"), @@ -61,7 +61,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveChainLink() { types.NewBech32Address(ext.GetAddress().String(), "cosmos"), types.NewProof( ext.GetPubKey(), - testutil.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), + profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), "wrong", ), types.NewChainConfig("cosmos"), @@ -73,7 +73,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveChainLink() { name: "link already existing returns error", store: func(ctx sdk.Context) { address := "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x" - profile := testutil.ProfileFromAddr(address) + profile := profilestesting.ProfileFromAddr(address) suite.ak.SetAccount(ctx, profile) link := types.NewChainLink( @@ -81,7 +81,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveChainLink() { types.NewBech32Address(ext.GetAddress().String(), "cosmos"), types.NewProof( ext.GetPubKey(), - testutil.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), + profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), hex.EncodeToString([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), ), types.NewChainConfig("cosmos"), @@ -94,7 +94,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveChainLink() { types.NewBech32Address(ext.GetAddress().String(), "cosmos"), types.NewProof( ext.GetPubKey(), - testutil.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), + profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), hex.EncodeToString([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), ), types.NewChainConfig("cosmos"), @@ -109,7 +109,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveChainLink() { types.NewBech32Address(ext.GetAddress().String(), "cosmos"), types.NewProof( ext.GetPubKey(), - testutil.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), + profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), hex.EncodeToString([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), ), types.NewChainConfig("cosmos"), @@ -124,7 +124,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveChainLink() { types.NewBech32Address(ext.GetAddress().String(), "cosmos"), types.NewProof( ext.GetPubKey(), - testutil.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), + profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), hex.EncodeToString([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), ), types.NewChainConfig("cosmos"), @@ -139,7 +139,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveChainLink() { types.NewBech32Address(ext.GetAddress().String(), "cosmos"), types.NewProof( ext.GetPubKey(), - testutil.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), + profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), hex.EncodeToString([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), ), types.NewChainConfig("cosmos"), @@ -150,7 +150,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveChainLink() { { name: "valid conditions return no error", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") + profile := profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") err := suite.k.SaveProfile(ctx, profile) suite.Require().NoError(err) }, @@ -159,7 +159,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveChainLink() { types.NewBech32Address(ext.GetAddress().String(), "cosmos"), types.NewProof( ext.GetPubKey(), - testutil.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), + profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), hex.EncodeToString([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), ), types.NewChainConfig("cosmos"), @@ -174,7 +174,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveChainLink() { types.NewBech32Address(ext.GetAddress().String(), "cosmos"), types.NewProof( ext.GetPubKey(), - testutil.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), + profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), hex.EncodeToString([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), ), types.NewChainConfig("cosmos"), @@ -237,7 +237,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetChainLink() { link := types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), - types.NewProof(secp256k1.GenPrivKey().PubKey(), testutil.SingleSignatureProtoFromHex("1234"), "706c61696e5f74657874"), + types.NewProof(secp256k1.GenPrivKey().PubKey(), profilestesting.SingleSignatureProtoFromHex("1234"), "706c61696e5f74657874"), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ) @@ -269,7 +269,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetChainLink() { } func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { - account := testutil.GetChainLinkAccount("cosmos", "cosmos") + account := profilestesting.GetChainLinkAccount("cosmos", "cosmos") testCases := []struct { name string store func(ctx sdk.Context) @@ -279,7 +279,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { { name: "different user does not delete link", store: func(ctx sdk.Context) { - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x"))) err := suite.k.SaveChainLink(ctx, account.GetBech32ChainLink( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), @@ -304,7 +304,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { { name: "different chain name does not delete link", store: func(ctx sdk.Context) { - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x"))) err := suite.k.SaveChainLink(ctx, account.GetBech32ChainLink( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), @@ -329,7 +329,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { { name: "different external address does not delete the link", store: func(ctx sdk.Context) { - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x"))) err := suite.k.SaveChainLink(ctx, account.GetBech32ChainLink( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), @@ -354,7 +354,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { { name: "proper data delete the link", store: func(ctx sdk.Context) { - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x"))) err := suite.k.SaveChainLink(ctx, account.GetBech32ChainLink( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), @@ -437,7 +437,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteAllUserChainLinks() { link := types.NewChainLink( user, types.NewBech32Address("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", "cosmos"), - types.NewProof(key, testutil.SingleSignatureProtoFromHex("1234"), "706c61696e74657874"), + types.NewProof(key, profilestesting.SingleSignatureProtoFromHex("1234"), "706c61696e74657874"), types.NewChainConfig("cosmos"), time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ) @@ -449,7 +449,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteAllUserChainLinks() { link = types.NewChainLink( user, types.NewBech32Address("cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn", "cosmos"), - types.NewProof(key, testutil.SingleSignatureProtoFromHex("1234"), "706c61696e74657874"), + types.NewProof(key, profilestesting.SingleSignatureProtoFromHex("1234"), "706c61696e74657874"), types.NewChainConfig("cosmos"), time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ) diff --git a/x/profiles/keeper/keeper_dtag_transfers_test.go b/x/profiles/keeper/keeper_dtag_transfers_test.go index db2999706f..8344936f30 100644 --- a/x/profiles/keeper/keeper_dtag_transfers_test.go +++ b/x/profiles/keeper/keeper_dtag_transfers_test.go @@ -3,7 +3,7 @@ package keeper_test import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" "github.com/desmos-labs/desmos/v3/x/profiles/types" ) @@ -24,7 +24,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveDTagTransferRequest() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) }, transferReq: types.NewDTagTransferRequest( @@ -42,7 +42,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveDTagTransferRequest() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) }, transferReq: types.NewDTagTransferRequest( @@ -60,10 +60,10 @@ func (suite *KeeperTestSuite) TestKeeper_SaveDTagTransferRequest() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn"))) }, transferReq: types.NewDTagTransferRequest( "dtag", @@ -95,10 +95,10 @@ func (suite *KeeperTestSuite) TestKeeper_SaveDTagTransferRequest() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn"))) }, transferReq: types.NewDTagTransferRequest( "dtag", @@ -126,7 +126,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveDTagTransferRequest() { name: "not already present request is saved correctly", store: func(ctx sdk.Context) { receiver := "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns" - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(receiver))) }, transferReq: types.NewDTagTransferRequest( "dtag", @@ -186,7 +186,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetDTagTransferRequest() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) }, sender: "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", @@ -238,7 +238,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetDTagTransferRequests() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) }, expReqs: []types.DTagTransferRequest{ @@ -284,7 +284,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteDTagTransferRequest() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) }, sender: "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", @@ -298,7 +298,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteDTagTransferRequest() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) }, sender: "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", @@ -335,10 +335,10 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteAllUserIncomingDTagTransferReques { name: "DTag requests are deleted properly", store: func(ctx sdk.Context) { - profile1 := testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") + profile1 := profilestesting.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") suite.Require().NoError(suite.k.SaveProfile(ctx, profile1)) - profile2 := testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") + profile2 := profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") suite.Require().NoError(suite.k.SaveProfile(ctx, profile2)) request := types.NewDTagTransferRequest( diff --git a/x/profiles/keeper/keeper_test.go b/x/profiles/keeper/keeper_test.go index 40e6041216..50a178bb15 100644 --- a/x/profiles/keeper/keeper_test.go +++ b/x/profiles/keeper/keeper_test.go @@ -4,7 +4,7 @@ import ( "strings" "time" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" sdk "github.com/cosmos/cosmos-sdk/types" @@ -22,7 +22,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveProfile() { { name: "existent profile with different creator returns error", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") + profile := profilestesting.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") profile.DTag = "DTag" suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, @@ -32,14 +32,14 @@ func (suite *KeeperTestSuite) TestKeeper_SaveProfile() { "", types.NewPictures("", ""), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - testutil.AccountFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), + profilestesting.AccountFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), ), shouldErr: true, }, { name: "existing profile is updated correctly", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") + profile := profilestesting.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") profile.DTag = "Old DTag" suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) @@ -51,7 +51,7 @@ func (suite *KeeperTestSuite) TestKeeper_SaveProfile() { ) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) }, - profile: testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + profile: profilestesting.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), shouldErr: false, check: func(ctx sdk.Context) { profile, found, err := suite.k.GetProfile(ctx, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") @@ -104,13 +104,13 @@ func (suite *KeeperTestSuite) TestKeeper_GetProfile() { { name: "found profile is returned properly", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") + profile := profilestesting.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, address: "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", shouldErr: false, expFound: true, - expProfile: testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + expProfile: profilestesting.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), }, { name: "not found profile returns no error", @@ -153,7 +153,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetAddressFromDTag() { { name: "valid profile returns correct address", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") + profile := profilestesting.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") profile.DTag = "DTag" suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, @@ -197,7 +197,7 @@ func (suite *KeeperTestSuite) TestKeeper_RemoveProfile() { { name: "found profile is deleted properly", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") + profile := profilestesting.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, address: "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", @@ -249,7 +249,7 @@ func (suite *KeeperTestSuite) TestKeeper_ValidateProfile() { "https://tc.com/cover-pic", ), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - testutil.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + profilestesting.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), )), shouldErr: true, }, @@ -265,7 +265,7 @@ func (suite *KeeperTestSuite) TestKeeper_ValidateProfile() { ), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - testutil.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + profilestesting.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), )), shouldErr: true, }, @@ -281,7 +281,7 @@ func (suite *KeeperTestSuite) TestKeeper_ValidateProfile() { ), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - testutil.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + profilestesting.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), )), shouldErr: true, }, @@ -296,7 +296,7 @@ func (suite *KeeperTestSuite) TestKeeper_ValidateProfile() { "https://tc.com/cover-pic", ), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - testutil.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + profilestesting.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), )), shouldErr: true, }, @@ -311,7 +311,7 @@ func (suite *KeeperTestSuite) TestKeeper_ValidateProfile() { "https://tc.com/cover-pic", ), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - testutil.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + profilestesting.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), )), shouldErr: true, }, @@ -326,7 +326,7 @@ func (suite *KeeperTestSuite) TestKeeper_ValidateProfile() { "https://tc.com/cover-pic", ), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - testutil.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + profilestesting.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), )), shouldErr: true, }, @@ -341,7 +341,7 @@ func (suite *KeeperTestSuite) TestKeeper_ValidateProfile() { "htts://tc.com/cover-pic", ), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - testutil.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + profilestesting.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), )), shouldErr: true, }, @@ -356,7 +356,7 @@ func (suite *KeeperTestSuite) TestKeeper_ValidateProfile() { "https://tc.com/cover-pic", ), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - testutil.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + profilestesting.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), )), shouldErr: false, }, diff --git a/x/profiles/keeper/msg_server_chain_link_test.go b/x/profiles/keeper/msg_server_chain_link_test.go index 833a1f34c7..2612c021cd 100644 --- a/x/profiles/keeper/msg_server_chain_link_test.go +++ b/x/profiles/keeper/msg_server_chain_link_test.go @@ -4,7 +4,7 @@ import ( "encoding/hex" "time" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -51,7 +51,7 @@ func (suite *KeeperTestSuite) TestMsgServer_LinkChainAccount() { name: "invalid chain link returns error", msg: types.NewMsgLinkChainAccount( types.NewBech32Address(srcAddr, "cosmos"), - types.NewProof(srcPubKey, testutil.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(srcAddr))), + types.NewProof(srcPubKey, profilestesting.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(srcAddr))), types.NewChainConfig("cosmos"), destAddr, ), @@ -61,8 +61,8 @@ func (suite *KeeperTestSuite) TestMsgServer_LinkChainAccount() { { name: "invalid chain address packed value returns error", msg: &types.MsgLinkChainAccount{ - ChainAddress: testutil.NewAny(srcPriv), - Proof: types.NewProof(srcPubKey, testutil.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(srcAddr))), + ChainAddress: profilestesting.NewAny(srcPriv), + Proof: types.NewProof(srcPubKey, profilestesting.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(srcAddr))), ChainConfig: types.NewChainConfig("cosmos"), Signer: destAddr, }, @@ -101,7 +101,7 @@ func (suite *KeeperTestSuite) TestMsgServer_LinkChainAccount() { }, msg: types.NewMsgLinkChainAccount( types.NewBech32Address(srcAddr, "cosmos"), - types.NewProof(srcPubKey, testutil.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(destAddr))), + types.NewProof(srcPubKey, profilestesting.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(destAddr))), types.NewChainConfig("cosmos"), destAddr, ), @@ -185,8 +185,8 @@ func (suite *KeeperTestSuite) TestMsgServer_UnlinkChainAccount() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), diff --git a/x/profiles/keeper/msg_server_dtag_transfers_test.go b/x/profiles/keeper/msg_server_dtag_transfers_test.go index 3c7d3e40c8..5ea82afc5a 100644 --- a/x/profiles/keeper/msg_server_dtag_transfers_test.go +++ b/x/profiles/keeper/msg_server_dtag_transfers_test.go @@ -5,7 +5,7 @@ import ( relationshipstypes "github.com/desmos-labs/desmos/v3/x/relationships/types" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" sdk "github.com/cosmos/cosmos-sdk/types" @@ -25,9 +25,9 @@ func (suite *KeeperTestSuite) TestMsgServer_RequestDTagTransfer() { name: "blocked receiver making request returns error", store: func(ctx sdk.Context) { suite.Require().NoError(suite.k.SaveProfile(ctx, - testutil.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"))) + profilestesting.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"))) suite.Require().NoError(suite.k.SaveProfile(ctx, - testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) + profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) suite.rk.SaveUserBlock(ctx, relationshipstypes.NewUserBlock( "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", @@ -57,7 +57,7 @@ func (suite *KeeperTestSuite) TestMsgServer_RequestDTagTransfer() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) }, msg: types.NewMsgRequestDTagTransfer( @@ -69,7 +69,7 @@ func (suite *KeeperTestSuite) TestMsgServer_RequestDTagTransfer() { { name: "not already present request is saved correctly", store: func(ctx sdk.Context) { - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"))) }, msg: types.NewMsgRequestDTagTransfer( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", @@ -137,7 +137,7 @@ func (suite *KeeperTestSuite) TestMsgServer_CancelDTagTransfer() { "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) }, msg: types.NewMsgCancelDTagTransferRequest( @@ -229,11 +229,11 @@ func (suite *KeeperTestSuite) TestMsgServer_AcceptDTagTransfer() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Sender))) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Sender))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) - profile := testutil.ProfileFromAddr("cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn") + profile := profilestesting.ProfileFromAddr("cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn") profile.DTag = "NewDTag" suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, @@ -252,11 +252,11 @@ func (suite *KeeperTestSuite) TestMsgServer_AcceptDTagTransfer() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Sender))) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Sender))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) - profile := testutil.ProfileFromAddr("cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn") + profile := profilestesting.ProfileFromAddr("cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn") profile.DTag = "dtag" suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, @@ -277,7 +277,7 @@ func (suite *KeeperTestSuite) TestMsgServer_AcceptDTagTransfer() { "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - receiverProfile := testutil.ProfileFromAddr(request.Receiver) + receiverProfile := profilestesting.ProfileFromAddr(request.Receiver) receiverProfile.DTag = "DTag" suite.Require().NoError(suite.k.SaveProfile(ctx, receiverProfile)) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) @@ -312,9 +312,9 @@ func (suite *KeeperTestSuite) TestMsgServer_AcceptDTagTransfer() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - receiverProfile := testutil.ProfileFromAddr(request.Receiver) + receiverProfile := profilestesting.ProfileFromAddr(request.Receiver) receiverProfile.DTag = "DTag" - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Sender))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Sender))) suite.Require().NoError(suite.k.SaveProfile(ctx, receiverProfile)) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) }, @@ -347,9 +347,9 @@ func (suite *KeeperTestSuite) TestMsgServer_AcceptDTagTransfer() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - receiverProfile := testutil.ProfileFromAddr(request.Receiver) + receiverProfile := profilestesting.ProfileFromAddr(request.Receiver) receiverProfile.DTag = "receiverDTag" - senderProfile := testutil.ProfileFromAddr(request.Sender) + senderProfile := profilestesting.ProfileFromAddr(request.Sender) senderProfile.DTag = "senderDTag" suite.Require().NoError(suite.k.SaveProfile(ctx, senderProfile)) suite.Require().NoError(suite.k.SaveProfile(ctx, receiverProfile)) @@ -434,7 +434,7 @@ func (suite *KeeperTestSuite) TestMsgServer_RefuseDTagTransfer() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr(request.Receiver))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(request.Receiver))) suite.Require().NoError(suite.k.SaveDTagTransferRequest(ctx, request)) }, msg: types.NewMsgRefuseDTagTransferRequest( diff --git a/x/profiles/keeper/msgs_server_profile_test.go b/x/profiles/keeper/msgs_server_profile_test.go index 812ccc652a..79ae89f51a 100644 --- a/x/profiles/keeper/msgs_server_profile_test.go +++ b/x/profiles/keeper/msgs_server_profile_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "time" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" "github.com/desmos-labs/desmos/v3/x/profiles/keeper" @@ -25,7 +25,7 @@ func (suite *KeeperTestSuite) TestMsgServer_SaveProfile() { { name: "profile saved (with no previous profile created)", store: func(ctx sdk.Context) { - suite.ak.SetAccount(ctx, testutil.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773")) + suite.ak.SetAccount(ctx, profilestesting.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773")) }, msg: types.NewMsgSaveProfile( "custom_dtag", @@ -68,7 +68,7 @@ func (suite *KeeperTestSuite) TestMsgServer_SaveProfile() { "https://tc.com/old-cover-pic", ), blockTime, - testutil.AccountFromAddr(address), + profilestesting.AccountFromAddr(address), )) suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, @@ -114,7 +114,7 @@ func (suite *KeeperTestSuite) TestMsgServer_SaveProfile() { "https://tc.com/old-cover-pic", ), blockTime, - testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + profilestesting.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), )) suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, @@ -160,7 +160,7 @@ func (suite *KeeperTestSuite) TestMsgServer_SaveProfile() { "https://tc.com/cover-pic", ), blockTime, - testutil.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + profilestesting.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), )) suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, @@ -198,7 +198,7 @@ func (suite *KeeperTestSuite) TestMsgServer_SaveProfile() { "https://tc.com/cover-pic", ), blockTime, - testutil.AccountFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), + profilestesting.AccountFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), )) suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, @@ -241,7 +241,7 @@ func (suite *KeeperTestSuite) TestMsgServer_SaveProfile() { "", types.NewPictures("", ""), blockTime, - testutil.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + profilestesting.AccountFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), )) suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, @@ -302,7 +302,7 @@ func (suite *KeeperTestSuite) TestMsgServer_DeleteProfile() { { name: "existent profile is deleted successfully", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") + profile := profilestesting.ProfileFromAddr("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773") suite.Require().NoError(suite.k.SaveProfile(ctx, profile)) }, msg: types.NewMsgDeleteProfile("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), diff --git a/x/profiles/keeper/relay_app_links_test.go b/x/profiles/keeper/relay_app_links_test.go index fa678f0e46..4f9d644bde 100644 --- a/x/profiles/keeper/relay_app_links_test.go +++ b/x/profiles/keeper/relay_app_links_test.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" "github.com/desmos-labs/desmos/v3/pkg/obi" @@ -140,7 +140,7 @@ func (suite *KeeperTestSuite) TestKeeper_StartProfileConnection() { callData = "call_data" }, storeChainA: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr(suite.chainA.Account.GetAddress().String()) + profile := profilestesting.ProfileFromAddr(suite.chainA.Account.GetAddress().String()) suite.chainA.App.AccountKeeper.SetAccount(ctx, profile) }, expPass: true, @@ -217,7 +217,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { { name: "resolve status expired updates connection properly", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") + profile := profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") suite.ak.SetAccount(ctx, profile) link := types.NewApplicationLink( @@ -260,7 +260,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { { name: "resolve status failure updates connection properly", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") + profile := profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") suite.ak.SetAccount(ctx, profile) link := types.NewApplicationLink( @@ -303,7 +303,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { { name: "wrongly encoded result returns error", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") + profile := profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") suite.ak.SetAccount(ctx, profile) link := types.NewApplicationLink( @@ -333,7 +333,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { { name: "different returned value (username) updates correctly", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") + profile := profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") suite.ak.SetAccount(ctx, profile) link := types.NewApplicationLink( @@ -376,7 +376,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { { name: "wrongly encoded result signature error", store: func(ctx sdk.Context) { - profile := testutil.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") + profile := profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") suite.ak.SetAccount(ctx, profile) link := types.NewApplicationLink( @@ -653,7 +653,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestAcknowledgementPacket() time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ) - suite.ak.SetAccount(ctx, testutil.ProfileFromAddr(address)) + suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr(address)) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) }, @@ -692,7 +692,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestAcknowledgementPacket() time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ) - suite.ak.SetAccount(ctx, testutil.ProfileFromAddr(address)) + suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr(address)) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) }, @@ -718,7 +718,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestAcknowledgementPacket() time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ) - suite.ak.SetAccount(ctx, testutil.ProfileFromAddr(address)) + suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr(address)) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) }, @@ -794,7 +794,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestTimeoutPacket() { time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ) - suite.ak.SetAccount(ctx, testutil.ProfileFromAddr(address)) + suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr(address)) suite.Require().NoError(suite.k.SaveApplicationLink(ctx, link)) }, data: createRequestPacketData("client_id"), diff --git a/x/profiles/keeper/relay_chain_links_test.go b/x/profiles/keeper/relay_chain_links_test.go index c186cbc5d5..fdf33b20b0 100644 --- a/x/profiles/keeper/relay_chain_links_test.go +++ b/x/profiles/keeper/relay_chain_links_test.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" "github.com/desmos-labs/desmos/v3/x/profiles/types" ) @@ -33,14 +33,14 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { SourceAddress: nil, SourceProof: types.NewProof( suite.chainA.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(srcSigHex), + profilestesting.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(destAddr)), ), SourceChainConfig: types.NewChainConfig("cosmos"), DestinationAddress: destAddr, DestinationProof: types.NewProof( suite.chainB.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(destSigHex), + profilestesting.SingleSignatureProtoFromHex(destSigHex), hex.EncodeToString([]byte(srcAddr)), ), } @@ -56,14 +56,14 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { SourceAddress: invalidAny, SourceProof: types.NewProof( suite.chainA.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(srcSigHex), + profilestesting.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(destAddr)), ), SourceChainConfig: types.NewChainConfig("cosmos"), DestinationAddress: destAddr, DestinationProof: types.NewProof( suite.chainB.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(destSigHex), + profilestesting.SingleSignatureProtoFromHex(destSigHex), hex.EncodeToString([]byte(srcAddr)), ), } @@ -77,14 +77,14 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewBech32Address(srcAddr, "cosmos"), types.NewProof( suite.chainA.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(srcSigHex), + profilestesting.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(destAddr)), ), types.NewChainConfig("cosmos"), "cosmos1asdjlansdjhasd", types.NewProof( suite.chainB.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(destSigHex), + profilestesting.SingleSignatureProtoFromHex(destSigHex), hex.EncodeToString([]byte(srcAddr)), ), ) @@ -98,14 +98,14 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewBech32Address(srcAddr, "cosmos"), types.NewProof( suite.chainA.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(srcSigHex), + profilestesting.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(destAddr)), ), types.NewChainConfig("cosmos"), destAddr, types.NewProof( suite.chainB.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(destSigHex), + profilestesting.SingleSignatureProtoFromHex(destSigHex), hex.EncodeToString([]byte(srcAddr)), ), ) @@ -119,14 +119,14 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewBech32Address(srcAddr, "cosmos"), types.NewProof( suite.chainA.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(srcSigHex), + profilestesting.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(destAddr)), ), types.NewChainConfig("cosmos"), destAddr, types.NewProof( suite.chainB.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(destSigHex), + profilestesting.SingleSignatureProtoFromHex(destSigHex), hex.EncodeToString([]byte(srcAddr)), ), ) @@ -160,7 +160,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewBech32Address(srcAddr, "cosmos"), types.NewProof( suite.chainA.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(srcSigHex), + profilestesting.SingleSignatureProtoFromHex(srcSigHex), "696e76616c6964", ), types.NewChainConfig( @@ -169,7 +169,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { destAddr, types.NewProof( suite.chainB.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(destSigHex), + profilestesting.SingleSignatureProtoFromHex(destSigHex), hex.EncodeToString([]byte(srcAddr)), ), ) @@ -203,7 +203,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewBech32Address(srcAddr, "cosmos"), types.NewProof( suite.chainA.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(srcSigHex), + profilestesting.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(destAddr)), ), types.NewChainConfig( @@ -212,7 +212,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { destAddr, types.NewProof( suite.chainB.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(destSigHex), + profilestesting.SingleSignatureProtoFromHex(destSigHex), "696e76616c6964", ), ) @@ -246,7 +246,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewBech32Address(srcAddr, "cosmos"), types.NewProof( suite.chainA.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(srcSigHex), + profilestesting.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(destAddr)), ), types.NewChainConfig( @@ -255,7 +255,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { destAddr, types.NewProof( suite.chainB.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(destSigHex), + profilestesting.SingleSignatureProtoFromHex(destSigHex), hex.EncodeToString([]byte(srcAddr)), ), ) @@ -286,7 +286,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { link := types.NewChainLink( addr.String(), types.NewBech32Address(srcAddr, "cosmos"), - types.NewProof(suite.chainA.Account.GetPubKey(), testutil.SingleSignatureProtoFromHex("1234"), hex.EncodeToString([]byte(srcAddr))), + types.NewProof(suite.chainA.Account.GetPubKey(), profilestesting.SingleSignatureProtoFromHex("1234"), hex.EncodeToString([]byte(srcAddr))), types.NewChainConfig("cosmos"), time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ) @@ -301,7 +301,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewBech32Address(srcAddr, "cosmos"), types.NewProof( suite.chainA.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(srcSigHex), + profilestesting.SingleSignatureProtoFromHex(srcSigHex), hex.EncodeToString([]byte(destAddr)), ), types.NewChainConfig( @@ -310,7 +310,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { destAddr, types.NewProof( suite.chainB.Account.GetPubKey(), - testutil.SingleSignatureProtoFromHex(destSigHex), + profilestesting.SingleSignatureProtoFromHex(destSigHex), hex.EncodeToString([]byte(srcAddr)), ), ) diff --git a/x/profiles/legacy/v4/store_test.go b/x/profiles/legacy/v4/store_test.go index 37469ba57b..6ce9da13c0 100644 --- a/x/profiles/legacy/v4/store_test.go +++ b/x/profiles/legacy/v4/store_test.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" profilestypes "github.com/desmos-labs/desmos/v3/x/profiles/types" "github.com/cosmos/cosmos-sdk/store" @@ -78,10 +78,10 @@ func TestMigrateStore(t *testing.T) { ) // Build common data - pubKey := testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d") - pubKeyAny := testutil.NewAny(pubKey) + pubKey := profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d") + pubKeyAny := profilestesting.NewAny(pubKey) - addressAny := testutil.NewAny(&v4.Bech32Address{ + addressAny := profilestesting.NewAny(&v4.Bech32Address{ Value: "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", Prefix: "cosmos", }) @@ -107,7 +107,7 @@ func TestMigrateStore(t *testing.T) { Cover: "", }, time.Date(2020, 1, 1, 0, 0, 0, 00, time.UTC), - testutil.AccountFromAddr("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), + profilestesting.AccountFromAddr("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), ) require.NoError(t, err) authKeeper.SetAccount(ctx, profile) @@ -125,7 +125,7 @@ func TestMigrateStore(t *testing.T) { "My name if John Doe", profilestypes.NewPictures("", ""), time.Date(2020, 1, 1, 0, 0, 0, 00, time.UTC), - testutil.AccountFromAddr("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), + profilestesting.AccountFromAddr("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), ) require.NoError(t, err) @@ -273,7 +273,7 @@ func TestMigrateStore(t *testing.T) { Mode: signing.SignMode_SIGN_MODE_TEXTUAL, Signature: signatureValue, } - signatureAny := testutil.NewAny(&signature) + signatureAny := profilestesting.NewAny(&signature) var stored profilestypes.ChainLink cdc.MustUnmarshal(kvStore.Get(profilestypes.ChainLinksStoreKey( @@ -340,7 +340,7 @@ func TestMigrateStore(t *testing.T) { signatureValue, err := hex.DecodeString("7369676E6174757265") require.NoError(t, err) - signatureAny := testutil.NewAny(&profilestypes.SingleSignatureData{ + signatureAny := profilestesting.NewAny(&profilestypes.SingleSignatureData{ Mode: signing.SignMode_SIGN_MODE_DIRECT, Signature: signatureValue, }) @@ -420,7 +420,7 @@ func TestMigrateStore(t *testing.T) { Mode: signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, Signature: signatureValue, } - signatureAny := testutil.NewAny(&signature) + signatureAny := profilestesting.NewAny(&signature) var stored profilestypes.ChainLink cdc.MustUnmarshal(kvStore.Get(profilestypes.ChainLinksStoreKey( diff --git a/x/profiles/legacy/v5/store_test.go b/x/profiles/legacy/v5/store_test.go index 2d4c4d0a9c..d5a6fc0b1c 100644 --- a/x/profiles/legacy/v5/store_test.go +++ b/x/profiles/legacy/v5/store_test.go @@ -9,7 +9,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/storetesting" + + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" profilestypes "github.com/desmos-labs/desmos/v3/x/profiles/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -30,7 +32,7 @@ func TestMigrateStore(t *testing.T) { tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) - account := testutil.GetChainLinkAccount("cosmos", "cosmos") + account := profilestesting.GetChainLinkAccount("cosmos", "cosmos") testCases := []struct { name string store func(ctx sdk.Context) @@ -87,7 +89,7 @@ func TestMigrateStore(t *testing.T) { Mode: signing.SignMode_SIGN_MODE_TEXTUAL, Signature: signatureValue, } - signatureAny := testutil.NewAny(&signature) + signatureAny := profilestesting.NewAny(&signature) chainLink := profilestypes.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", @@ -162,7 +164,7 @@ func TestMigrateStore(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - ctx := testutil.BuildContext(keys, tKeys, memKeys) + ctx := storetesting.BuildContext(keys, tKeys, memKeys) if tc.store != nil { tc.store(ctx) } diff --git a/x/profiles/types/account_test.go b/x/profiles/types/account_test.go index af867b892c..78c42962b2 100644 --- a/x/profiles/types/account_test.go +++ b/x/profiles/types/account_test.go @@ -7,7 +7,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/desmos-labs/desmos/v3/app" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -26,7 +26,7 @@ func TestProfile_Update(t *testing.T) { }{ { name: "DoNotModify does not update original values", - original: testutil.AssertNoProfileError(types.NewProfile( + original: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "nickname", "bio", @@ -35,7 +35,7 @@ func TestProfile_Update(t *testing.T) { "https://example.com", ), time.Unix(100, 0), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), update: types.NewProfileUpdate( types.DoNotModify, @@ -47,7 +47,7 @@ func TestProfile_Update(t *testing.T) { ), ), shouldErr: false, - expProfile: testutil.AssertNoProfileError(types.NewProfile( + expProfile: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "", "bio", @@ -56,12 +56,12 @@ func TestProfile_Update(t *testing.T) { "", ), time.Unix(100, 0), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), }, { name: "empty fields are allowed", - original: testutil.AssertNoProfileError(types.NewProfile( + original: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "nickname", "bio", @@ -70,7 +70,7 @@ func TestProfile_Update(t *testing.T) { "https://example.com", ), time.Unix(100, 0), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), update: types.NewProfileUpdate( types.DoNotModify, @@ -79,18 +79,18 @@ func TestProfile_Update(t *testing.T) { types.NewPictures("", ""), ), shouldErr: false, - expProfile: testutil.AssertNoProfileError(types.NewProfile( + expProfile: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "", "", types.NewPictures("", ""), time.Unix(100, 0), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), }, { name: "all fields are updated correctly", - original: testutil.AssertNoProfileError(types.NewProfile( + original: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "nickname", "bio", @@ -99,7 +99,7 @@ func TestProfile_Update(t *testing.T) { "https://example.com", ), time.Unix(100, 0), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), update: types.NewProfileUpdate( "dtag-2", @@ -111,7 +111,7 @@ func TestProfile_Update(t *testing.T) { ), ), shouldErr: false, - expProfile: testutil.AssertNoProfileError(types.NewProfile( + expProfile: profilestesting.AssertNoProfileError(types.NewProfile( "dtag-2", "nickname-2", "bio-2", @@ -120,7 +120,7 @@ func TestProfile_Update(t *testing.T) { "https://example.com/2", ), time.Unix(100, 0), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), }, } @@ -148,7 +148,7 @@ func TestProfile_Validate(t *testing.T) { }{ { name: "empty profile creator returns error", - account: testutil.AssertNoProfileError(types.NewProfile( + account: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "", "bio", @@ -163,7 +163,7 @@ func TestProfile_Validate(t *testing.T) { }, { name: "empty profile DTag returns error", - account: testutil.AssertNoProfileError(types.NewProfile( + account: profilestesting.AssertNoProfileError(types.NewProfile( "", "", "bio", @@ -172,13 +172,13 @@ func TestProfile_Validate(t *testing.T) { "https://shorturl.at/cgpyF", ), time.Now(), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), shouldErr: true, }, { name: "setting DTag to DoNotModify returns error", - account: testutil.AssertNoProfileError(types.NewProfile( + account: profilestesting.AssertNoProfileError(types.NewProfile( types.DoNotModify, "", "bio", @@ -187,103 +187,103 @@ func TestProfile_Validate(t *testing.T) { "https://shorturl.at/cgpyF", ), time.Now(), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), shouldErr: true, }, { name: "invalid profile picture returns error", - account: testutil.AssertNoProfileError(types.NewProfile( + account: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "", "bio", types.NewPictures("pic", "https://example.com"), time.Now(), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), shouldErr: true, }, { name: "invalid cover picture returns error", - account: testutil.AssertNoProfileError(types.NewProfile( + account: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "", "bio", types.NewPictures("https://example.com", "cov"), time.Now(), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), shouldErr: true, }, { name: "setting the nickname to DoNotModify returns error", - account: testutil.AssertNoProfileError(types.NewProfile( + account: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", types.DoNotModify, "", types.Pictures{}, time.Now(), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), shouldErr: true, }, { name: "setting the bio to DoNotModify returns error", - account: testutil.AssertNoProfileError(types.NewProfile( + account: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "", types.DoNotModify, types.Pictures{}, time.Now(), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), shouldErr: true, }, { name: "setting the profile picture to DoNotModify returns error", - account: testutil.AssertNoProfileError(types.NewProfile( + account: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "", "", types.NewPictures(types.DoNotModify, ""), time.Now(), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), shouldErr: true, }, { name: "setting the profile cover to DoNotModify returns error", - account: testutil.AssertNoProfileError(types.NewProfile( + account: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "", "", types.NewPictures("", types.DoNotModify), time.Now(), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), shouldErr: true, }, { name: "profile with only DTag does not error", - account: testutil.AssertNoProfileError(types.NewProfile( + account: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "", "", types.Pictures{}, time.Now(), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), shouldErr: false, }, { name: "valid profile returns no error", - account: testutil.AssertNoProfileError(types.NewProfile( + account: profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "", "bio", types.NewPictures("https://shorturl.at/adnX3", "https://shorturl.at/cgpyF"), time.Now(), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )), shouldErr: false, }, @@ -333,7 +333,7 @@ func TestProfileSerialization(t *testing.T) { err = profile.SetAddress(addr2) require.NoError(t, err) - pubKey := testutil.PubKeyFromBech32( + pubKey := profilestesting.PubKeyFromBech32( "cosmospub1addwnpepqtkndttcutq2sehejxs2x3jl2uhxzuds4705u8nkgayuct0khqkzjd0vvln", ) err = profile.SetPubKey(pubKey) @@ -367,7 +367,7 @@ func TestProfileSerialization(t *testing.T) { } func BenchmarkProfile_Update(b *testing.B) { - profile := testutil.AssertNoProfileError(types.NewProfile( + profile := profilestesting.AssertNoProfileError(types.NewProfile( "dtag", "nickname", "bio", @@ -376,7 +376,7 @@ func BenchmarkProfile_Update(b *testing.B) { "https://example.com", ), time.Unix(100, 0), - testutil.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + profilestesting.AccountFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), )) update := types.NewProfileUpdate( diff --git a/x/profiles/types/genesis_test.go b/x/profiles/types/genesis_test.go index 6a622182a1..c9958a22e5 100644 --- a/x/profiles/types/genesis_test.go +++ b/x/profiles/types/genesis_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -67,7 +67,7 @@ func TestValidateGenesis(t *testing.T) { "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", types.NewBech32Address("cosmos1xmquc944hzu6n6qtljcexkuhhz76mucxtgm5x0", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepq0j8zw4t6tg3v8gh7d2d799gjhue7ewwmpg2hwr77f9kuuyzgqtrw5r6wec"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepq0j8zw4t6tg3v8gh7d2d799gjhue7ewwmpg2hwr77f9kuuyzgqtrw5r6wec"), &types.SingleSignatureData{}, "addr", ), @@ -135,8 +135,8 @@ func TestValidateGenesis(t *testing.T) { "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", types.NewBech32Address("cosmos1xmquc944hzu6n6qtljcexkuhhz76mucxtgm5x0", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepq0j8zw4t6tg3v8gh7d2d799gjhue7ewwmpg2hwr77f9kuuyzgqtrw5r6wec"), - testutil.SingleSignatureProtoFromHex("4e188d9c17150037d5199bbdb91ae1eb2a78a15aca04cb35530cccb81494b36e"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepq0j8zw4t6tg3v8gh7d2d799gjhue7ewwmpg2hwr77f9kuuyzgqtrw5r6wec"), + profilestesting.SingleSignatureProtoFromHex("4e188d9c17150037d5199bbdb91ae1eb2a78a15aca04cb35530cccb81494b36e"), "636f736d6f7331786d717563393434687a75366e3671746c6a6365786b7568687a37366d75637874676d357830", ), types.NewChainConfig("cosmos"), @@ -146,8 +146,8 @@ func TestValidateGenesis(t *testing.T) { "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", types.NewBech32Address("cosmos1xmquc944hzu6n6qtljcexkuhhz76mucxtgm5x0", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepq0j8zw4t6tg3v8gh7d2d799gjhue7ewwmpg2hwr77f9kuuyzgqtrw5r6wec"), - testutil.SingleSignatureProtoFromHex("4e188d9c17150037d5199bbdb91ae1eb2a78a15aca04cb35530cccb81494b36e"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepq0j8zw4t6tg3v8gh7d2d799gjhue7ewwmpg2hwr77f9kuuyzgqtrw5r6wec"), + profilestesting.SingleSignatureProtoFromHex("4e188d9c17150037d5199bbdb91ae1eb2a78a15aca04cb35530cccb81494b36e"), "636f736d6f7331786d717563393434687a75366e3671746c6a6365786b7568687a37366d75637874676d357830", ), types.NewChainConfig("cosmos"), diff --git a/x/profiles/types/models_chain_links_test.go b/x/profiles/types/models_chain_links_test.go index 3ae8af6049..cbd202e553 100644 --- a/x/profiles/types/models_chain_links_test.go +++ b/x/profiles/types/models_chain_links_test.go @@ -3,7 +3,7 @@ package types_test import ( "encoding/hex" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" "github.com/mr-tron/base58" @@ -114,19 +114,19 @@ func TestProof_Validate(t *testing.T) { }, { name: "empty plain text returns error", - proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), testutil.SingleSignatureProtoFromHex("74657874"), ""), + proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), profilestesting.SingleSignatureProtoFromHex("74657874"), ""), shouldErr: true, }, { name: "invalid plain text format returns error", - proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), testutil.SingleSignatureProtoFromHex("74657874"), "="), + proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), profilestesting.SingleSignatureProtoFromHex("74657874"), "="), shouldErr: true, }, { name: "valid proof returns no error", proof: types.NewProof( secp256k1.GenPrivKey().PubKey(), - testutil.SingleSignatureProtoFromHex("74657874"), + profilestesting.SingleSignatureProtoFromHex("74657874"), "74657874", ), shouldErr: false, @@ -279,7 +279,7 @@ func TestProof_Verify(t *testing.T) { }, { name: "wrong signature returns error", - proof: types.NewProof(bech32PubKey, testutil.SingleSignatureProtoFromHex("74657874"), hex.EncodeToString([]byte(bech32Owner))), + proof: types.NewProof(bech32PubKey, profilestesting.SingleSignatureProtoFromHex("74657874"), hex.EncodeToString([]byte(bech32Owner))), owner: bech32Owner, addressData: types.NewBech32Address(bech32Addr, "cosmos"), shouldErr: true, @@ -642,17 +642,17 @@ func TestUnpackAddressData(t *testing.T) { }{ { name: "invalid address returns error", - address: testutil.NewAny(secp256k1.GenPrivKey()), + address: profilestesting.NewAny(secp256k1.GenPrivKey()), shouldErr: true, }, { name: "valid Bech32 data returns no error", - address: testutil.NewAny(types.NewBech32Address("cosmos1tdgrkvx2qgjk0uqsmdhm6dcz6wvwh9f8t37x0k", "cosmos")), + address: profilestesting.NewAny(types.NewBech32Address("cosmos1tdgrkvx2qgjk0uqsmdhm6dcz6wvwh9f8t37x0k", "cosmos")), shouldErr: false, }, { name: "valid Base58 data returns no error", - address: testutil.NewAny(types.NewBase58Address("5AfetAwZzftP8i5JBNatzWeccfXd4KvKq6TRfAvacFaN")), + address: profilestesting.NewAny(types.NewBase58Address("5AfetAwZzftP8i5JBNatzWeccfXd4KvKq6TRfAvacFaN")), shouldErr: false, }, } @@ -685,7 +685,7 @@ func TestChainLink_Validate(t *testing.T) { name: "empty address returns error", chainLink: types.ChainLink{ User: "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", - Proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), testutil.SingleSignatureProtoFromHex("74657874"), "74657874"), + Proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), profilestesting.SingleSignatureProtoFromHex("74657874"), "74657874"), ChainConfig: types.NewChainConfig("cosmos"), CreationTime: time.Now(), }, @@ -696,7 +696,7 @@ func TestChainLink_Validate(t *testing.T) { chainLink: types.NewChainLink( "", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), - types.NewProof(secp256k1.GenPrivKey().PubKey(), testutil.SingleSignatureProtoFromHex("74657874"), "74657874"), + types.NewProof(secp256k1.GenPrivKey().PubKey(), profilestesting.SingleSignatureProtoFromHex("74657874"), "74657874"), types.NewChainConfig("cosmos"), time.Now(), ), @@ -718,7 +718,7 @@ func TestChainLink_Validate(t *testing.T) { chainLink: types.NewChainLink( "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), - types.NewProof(secp256k1.GenPrivKey().PubKey(), testutil.SingleSignatureProtoFromHex("74657874"), "74657874"), + types.NewProof(secp256k1.GenPrivKey().PubKey(), profilestesting.SingleSignatureProtoFromHex("74657874"), "74657874"), types.NewChainConfig(""), time.Now(), ), @@ -729,7 +729,7 @@ func TestChainLink_Validate(t *testing.T) { chainLink: types.NewChainLink( "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), - types.NewProof(secp256k1.GenPrivKey().PubKey(), testutil.SingleSignatureProtoFromHex("74657874"), "74657874"), + types.NewProof(secp256k1.GenPrivKey().PubKey(), profilestesting.SingleSignatureProtoFromHex("74657874"), "74657874"), types.NewChainConfig("cosmos"), time.Time{}, ), @@ -740,7 +740,7 @@ func TestChainLink_Validate(t *testing.T) { chainLink: types.NewChainLink( "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), - types.NewProof(secp256k1.GenPrivKey().PubKey(), testutil.SingleSignatureProtoFromHex("74657874"), "74657874"), + types.NewProof(secp256k1.GenPrivKey().PubKey(), profilestesting.SingleSignatureProtoFromHex("74657874"), "74657874"), types.NewChainConfig("cosmos"), time.Now(), ), @@ -772,7 +772,7 @@ func TestChainLinkMarshaling(t *testing.T) { chainLink := types.NewChainLink( "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", types.NewBech32Address(addr, "cosmos"), - types.NewProof(pubKey, testutil.SingleSignatureProtoFromHex("74657874"), "plain-text"), + types.NewProof(pubKey, profilestesting.SingleSignatureProtoFromHex("74657874"), "plain-text"), types.NewChainConfig("cosmos"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ) diff --git a/x/profiles/types/models_packets_test.go b/x/profiles/types/models_packets_test.go index b38d881e0e..04e3a0815e 100644 --- a/x/profiles/types/models_packets_test.go +++ b/x/profiles/types/models_packets_test.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/stretchr/testify/require" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" "github.com/desmos-labs/desmos/v3/x/profiles/types" ) @@ -21,14 +21,14 @@ func TestLinkChainAccountPacketData_Validate(t *testing.T) { packet: types.LinkChainAccountPacketData{ SourceProof: types.NewProof( secp256k1.GenPrivKey().PubKey(), - testutil.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), + profilestesting.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "706c61696e5f74657874", ), SourceChainConfig: types.NewChainConfig("cosmos"), DestinationAddress: "cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", DestinationProof: types.NewProof( secp256k1.GenPrivKey().PubKey(), - testutil.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), + profilestesting.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "706c61696e5f74657874", ), }, @@ -43,7 +43,7 @@ func TestLinkChainAccountPacketData_Validate(t *testing.T) { "cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", types.NewProof( secp256k1.GenPrivKey().PubKey(), - testutil.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), + profilestesting.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "706c61696e5f74657874", ), ), @@ -55,14 +55,14 @@ func TestLinkChainAccountPacketData_Validate(t *testing.T) { types.NewBech32Address("cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", "cosmos"), types.NewProof( secp256k1.GenPrivKey().PubKey(), - testutil.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), + profilestesting.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "706c61696e5f74657874", ), types.NewChainConfig(""), "cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", types.NewProof( secp256k1.GenPrivKey().PubKey(), - testutil.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), + profilestesting.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "706c61696e5f74657874", ), ), @@ -74,14 +74,14 @@ func TestLinkChainAccountPacketData_Validate(t *testing.T) { types.NewBech32Address("cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", "cosmos"), types.NewProof( secp256k1.GenPrivKey().PubKey(), - testutil.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), + profilestesting.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "706c61696e5f74657874", ), types.NewChainConfig("cosmos"), "", types.NewProof( secp256k1.GenPrivKey().PubKey(), - testutil.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), + profilestesting.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "706c61696e5f74657874", ), ), @@ -93,7 +93,7 @@ func TestLinkChainAccountPacketData_Validate(t *testing.T) { types.NewBech32Address("cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", "cosmos"), types.NewProof( secp256k1.GenPrivKey().PubKey(), - testutil.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), + profilestesting.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "706c61696e5f74657874", ), types.NewChainConfig("cosmos"), @@ -108,14 +108,14 @@ func TestLinkChainAccountPacketData_Validate(t *testing.T) { types.NewBech32Address("cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", "cosmos"), types.NewProof( secp256k1.GenPrivKey().PubKey(), - testutil.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), + profilestesting.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "706c61696e5f74657874", ), types.NewChainConfig("cosmos"), "cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", types.NewProof( secp256k1.GenPrivKey().PubKey(), - testutil.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), + profilestesting.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "706c61696e5f74657874", ), ), @@ -140,10 +140,10 @@ func TestLinkChainAccountPacketData_Validate(t *testing.T) { func TestLinkChainAccountPacketData_GetBytes(t *testing.T) { packetData := types.NewLinkChainAccountPacketData( types.NewBech32Address("cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", "cosmos"), - types.NewProof(secp256k1.GenPrivKey().PubKey(), testutil.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "plain_text"), + types.NewProof(secp256k1.GenPrivKey().PubKey(), profilestesting.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "plain_text"), types.NewChainConfig("cosmos"), "cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", - types.NewProof(secp256k1.GenPrivKey().PubKey(), testutil.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "plain_text"), + types.NewProof(secp256k1.GenPrivKey().PubKey(), profilestesting.SingleSignatureProtoFromHex("032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561"), "plain_text"), ) _, err := packetData.GetBytes() require.NoError(t, err) diff --git a/x/profiles/types/msgs_chain_links_test.go b/x/profiles/types/msgs_chain_links_test.go index 9ba7772fff..52490976b4 100644 --- a/x/profiles/types/msgs_chain_links_test.go +++ b/x/profiles/types/msgs_chain_links_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,8 +16,8 @@ import ( var msgChainLinkAccount = types.NewMsgLinkChainAccount( types.NewBech32Address("cosmos1xmquc944hzu6n6qtljcexkuhhz76mucxtgm5x0", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepq0j8zw4t6tg3v8gh7d2d799gjhue7ewwmpg2hwr77f9kuuyzgqtrw5r6wec"), - testutil.SingleSignatureProtoFromHex("ad112abb30e5240c7b9d21b4cc5421d76cfadfcd5977cca262523b5f5bc759457d4aa6d5c1eb6223db104b47aa1f222468be8eb5bb2762b971622ac5b96351b5"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepq0j8zw4t6tg3v8gh7d2d799gjhue7ewwmpg2hwr77f9kuuyzgqtrw5r6wec"), + profilestesting.SingleSignatureProtoFromHex("ad112abb30e5240c7b9d21b4cc5421d76cfadfcd5977cca262523b5f5bc759457d4aa6d5c1eb6223db104b47aa1f222468be8eb5bb2762b971622ac5b96351b5"), "74657874", ), types.NewChainConfig("cosmos"), diff --git a/x/reports/legacy/v2/store_test.go b/x/reports/legacy/v2/store_test.go index 31c7f67a01..2338c2630a 100644 --- a/x/reports/legacy/v2/store_test.go +++ b/x/reports/legacy/v2/store_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" "github.com/desmos-labs/desmos/v3/app" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/storetesting" v2 "github.com/desmos-labs/desmos/v3/x/reports/legacy/v2" "github.com/desmos-labs/desmos/v3/x/reports/types" subspaceskeeper "github.com/desmos-labs/desmos/v3/x/subspaces/keeper" @@ -72,7 +72,7 @@ func TestMigrateStore(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - ctx := testutil.BuildContext(keys, tKeys, memKeys) + ctx := storetesting.BuildContext(keys, tKeys, memKeys) if tc.store != nil { tc.store(ctx) } diff --git a/x/subspaces/legacy/v2/store_test.go b/x/subspaces/legacy/v2/store_test.go index d27ca5e543..ac30759e35 100644 --- a/x/subspaces/legacy/v2/store_test.go +++ b/x/subspaces/legacy/v2/store_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" "github.com/desmos-labs/desmos/v3/app" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/storetesting" v2 "github.com/desmos-labs/desmos/v3/x/subspaces/legacy/v2" "github.com/desmos-labs/desmos/v3/x/subspaces/types" ) @@ -71,7 +71,7 @@ func TestMigrateStore(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - ctx := testutil.BuildContext(keys, tKeys, memKeys) + ctx := storetesting.BuildContext(keys, tKeys, memKeys) if tc.store != nil { tc.store(ctx) } diff --git a/x/subspaces/legacy/v3/store_test.go b/x/subspaces/legacy/v3/store_test.go index 71d4049025..08e6b74b3f 100644 --- a/x/subspaces/legacy/v3/store_test.go +++ b/x/subspaces/legacy/v3/store_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "github.com/desmos-labs/desmos/v3/testutil/storetesting" v3 "github.com/desmos-labs/desmos/v3/x/subspaces/legacy/v3" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,7 +13,6 @@ import ( "github.com/stretchr/testify/require" "github.com/desmos-labs/desmos/v3/app" - "github.com/desmos-labs/desmos/v3/testutil" "github.com/desmos-labs/desmos/v3/x/subspaces/types" ) @@ -63,7 +63,7 @@ func TestMigrateStore(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - ctx := testutil.BuildContext(keys, tKeys, memKeys) + ctx := storetesting.BuildContext(keys, tKeys, memKeys) if tc.store != nil { tc.store(ctx) } From d56eedd953b0d44c715a097032e4c4aafe52aa7a Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 15:56:09 +0800 Subject: [PATCH 13/64] Add missing chain link sim tests --- app/params/weights.go | 2 + x/profiles/simulation/genesis.go | 35 ++++- x/profiles/simulation/operations.go | 24 +++ .../simulation/operations_chain_links.go | 143 ++++++++++++++++++ x/profiles/simulation/utils.go | 6 + 5 files changed, 209 insertions(+), 1 deletion(-) create mode 100644 x/profiles/simulation/operations_chain_links.go diff --git a/app/params/weights.go b/app/params/weights.go index 1f96b75ff7..fc4bf21d49 100644 --- a/app/params/weights.go +++ b/app/params/weights.go @@ -8,6 +8,8 @@ const ( DefaultWeightMsgCancelDTagTransfer int = 25 DefaultWeightMsgAcceptDTagTransfer int = 75 DefaultWeightMsgRefuseDTagTransfer int = 25 + DefaultWeightMsgLinkChainAccount int = 75 + DefaultWeightMsgUnLinkChainAccount int = 25 DefaultWeightMsgCreateRelationship int = 80 DefaultWeightMsgDeleteRelationship int = 30 diff --git a/x/profiles/simulation/genesis.go b/x/profiles/simulation/genesis.go index 35f8354872..d1d259f0ac 100644 --- a/x/profiles/simulation/genesis.go +++ b/x/profiles/simulation/genesis.go @@ -4,6 +4,9 @@ package simulation import ( "fmt" + "time" + + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" subspacestypes "github.com/desmos-labs/desmos/v3/x/subspaces/types" @@ -55,7 +58,7 @@ func RandomizedGenState(simsState *module.SimulationState) { RandomOracleParams(simsState.Rand), ), types.IBCPortID, - nil, + randomChainLinks(profiles, simsState), nil, ) @@ -137,3 +140,33 @@ func containsDTagTransferRequest(slice []types.DTagTransferRequest, request type } return false } + +// ------------------------------------------------------------------------------------------------------------------- + +func randomChainLinks( + profiles []*types.Profile, simsState *module.SimulationState, +) []types.ChainLink { + linksNumber := simsState.Rand.Intn(100) + links := make([]types.ChainLink, linksNumber) + for i := 0; i < linksNumber; { + // Get a random profile + profile := RandomProfile(simsState.Rand, profiles) + chainAccount := profilestesting.GetChainLinkAccount("cosmos", "cosmos") + link := chainAccount.GetBech32ChainLink(profile.GetAddress().String(), time.Date(2022, 6, 9, 0, 0, 0, 0, time.UTC)) + + if !containsChainLink(links, link) { + links[i] = link + i++ + } + } + return links +} + +func containsChainLink(slice []types.ChainLink, link types.ChainLink) bool { + for _, l := range slice { + if l.User == link.User && l.Address == link.Address && l.ChainConfig.Name == link.ChainConfig.Name { + return true + } + } + return false +} diff --git a/x/profiles/simulation/operations.go b/x/profiles/simulation/operations.go index 5e1a3da120..93c4dc8d31 100644 --- a/x/profiles/simulation/operations.go +++ b/x/profiles/simulation/operations.go @@ -26,6 +26,8 @@ const ( OpWeightMsgAcceptDTagTransfer = "op_weight_msg_accept_dtag_transfer_request" OpWeightMsgRefuseDTagTransfer = "op_weight_msg_refuse_dtag_transfer_request" OpWeightMsgCancelDTagTransfer = "op_weight_msg_cancel_dtag_transfer_request" + OpWeightMsgLinkChainAccount = "op_weight_msg_link_chain_account" + OpWeightMsgUnlinkChainAccount = "op_weight_msg_unlink_chain_account" DefaultGasValue = 200000 ) @@ -77,6 +79,20 @@ func WeightedOperations( }, ) + var weightMsgLinkChainAccount int + appParams.GetOrGenerate(cdc, OpWeightMsgLinkChainAccount, &weightMsgLinkChainAccount, nil, + func(r *rand.Rand) { + weightMsgLinkChainAccount = params.DefaultWeightMsgLinkChainAccount + }, + ) + + var weightMsgUnlinkChainAccount int + appParams.GetOrGenerate(cdc, OpWeightMsgLinkChainAccount, &weightMsgUnlinkChainAccount, nil, + func(r *rand.Rand) { + weightMsgUnlinkChainAccount = params.DefaultWeightMsgUnLinkChainAccount + }, + ) + return sim.WeightedOperations{ sim.NewWeightedOperation( weightMsgSaveProfile, @@ -102,5 +118,13 @@ func WeightedOperations( weightMsgCancelDTagTransfer, SimulateMsgCancelDTagTransfer(k, ak, bk, fk), ), + sim.NewWeightedOperation( + weightMsgLinkChainAccount, + SimulateMsgLinkChainAccount(k, ak, bk, fk), + ), + sim.NewWeightedOperation( + weightMsgLinkChainAccount, + SimulateMsgLinkChainAccount(k, ak, bk, fk), + ), } } diff --git a/x/profiles/simulation/operations_chain_links.go b/x/profiles/simulation/operations_chain_links.go new file mode 100644 index 0000000000..62a9e2f570 --- /dev/null +++ b/x/profiles/simulation/operations_chain_links.go @@ -0,0 +1,143 @@ +package simulation + +import ( + "math/rand" + "time" + + feeskeeper "github.com/desmos-labs/desmos/v3/x/fees/keeper" + + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" + "github.com/desmos-labs/desmos/v3/testutil/simtesting" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/desmos-labs/desmos/v3/x/profiles/keeper" + "github.com/desmos-labs/desmos/v3/x/profiles/types" +) + +// DONTCOVER + +// SimulateMsgLinkChainAccount tests and runs a single MsgLinkChainAccount +func SimulateMsgLinkChainAccount( + k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper, +) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, + accs []simtypes.Account, chainID string, + ) (OperationMsg simtypes.OperationMsg, futureOps []simtypes.FutureOperation, err error) { + + // Get the data + link, signer, skip := randomLinkChainAccountFields(r, ctx, accs, k) + if skip { + return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, ""), nil, nil + } + + // Build the message + msg := types.NewMsgLinkChainAccount( + link.GetAddressData(), + link.Proof, + link.ChainConfig, + signer.Address.String(), + ) + + // Send the message + err = simtesting.SendMsg(r, app, ak, bk, fk, msg, ctx, chainID, DefaultGasValue, []cryptotypes.PrivKey{signer.PrivKey}) + if err != nil { + return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, "MsgRequestDTagTransfer"), nil, err + } + + return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + } +} + +// randomLinkChainAccountFields returns the data used to build a random MsgLinkChainAccount +func randomLinkChainAccountFields( + r *rand.Rand, ctx sdk.Context, accs []simtypes.Account, k keeper.Keeper, +) (link types.ChainLink, signer simtypes.Account, skip bool) { + if len(accs) == 0 { + // Skip because there are no accounts + skip = true + return + } + + // Get random signer + signer, _ = simtypes.RandomAcc(r, accs) + + chainAccount := profilestesting.GetChainLinkAccount("cosmos", "cosmos") + link = chainAccount.GetBech32ChainLink(signer.Address.String(), time.Now()) + + // Skip if link already exists + _, found := k.GetChainLink(ctx, signer.Address.String(), link.ChainConfig.Name, link.GetAddressData().GetValue()) + if found { + skip = true + return + } + + return link, signer, false +} + +// -------------------------------------------------------------------------------------------------------------------- + +// SimulateMsgUnlinkChainAccount tests and runs a single MsgUnlinkChainAccount +func SimulateMsgUnlinkChainAccount( + k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper, +) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, + accs []simtypes.Account, chainID string, + ) (OperationMsg simtypes.OperationMsg, futureOps []simtypes.FutureOperation, err error) { + + // Get the data + link, signer, skip := randomUnlinkChainAccountFields(r, ctx, accs, k) + if skip { + return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, ""), nil, nil + } + + // Build the message + msg := types.NewMsgUnlinkChainAccount(link.User, link.ChainConfig.Name, link.GetAddressData().GetValue()) + + // Send the message + err = simtesting.SendMsg(r, app, ak, bk, fk, msg, ctx, chainID, DefaultGasValue, []cryptotypes.PrivKey{signer.PrivKey}) + if err != nil { + return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, "MsgRequestDTagTransfer"), nil, err + } + return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + } +} + +// randomUnlinkChainAccountFields returns the data used to build a random MsgUnlinkChainAccount +func randomUnlinkChainAccountFields( + r *rand.Rand, ctx sdk.Context, accs []simtypes.Account, k keeper.Keeper, +) (link types.ChainLink, signer simtypes.Account, skip bool) { + if len(accs) == 0 { + // Skip because there are no accounts + skip = true + return + } + + // Get a random chain link + links := k.GetChainLinks(ctx) + if len(links) == 0 { + skip = true + return + } + link = RandomChainLink(r, links) + + // Get the signer + addr, _ := sdk.AccAddressFromBech32(link.User) + signerAcc := GetSimAccount(addr, accs) + if signerAcc == nil { + skip = true + return + } + + signer = *signerAcc + return link, signer, false +} diff --git a/x/profiles/simulation/utils.go b/x/profiles/simulation/utils.go index 4bfcd64011..ba4598364f 100644 --- a/x/profiles/simulation/utils.go +++ b/x/profiles/simulation/utils.go @@ -101,6 +101,12 @@ func RandomDTagTransferRequest(r *rand.Rand, requests []types.DTagTransferReques return requests[idx] } +// RandomChainLink picks and returns a random chain link from an array of chain links +func RandomChainLink(r *rand.Rand, links []types.ChainLink) types.ChainLink { + idx := r.Intn(len(links)) + return links[idx] +} + // RandomDTag return a random DTag func RandomDTag(r *rand.Rand) string { // DTag must be at least 3 characters and at most 30 From 74edd843ba13e6ca971c33fc20e18a5c9aac50f2 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 16:08:59 +0800 Subject: [PATCH 14/64] Add missing docs and improve dependancies --- app/desmos/cmd/chainlink/create_json_test.go | 2 +- x/profiles/simulation/genesis.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/desmos/cmd/chainlink/create_json_test.go b/app/desmos/cmd/chainlink/create_json_test.go index bb53ac1f7f..96a2528ca3 100644 --- a/app/desmos/cmd/chainlink/create_json_test.go +++ b/app/desmos/cmd/chainlink/create_json_test.go @@ -5,9 +5,9 @@ import ( "io/ioutil" "github.com/desmos-labs/desmos/v3/app/desmos/cmd/chainlink/builder" - "github.com/desmos-labs/desmos/v3/testutil/profilestesting" cmd "github.com/desmos-labs/desmos/v3/app/desmos/cmd/chainlink" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" diff --git a/x/profiles/simulation/genesis.go b/x/profiles/simulation/genesis.go index d1d259f0ac..468b885a02 100644 --- a/x/profiles/simulation/genesis.go +++ b/x/profiles/simulation/genesis.go @@ -143,6 +143,7 @@ func containsDTagTransferRequest(slice []types.DTagTransferRequest, request type // ------------------------------------------------------------------------------------------------------------------- +// randomChainLinks returns randomly generated genesis chain links func randomChainLinks( profiles []*types.Profile, simsState *module.SimulationState, ) []types.ChainLink { @@ -164,7 +165,7 @@ func randomChainLinks( func containsChainLink(slice []types.ChainLink, link types.ChainLink) bool { for _, l := range slice { - if l.User == link.User && l.Address == link.Address && l.ChainConfig.Name == link.ChainConfig.Name { + if l.User == link.User && l.Address.Equal(link.Address) && l.ChainConfig.Name == link.ChainConfig.Name { return true } } From 7c8186df01083535c86bbc07b1c495bfe7756a06 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 16:19:52 +0800 Subject: [PATCH 15/64] Fix typo --- x/profiles/simulation/operations.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/profiles/simulation/operations.go b/x/profiles/simulation/operations.go index 93c4dc8d31..8565f8341d 100644 --- a/x/profiles/simulation/operations.go +++ b/x/profiles/simulation/operations.go @@ -123,8 +123,8 @@ func WeightedOperations( SimulateMsgLinkChainAccount(k, ak, bk, fk), ), sim.NewWeightedOperation( - weightMsgLinkChainAccount, - SimulateMsgLinkChainAccount(k, ak, bk, fk), + weightMsgUnlinkChainAccount, + SimulateMsgUnlinkChainAccount(k, ak, bk, fk), ), } } From 95344c9ddd7dea753a239f5dca780c4cc8645e1d Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 16:21:08 +0800 Subject: [PATCH 16/64] Fix typo --- app/params/weights.go | 2 +- x/profiles/simulation/operations.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/params/weights.go b/app/params/weights.go index fc4bf21d49..c79fbe5c22 100644 --- a/app/params/weights.go +++ b/app/params/weights.go @@ -9,7 +9,7 @@ const ( DefaultWeightMsgAcceptDTagTransfer int = 75 DefaultWeightMsgRefuseDTagTransfer int = 25 DefaultWeightMsgLinkChainAccount int = 75 - DefaultWeightMsgUnLinkChainAccount int = 25 + DefaultWeightMsgUnlinkChainAccount int = 25 DefaultWeightMsgCreateRelationship int = 80 DefaultWeightMsgDeleteRelationship int = 30 diff --git a/x/profiles/simulation/operations.go b/x/profiles/simulation/operations.go index 8565f8341d..d299350e92 100644 --- a/x/profiles/simulation/operations.go +++ b/x/profiles/simulation/operations.go @@ -89,7 +89,7 @@ func WeightedOperations( var weightMsgUnlinkChainAccount int appParams.GetOrGenerate(cdc, OpWeightMsgLinkChainAccount, &weightMsgUnlinkChainAccount, nil, func(r *rand.Rand) { - weightMsgUnlinkChainAccount = params.DefaultWeightMsgUnLinkChainAccount + weightMsgUnlinkChainAccount = params.DefaultWeightMsgUnlinkChainAccount }, ) From 51c30ff738f39efb783e005f2cf915fb3342e66d Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 16:24:49 +0800 Subject: [PATCH 17/64] Fix v6 store tests --- x/profiles/legacy/v6/store_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/x/profiles/legacy/v6/store_test.go b/x/profiles/legacy/v6/store_test.go index 94dff77c5c..a51853d64a 100644 --- a/x/profiles/legacy/v6/store_test.go +++ b/x/profiles/legacy/v6/store_test.go @@ -4,7 +4,8 @@ import ( "testing" "time" - "github.com/desmos-labs/desmos/v3/testutil" + "github.com/desmos-labs/desmos/v3/testutil/profilestesting" + "github.com/desmos-labs/desmos/v3/testutil/storetesting" v6 "github.com/desmos-labs/desmos/v3/x/profiles/legacy/v6" profilestypes "github.com/desmos-labs/desmos/v3/x/profiles/types" @@ -26,8 +27,8 @@ func TestMigrateStore(t *testing.T) { tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) - olderChainAccount := testutil.GetChainLinkAccount("cosmos", "cosmos") - newerChainAccount := testutil.GetChainLinkAccount("cosmos", "cosmos") + olderChainAccount := profilestesting.GetChainLinkAccount("cosmos", "cosmos") + newerChainAccount := profilestesting.GetChainLinkAccount("cosmos", "cosmos") testCases := []struct { name string @@ -84,7 +85,7 @@ func TestMigrateStore(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - ctx := testutil.BuildContext(keys, tKeys, memKeys) + ctx := storetesting.BuildContext(keys, tKeys, memKeys) if tc.store != nil { tc.store(ctx) } From 0de327ad7cc553ce960f7539d90cd797adbdffec Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 16:28:18 +0800 Subject: [PATCH 18/64] Update x/profiles/simulation/operations_chain_links.go --- x/profiles/simulation/operations_chain_links.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/profiles/simulation/operations_chain_links.go b/x/profiles/simulation/operations_chain_links.go index 62a9e2f570..de6451b064 100644 --- a/x/profiles/simulation/operations_chain_links.go +++ b/x/profiles/simulation/operations_chain_links.go @@ -106,7 +106,7 @@ func SimulateMsgUnlinkChainAccount( // Send the message err = simtesting.SendMsg(r, app, ak, bk, fk, msg, ctx, chainID, DefaultGasValue, []cryptotypes.PrivKey{signer.PrivKey}) if err != nil { - return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, "MsgRequestDTagTransfer"), nil, err + return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, "MsgUnlinkChainAccount"), nil, err } return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil } From 0e793309714104c73fb80e23891675277d8d849e Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 16:28:28 +0800 Subject: [PATCH 19/64] Update x/profiles/simulation/operations_chain_links.go --- x/profiles/simulation/operations_chain_links.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/profiles/simulation/operations_chain_links.go b/x/profiles/simulation/operations_chain_links.go index de6451b064..396894a363 100644 --- a/x/profiles/simulation/operations_chain_links.go +++ b/x/profiles/simulation/operations_chain_links.go @@ -50,7 +50,7 @@ func SimulateMsgLinkChainAccount( // Send the message err = simtesting.SendMsg(r, app, ak, bk, fk, msg, ctx, chainID, DefaultGasValue, []cryptotypes.PrivKey{signer.PrivKey}) if err != nil { - return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, "MsgRequestDTagTransfer"), nil, err + return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, "MsgLinkChainAccount"), nil, err } return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil From 4154d5676146e8946de6c48860a8862b3398a98c Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 16:34:45 +0800 Subject: [PATCH 20/64] Add sim tests --- app/params/weights.go | 17 +++--- x/profiles/simulation/operations.go | 28 ++++++--- .../simulation/operations_chain_links.go | 59 +++++++++++++++++++ 3 files changed, 88 insertions(+), 16 deletions(-) diff --git a/app/params/weights.go b/app/params/weights.go index c79fbe5c22..d8ac740f1c 100644 --- a/app/params/weights.go +++ b/app/params/weights.go @@ -2,14 +2,15 @@ package params // Default simulation operation weights for messages const ( - DefaultWeightMsgSaveProfile int = 80 - DefaultWeightMsgDeleteProfile int = 20 - DefaultWeightMsgRequestDTagTransfer int = 85 - DefaultWeightMsgCancelDTagTransfer int = 25 - DefaultWeightMsgAcceptDTagTransfer int = 75 - DefaultWeightMsgRefuseDTagTransfer int = 25 - DefaultWeightMsgLinkChainAccount int = 75 - DefaultWeightMsgUnlinkChainAccount int = 25 + DefaultWeightMsgSaveProfile int = 80 + DefaultWeightMsgDeleteProfile int = 20 + DefaultWeightMsgRequestDTagTransfer int = 85 + DefaultWeightMsgCancelDTagTransfer int = 25 + DefaultWeightMsgAcceptDTagTransfer int = 75 + DefaultWeightMsgRefuseDTagTransfer int = 25 + DefaultWeightMsgLinkChainAccount int = 75 + DefaultWeightMsgUnlinkChainAccount int = 25 + DefaultWeightMsgSetDefaultExternalAddress int = 15 DefaultWeightMsgCreateRelationship int = 80 DefaultWeightMsgDeleteRelationship int = 30 diff --git a/x/profiles/simulation/operations.go b/x/profiles/simulation/operations.go index d299350e92..af3f33a47f 100644 --- a/x/profiles/simulation/operations.go +++ b/x/profiles/simulation/operations.go @@ -20,14 +20,15 @@ import ( // Simulation operation weights constants const ( - OpWeightMsgSaveProfile = "op_weight_msg_save_profile" - OpWeightMsgDeleteProfile = "op_weight_msg_delete_profile" - OpWeightMsgRequestDTagTransfer = "op_weight_msg_request_dtag_transfer" - OpWeightMsgAcceptDTagTransfer = "op_weight_msg_accept_dtag_transfer_request" - OpWeightMsgRefuseDTagTransfer = "op_weight_msg_refuse_dtag_transfer_request" - OpWeightMsgCancelDTagTransfer = "op_weight_msg_cancel_dtag_transfer_request" - OpWeightMsgLinkChainAccount = "op_weight_msg_link_chain_account" - OpWeightMsgUnlinkChainAccount = "op_weight_msg_unlink_chain_account" + OpWeightMsgSaveProfile = "op_weight_msg_save_profile" + OpWeightMsgDeleteProfile = "op_weight_msg_delete_profile" + OpWeightMsgRequestDTagTransfer = "op_weight_msg_request_dtag_transfer" + OpWeightMsgAcceptDTagTransfer = "op_weight_msg_accept_dtag_transfer_request" + OpWeightMsgRefuseDTagTransfer = "op_weight_msg_refuse_dtag_transfer_request" + OpWeightMsgCancelDTagTransfer = "op_weight_msg_cancel_dtag_transfer_request" + OpWeightMsgLinkChainAccount = "op_weight_msg_link_chain_account" + OpWeightMsgUnlinkChainAccount = "op_weight_msg_unlink_chain_account" + OpWeightSetDefaultExternalAddress = "op_weight_set_default_external_address" DefaultGasValue = 200000 ) @@ -93,6 +94,13 @@ func WeightedOperations( }, ) + var weightMsgSetDefaultExternalAddress int + appParams.GetOrGenerate(cdc, OpWeightMsgLinkChainAccount, &weightMsgSetDefaultExternalAddress, nil, + func(r *rand.Rand) { + weightMsgSetDefaultExternalAddress = params.DefaultWeightMsgSetDefaultExternalAddress + }, + ) + return sim.WeightedOperations{ sim.NewWeightedOperation( weightMsgSaveProfile, @@ -126,5 +134,9 @@ func WeightedOperations( weightMsgUnlinkChainAccount, SimulateMsgUnlinkChainAccount(k, ak, bk, fk), ), + sim.NewWeightedOperation( + weightMsgSetDefaultExternalAddress, + SimulateMsgSetDefaultExternalAddress(k, ak, bk, fk), + ), } } diff --git a/x/profiles/simulation/operations_chain_links.go b/x/profiles/simulation/operations_chain_links.go index 396894a363..8a07e47073 100644 --- a/x/profiles/simulation/operations_chain_links.go +++ b/x/profiles/simulation/operations_chain_links.go @@ -141,3 +141,62 @@ func randomUnlinkChainAccountFields( signer = *signerAcc return link, signer, false } + +// -------------------------------------------------------------------------------------------------------------------- + +// SimulateMsgSetDefaultExternalAddress tests and runs a single MsgSetDefaultExternalAddress +func SimulateMsgSetDefaultExternalAddress( + k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper, +) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, + accs []simtypes.Account, chainID string, + ) (OperationMsg simtypes.OperationMsg, futureOps []simtypes.FutureOperation, err error) { + + // Get the data + link, signer, skip := randomSetDefaultExternalAddressFields(r, ctx, accs, k) + if skip { + return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, ""), nil, nil + } + + // Build the message + msg := types.NewMsgSetDefaultExternalAddress(link.ChainConfig.Name, link.GetAddressData().GetValue(), link.User) + + // Send the message + err = simtesting.SendMsg(r, app, ak, bk, fk, msg, ctx, chainID, DefaultGasValue, []cryptotypes.PrivKey{signer.PrivKey}) + if err != nil { + return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, "MsgSetDefaultExternalAddress"), nil, err + } + return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + } +} + +// randomSetDefaultExternalAddressFields returns the data used to build a random MsgSetDefaultExternalAddress +func randomSetDefaultExternalAddressFields( + r *rand.Rand, ctx sdk.Context, accs []simtypes.Account, k keeper.Keeper, +) (link types.ChainLink, signer simtypes.Account, skip bool) { + if len(accs) == 0 { + // Skip because there are no accounts + skip = true + return + } + + // Get a random chain link + links := k.GetChainLinks(ctx) + if len(links) == 0 { + skip = true + return + } + link = RandomChainLink(r, links) + + // Get the signer + addr, _ := sdk.AccAddressFromBech32(link.User) + signerAcc := GetSimAccount(addr, accs) + if signerAcc == nil { + skip = true + return + } + + signer = *signerAcc + return link, signer, false +} From c44eff5a15098d48fc3a677293b2bf1bfd7d5e43 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 16:42:42 +0800 Subject: [PATCH 21/64] Fix tests --- app/sim-params.json | 1 + x/profiles/keeper/grpc_query_test.go | 16 ++++++++-------- x/profiles/keeper/msg_server_chain_link_test.go | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 app/sim-params.json diff --git a/app/sim-params.json b/app/sim-params.json new file mode 100644 index 0000000000..c776f7e354 --- /dev/null +++ b/app/sim-params.json @@ -0,0 +1 @@ +{"op_reflect_contract_path":"../testutil/wasm/reflect.wasm"} \ No newline at end of file diff --git a/x/profiles/keeper/grpc_query_test.go b/x/profiles/keeper/grpc_query_test.go index 9b24c5fbf7..115e37aa73 100644 --- a/x/profiles/keeper/grpc_query_test.go +++ b/x/profiles/keeper/grpc_query_test.go @@ -625,13 +625,13 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinkOwners() { } func (suite *KeeperTestSuite) TestQueryServer_DefaultExternalAddresses() { - firstAccount := testutil.GetChainLinkAccount("cosmos", "cosmos") + firstAccount := profilestesting.GetChainLinkAccount("cosmos", "cosmos") firstChainLink := firstAccount.GetBech32ChainLink( "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), ) - secondAccount := testutil.GetChainLinkAccount("likecoin", "cosmos") + secondAccount := profilestesting.GetChainLinkAccount("likecoin", "cosmos") secondChainLink := secondAccount.GetBech32ChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), @@ -647,8 +647,8 @@ func (suite *KeeperTestSuite) TestQueryServer_DefaultExternalAddresses() { { name: "query without any data returns everything", store: func(ctx sdk.Context) { - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"))) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) suite.Require().NoError(suite.k.SaveChainLink(ctx, firstChainLink)) suite.Require().NoError(suite.k.SaveChainLink(ctx, secondChainLink)) @@ -660,8 +660,8 @@ func (suite *KeeperTestSuite) TestQueryServer_DefaultExternalAddresses() { { name: "query with owner returns correct data", store: func(ctx sdk.Context) { - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"))) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) suite.Require().NoError(suite.k.SaveChainLink(ctx, firstChainLink)) suite.Require().NoError(suite.k.SaveChainLink(ctx, secondChainLink)) @@ -673,8 +673,8 @@ func (suite *KeeperTestSuite) TestQueryServer_DefaultExternalAddresses() { { name: "query with owner and chain name returns correct data", store: func(ctx sdk.Context) { - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"))) - suite.Require().NoError(suite.k.SaveProfile(ctx, testutil.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"))) + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"))) suite.Require().NoError(suite.k.SaveChainLink(ctx, firstChainLink)) suite.Require().NoError(suite.k.SaveChainLink(ctx, secondChainLink)) diff --git a/x/profiles/keeper/msg_server_chain_link_test.go b/x/profiles/keeper/msg_server_chain_link_test.go index a273f8de5a..6681b213f5 100644 --- a/x/profiles/keeper/msg_server_chain_link_test.go +++ b/x/profiles/keeper/msg_server_chain_link_test.go @@ -298,8 +298,8 @@ func (suite *KeeperTestSuite) TestMsgServer_SetDefaultExternalAddress() { "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), types.NewProof( - testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), - testutil.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), + profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), + profilestesting.SingleSignatureProtoFromHex("909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b"), "74657874", ), types.NewChainConfig("cosmos"), From 08c4206f6bd79eb037529c9331b2cefd4d077e37 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 16:45:13 +0800 Subject: [PATCH 22/64] Delete sim params file --- app/sim-params.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 app/sim-params.json diff --git a/app/sim-params.json b/app/sim-params.json deleted file mode 100644 index c776f7e354..0000000000 --- a/app/sim-params.json +++ /dev/null @@ -1 +0,0 @@ -{"op_reflect_contract_path":"../testutil/wasm/reflect.wasm"} \ No newline at end of file From 9a9d09f31feddaa9f52ef69e214a32775dc3614f Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 16:47:26 +0800 Subject: [PATCH 23/64] Fix import dependacy name --- x/posts/legacy/v2/store_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/posts/legacy/v2/store_test.go b/x/posts/legacy/v2/store_test.go index f2af7f3d71..f9af06fad8 100644 --- a/x/posts/legacy/v2/store_test.go +++ b/x/posts/legacy/v2/store_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" "github.com/desmos-labs/desmos/v3/app" - testutil "github.com/desmos-labs/desmos/v3/testutil/storetesting" + "github.com/desmos-labs/desmos/v3/testutil/storetesting" v2 "github.com/desmos-labs/desmos/v3/x/posts/legacy/v2" "github.com/desmos-labs/desmos/v3/x/posts/types" subspaceskeeper "github.com/desmos-labs/desmos/v3/x/subspaces/keeper" @@ -72,7 +72,7 @@ func TestMigrateStore(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - ctx := testutil.BuildContext(keys, tKeys, memKeys) + ctx := storetesting.BuildContext(keys, tKeys, memKeys) if tc.store != nil { tc.store(ctx) } From 4c2df0f14947fb5afd008e908c528e81e107963d Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 16:49:49 +0800 Subject: [PATCH 24/64] Add missing docs --- x/profiles/keeper/alias_functions.go | 1 + 1 file changed, 1 insertion(+) diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go index d614deb6c3..e97c19cc78 100644 --- a/x/profiles/keeper/alias_functions.go +++ b/x/profiles/keeper/alias_functions.go @@ -169,6 +169,7 @@ func (k Keeper) IterateUserChainLinks(ctx sdk.Context, user string, fn func(inde } } +// IterateUserChainLinksByChain iterates through the chain links related to the given user by the given chain name and perform the provided function func (k Keeper) IterateUserChainLinksByChain(ctx sdk.Context, user string, chainName string, fn func(link types.ChainLink) (stop bool)) { store := ctx.KVStore(k.storeKey) From 6e8412a692e057aba5c5566815fe517229855415 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 16:52:57 +0800 Subject: [PATCH 25/64] Update x/profiles/keeper/alias_functions.go --- x/profiles/keeper/alias_functions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go index e97c19cc78..338a408183 100644 --- a/x/profiles/keeper/alias_functions.go +++ b/x/profiles/keeper/alias_functions.go @@ -169,7 +169,7 @@ func (k Keeper) IterateUserChainLinks(ctx sdk.Context, user string, fn func(inde } } -// IterateUserChainLinksByChain iterates through the chain links related to the given user by the given chain name and perform the provided function +// IterateUserChainLinksByChain iterates through the chain links related to the given user by the chain having the given chain name and perform the provided function func (k Keeper) IterateUserChainLinksByChain(ctx sdk.Context, user string, chainName string, fn func(link types.ChainLink) (stop bool)) { store := ctx.KVStore(k.storeKey) From 1ab2959d80a820563e76bf0b9c824c97f7d65199 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 17:01:14 +0800 Subject: [PATCH 26/64] Improve tests --- x/profiles/keeper/keeper_chain_links_test.go | 48 +++++++------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index 3113888cef..3ebb79a70f 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -302,13 +302,10 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { )) // Check default external address key - suite.Require().True( - suite.k.HasDefaultExternalAddress( - ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos", - ), - ) + suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + )) }, }, { @@ -336,13 +333,10 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { )) // Check default external address key - suite.Require().True( - suite.k.HasDefaultExternalAddress( - ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos", - ), - ) + suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + )) }, }, { @@ -370,13 +364,10 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { )) // Check default external address key - suite.Require().True( - suite.k.HasDefaultExternalAddress( - ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos", - ), - ) + suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + )) }, }, { @@ -454,18 +445,13 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { ))) // Check default external address key is updated properly - suite.Require().True( - suite.k.HasDefaultExternalAddress( - ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos", - ), - ) + suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + )) suite.Require().Equal( olderAccount.Bech32Address().Value, - string(store.Get( - types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos"), - )), + string(store.Get(types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos"))), ) }, }, From 20b91dcd4304c1a256f230b596c54e3cad81a84d Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 9 Jun 2022 17:04:43 +0800 Subject: [PATCH 27/64] Improve tests --- x/profiles/keeper/msg_server_chain_link_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/x/profiles/keeper/msg_server_chain_link_test.go b/x/profiles/keeper/msg_server_chain_link_test.go index 6681b213f5..37fbb5ad1b 100644 --- a/x/profiles/keeper/msg_server_chain_link_test.go +++ b/x/profiles/keeper/msg_server_chain_link_test.go @@ -239,9 +239,7 @@ func (suite *KeeperTestSuite) TestMsgServer_UnlinkChainAccount() { suite.Require().False(found) // Check the default external address is removed properly - suite.Require().False( - store.Has(types.DefaultExternalAddressKey("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos")), - ) + suite.Require().False(store.Has(types.DefaultExternalAddressKey("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos"))) }, }, } @@ -339,9 +337,7 @@ func (suite *KeeperTestSuite) TestMsgServer_SetDefaultExternalAddress() { check: func(ctx sdk.Context) { store := ctx.KVStore(suite.storeKey) external := store.Get(types.DefaultExternalAddressKey("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos")) - suite.Require().True( - string(external) == "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", - ) + suite.Require().True(string(external) == "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns") }, }, } From df7e62f6e73c33546127985ece9e7a1d14ae842f Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 10 Jun 2022 13:35:51 +0800 Subject: [PATCH 28/64] Add missing test --- x/profiles/keeper/keeper_chain_links_test.go | 65 +++++++++++++++++--- 1 file changed, 57 insertions(+), 8 deletions(-) diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index 3ebb79a70f..fd4aaeb65c 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -400,13 +400,10 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { ))) // Check default external address is deleted properly - suite.Require().False( - suite.k.HasDefaultExternalAddress( - ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos", - ), - ) + suite.Require().False(suite.k.HasDefaultExternalAddress(ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + )) }, }, { @@ -562,4 +559,56 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteAllUserChainLinks() { } } -func (suite *KeeperTestSuite) TestKeeper_SaveDefaultExternalAddress() {} +func (suite *KeeperTestSuite) TestKeeper_SaveDefaultExternalAddress() { + + testCases := []struct { + name string + store func(ctx sdk.Context) + owner string + chainName string + target string + check func(ctx sdk.Context) + }{ + { + name: "non existing external address is set properly", + owner: "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + chainName: "cosmos", + target: "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + check: func(ctx sdk.Context) { + store := ctx.KVStore(suite.storeKey) + suite.Require().Equal("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + string(store.Get(types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")))) + }, + }, + { + name: "existing external address is overridden properly", + store: func(ctx sdk.Context) { + suite.k.SaveDefaultExternalAddress(ctx, "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos", "cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn") + }, + owner: "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + chainName: "cosmos", + target: "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + check: func(ctx sdk.Context) { + store := ctx.KVStore(suite.storeKey) + suite.Require().Equal("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + string(store.Get(types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")))) + }, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + ctx, _ := suite.ctx.CacheContext() + if tc.store != nil { + tc.store(ctx) + } + + suite.k.SaveDefaultExternalAddress(ctx, tc.owner, tc.chainName, tc.target) + if tc.check != nil { + tc.check(ctx) + } + }) + } + +} From 0d72816a496ccd2a8204437001d8c05bbed9ede1 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 10 Jun 2022 15:31:46 +0800 Subject: [PATCH 29/64] Add default external addresses to genesis --- proto/desmos/profiles/v2/genesis.proto | 14 +- x/profiles/keeper/alias_functions.go | 27 ++ x/profiles/keeper/genesis.go | 5 + x/profiles/simulation/genesis.go | 1 + x/profiles/types/genesis.go | 55 +++- x/profiles/types/genesis.pb.go | 405 ++++++++++++++++++++++--- x/profiles/types/genesis_test.go | 18 ++ 7 files changed, 482 insertions(+), 43 deletions(-) diff --git a/proto/desmos/profiles/v2/genesis.proto b/proto/desmos/profiles/v2/genesis.proto index fb3171287c..a3bcc078c8 100644 --- a/proto/desmos/profiles/v2/genesis.proto +++ b/proto/desmos/profiles/v2/genesis.proto @@ -35,8 +35,20 @@ message GenesisState { (gogoproto.moretags) = "yaml:\"chain_links\"" ]; - repeated ApplicationLink application_links = 5 [ + repeated DefaultExternalAddressEntry default_external_addresses = 5 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"default_external_addresses\"" + ]; + + repeated ApplicationLink application_links = 6 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"application_links\"" ]; } + +// DefaultExternalAddressEntry contains the data of a default extnernal address +message DefaultExternalAddressEntry { + string owner = 1; + string chain_name = 2; + string target = 3; +} \ No newline at end of file diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go index 338a408183..8e5ea77ed3 100644 --- a/x/profiles/keeper/alias_functions.go +++ b/x/profiles/keeper/alias_functions.go @@ -195,3 +195,30 @@ func (k Keeper) GetChainLinks(ctx sdk.Context) []types.ChainLink { }) return links } + +func (k Keeper) IterateDefaultExternalAddresses(ctx sdk.Context, fn func(entry types.DefaultExternalAddressEntry) (stop bool)) { + store := ctx.KVStore(k.storeKey) + + iterator := sdk.KVStorePrefixIterator(store, types.DefaultExternalAddressPrefix) + defer iterator.Close() + + i := int64(0) + for ; iterator.Valid(); iterator.Next() { + owner, chainName := types.GetDefaultExternalAddressData(iterator.Key()) + target := string(iterator.Value()) + stop := fn(types.NewDefaultExternalAddressEntry(owner, chainName, target)) + if stop { + break + } + i++ + } +} + +func (k Keeper) GetDefaultExternalAddressEntries(ctx sdk.Context) []types.DefaultExternalAddressEntry { + var entries []types.DefaultExternalAddressEntry + k.IterateDefaultExternalAddresses(ctx, func(entry types.DefaultExternalAddressEntry) (stop bool) { + entries = append(entries, entry) + return false + }) + return entries +} diff --git a/x/profiles/keeper/genesis.go b/x/profiles/keeper/genesis.go index 1900a5fee2..d56db92264 100644 --- a/x/profiles/keeper/genesis.go +++ b/x/profiles/keeper/genesis.go @@ -15,6 +15,7 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { k.GetParams(ctx), k.GetPort(ctx), k.GetChainLinks(ctx), + k.GetDefaultExternalAddressEntries(ctx), k.GetApplicationLinks(ctx), ) } @@ -63,6 +64,10 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) []abci.Val } } + for _, entry := range data.DefaultExternalAddresses { + k.SaveDefaultExternalAddress(ctx, entry.Owner, entry.ChainName, entry.Target) + } + // Store the application links for _, link := range data.ApplicationLinks { err := k.SaveApplicationLink(ctx, link) diff --git a/x/profiles/simulation/genesis.go b/x/profiles/simulation/genesis.go index 468b885a02..f1bd40f12d 100644 --- a/x/profiles/simulation/genesis.go +++ b/x/profiles/simulation/genesis.go @@ -60,6 +60,7 @@ func RandomizedGenState(simsState *module.SimulationState) { types.IBCPortID, randomChainLinks(profiles, simsState), nil, + nil, ) bz, err = simsState.Cdc.MarshalJSON(profileGenesis) diff --git a/x/profiles/types/genesis.go b/x/profiles/types/genesis.go index fbf09ec739..2a32194a71 100644 --- a/x/profiles/types/genesis.go +++ b/x/profiles/types/genesis.go @@ -1,7 +1,11 @@ package types import ( + "fmt" + "strings" + "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" host "github.com/cosmos/ibc-go/v3/modules/core/24-host" ) @@ -9,14 +13,16 @@ import ( func NewGenesisState( requests []DTagTransferRequest, params Params, portID string, - chainLinks []ChainLink, applicationLinks []ApplicationLink, + chainLinks []ChainLink, defaultExternalAddresses []DefaultExternalAddressEntry, + applicationLinks []ApplicationLink, ) *GenesisState { return &GenesisState{ - Params: params, - DTagTransferRequests: requests, - IBCPortID: portID, - ChainLinks: chainLinks, - ApplicationLinks: applicationLinks, + Params: params, + DTagTransferRequests: requests, + IBCPortID: portID, + ChainLinks: chainLinks, + DefaultExternalAddresses: defaultExternalAddresses, + ApplicationLinks: applicationLinks, } } @@ -33,7 +39,7 @@ func (g GenesisState) UnpackInterfaces(unpacker types.AnyUnpacker) error { // DefaultGenesisState returns a default GenesisState func DefaultGenesisState() *GenesisState { - return NewGenesisState(nil, DefaultParams(), IBCPortID, nil, nil) + return NewGenesisState(nil, DefaultParams(), IBCPortID, nil, nil, nil) } // ValidateGenesis validates the given genesis state and returns an error if something is invalid @@ -62,6 +68,13 @@ func ValidateGenesis(data *GenesisState) error { } } + for _, entry := range data.DefaultExternalAddresses { + err := entry.Validate() + if err != nil { + return err + } + } + for _, link := range data.ApplicationLinks { err = link.Validate() if err != nil { @@ -71,3 +84,31 @@ func ValidateGenesis(data *GenesisState) error { return nil } + +// -------------------------------------------------------------------------------------------------------------------- + +// NewDefaultExternalAddressEntry returns a new DefaultExternalAddressEntry instance +func NewDefaultExternalAddressEntry(owner, chainName, target string) DefaultExternalAddressEntry { + return DefaultExternalAddressEntry{ + Owner: owner, + ChainName: chainName, + Target: target, + } +} + +// Validate implements fmt.Validator +func (data DefaultExternalAddressEntry) Validate() error { + _, err := sdk.AccAddressFromBech32(data.Owner) + if err != nil { + return fmt.Errorf("invalid owner: %s", data.Owner) + } + + if strings.TrimSpace(data.ChainName) == "" { + return fmt.Errorf("invalid chain name: %s", data.ChainName) + } + + if strings.TrimSpace(data.Target) == "" { + return fmt.Errorf("invalid external address target: %s", data.Target) + } + return nil +} diff --git a/x/profiles/types/genesis.pb.go b/x/profiles/types/genesis.pb.go index e472cb2aac..5e23f96f78 100644 --- a/x/profiles/types/genesis.pb.go +++ b/x/profiles/types/genesis.pb.go @@ -25,11 +25,12 @@ 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"` + 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"` + DefaultExternalAddresses []DefaultExternalAddressEntry `protobuf:"bytes,5,rep,name=default_external_addresses,json=defaultExternalAddresses,proto3" json:"default_external_addresses" yaml:"default_external_addresses"` + ApplicationLinks []ApplicationLink `protobuf:"bytes,6,rep,name=application_links,json=applicationLinks,proto3" json:"application_links" yaml:"application_links"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -65,43 +66,112 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo +// DefaultExternalAddressEntry contains the data of a default extnernal address +type DefaultExternalAddressEntry struct { + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + ChainName string `protobuf:"bytes,2,opt,name=chain_name,json=chainName,proto3" json:"chain_name,omitempty"` + Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` +} + +func (m *DefaultExternalAddressEntry) Reset() { *m = DefaultExternalAddressEntry{} } +func (m *DefaultExternalAddressEntry) String() string { return proto.CompactTextString(m) } +func (*DefaultExternalAddressEntry) ProtoMessage() {} +func (*DefaultExternalAddressEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_be71125223ae0fd1, []int{1} +} +func (m *DefaultExternalAddressEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DefaultExternalAddressEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DefaultExternalAddressEntry.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 *DefaultExternalAddressEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_DefaultExternalAddressEntry.Merge(m, src) +} +func (m *DefaultExternalAddressEntry) XXX_Size() int { + return m.Size() +} +func (m *DefaultExternalAddressEntry) XXX_DiscardUnknown() { + xxx_messageInfo_DefaultExternalAddressEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_DefaultExternalAddressEntry proto.InternalMessageInfo + +func (m *DefaultExternalAddressEntry) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *DefaultExternalAddressEntry) GetChainName() string { + if m != nil { + return m.ChainName + } + return "" +} + +func (m *DefaultExternalAddressEntry) GetTarget() string { + if m != nil { + return m.Target + } + return "" +} + func init() { proto.RegisterType((*GenesisState)(nil), "desmos.profiles.v2.GenesisState") + proto.RegisterType((*DefaultExternalAddressEntry)(nil), "desmos.profiles.v2.DefaultExternalAddressEntry") } func init() { proto.RegisterFile("desmos/profiles/v2/genesis.proto", fileDescriptor_be71125223ae0fd1) } var fileDescriptor_be71125223ae0fd1 = []byte{ - // 463 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, 0xb7, 0xb7, 0x82, 0x07, 0xb3, 0x05, 0x59, 0xf4, 0x50, 0x62, 0x4f, 0xbd, 0x84, 0x49, - 0x32, 0x4d, 0x87, 0x26, 0x99, 0x71, 0x66, 0xba, 0xd8, 0x37, 0xf0, 0x28, 0x78, 0xf5, 0xe0, 0xe3, - 0xf4, 0xd8, 0xa3, 0xa7, 0x20, 0xd9, 0x37, 0xd8, 0x27, 0x90, 0xcd, 0x4c, 0x6c, 0x74, 0xb3, 0xde, - 0x42, 0x7e, 0x9f, 0xef, 0x1f, 0xbe, 0x8c, 0xe6, 0xa4, 0x90, 0x15, 0x98, 0xf9, 0x84, 0xe2, 0x0b, - 0x94, 0x43, 0xe6, 0x2f, 0xa6, 0x7e, 0x06, 0x4b, 0xc8, 0x10, 0xf3, 0x08, 0xc5, 0x1c, 0xeb, 0xba, - 0x20, 0xbc, 0x96, 0xf0, 0x16, 0x53, 0x73, 0x9c, 0xe1, 0x0c, 0x37, 0x67, 0x7f, 0xfd, 0x25, 0x48, - 0xf3, 0x45, 0x8f, 0x57, 0x81, 0x53, 0x98, 0xb3, 0x88, 0x00, 0x0a, 0x0a, 0xe9, 0x68, 0x1e, 0xfc, - 0x87, 0x13, 0xbf, 0x24, 0x78, 0xb8, 0x1d, 0x4c, 0x39, 0xc8, 0x22, 0x0a, 0x3f, 0x5d, 0x43, 0xc6, - 0x5b, 0xdf, 0x57, 0xdb, 0xf1, 0xe4, 0x12, 0xa0, 0x32, 0xca, 0x51, 0x79, 0xd5, 0xc2, 0x2f, 0xb7, - 0xc3, 0x80, 0x90, 0x2e, 0xea, 0x7e, 0x1b, 0x68, 0x8f, 0xde, 0x89, 0x4d, 0x3e, 0x72, 0xc0, 0xa1, - 0xfe, 0x5d, 0xd5, 0x9e, 0x37, 0x05, 0x38, 0x05, 0x25, 0xbb, 0x80, 0xf4, 0x4f, 0x13, 0x43, 0x75, - 0x76, 0x26, 0xa3, 0xe9, 0x81, 0xb7, 0x39, 0x9a, 0x77, 0x72, 0x06, 0xb2, 0x33, 0x29, 0x08, 0x05, - 0x1f, 0xbc, 0xb9, 0xad, 0x6c, 0xa5, 0xae, 0xec, 0x71, 0xcf, 0x91, 0xad, 0x2a, 0x7b, 0xef, 0x06, - 0x14, 0xf9, 0xb1, 0xdb, 0x1f, 0xe6, 0x86, 0xe3, 0xf5, 0xe1, 0x5f, 0x99, 0x3e, 0xd7, 0x76, 0xc5, - 0xde, 0xc6, 0x03, 0x47, 0x9d, 0x8c, 0xa6, 0x66, 0x5f, 0x9b, 0xd3, 0x86, 0x08, 0x9e, 0xad, 0x0b, - 0xac, 0x2a, 0xfb, 0xb1, 0x08, 0x12, 0x3a, 0x37, 0x94, 0x06, 0xfa, 0x4c, 0x1b, 0xa1, 0x38, 0x89, - 0x08, 0xa6, 0x3c, 0x42, 0xa9, 0xb1, 0xe3, 0xa8, 0x93, 0x61, 0xb0, 0x5f, 0x57, 0xf6, 0x70, 0x1e, - 0xcc, 0x4e, 0x31, 0xe5, 0xf3, 0x93, 0x55, 0x65, 0xeb, 0x42, 0xdc, 0x21, 0xdd, 0x70, 0x88, 0xe2, - 0xa4, 0x01, 0x52, 0xfd, 0x5c, 0x1b, 0x75, 0xf6, 0x37, 0x06, 0xcd, 0x44, 0x7b, 0x7d, 0xa5, 0x66, - 0x6b, 0xec, 0x03, 0x2a, 0xaf, 0x02, 0x53, 0xf6, 0x92, 0xd6, 0x1d, 0xbd, 0x1b, 0x6a, 0x49, 0x8b, - 0x31, 0x9d, 0x6a, 0x4f, 0x01, 0x21, 0x39, 0x4a, 0x00, 0x47, 0xb8, 0x4d, 0x78, 0xd8, 0x24, 0xec, - 0xf7, 0x25, 0xbc, 0xbd, 0x87, 0x9b, 0x1c, 0x47, 0xe6, 0x18, 0x22, 0x67, 0xc3, 0xcb, 0x0d, 0x9f, - 0x80, 0xbf, 0x25, 0xec, 0x78, 0xf0, 0xe5, 0x87, 0xad, 0x04, 0xef, 0x6f, 0x6b, 0x4b, 0xbd, 0xab, - 0x2d, 0xf5, 0x57, 0x6d, 0xa9, 0x5f, 0x97, 0x96, 0x72, 0xb7, 0xb4, 0x94, 0x9f, 0x4b, 0x4b, 0x39, - 0x7f, 0x9d, 0x21, 0x7e, 0x79, 0x1d, 0x7b, 0x09, 0x2e, 0x7c, 0x51, 0xe1, 0x30, 0x07, 0x31, 0x93, - 0xdf, 0xfe, 0xe2, 0xc8, 0xff, 0x7c, 0xff, 0xec, 0xf8, 0x0d, 0x81, 0x2c, 0xde, 0x6d, 0x5e, 0xda, - 0xd1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, 0x6d, 0x9f, 0x73, 0x8f, 0x03, 0x00, 0x00, + // 574 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xcf, 0x6e, 0xd3, 0x30, + 0x1c, 0xc7, 0x1b, 0xb6, 0x55, 0xaa, 0x0b, 0x12, 0x58, 0x65, 0x8a, 0x82, 0x96, 0x94, 0x4c, 0x62, + 0x9b, 0xd0, 0x12, 0xd1, 0xdd, 0x26, 0x71, 0x58, 0xba, 0x09, 0x55, 0x20, 0x34, 0x85, 0x9d, 0x76, + 0x89, 0xdc, 0xc4, 0xcd, 0xc2, 0x92, 0x38, 0xd8, 0x6e, 0x59, 0xdf, 0x80, 0x23, 0x47, 0x0e, 0x1c, + 0x78, 0x02, 0x9e, 0x63, 0xc7, 0x1d, 0x39, 0x45, 0xa8, 0x7d, 0x83, 0x3e, 0x01, 0xaa, 0xed, 0xb2, + 0xc2, 0xd2, 0xdd, 0xfc, 0xe7, 0xf3, 0xfd, 0xfd, 0xbe, 0xfe, 0xda, 0x06, 0xed, 0x08, 0xb3, 0x8c, + 0x30, 0xb7, 0xa0, 0x64, 0x90, 0xa4, 0x98, 0xb9, 0xa3, 0x8e, 0x1b, 0xe3, 0x1c, 0xb3, 0x84, 0x39, + 0x05, 0x25, 0x9c, 0x40, 0x28, 0x09, 0x67, 0x41, 0x38, 0xa3, 0x8e, 0xd1, 0x8a, 0x49, 0x4c, 0xc4, + 0xb6, 0x3b, 0x1f, 0x49, 0xd2, 0x78, 0x51, 0x51, 0x2b, 0x23, 0x11, 0x4e, 0x59, 0x50, 0x20, 0x8a, + 0x32, 0x55, 0xd1, 0xd8, 0xb9, 0x87, 0x93, 0x4b, 0x0a, 0xdc, 0x5f, 0x0d, 0x46, 0x1c, 0xc5, 0x01, + 0xc5, 0x9f, 0x86, 0x98, 0xf1, 0x45, 0xdd, 0x97, 0xab, 0xf1, 0xf0, 0x02, 0x25, 0x79, 0x90, 0x26, + 0xf9, 0xe5, 0x02, 0xde, 0x5b, 0x0d, 0xa3, 0xa2, 0x58, 0x46, 0xed, 0x9f, 0x1b, 0xe0, 0xe1, 0x1b, + 0x99, 0xc9, 0x07, 0x8e, 0x38, 0x86, 0xdf, 0x35, 0xb0, 0x29, 0x0c, 0x70, 0x8a, 0x72, 0x36, 0xc0, + 0xf4, 0xaf, 0x13, 0x5d, 0x6b, 0xaf, 0xed, 0x36, 0x3b, 0x3b, 0xce, 0xdd, 0xd0, 0x9c, 0xe3, 0x33, + 0x14, 0x9f, 0x29, 0x81, 0x2f, 0x79, 0xef, 0xf5, 0x75, 0x69, 0xd5, 0x26, 0xa5, 0xd5, 0xaa, 0xd8, + 0x64, 0xb3, 0xd2, 0xda, 0x1a, 0xa3, 0x2c, 0x3d, 0xb4, 0xab, 0x9b, 0xd9, 0x7e, 0x6b, 0xbe, 0xf1, + 0xbf, 0x0c, 0xf6, 0x40, 0x5d, 0xe6, 0xad, 0x3f, 0x68, 0x6b, 0xbb, 0xcd, 0x8e, 0x51, 0xe5, 0xe6, + 0x54, 0x10, 0xde, 0xd3, 0xb9, 0x81, 0x59, 0x69, 0x3d, 0x92, 0x8d, 0xa4, 0xce, 0xf6, 0x55, 0x01, + 0xd8, 0x05, 0xcd, 0xa4, 0x1f, 0x06, 0x05, 0xa1, 0x3c, 0x48, 0x22, 0x7d, 0xad, 0xad, 0xed, 0x36, + 0xbc, 0xed, 0x49, 0x69, 0x35, 0x7a, 0x5e, 0xf7, 0x94, 0x50, 0xde, 0x3b, 0x9e, 0x95, 0x16, 0x94, + 0xe2, 0x25, 0xd2, 0xf6, 0x1b, 0x49, 0x3f, 0x14, 0x40, 0x04, 0xcf, 0x41, 0x73, 0x29, 0x7f, 0x7d, + 0x5d, 0x44, 0xb4, 0x55, 0x65, 0xaa, 0x3b, 0xc7, 0xde, 0x25, 0xf9, 0xa5, 0x67, 0x28, 0x5f, 0xaa, + 0xf4, 0x92, 0xde, 0xf6, 0x41, 0xb8, 0xc0, 0x18, 0xfc, 0xa6, 0x01, 0x23, 0xc2, 0x03, 0x34, 0x4c, + 0x79, 0x80, 0xaf, 0x38, 0xa6, 0x39, 0x4a, 0x03, 0x14, 0x45, 0x14, 0x33, 0x86, 0x99, 0xbe, 0x21, + 0x7a, 0xb9, 0x95, 0xd7, 0x21, 0x55, 0x27, 0x4a, 0x74, 0x24, 0x35, 0x27, 0x39, 0xa7, 0x63, 0x6f, + 0x4f, 0x75, 0x7f, 0xae, 0xe2, 0x5f, 0xd9, 0xc0, 0xf6, 0xf5, 0xa8, 0xb2, 0x0e, 0x66, 0x90, 0x82, + 0x27, 0xa8, 0x28, 0xd2, 0x24, 0x44, 0x3c, 0x21, 0x8b, 0xc3, 0xd7, 0x85, 0xa1, 0xed, 0x2a, 0x43, + 0x47, 0xb7, 0xb0, 0x88, 0xa0, 0xad, 0x4c, 0xe8, 0xd2, 0xc4, 0x9d, 0x5a, 0xb6, 0xff, 0x18, 0xfd, + 0x2b, 0x61, 0x87, 0xeb, 0x5f, 0x7e, 0x58, 0x35, 0xfb, 0x23, 0x78, 0x76, 0xcf, 0xe9, 0x60, 0x0b, + 0x6c, 0x90, 0xcf, 0x39, 0xa6, 0xba, 0x36, 0xbf, 0x4e, 0x5f, 0x4e, 0xe0, 0x16, 0x90, 0xb9, 0x06, + 0x39, 0xca, 0xb0, 0x78, 0x39, 0x0d, 0xbf, 0x21, 0x56, 0xde, 0xa3, 0x0c, 0xc3, 0x4d, 0x50, 0xe7, + 0x88, 0xc6, 0x98, 0xcb, 0x47, 0xe0, 0xab, 0x99, 0xf7, 0xf6, 0x7a, 0x62, 0x6a, 0x37, 0x13, 0x53, + 0xfb, 0x3d, 0x31, 0xb5, 0xaf, 0x53, 0xb3, 0x76, 0x33, 0x35, 0x6b, 0xbf, 0xa6, 0x66, 0xed, 0xfc, + 0x55, 0x9c, 0xf0, 0x8b, 0x61, 0xdf, 0x09, 0x49, 0xe6, 0xca, 0xe3, 0xee, 0xa7, 0xa8, 0xcf, 0xd4, + 0xd8, 0x1d, 0x1d, 0xb8, 0x57, 0xb7, 0xbf, 0x8f, 0x8f, 0x0b, 0xcc, 0xfa, 0x75, 0xf1, 0xe1, 0x0e, + 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0xf1, 0x2a, 0x57, 0x23, 0x96, 0x04, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -135,6 +205,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x32 + } + } + if len(m.DefaultExternalAddresses) > 0 { + for iNdEx := len(m.DefaultExternalAddresses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DefaultExternalAddresses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x2a } } @@ -186,6 +270,50 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *DefaultExternalAddressEntry) 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 *DefaultExternalAddressEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DefaultExternalAddressEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Target) > 0 { + i -= len(m.Target) + copy(dAtA[i:], m.Target) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Target))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChainName) > 0 { + i -= len(m.ChainName) + copy(dAtA[i:], m.ChainName) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ChainName))) + i-- + dAtA[i] = 0x12 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { offset -= sovGenesis(v) base := offset @@ -221,6 +349,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.DefaultExternalAddresses) > 0 { + for _, e := range m.DefaultExternalAddresses { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } if len(m.ApplicationLinks) > 0 { for _, e := range m.ApplicationLinks { l = e.Size() @@ -230,6 +364,27 @@ func (m *GenesisState) Size() (n int) { return n } +func (m *DefaultExternalAddressEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.ChainName) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Target) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + func sovGenesis(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -399,6 +554,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultExternalAddresses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DefaultExternalAddresses = append(m.DefaultExternalAddresses, DefaultExternalAddressEntry{}) + if err := m.DefaultExternalAddresses[len(m.DefaultExternalAddresses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ApplicationLinks", wireType) } @@ -453,6 +642,152 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } return nil } +func (m *DefaultExternalAddressEntry) 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 ErrIntOverflowGenesis + } + 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: DefaultExternalAddressEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DefaultExternalAddressEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Target = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipGenesis(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/profiles/types/genesis_test.go b/x/profiles/types/genesis_test.go index c9958a22e5..157caab386 100644 --- a/x/profiles/types/genesis_test.go +++ b/x/profiles/types/genesis_test.go @@ -36,6 +36,7 @@ func TestValidateGenesis(t *testing.T) { types.IBCPortID, nil, nil, + nil, ), shouldErr: true, }, @@ -53,6 +54,7 @@ func TestValidateGenesis(t *testing.T) { types.IBCPortID, nil, nil, + nil, ), shouldErr: true, }, @@ -76,6 +78,19 @@ func TestValidateGenesis(t *testing.T) { ), }, nil, + nil, + ), + shouldErr: true, + }, + { + name: "invalid default external address return error", + genesis: types.NewGenesisState( + nil, + types.DefaultParams(), + types.IBCPortID, + nil, + []types.DefaultExternalAddressEntry{types.NewDefaultExternalAddressEntry("", "", "")}, + nil, ), shouldErr: true, }, @@ -86,6 +101,7 @@ func TestValidateGenesis(t *testing.T) { types.DefaultParams(), types.IBCPortID, nil, + nil, []types.ApplicationLink{ types.NewApplicationLink( "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", @@ -115,6 +131,7 @@ func TestValidateGenesis(t *testing.T) { "1235$512", nil, nil, + nil, ), shouldErr: true, }, @@ -154,6 +171,7 @@ func TestValidateGenesis(t *testing.T) { time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), }, + nil, []types.ApplicationLink{ types.NewApplicationLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", From 43d8c0d2f2621d37e58faca20c4f14e5e71aa86b Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 15 Jun 2022 19:01:22 +0800 Subject: [PATCH 30/64] Add genesis unit and sim tests --- x/profiles/keeper/genesis_test.go | 22 ++++++++++++++++++++++ x/profiles/simulation/genesis.go | 31 +++++++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/x/profiles/keeper/genesis_test.go b/x/profiles/keeper/genesis_test.go index b279a643c4..aa4c06a44f 100644 --- a/x/profiles/keeper/genesis_test.go +++ b/x/profiles/keeper/genesis_test.go @@ -30,6 +30,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { "", nil, nil, + nil, ), }, { @@ -80,6 +81,15 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { suite.Require().NoError(suite.k.SaveChainLink(ctx, link)) } + defaultExternalAddressEntries := []types.DefaultExternalAddressEntry{{ + Owner: "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + ChainName: "cosmos", + Target: chainLinkAccount.Bech32Address().GetValue(), + }} + for _, entry := range defaultExternalAddressEntries { + suite.k.SaveDefaultExternalAddress(ctx, entry.Owner, entry.ChainName, entry.Target) + } + applicationLinks := []types.ApplicationLink{ types.NewApplicationLink( "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", @@ -125,6 +135,13 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), ), }, + []types.DefaultExternalAddressEntry{ + types.NewDefaultExternalAddressEntry( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + chainLinkAccount.Bech32Address().GetValue(), + ), + }, []types.ApplicationLink{ types.NewApplicationLink( "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", @@ -176,6 +193,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { types.IBCPortID, nil, nil, + nil, ), check: func(ctx sdk.Context) { suite.Require().Equal([]types.DTagTransferRequest(nil), suite.k.GetDTagTransferRequests(ctx)) @@ -207,6 +225,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { ), }, nil, + nil, ), shouldErr: true, }, @@ -263,6 +282,9 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), }, + []types.DefaultExternalAddressEntry{ + types.NewDefaultExternalAddressEntry("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", ext.GetAddress().String()), + }, []types.ApplicationLink{ types.NewApplicationLink( "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", diff --git a/x/profiles/simulation/genesis.go b/x/profiles/simulation/genesis.go index f1bd40f12d..9f3da81ac1 100644 --- a/x/profiles/simulation/genesis.go +++ b/x/profiles/simulation/genesis.go @@ -49,6 +49,8 @@ func RandomizedGenState(simsState *module.SimulationState) { panic(err) } + chainLinks := randomChainLinks(profiles, simsState) + profileGenesis := types.NewGenesisState( randomDTagTransferRequests(profiles, simsState, simsState.Rand.Intn(profilesNumber)), types.NewParams( @@ -58,8 +60,8 @@ func RandomizedGenState(simsState *module.SimulationState) { RandomOracleParams(simsState.Rand), ), types.IBCPortID, - randomChainLinks(profiles, simsState), - nil, + chainLinks, + getDefaultExternalAddressEntries(chainLinks, simsState), nil, ) @@ -172,3 +174,28 @@ func containsChainLink(slice []types.ChainLink, link types.ChainLink) bool { } return false } + +// ------------------------------------------------------------------------------------------------------------------- + +// getDefaultExternalAddressEntries returns randomly generated genesis default external address entries +func getDefaultExternalAddressEntries( + links []types.ChainLink, simsState *module.SimulationState, +) []types.DefaultExternalAddressEntry { + entries := make([]types.DefaultExternalAddressEntry, 0, len(links)) + for _, link := range links { + entry := types.NewDefaultExternalAddressEntry(link.User, link.ChainConfig.Name, link.GetAddressData().GetValue()) + if !containsDefaultExternalAddressEntry(entries, entry) { + entries = append(entries, entry) + } + } + return entries +} + +func containsDefaultExternalAddressEntry(slice []types.DefaultExternalAddressEntry, entry types.DefaultExternalAddressEntry) bool { + for _, e := range slice { + if e.Owner == entry.Owner && e.ChainName == entry.ChainName { + return true + } + } + return false +} From cfaa63d40b9a1de9f12d0418a00e34fd7967ffee Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 15 Jun 2022 19:19:43 +0800 Subject: [PATCH 31/64] Fix link and add missing tests --- x/profiles/keeper/alias_functions.go | 5 +-- x/profiles/simulation/genesis.go | 6 ++-- x/profiles/types/genesis_test.go | 53 ++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 6 deletions(-) diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go index 8e5ea77ed3..404cc2e4fb 100644 --- a/x/profiles/keeper/alias_functions.go +++ b/x/profiles/keeper/alias_functions.go @@ -196,13 +196,13 @@ func (k Keeper) GetChainLinks(ctx sdk.Context) []types.ChainLink { return links } +// IterateDefaultExternalAddresses iterates through the default external addresses and performs the provided function func (k Keeper) IterateDefaultExternalAddresses(ctx sdk.Context, fn func(entry types.DefaultExternalAddressEntry) (stop bool)) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.DefaultExternalAddressPrefix) defer iterator.Close() - i := int64(0) for ; iterator.Valid(); iterator.Next() { owner, chainName := types.GetDefaultExternalAddressData(iterator.Key()) target := string(iterator.Value()) @@ -210,10 +210,11 @@ func (k Keeper) IterateDefaultExternalAddresses(ctx sdk.Context, fn func(entry t if stop { break } - i++ } } +// GetDefaultExternalAddressEntries returns a slice of DefaultExternalAddressEntry objects containing the details of all the +// default exnternal address entries stored inside the current context func (k Keeper) GetDefaultExternalAddressEntries(ctx sdk.Context) []types.DefaultExternalAddressEntry { var entries []types.DefaultExternalAddressEntry k.IterateDefaultExternalAddresses(ctx, func(entry types.DefaultExternalAddressEntry) (stop bool) { diff --git a/x/profiles/simulation/genesis.go b/x/profiles/simulation/genesis.go index 9f3da81ac1..11f6ee4bf8 100644 --- a/x/profiles/simulation/genesis.go +++ b/x/profiles/simulation/genesis.go @@ -61,7 +61,7 @@ func RandomizedGenState(simsState *module.SimulationState) { ), types.IBCPortID, chainLinks, - getDefaultExternalAddressEntries(chainLinks, simsState), + getDefaultExternalAddressEntries(chainLinks), nil, ) @@ -178,9 +178,7 @@ func containsChainLink(slice []types.ChainLink, link types.ChainLink) bool { // ------------------------------------------------------------------------------------------------------------------- // getDefaultExternalAddressEntries returns randomly generated genesis default external address entries -func getDefaultExternalAddressEntries( - links []types.ChainLink, simsState *module.SimulationState, -) []types.DefaultExternalAddressEntry { +func getDefaultExternalAddressEntries(links []types.ChainLink) []types.DefaultExternalAddressEntry { entries := make([]types.DefaultExternalAddressEntry, 0, len(links)) for _, link := range links { entry := types.NewDefaultExternalAddressEntry(link.User, link.ChainConfig.Name, link.GetAddressData().GetValue()) diff --git a/x/profiles/types/genesis_test.go b/x/profiles/types/genesis_test.go index 157caab386..a2113db556 100644 --- a/x/profiles/types/genesis_test.go +++ b/x/profiles/types/genesis_test.go @@ -209,3 +209,56 @@ func TestValidateGenesis(t *testing.T) { }) } } + +func TestDefaultExternalAddressEntry_Validate(t *testing.T) { + testCases := []struct { + name string + entry types.DefaultExternalAddressEntry + shouldErr bool + }{ + { + name: "invalid owner returns error", + entry: types.NewDefaultExternalAddressEntry("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "", ""), + shouldErr: true, + }, + { + name: "invalid chain name returns error - empty", + entry: types.NewDefaultExternalAddressEntry("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "", ""), + shouldErr: true, + }, + { + name: "invalid chain name returns error - blank", + entry: types.NewDefaultExternalAddressEntry("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", " ", ""), + shouldErr: true, + }, + { + name: "invalid target returns error - empty", + entry: types.NewDefaultExternalAddressEntry("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos", ""), + shouldErr: true, + }, + { + name: "invalid target returns error - blank", + entry: types.NewDefaultExternalAddressEntry("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos", " "), + shouldErr: true, + }, + { + name: "valid entry returns no error", + entry: types.NewDefaultExternalAddressEntry("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos", "cosmos1s3nh6tafl4amaxkke9kdejhp09lk93g9ev39r4"), + shouldErr: true, + }, + } + + for _, tc := range testCases { + tc := tc + + t.Run(tc.name, func(t *testing.T) { + err := tc.entry.Validate() + + if tc.shouldErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} From 4b6376be5dd27b8f1b5d9fca2f3c58ae22671819 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 15 Jun 2022 19:25:11 +0800 Subject: [PATCH 32/64] Fix test --- x/profiles/types/genesis_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/profiles/types/genesis_test.go b/x/profiles/types/genesis_test.go index a2113db556..01e27356a4 100644 --- a/x/profiles/types/genesis_test.go +++ b/x/profiles/types/genesis_test.go @@ -244,7 +244,7 @@ func TestDefaultExternalAddressEntry_Validate(t *testing.T) { { name: "valid entry returns no error", entry: types.NewDefaultExternalAddressEntry("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos", "cosmos1s3nh6tafl4amaxkke9kdejhp09lk93g9ev39r4"), - shouldErr: true, + shouldErr: false, }, } From dc116cca9983efbf42ce6b7dccd11e0afb66c2c3 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 15 Jun 2022 19:32:57 +0800 Subject: [PATCH 33/64] Add migrations --- x/profiles/keeper/migrations.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/profiles/keeper/migrations.go b/x/profiles/keeper/migrations.go index a5f4f50bf9..80adf4c0eb 100644 --- a/x/profiles/keeper/migrations.go +++ b/x/profiles/keeper/migrations.go @@ -7,6 +7,7 @@ import ( v4 "github.com/desmos-labs/desmos/v3/x/profiles/legacy/v4" v5 "github.com/desmos-labs/desmos/v3/x/profiles/legacy/v5" + v6 "github.com/desmos-labs/desmos/v3/x/profiles/legacy/v6" ) // DONTCOVER @@ -36,3 +37,8 @@ func (m Migrator) Migrate4to5(ctx sdk.Context) error { func (m Migrator) Migrate5To6(ctx sdk.Context) error { return v5.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc, m.keeper.legacyAmino) } + +// Migrate5To6 migrates from version 6 to 7. +func (m Migrator) Migrate6To7(ctx sdk.Context) error { + return v6.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc) +} From 989794a44f00c3dd4984f146d24b6366780dc6ea Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 15 Jun 2022 19:56:55 +0800 Subject: [PATCH 34/64] Update changeset --- ...0d65d536627bc73880d65a9cad24048ca60a6c2420c028180f3.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/entries/88359bd8fafae0d65d536627bc73880d65a9cad24048ca60a6c2420c028180f3.yaml diff --git a/.changeset/entries/88359bd8fafae0d65d536627bc73880d65a9cad24048ca60a6c2420c028180f3.yaml b/.changeset/entries/88359bd8fafae0d65d536627bc73880d65a9cad24048ca60a6c2420c028180f3.yaml new file mode 100644 index 0000000000..22af2bacfc --- /dev/null +++ b/.changeset/entries/88359bd8fafae0d65d536627bc73880d65a9cad24048ca60a6c2420c028180f3.yaml @@ -0,0 +1,6 @@ +type: feat +module: x/profiles +pull_request: 887 +description: implement adr 013 per-chain default address +backward_compatible: true +date: 2022-06-15T11:56:47.0160117Z From c3a9b14061cf88664362f88bd3f0310be123fcbc Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 15 Jun 2022 20:00:22 +0800 Subject: [PATCH 35/64] Update adr status --- docs/architecture/adr-013-per-chain-default-address.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/architecture/adr-013-per-chain-default-address.md b/docs/architecture/adr-013-per-chain-default-address.md index fc144202dc..d6bedb1c4b 100644 --- a/docs/architecture/adr-013-per-chain-default-address.md +++ b/docs/architecture/adr-013-per-chain-default-address.md @@ -6,7 +6,7 @@ ## Status -DRAFT Not Implemented +ACCEPTED Implemented ## Abstract @@ -47,7 +47,7 @@ message MsgSetDefaultExternalAddress { string chain_name = 1; // Address to be set as the default one - string external_address = 2; + string target = 2; // User signing the message string signer = 3; From b2b681fc57c829ec61ad7dfa4457795eca249a8d Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 16 Jun 2022 13:18:18 +0800 Subject: [PATCH 36/64] move SaveDefaultExternalAddress out of SaveChainLink --- x/profiles/client/cli/cli_chain_links_test.go | 2 +- x/profiles/client/cli/cli_test.go | 8 +++ x/profiles/keeper/grpc_query_test.go | 9 +++ x/profiles/keeper/keeper_chain_links.go | 10 --- x/profiles/keeper/keeper_chain_links_test.go | 71 ------------------- x/profiles/keeper/msg_server_chain_link.go | 9 +++ 6 files changed, 27 insertions(+), 82 deletions(-) diff --git a/x/profiles/client/cli/cli_chain_links_test.go b/x/profiles/client/cli/cli_chain_links_test.go index ab74889bf7..41bbf00f69 100644 --- a/x/profiles/client/cli/cli_chain_links_test.go +++ b/x/profiles/client/cli/cli_chain_links_test.go @@ -206,7 +206,7 @@ func (s *IntegrationTestSuite) TestCmdQueryDefaultExternalAddress() { expectedOutput types.QueryDefaultExternalAddressesResponse }{ { - name: "All default chain links are returned properly", + name: "all default chain links are returned properly", args: []string{ fmt.Sprintf("--%s=json", tmcli.OutputFlag), }, diff --git a/x/profiles/client/cli/cli_test.go b/x/profiles/client/cli/cli_test.go index 1d43f4e48e..5fec4aaf36 100644 --- a/x/profiles/client/cli/cli_test.go +++ b/x/profiles/client/cli/cli_test.go @@ -142,6 +142,14 @@ func (s *IntegrationTestSuite) SetupSuite() { ), } + profilesData.DefaultExternalAddresses = []types.DefaultExternalAddressEntry{ + types.NewDefaultExternalAddressEntry( + "cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", + s.testChainLinkAccount.ChainName(), + s.testChainLinkAccount.Bech32Address().GetValue(), + ), + } + profilesDataBz, err := cfg.Codec.MarshalJSON(&profilesData) s.Require().NoError(err) genesisState[types.ModuleName] = profilesDataBz diff --git a/x/profiles/keeper/grpc_query_test.go b/x/profiles/keeper/grpc_query_test.go index 115e37aa73..a2443bf27c 100644 --- a/x/profiles/keeper/grpc_query_test.go +++ b/x/profiles/keeper/grpc_query_test.go @@ -652,6 +652,9 @@ func (suite *KeeperTestSuite) TestQueryServer_DefaultExternalAddresses() { suite.Require().NoError(suite.k.SaveChainLink(ctx, firstChainLink)) suite.Require().NoError(suite.k.SaveChainLink(ctx, secondChainLink)) + + suite.k.SaveDefaultExternalAddress(ctx, firstChainLink.User, firstChainLink.ChainConfig.Name, firstChainLink.GetAddressData().GetValue()) + suite.k.SaveDefaultExternalAddress(ctx, secondChainLink.User, secondChainLink.ChainConfig.Name, secondChainLink.GetAddressData().GetValue()) }, request: types.NewQueryDefaultExternalAddressesRequest("", "", nil), shouldErr: false, @@ -665,6 +668,9 @@ func (suite *KeeperTestSuite) TestQueryServer_DefaultExternalAddresses() { suite.Require().NoError(suite.k.SaveChainLink(ctx, firstChainLink)) suite.Require().NoError(suite.k.SaveChainLink(ctx, secondChainLink)) + + suite.k.SaveDefaultExternalAddress(ctx, firstChainLink.User, firstChainLink.ChainConfig.Name, firstChainLink.GetAddressData().GetValue()) + suite.k.SaveDefaultExternalAddress(ctx, secondChainLink.User, secondChainLink.ChainConfig.Name, secondChainLink.GetAddressData().GetValue()) }, request: types.NewQueryDefaultExternalAddressesRequest("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "", nil), shouldErr: false, @@ -678,6 +684,9 @@ func (suite *KeeperTestSuite) TestQueryServer_DefaultExternalAddresses() { suite.Require().NoError(suite.k.SaveChainLink(ctx, firstChainLink)) suite.Require().NoError(suite.k.SaveChainLink(ctx, secondChainLink)) + + suite.k.SaveDefaultExternalAddress(ctx, firstChainLink.User, firstChainLink.ChainConfig.Name, firstChainLink.GetAddressData().GetValue()) + suite.k.SaveDefaultExternalAddress(ctx, secondChainLink.User, secondChainLink.ChainConfig.Name, secondChainLink.GetAddressData().GetValue()) }, request: types.NewQueryDefaultExternalAddressesRequest("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos", nil), shouldErr: false, diff --git a/x/profiles/keeper/keeper_chain_links.go b/x/profiles/keeper/keeper_chain_links.go index 96eaf8b7b7..5408ba55aa 100644 --- a/x/profiles/keeper/keeper_chain_links.go +++ b/x/profiles/keeper/keeper_chain_links.go @@ -50,11 +50,6 @@ func (k Keeper) SaveChainLink(ctx sdk.Context, link types.ChainLink) error { store.Set(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, target), types.MustMarshalChainLink(k.cdc, link)) store.Set(types.ChainLinkOwnerKey(link.ChainConfig.Name, target, link.User), []byte{0x01}) - // The first chain link of each chain for the owner will be set as default external address - if !k.HasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { - k.SaveDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name, srcAddrData.GetValue()) - } - k.AfterChainLinkSaved(ctx, link) return nil } @@ -79,16 +74,11 @@ func (k Keeper) GetChainLink(ctx sdk.Context, owner, chainName, target string) ( } // DeleteChainLink deletes the link associated with the given address and chain name -// If the deleted chain link is default external address, the default external address will be updated to be oldest one func (k Keeper) DeleteChainLink(ctx sdk.Context, link types.ChainLink) { store := ctx.KVStore(k.storeKey) store.Delete(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, link.GetAddressData().GetValue())) store.Delete(types.ChainLinkOwnerKey(link.ChainConfig.Name, link.GetAddressData().GetValue(), link.User)) - // If the deleted chain link is the default external address, update the default external address for owner - if k.isDefaultExternalAddress(ctx, link) { - k.updateOwnerDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) - } k.AfterChainLinkDeleted(ctx, link) } diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index fd4aaeb65c..f26ed575d1 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -270,7 +270,6 @@ func (suite *KeeperTestSuite) TestKeeper_GetChainLink() { func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { account := profilestesting.GetChainLinkAccount("cosmos", "cosmos") - olderAccount := profilestesting.GetChainLinkAccount("cosmos", "cosmos") testCases := []struct { name string store func(ctx sdk.Context) @@ -300,12 +299,6 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { "cosmos", account.Bech32Address().GetValue(), )) - - // Check default external address key - suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos", - )) }, }, { @@ -331,12 +324,6 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { "cosmos", account.Bech32Address().GetValue(), )) - - // Check default external address key - suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos", - )) }, }, { @@ -362,12 +349,6 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { "cosmos", account.Bech32Address().GetValue(), )) - - // Check default external address key - suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos", - )) }, }, { @@ -398,58 +379,6 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { account.Bech32Address().GetValue(), "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", ))) - - // Check default external address is deleted properly - suite.Require().False(suite.k.HasDefaultExternalAddress(ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos", - )) - }, - }, - { - name: "proper data delete the link - update default external address", - store: func(ctx sdk.Context) { - suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x"))) - err := suite.k.SaveChainLink(ctx, account.GetBech32ChainLink( - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), - )) - suite.Require().NoError(err) - - err = suite.k.SaveChainLink(ctx, olderAccount.GetBech32ChainLink( - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), - )) - suite.Require().NoError(err) - }, - link: account.GetBech32ChainLink( - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), - ), - check: func(ctx sdk.Context) { - suite.Require().False(suite.k.HasChainLink(ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos", - account.Bech32Address().GetValue(), - )) - - // Check the additional keys - store := ctx.KVStore(suite.storeKey) - suite.Require().False(store.Has(types.ChainLinkOwnerKey( - "cosmos", - account.Bech32Address().GetValue(), - "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", - ))) - - // Check default external address key is updated properly - suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos", - )) - suite.Require().Equal( - olderAccount.Bech32Address().Value, - string(store.Get(types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos"))), - ) }, }, } diff --git a/x/profiles/keeper/msg_server_chain_link.go b/x/profiles/keeper/msg_server_chain_link.go index 64892a019f..dd12e891af 100644 --- a/x/profiles/keeper/msg_server_chain_link.go +++ b/x/profiles/keeper/msg_server_chain_link.go @@ -25,6 +25,11 @@ func (k msgServer) LinkChainAccount(goCtx context.Context, msg *types.MsgLinkCha return nil, err } + // The first chain link of each chain for the owner will be set as default external address + if !k.HasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { + k.SaveDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name, srcAddrData.GetValue()) + } + ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( sdk.EventTypeMessage, @@ -56,6 +61,10 @@ func (k msgServer) UnlinkChainAccount(goCtx context.Context, msg *types.MsgUnlin // Delete the link k.DeleteChainLink(ctx, link) + if k.isDefaultExternalAddress(ctx, link) { + k.updateOwnerDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) + } + ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( sdk.EventTypeMessage, From 98fb4f0de94c7ffb5509668308cdad7b8b3795b9 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 15 Jul 2022 11:37:36 +0200 Subject: [PATCH 37/64] updated migration tests Signed-off-by: Riccardo Montagnin --- x/profiles/legacy/v6/store.go | 2 +- x/profiles/legacy/v6/store_test.go | 43 +- x/profiles/types/genesis.go | 3 +- x/profiles/types/genesis.pb.go | 411 ++++++++++++++-- x/profiles/types/msg_server.pb.go | 102 ++-- x/profiles/types/msgs_chain_links.pb.go | 465 ++++++++++++++++-- x/profiles/types/query.pb.go | 123 +++-- x/profiles/types/query.pb.gw.go | 80 +++ x/profiles/types/query_chain_links.pb.go | 597 +++++++++++++++++++++-- 9 files changed, 1628 insertions(+), 198 deletions(-) diff --git a/x/profiles/legacy/v6/store.go b/x/profiles/legacy/v6/store.go index 306c533e78..64feb71080 100644 --- a/x/profiles/legacy/v6/store.go +++ b/x/profiles/legacy/v6/store.go @@ -46,7 +46,7 @@ func MigrateStore(ctx sdk.Context, ak authkeeper.AccountKeeper, storeKey sdk.Sto } // Set the default external addresses - err := setDefaultExternalAddresses(store, cdc) + err = setDefaultExternalAddresses(store, cdc) if err != nil { return err } diff --git a/x/profiles/legacy/v6/store_test.go b/x/profiles/legacy/v6/store_test.go index b59a9e63e0..ff0bf3d0cf 100644 --- a/x/profiles/legacy/v6/store_test.go +++ b/x/profiles/legacy/v6/store_test.go @@ -233,43 +233,36 @@ func TestMigrateStore(t *testing.T) { store: func(ctx sdk.Context) { kvStore := ctx.KVStore(keys[types.StoreKey]) - // Store the chain links - newerChainLink := newerChainAccount.GetBech32ChainLink( - "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", - time.Date(2020, 1, 3, 00, 00, 00, 000, time.UTC), - ) - - kvStore.Set( - profilestypes.ChainLinksStoreKey( - "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", - "cosmos", - newerChainAccount.Bech32Address().Value, - ), - cdc.MustMarshal(&newerChainLink), - ) + sig, err := hex.DecodeString("1234") + require.NoError(t, err) - olderChainLink := olderChainAccount.GetBech32ChainLink( + 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( - profilestypes.ChainLinksStoreKey( + types.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", - olderChainAccount.Bech32Address().Value, + "cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", ), - cdc.MustMarshal(&olderChainLink), + cdc.MustMarshal(&chainLink), ) }, check: func(ctx sdk.Context) { kvStore := ctx.KVStore(keys[types.StoreKey]) - - key := profilestypes.DefaultExternalAddressKey( - "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", - "cosmos", - ) - require.Equal(t, []byte(olderChainAccount.Bech32Address().Value), kvStore.Get(key)) + key := types.DefaultExternalAddressKey("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos") + require.Equal(t, []byte("cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs"), kvStore.Get(key)) }, }, } diff --git a/x/profiles/types/genesis.go b/x/profiles/types/genesis.go index 2a32194a71..ac7f9d4fb0 100644 --- a/x/profiles/types/genesis.go +++ b/x/profiles/types/genesis.go @@ -13,7 +13,8 @@ import ( func NewGenesisState( requests []DTagTransferRequest, params Params, portID string, - chainLinks []ChainLink, defaultExternalAddresses []DefaultExternalAddressEntry, + chainLinks []ChainLink, + defaultExternalAddresses []DefaultExternalAddressEntry, applicationLinks []ApplicationLink, ) *GenesisState { return &GenesisState{ diff --git a/x/profiles/types/genesis.pb.go b/x/profiles/types/genesis.pb.go index 3bc417f368..10b14c5582 100644 --- a/x/profiles/types/genesis.pb.go +++ b/x/profiles/types/genesis.pb.go @@ -25,11 +25,12 @@ 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"` - 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"` + DTagTransferRequests []DTagTransferRequest `protobuf:"bytes,1,rep,name=dtag_transfer_requests,json=dtagTransferRequests,proto3" json:"dtag_transfer_requests" yaml:"dtag_transfer_requests"` + 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"` + DefaultExternalAddresses []DefaultExternalAddressEntry `protobuf:"bytes,4,rep,name=default_external_addresses,json=defaultExternalAddresses,proto3" json:"default_external_addresses" yaml:"default_external_addresses"` + IBCPortID string `protobuf:"bytes,5,opt,name=ibc_port_id,json=ibcPortId,proto3" json:"ibc_port_id,omitempty" yaml:"ibc_port_id"` + Params Params `protobuf:"bytes,6,opt,name=params,proto3" json:"params" yaml:"params"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -65,43 +66,112 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo +// DefaultExternalAddressEntry contains the data of a default extnernal address +type DefaultExternalAddressEntry struct { + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + ChainName string `protobuf:"bytes,2,opt,name=chain_name,json=chainName,proto3" json:"chain_name,omitempty"` + Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` +} + +func (m *DefaultExternalAddressEntry) Reset() { *m = DefaultExternalAddressEntry{} } +func (m *DefaultExternalAddressEntry) String() string { return proto.CompactTextString(m) } +func (*DefaultExternalAddressEntry) ProtoMessage() {} +func (*DefaultExternalAddressEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_bd22d098f73f0a1c, []int{1} +} +func (m *DefaultExternalAddressEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DefaultExternalAddressEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DefaultExternalAddressEntry.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 *DefaultExternalAddressEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_DefaultExternalAddressEntry.Merge(m, src) +} +func (m *DefaultExternalAddressEntry) XXX_Size() int { + return m.Size() +} +func (m *DefaultExternalAddressEntry) XXX_DiscardUnknown() { + xxx_messageInfo_DefaultExternalAddressEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_DefaultExternalAddressEntry proto.InternalMessageInfo + +func (m *DefaultExternalAddressEntry) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *DefaultExternalAddressEntry) GetChainName() string { + if m != nil { + return m.ChainName + } + return "" +} + +func (m *DefaultExternalAddressEntry) GetTarget() string { + if m != nil { + return m.Target + } + return "" +} + func init() { proto.RegisterType((*GenesisState)(nil), "desmos.profiles.v3.GenesisState") + proto.RegisterType((*DefaultExternalAddressEntry)(nil), "desmos.profiles.v3.DefaultExternalAddressEntry") } func init() { proto.RegisterFile("desmos/profiles/v3/genesis.proto", fileDescriptor_bd22d098f73f0a1c) } 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, 0xbb, 0x9e, 0x0a, 0x1e, 0xcc, 0x16, 0x64, 0xd1, 0x43, 0x89, 0x3d, 0xf5, 0x12, 0x26, - 0xc9, 0x34, 0x1d, 0x9a, 0x64, 0xc6, 0x99, 0xe9, 0x62, 0xdf, 0xc0, 0xa3, 0xe0, 0xd5, 0x83, 0x8f, - 0xd3, 0x63, 0x8f, 0x9e, 0x82, 0x64, 0xdf, 0xa0, 0x4f, 0x20, 0x3b, 0x93, 0xb8, 0xd1, 0x66, 0x7b, - 0x1b, 0xf2, 0xfb, 0x7c, 0xff, 0xe4, 0xc7, 0x4f, 0x73, 0x52, 0xc8, 0x0a, 0xcc, 0x7c, 0x42, 0xf1, - 0x19, 0xca, 0x21, 0xf3, 0x17, 0x53, 0x3f, 0x83, 0x25, 0x64, 0x88, 0x79, 0x84, 0x62, 0x8e, 0x75, - 0x5d, 0x12, 0x5e, 0x4b, 0x78, 0x8b, 0xa9, 0x39, 0xce, 0x70, 0x86, 0xc5, 0xd8, 0x5f, 0xbd, 0x24, - 0x69, 0xbe, 0xe8, 0xf1, 0x2a, 0x70, 0x0a, 0x73, 0x16, 0x11, 0x40, 0x41, 0xd1, 0x38, 0x9a, 0x7b, - 0xf7, 0x70, 0xf2, 0x53, 0x03, 0xee, 0x6f, 0x06, 0x53, 0x0e, 0xb2, 0x88, 0xc2, 0xcf, 0x97, 0x90, - 0xf1, 0xd6, 0xf7, 0xd5, 0x66, 0x3c, 0x39, 0x07, 0xa8, 0x8c, 0x72, 0x54, 0x5e, 0xb4, 0xf0, 0xcb, - 0xcd, 0x30, 0x20, 0xa4, 0x8b, 0xba, 0xdf, 0x07, 0xda, 0xa3, 0xf7, 0x72, 0x27, 0x9f, 0x38, 0xe0, - 0x50, 0xff, 0xa1, 0x6a, 0xcf, 0x45, 0x01, 0x4e, 0x41, 0xc9, 0xce, 0x20, 0xfd, 0xdb, 0xc4, 0x50, - 0x9d, 0xad, 0xc9, 0xe8, 0x60, 0xcf, 0xbb, 0xbb, 0x34, 0xef, 0xe8, 0x04, 0x64, 0x27, 0x8d, 0x20, - 0x94, 0x7c, 0xf0, 0xf6, 0xba, 0xb2, 0x95, 0xba, 0xb2, 0xc7, 0x3d, 0x43, 0x76, 0x5b, 0xd9, 0x3b, - 0x57, 0xa0, 0xc8, 0x0f, 0xdd, 0xfe, 0x30, 0x37, 0x1c, 0xaf, 0x06, 0xff, 0xcb, 0xf4, 0x53, 0x6d, - 0xd4, 0xf9, 0x5f, 0xe3, 0x81, 0xa8, 0xb4, 0xd3, 0x57, 0x69, 0xb6, 0xc2, 0x3e, 0xa2, 0xf2, 0x22, - 0x30, 0x57, 0x45, 0x6e, 0x2b, 0x5b, 0x97, 0x81, 0x1d, 0xbd, 0x1b, 0x6a, 0x49, 0x8b, 0x31, 0x9d, - 0x6a, 0x4f, 0x01, 0x21, 0x39, 0x4a, 0x00, 0x47, 0xb8, 0x4d, 0xd8, 0x12, 0x09, 0xbb, 0x7d, 0x09, - 0xef, 0xd6, 0xb0, 0xc8, 0x71, 0x9a, 0x1c, 0x43, 0xe6, 0xdc, 0xf1, 0x72, 0xc3, 0x27, 0xe0, 0x5f, - 0x09, 0xd3, 0x67, 0xda, 0x08, 0xc5, 0x49, 0x44, 0x30, 0xe5, 0x11, 0x4a, 0x8d, 0x81, 0xa3, 0x4e, - 0x86, 0xc1, 0x6e, 0x5d, 0xd9, 0xc3, 0x79, 0x30, 0x3b, 0xc6, 0x94, 0xcf, 0x8f, 0xd6, 0xcd, 0x3b, - 0xa4, 0x1b, 0x0e, 0x51, 0x9c, 0x08, 0x20, 0xd5, 0xe7, 0xda, 0xb6, 0x3c, 0x42, 0xe3, 0xa1, 0xa3, - 0x4e, 0x46, 0x07, 0x66, 0x5f, 0xdb, 0x63, 0x41, 0x04, 0xcf, 0x9a, 0x92, 0x8f, 0xa5, 0xa5, 0xd4, - 0xb9, 0x61, 0x63, 0x70, 0x38, 0xf8, 0xfa, 0xd3, 0x56, 0x82, 0x0f, 0xd7, 0xb5, 0xa5, 0xde, 0xd4, - 0x96, 0xfa, 0xbb, 0xb6, 0xd4, 0x6f, 0x4b, 0x4b, 0xb9, 0x59, 0x5a, 0xca, 0xaf, 0xa5, 0xa5, 0x9c, - 0xbe, 0xce, 0x10, 0x3f, 0xbf, 0x8c, 0xbd, 0x04, 0x17, 0xbe, 0x0c, 0xd9, 0xcf, 0x41, 0xcc, 0x9a, - 0xb7, 0xbf, 0x78, 0xe3, 0x7f, 0x59, 0x9f, 0x1d, 0xbf, 0x22, 0x90, 0xc5, 0xdb, 0xe2, 0xd2, 0xa6, - 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x28, 0x41, 0x3b, 0xa9, 0x8f, 0x03, 0x00, 0x00, + // 572 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0x9b, 0xfd, 0xa9, 0x54, 0x17, 0x24, 0xb0, 0xca, 0x14, 0x05, 0x2d, 0x29, 0x99, 0xc4, + 0x3a, 0xa1, 0x25, 0x62, 0xe5, 0x34, 0x89, 0xc3, 0xd2, 0x4d, 0xa8, 0x02, 0xa1, 0x29, 0xec, 0xb4, + 0x4b, 0xe4, 0x26, 0x6e, 0x16, 0x96, 0xc4, 0xc1, 0x76, 0xcb, 0xfa, 0x0d, 0x38, 0x72, 0xe4, 0xc0, + 0x81, 0x4f, 0xc0, 0xe7, 0xd8, 0x71, 0x47, 0x4e, 0x15, 0x6a, 0xbf, 0xc1, 0x3e, 0x01, 0xaa, 0xed, + 0xd2, 0xc2, 0xd2, 0xdd, 0x62, 0xbf, 0xbf, 0xe7, 0x7d, 0x9e, 0xf7, 0x8d, 0x0c, 0x9a, 0x11, 0x66, + 0x19, 0x61, 0x6e, 0x41, 0x49, 0x3f, 0x49, 0x31, 0x73, 0x87, 0x6d, 0x37, 0xc6, 0x39, 0x66, 0x09, + 0x73, 0x0a, 0x4a, 0x38, 0x81, 0x50, 0x12, 0xce, 0x9c, 0x70, 0x86, 0x6d, 0xa3, 0x11, 0x93, 0x98, + 0x88, 0xb2, 0x3b, 0xfb, 0x92, 0xa4, 0xf1, 0xbc, 0xa4, 0x57, 0x46, 0x22, 0x9c, 0xb2, 0xa0, 0x40, + 0x14, 0x65, 0xaa, 0xa3, 0xb1, 0x7b, 0x0f, 0x27, 0xaf, 0x14, 0xb8, 0xbf, 0x1a, 0x8c, 0x38, 0x8a, + 0x03, 0x8a, 0x3f, 0x0d, 0x30, 0xe3, 0xf3, 0xbe, 0x2f, 0x56, 0xe3, 0xe1, 0x05, 0x4a, 0xf2, 0x20, + 0x4d, 0xf2, 0xcb, 0x39, 0xbc, 0xb7, 0x1a, 0x46, 0x45, 0xb1, 0x8c, 0xda, 0x3f, 0x37, 0xc1, 0x83, + 0x37, 0x72, 0x27, 0x1f, 0x38, 0xe2, 0x18, 0x7e, 0xd7, 0xc0, 0x96, 0x08, 0xc0, 0x29, 0xca, 0x59, + 0x1f, 0xd3, 0xbf, 0x49, 0x74, 0xad, 0xb9, 0xde, 0xaa, 0x1f, 0xec, 0x3a, 0x77, 0x97, 0xe6, 0x1c, + 0x9f, 0xa1, 0xf8, 0x4c, 0x09, 0x7c, 0xc9, 0x7b, 0xaf, 0xaf, 0xc7, 0x56, 0x65, 0x32, 0xb6, 0x1a, + 0x25, 0x45, 0x76, 0x3b, 0xb6, 0xb6, 0x47, 0x28, 0x4b, 0x0f, 0xed, 0x72, 0x33, 0xdb, 0x6f, 0xcc, + 0x0a, 0xff, 0xcb, 0xe0, 0x39, 0xa8, 0x2f, 0xcd, 0xab, 0xaf, 0x89, 0x48, 0xdb, 0x65, 0x91, 0x3a, + 0x33, 0xec, 0x5d, 0x92, 0x5f, 0x7a, 0xc6, 0x2c, 0xc8, 0xed, 0xd8, 0x82, 0xd2, 0x70, 0x49, 0x6f, + 0xfb, 0x20, 0x9c, 0x63, 0x0c, 0x52, 0xf0, 0x18, 0x15, 0x45, 0x9a, 0x84, 0x88, 0x27, 0x64, 0xee, + 0xb0, 0x2e, 0x1c, 0x76, 0xca, 0x1c, 0x8e, 0x16, 0xb0, 0xf0, 0x69, 0x2a, 0x1f, 0x5d, 0xfa, 0xdc, + 0xe9, 0x65, 0xfb, 0x8f, 0xd0, 0xbf, 0x12, 0x06, 0xbf, 0x69, 0xc0, 0x88, 0x70, 0x1f, 0x0d, 0x52, + 0x1e, 0xe0, 0x2b, 0x8e, 0x69, 0x8e, 0xd2, 0x00, 0x45, 0x11, 0xc5, 0x8c, 0x61, 0xa6, 0x6f, 0x08, + 0x77, 0xb7, 0x74, 0xe5, 0x52, 0x75, 0xa2, 0x44, 0x47, 0x52, 0x73, 0x92, 0x73, 0x3a, 0xf2, 0xf6, + 0x54, 0x92, 0x67, 0x6a, 0xc5, 0x2b, 0x0d, 0x6c, 0x5f, 0x8f, 0x4a, 0xfb, 0x60, 0x06, 0x3b, 0xa0, + 0x9e, 0xf4, 0xc2, 0xa0, 0x20, 0x94, 0x07, 0x49, 0xa4, 0x6f, 0x36, 0xb5, 0x56, 0xcd, 0xdb, 0x99, + 0x8c, 0xad, 0x5a, 0xd7, 0xeb, 0x9c, 0x12, 0xca, 0xbb, 0xc7, 0x8b, 0xa5, 0x2e, 0x91, 0xb6, 0x5f, + 0x4b, 0x7a, 0xa1, 0x00, 0x22, 0xd8, 0x05, 0x55, 0xf9, 0x3e, 0xf4, 0x6a, 0x53, 0x6b, 0xd5, 0x0f, + 0x8c, 0xb2, 0x51, 0x4e, 0x05, 0xe1, 0x3d, 0x51, 0xa9, 0x1f, 0xca, 0x96, 0x52, 0x67, 0xfb, 0xaa, + 0xc1, 0xe1, 0xc6, 0x97, 0x1f, 0x56, 0xc5, 0xfe, 0x08, 0x9e, 0xde, 0x33, 0x39, 0x6c, 0x80, 0x4d, + 0xf2, 0x39, 0xc7, 0x54, 0xd7, 0x66, 0x71, 0x7d, 0x79, 0x80, 0xdb, 0x40, 0xfe, 0xe7, 0x20, 0x47, + 0x19, 0xd6, 0xd7, 0x44, 0xa9, 0x26, 0x6e, 0xde, 0xa3, 0x0c, 0xc3, 0x2d, 0x50, 0xe5, 0x88, 0xc6, + 0x98, 0xeb, 0xeb, 0xa2, 0xa4, 0x4e, 0xde, 0xdb, 0xeb, 0x89, 0xa9, 0xdd, 0x4c, 0x4c, 0xed, 0xf7, + 0xc4, 0xd4, 0xbe, 0x4e, 0xcd, 0xca, 0xcd, 0xd4, 0xac, 0xfc, 0x9a, 0x9a, 0x95, 0xf3, 0x97, 0x71, + 0xc2, 0x2f, 0x06, 0x3d, 0x27, 0x24, 0x99, 0x2b, 0x07, 0xda, 0x4f, 0x51, 0x8f, 0xa9, 0x6f, 0x77, + 0xf8, 0xca, 0xbd, 0x5a, 0xbc, 0x3e, 0x3e, 0x2a, 0x30, 0xeb, 0x55, 0xc5, 0x83, 0x6b, 0xff, 0x09, + 0x00, 0x00, 0xff, 0xff, 0xf9, 0x11, 0x80, 0x39, 0x96, 0x04, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -133,13 +203,27 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 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 + dAtA[i] = 0x2a + } + if len(m.DefaultExternalAddresses) > 0 { + for iNdEx := len(m.DefaultExternalAddresses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DefaultExternalAddresses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } } if len(m.ApplicationLinks) > 0 { for iNdEx := len(m.ApplicationLinks) - 1; iNdEx >= 0; iNdEx-- { @@ -186,6 +270,50 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *DefaultExternalAddressEntry) 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 *DefaultExternalAddressEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DefaultExternalAddressEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Target) > 0 { + i -= len(m.Target) + copy(dAtA[i:], m.Target) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Target))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChainName) > 0 { + i -= len(m.ChainName) + copy(dAtA[i:], m.ChainName) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ChainName))) + i-- + dAtA[i] = 0x12 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { offset -= sovGenesis(v) base := offset @@ -221,6 +349,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.DefaultExternalAddresses) > 0 { + for _, e := range m.DefaultExternalAddresses { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } l = len(m.IBCPortID) if l > 0 { n += 1 + l + sovGenesis(uint64(l)) @@ -230,6 +364,27 @@ func (m *GenesisState) Size() (n int) { return n } +func (m *DefaultExternalAddressEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.ChainName) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Target) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + func sovGenesis(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -368,6 +523,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultExternalAddresses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DefaultExternalAddresses = append(m.DefaultExternalAddresses, DefaultExternalAddressEntry{}) + if err := m.DefaultExternalAddresses[len(m.DefaultExternalAddresses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field IBCPortID", wireType) } @@ -399,7 +588,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } m.IBCPortID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } @@ -453,6 +642,152 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } return nil } +func (m *DefaultExternalAddressEntry) 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 ErrIntOverflowGenesis + } + 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: DefaultExternalAddressEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DefaultExternalAddressEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Target = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipGenesis(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/profiles/types/msg_server.pb.go b/x/profiles/types/msg_server.pb.go index 9d1f30e42d..371a104dd4 100644 --- a/x/profiles/types/msg_server.pb.go +++ b/x/profiles/types/msg_server.pb.go @@ -33,37 +33,39 @@ func init() { } var fileDescriptor_869194438e2ecf0d = []byte{ - // 477 bytes of a gzipped FileDescriptorProto + // 506 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, 0xb6, 0x72, 0xe0, 0x5a, 0xb6, 0x1b, 0x4c, 0x42, 0x65, 0x5c, 0x90, 0x50, 0xe5, 0xba, 0xbf, - 0x7a, 0xd1, 0x5c, 0xdb, 0xc4, 0x4e, 0xc4, 0x9e, 0x80, 0x2b, 0x0f, 0xc0, 0x03, 0x71, 0xdc, 0x91, - 0x23, 0x6a, 0x5f, 0x04, 0x25, 0x6e, 0x43, 0xda, 0xc5, 0x25, 0xbd, 0xd9, 0xf9, 0x7d, 0xbe, 0x7f, - 0x6c, 0x29, 0x46, 0x8f, 0xc7, 0x60, 0xa7, 0xda, 0x52, 0x93, 0xea, 0x49, 0x22, 0xc1, 0xd2, 0xbc, - 0x47, 0xa7, 0x56, 0x0c, 0x2d, 0xa4, 0x39, 0xa4, 0xb1, 0x49, 0xb5, 0xd3, 0x18, 0x7b, 0x28, 0x5e, - 0x42, 0x71, 0xde, 0x23, 0x0f, 0x85, 0x16, 0xba, 0x1c, 0xd3, 0x62, 0xe5, 0x49, 0xb2, 0x23, 0xb4, - 0x16, 0x12, 0x68, 0xb9, 0x1b, 0x65, 0x13, 0xca, 0xd4, 0xe5, 0x72, 0xc4, 0x75, 0x61, 0x32, 0xf4, - 0x1a, 0xbf, 0x59, 0x8c, 0x76, 0x9b, 0x4a, 0xe8, 0x31, 0xc8, 0x92, 0x2e, 0x3e, 0x2d, 0xc0, 0xfd, - 0x30, 0x38, 0x76, 0x4c, 0x0c, 0x53, 0xf8, 0x9a, 0x81, 0x75, 0x4b, 0xdf, 0xa7, 0xcd, 0x87, 0x5b, - 0x77, 0x7d, 0x19, 0xc2, 0x9a, 0x3c, 0xf7, 0x42, 0x30, 0x3f, 0x67, 0x89, 0x1a, 0xca, 0x44, 0x5d, - 0x6c, 0x3c, 0x56, 0x81, 0x32, 0x63, 0xea, 0xe0, 0xd1, 0xcf, 0x5b, 0xe8, 0xc6, 0xa9, 0x15, 0xf8, - 0x0b, 0xba, 0xfd, 0x91, 0xe5, 0xf0, 0xc1, 0xf3, 0xf8, 0x51, 0x7c, 0xfd, 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, + 0x1c, 0xc7, 0x5b, 0x21, 0x71, 0x30, 0x42, 0x80, 0xe1, 0xb2, 0x1c, 0x72, 0xe0, 0xdf, 0x18, 0xb0, + 0x78, 0x5b, 0x39, 0x70, 0x2d, 0x2b, 0x27, 0x98, 0x84, 0xba, 0x71, 0x41, 0x42, 0x95, 0xeb, 0xfe, + 0xea, 0x45, 0x73, 0xed, 0x60, 0x3b, 0xd5, 0xf6, 0x04, 0x5c, 0x79, 0x0a, 0x9e, 0x85, 0xe3, 0x8e, + 0x1c, 0x51, 0xfb, 0x22, 0x28, 0x49, 0x1b, 0x92, 0xae, 0xbf, 0x92, 0xde, 0x92, 0xfa, 0xf3, 0xfd, + 0x93, 0xaf, 0x54, 0x93, 0x27, 0x23, 0x70, 0x13, 0xe3, 0x58, 0x62, 0xcd, 0x38, 0x56, 0xe0, 0xd8, + 0xb4, 0xc3, 0x26, 0x4e, 0x0e, 0x1c, 0xd8, 0x29, 0xd8, 0x28, 0xb1, 0xc6, 0x1b, 0x4a, 0x0b, 0x28, + 0x5a, 0x42, 0xd1, 0xb4, 0x13, 0x3c, 0x92, 0x46, 0x9a, 0xfc, 0x98, 0x65, 0x4f, 0x05, 0x19, 0xec, + 0x48, 0x63, 0xa4, 0x02, 0x96, 0xbf, 0x0d, 0xd3, 0x31, 0xe3, 0xfa, 0x6a, 0x79, 0x24, 0x4c, 0x66, + 0x32, 0x28, 0x34, 0xc5, 0xcb, 0xe2, 0x68, 0x77, 0x5d, 0x09, 0x33, 0x02, 0x95, 0xd3, 0xd9, 0x4f, + 0x0b, 0x70, 0x1f, 0x07, 0x47, 0x9e, 0xcb, 0x81, 0x85, 0x6f, 0x29, 0x38, 0xbf, 0xf4, 0x7d, 0xb6, + 0xfe, 0xe3, 0x56, 0x5d, 0x5f, 0x61, 0xd8, 0x3a, 0xcf, 0x3d, 0x0c, 0x16, 0xe7, 0x3c, 0xd6, 0x03, + 0x15, 0xeb, 0x8b, 0x8d, 0x9f, 0x95, 0xa1, 0x3c, 0x49, 0xaa, 0xe0, 0xd1, 0x4f, 0x42, 0x6e, 0x9d, + 0x38, 0x49, 0xbf, 0x92, 0x3b, 0xa7, 0x7c, 0x0a, 0x9f, 0x0a, 0x9e, 0x3e, 0x8e, 0x6e, 0xee, 0x1e, + 0x9d, 0x38, 0x59, 0x61, 0x82, 0x97, 0xff, 0x67, 0xfa, 0xe0, 0x12, 0xa3, 0x1d, 0x50, 0x41, 0xee, + 0xf6, 0x40, 0x81, 0x2f, 0x03, 0x9e, 0x22, 0xe2, 0x1a, 0x15, 0xbc, 0x6e, 0x42, 0x95, 0x21, 0x29, + 0x79, 0xd8, 0x2f, 0x16, 0xeb, 0x9d, 0x71, 0x79, 0x66, 0xb9, 0x76, 0x63, 0xb0, 0x14, 0xeb, 0xb9, + 0x86, 0x0d, 0x8e, 0x9a, 0xb3, 0x65, 0xec, 0xf7, 0x36, 0xd9, 0x39, 0xe6, 0x5a, 0x80, 0xaa, 0x1f, + 0xe7, 0x0a, 0x7a, 0x80, 0x38, 0xa2, 0x8a, 0xe0, 0xed, 0xb6, 0x8a, 0x5a, 0x93, 0xae, 0x10, 0x90, + 0xf8, 0x6d, 0x9a, 0xa0, 0x0a, 0xb4, 0x09, 0xaa, 0xa8, 0x35, 0xe9, 0xc3, 0x38, 0x75, 0xb0, 0x4d, + 0x13, 0x54, 0x81, 0x36, 0x41, 0x15, 0x65, 0x13, 0x45, 0xee, 0x7f, 0x8c, 0xf5, 0xc5, 0x71, 0xf6, + 0x17, 0xe9, 0x0a, 0x61, 0x52, 0xed, 0xe9, 0x2e, 0xe2, 0xb6, 0x0a, 0x06, 0xac, 0x21, 0x58, 0xa6, + 0x59, 0x42, 0x3f, 0x6b, 0xb5, 0x9a, 0xb7, 0x87, 0xd8, 0xdc, 0x44, 0x83, 0xc3, 0xc6, 0x68, 0x6d, + 0xeb, 0x53, 0xf0, 0x3d, 0x18, 0xf3, 0x54, 0xf9, 0xf7, 0x97, 0x1e, 0xac, 0xe6, 0xaa, 0x3b, 0x1a, + 0x59, 0x70, 0x0e, 0xdd, 0x1a, 0x55, 0xa0, 0x5b, 0xa3, 0x8a, 0xb2, 0x49, 0x4c, 0xee, 0x65, 0xcb, + 0x74, 0x93, 0x44, 0xc5, 0x82, 0xfb, 0xd8, 0x68, 0xfa, 0x7c, 0xc3, 0x82, 0x15, 0x2e, 0x88, 0x9a, + 0x71, 0x65, 0x94, 0x21, 0x0f, 0x8a, 0x49, 0xaa, 0x61, 0x2f, 0x36, 0x8e, 0x57, 0x8d, 0x3b, 0x68, + 0x4a, 0x2e, 0x03, 0xdf, 0x7d, 0xf8, 0x35, 0x0b, 0xdb, 0xd7, 0xb3, 0xb0, 0xfd, 0x67, 0x16, 0xb6, + 0x7f, 0xcc, 0xc3, 0xd6, 0xf5, 0x3c, 0x6c, 0xfd, 0x9e, 0x87, 0xad, 0x2f, 0x87, 0x32, 0xf6, 0xe7, + 0xe9, 0x30, 0x12, 0x66, 0xc2, 0x0a, 0xd7, 0x7d, 0xc5, 0x87, 0x6e, 0xf1, 0xcc, 0xa6, 0x6f, 0xd8, + 0xe5, 0xbf, 0x7b, 0xd8, 0x5f, 0x25, 0xe0, 0x86, 0xb7, 0xf3, 0xcb, 0xb7, 0xf3, 0x37, 0x00, 0x00, + 0xff, 0xff, 0x10, 0x07, 0x35, 0xfa, 0x03, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -100,6 +102,9 @@ type MsgClient interface { // UnlinkChainAccount defines a method to unlink an external chain account // from a profile UnlinkChainAccount(ctx context.Context, in *MsgUnlinkChainAccount, opts ...grpc.CallOption) (*MsgUnlinkChainAccountResponse, error) + // SetDefaultExternalAddress allows to set a specific external address as the + // default one for a given chain + SetDefaultExternalAddress(ctx context.Context, in *MsgSetDefaultExternalAddress, opts ...grpc.CallOption) (*MsgSetDefaultExternalAddressResponse, error) // LinkApplication defines a method to create a centralized application // link LinkApplication(ctx context.Context, in *MsgLinkApplication, opts ...grpc.CallOption) (*MsgLinkApplicationResponse, error) @@ -187,6 +192,15 @@ func (c *msgClient) UnlinkChainAccount(ctx context.Context, in *MsgUnlinkChainAc return out, nil } +func (c *msgClient) SetDefaultExternalAddress(ctx context.Context, in *MsgSetDefaultExternalAddress, opts ...grpc.CallOption) (*MsgSetDefaultExternalAddressResponse, error) { + out := new(MsgSetDefaultExternalAddressResponse) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/SetDefaultExternalAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) LinkApplication(ctx context.Context, in *MsgLinkApplication, opts ...grpc.CallOption) (*MsgLinkApplicationResponse, error) { out := new(MsgLinkApplicationResponse) err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/LinkApplication", in, out, opts...) @@ -229,6 +243,9 @@ type MsgServer interface { // UnlinkChainAccount defines a method to unlink an external chain account // from a profile UnlinkChainAccount(context.Context, *MsgUnlinkChainAccount) (*MsgUnlinkChainAccountResponse, error) + // SetDefaultExternalAddress allows to set a specific external address as the + // default one for a given chain + SetDefaultExternalAddress(context.Context, *MsgSetDefaultExternalAddress) (*MsgSetDefaultExternalAddressResponse, error) // LinkApplication defines a method to create a centralized application // link LinkApplication(context.Context, *MsgLinkApplication) (*MsgLinkApplicationResponse, error) @@ -264,6 +281,9 @@ func (*UnimplementedMsgServer) LinkChainAccount(ctx context.Context, req *MsgLin func (*UnimplementedMsgServer) UnlinkChainAccount(ctx context.Context, req *MsgUnlinkChainAccount) (*MsgUnlinkChainAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UnlinkChainAccount not implemented") } +func (*UnimplementedMsgServer) SetDefaultExternalAddress(ctx context.Context, req *MsgSetDefaultExternalAddress) (*MsgSetDefaultExternalAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetDefaultExternalAddress not implemented") +} func (*UnimplementedMsgServer) LinkApplication(ctx context.Context, req *MsgLinkApplication) (*MsgLinkApplicationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LinkApplication not implemented") } @@ -419,6 +439,24 @@ func _Msg_UnlinkChainAccount_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Msg_SetDefaultExternalAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetDefaultExternalAddress) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetDefaultExternalAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/desmos.profiles.v3.Msg/SetDefaultExternalAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetDefaultExternalAddress(ctx, req.(*MsgSetDefaultExternalAddress)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_LinkApplication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgLinkApplication) if err := dec(in); err != nil { @@ -491,6 +529,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UnlinkChainAccount", Handler: _Msg_UnlinkChainAccount_Handler, }, + { + MethodName: "SetDefaultExternalAddress", + Handler: _Msg_SetDefaultExternalAddress_Handler, + }, { MethodName: "LinkApplication", Handler: _Msg_LinkApplication_Handler, diff --git a/x/profiles/types/msgs_chain_links.pb.go b/x/profiles/types/msgs_chain_links.pb.go index d13b8469bf..fe05de9f5f 100644 --- a/x/profiles/types/msgs_chain_links.pb.go +++ b/x/profiles/types/msgs_chain_links.pb.go @@ -240,11 +240,116 @@ func (m *MsgUnlinkChainAccountResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnlinkChainAccountResponse proto.InternalMessageInfo +// MsgSetDefaultExternalAddress represents the message used to set a default +// address for a specific chain +type MsgSetDefaultExternalAddress struct { + // Name of the chain for which to set the default address + ChainName string `protobuf:"bytes,1,opt,name=chain_name,json=chainName,proto3" json:"chain_name,omitempty"` + // Address to be set as the default one + Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` + // User signing the message + Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgSetDefaultExternalAddress) Reset() { *m = MsgSetDefaultExternalAddress{} } +func (m *MsgSetDefaultExternalAddress) String() string { return proto.CompactTextString(m) } +func (*MsgSetDefaultExternalAddress) ProtoMessage() {} +func (*MsgSetDefaultExternalAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_52cd1f5b825f2f4e, []int{4} +} +func (m *MsgSetDefaultExternalAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetDefaultExternalAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetDefaultExternalAddress.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 *MsgSetDefaultExternalAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetDefaultExternalAddress.Merge(m, src) +} +func (m *MsgSetDefaultExternalAddress) XXX_Size() int { + return m.Size() +} +func (m *MsgSetDefaultExternalAddress) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetDefaultExternalAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetDefaultExternalAddress proto.InternalMessageInfo + +func (m *MsgSetDefaultExternalAddress) GetChainName() string { + if m != nil { + return m.ChainName + } + return "" +} + +func (m *MsgSetDefaultExternalAddress) GetTarget() string { + if m != nil { + return m.Target + } + return "" +} + +func (m *MsgSetDefaultExternalAddress) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +// MsgSetDefaultExternalAddressResponse represents the +// Msg/SetDefaultExternalAddress response type +type MsgSetDefaultExternalAddressResponse struct { +} + +func (m *MsgSetDefaultExternalAddressResponse) Reset() { *m = MsgSetDefaultExternalAddressResponse{} } +func (m *MsgSetDefaultExternalAddressResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetDefaultExternalAddressResponse) ProtoMessage() {} +func (*MsgSetDefaultExternalAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_52cd1f5b825f2f4e, []int{5} +} +func (m *MsgSetDefaultExternalAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetDefaultExternalAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetDefaultExternalAddressResponse.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 *MsgSetDefaultExternalAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetDefaultExternalAddressResponse.Merge(m, src) +} +func (m *MsgSetDefaultExternalAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetDefaultExternalAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetDefaultExternalAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetDefaultExternalAddressResponse proto.InternalMessageInfo + func init() { 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") + proto.RegisterType((*MsgSetDefaultExternalAddress)(nil), "desmos.profiles.v3.MsgSetDefaultExternalAddress") + proto.RegisterType((*MsgSetDefaultExternalAddressResponse)(nil), "desmos.profiles.v3.MsgSetDefaultExternalAddressResponse") } func init() { @@ -252,38 +357,41 @@ func init() { } 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, 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, - 0x0b, 0x23, 0xae, 0xc8, 0x62, 0x48, 0x62, 0x25, 0xd4, 0x98, 0xdd, 0xd1, 0x50, 0x8e, 0xa3, 0x50, - 0xde, 0x2b, 0x2f, 0x49, 0x21, 0x03, 0xdb, 0x36, 0x54, 0xaf, 0xa6, 0x7a, 0x8b, 0x61, 0xff, 0x58, - 0x80, 0x00, 0x0d, 0x93, 0x32, 0x32, 0xcc, 0xfe, 0x89, 0x00, 0x10, 0x11, 0x27, 0x3a, 0x9b, 0xcc, - 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, 0xe7, 0xcd, 0xb1, 0x67, 0x2c, 0x79, 0xb5, 0x25, 0x6f, 0x24, 0x97, - 0xfe, 0xa0, 0xc8, 0xdd, 0xee, 0x92, 0xc6, 0xd1, 0x5b, 0xac, 0x60, 0x9e, 0x32, 0x5e, 0x77, 0xe1, - 0x9f, 0x3f, 0x2e, 0x3b, 0x23, 0x13, 0xbf, 0xa3, 0x19, 0x0d, 0xf6, 0xb5, 0x68, 0x55, 0xb1, 0x6f, - 0xd0, 0x6e, 0x92, 0x02, 0xcc, 0x7a, 0x3b, 0x5a, 0xfc, 0xc4, 0x7b, 0x7a, 0x19, 0xef, 0x63, 0x49, - 0xf0, 0x4f, 0x1f, 0x72, 0xb7, 0x55, 0xe4, 0xee, 0xd1, 0xd6, 0x14, 0xdd, 0x8c, 0x03, 0x23, 0x62, - 0xcf, 0x90, 0x51, 0x1f, 0x33, 0x90, 0xb3, 0x50, 0xf4, 0x9e, 0x69, 0x51, 0xb7, 0x49, 0x54, 0xaf, - 0x7a, 0xad, 0x69, 0x3e, 0xae, 0xa4, 0xfb, 0x5b, 0xd2, 0xff, 0x2a, 0xe1, 0xa0, 0xc3, 0x36, 0x0d, - 0xf6, 0x05, 0xda, 0x53, 0xa1, 0x90, 0x3c, 0xed, 0x3d, 0x3f, 0xb7, 0x06, 0x6d, 0xff, 0xb0, 0xc8, - 0xdd, 0x83, 0xaa, 0x59, 0xd7, 0x71, 0x50, 0x11, 0xf0, 0x19, 0x3a, 0x6d, 0x38, 0x6e, 0xc0, 0x55, - 0x02, 0x52, 0x71, 0xfc, 0xdd, 0x42, 0xdd, 0x5b, 0x25, 0x3e, 0xc9, 0xe8, 0xff, 0xf3, 0xbf, 0x44, - 0xbb, 0xf0, 0xa5, 0x1c, 0x61, 0xe9, 0x11, 0x2f, 0x8a, 0xdc, 0xdd, 0x37, 0x23, 0x74, 0x19, 0x07, - 0x06, 0xb6, 0xaf, 0x10, 0x32, 0x4e, 0x25, 0x8d, 0xb9, 0x3e, 0x63, 0xdb, 0xef, 0x16, 0xb9, 0x7b, - 0x68, 0xc8, 0x1b, 0x0c, 0x07, 0x6d, 0x9d, 0x7c, 0xa0, 0x31, 0x2f, 0x37, 0xc8, 0x68, 0x2a, 0x78, - 0xa6, 0x6f, 0xb4, 0xb5, 0x81, 0xa9, 0xe3, 0xa0, 0x22, 0x60, 0x17, 0x9d, 0x35, 0x3a, 0xac, 0x77, - 0xf0, 0xdf, 0x3f, 0xac, 0x1c, 0xeb, 0x71, 0xe5, 0x58, 0x7f, 0x56, 0x8e, 0xf5, 0x6d, 0xed, 0xb4, - 0x1e, 0xd7, 0x4e, 0xeb, 0xd7, 0xda, 0x69, 0x7d, 0x7e, 0x2d, 0xc2, 0xec, 0x6e, 0x3e, 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, + // 540 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xd1, 0x6e, 0xd3, 0x30, + 0x14, 0x6d, 0x36, 0x36, 0xa9, 0xee, 0x26, 0xb1, 0x6c, 0x45, 0x5d, 0x47, 0x93, 0xc9, 0x42, 0x53, + 0x27, 0xb4, 0x44, 0xd0, 0x3d, 0xf1, 0xd6, 0x6c, 0x3c, 0xb1, 0x22, 0x14, 0xc4, 0x0b, 0x2f, 0x95, + 0x9b, 0x3a, 0x5e, 0xb4, 0xc4, 0x8e, 0x62, 0xa7, 0xac, 0x7f, 0xc1, 0x27, 0xf0, 0x11, 0x7c, 0xc4, + 0xc4, 0xd3, 0x1e, 0x91, 0x90, 0x22, 0xd4, 0xfe, 0x41, 0xbe, 0x00, 0xc5, 0x4e, 0xd6, 0x15, 0x22, + 0xde, 0xec, 0x7b, 0xcf, 0x3d, 0xe7, 0xdc, 0x13, 0x07, 0x9c, 0x4e, 0x31, 0x8f, 0x18, 0xb7, 0xe3, + 0x84, 0xf9, 0x41, 0x88, 0xb9, 0x3d, 0x1b, 0xd8, 0x11, 0x27, 0x7c, 0xec, 0x5d, 0xa3, 0x80, 0x8e, + 0xc3, 0x80, 0xde, 0x70, 0x2b, 0x4e, 0x98, 0x60, 0xba, 0xae, 0xa0, 0x56, 0x05, 0xb5, 0x66, 0x83, + 0xee, 0x01, 0x61, 0x84, 0xc9, 0xb6, 0x5d, 0x9c, 0x14, 0xb2, 0x7b, 0x48, 0x18, 0x23, 0x21, 0xb6, + 0xe5, 0x6d, 0x92, 0xfa, 0x36, 0xa2, 0xf3, 0xaa, 0xe5, 0xb1, 0x82, 0x64, 0xac, 0x66, 0xd4, 0xa5, + 0x6c, 0xbd, 0xac, 0xb3, 0xc2, 0xa6, 0x38, 0xac, 0x31, 0x03, 0x7f, 0x6d, 0x80, 0xfd, 0x11, 0x27, + 0x57, 0x01, 0xbd, 0xb9, 0x28, 0x9a, 0x43, 0xcf, 0x63, 0x29, 0x15, 0xba, 0x07, 0x76, 0x15, 0x18, + 0x4d, 0xa7, 0x09, 0xe6, 0xbc, 0xa3, 0x1d, 0x6b, 0xfd, 0xd6, 0xeb, 0x03, 0x4b, 0x59, 0xb2, 0x2a, + 0x4b, 0xd6, 0x90, 0xce, 0x9d, 0x7e, 0x9e, 0x99, 0xed, 0x39, 0x8a, 0xc2, 0x37, 0x90, 0xb3, 0x34, + 0xf1, 0x70, 0x35, 0x05, 0x7f, 0x7c, 0x3f, 0x6b, 0x0d, 0xd5, 0xf9, 0x12, 0x09, 0xe4, 0xee, 0x48, + 0xd2, 0xb2, 0xa2, 0x5f, 0x81, 0xad, 0x38, 0x61, 0xcc, 0xef, 0x6c, 0x48, 0xf2, 0x43, 0xeb, 0xdf, + 0x64, 0xac, 0x0f, 0x05, 0xc0, 0x39, 0xba, 0xcb, 0xcc, 0x46, 0x9e, 0x99, 0xfb, 0x6b, 0x2a, 0x72, + 0x18, 0xba, 0x8a, 0x44, 0xf7, 0x81, 0x62, 0x1f, 0x7b, 0x8c, 0xfa, 0x01, 0xe9, 0x6c, 0x4a, 0x52, + 0xb3, 0x8e, 0x54, 0xae, 0x7a, 0x21, 0x61, 0x0e, 0x2c, 0xa9, 0xbb, 0x6b, 0xd4, 0x8f, 0x99, 0xa0, + 0xdb, 0xf2, 0x56, 0x03, 0xfa, 0x29, 0xd8, 0xe6, 0x01, 0xa1, 0x38, 0xe9, 0x3c, 0x39, 0xd6, 0xfa, + 0x4d, 0x67, 0x2f, 0xcf, 0xcc, 0xdd, 0x72, 0x58, 0xd6, 0xa1, 0x5b, 0x02, 0x60, 0x0f, 0x1c, 0xd5, + 0x84, 0xeb, 0x62, 0x1e, 0x33, 0xca, 0x31, 0xfc, 0xa6, 0x81, 0xf6, 0x88, 0x93, 0x4f, 0x34, 0xfc, + 0x3b, 0xfe, 0x13, 0xb0, 0xc5, 0xbe, 0x14, 0x12, 0x9a, 0x94, 0x78, 0x9a, 0x67, 0xe6, 0x8e, 0x92, + 0x90, 0x65, 0xe8, 0xaa, 0xb6, 0x7e, 0x0e, 0x80, 0x72, 0x4a, 0x51, 0x84, 0x65, 0x8c, 0x4d, 0xa7, + 0x9d, 0x67, 0xe6, 0x9e, 0x02, 0xaf, 0x7a, 0xd0, 0x6d, 0xca, 0xcb, 0x7b, 0x14, 0xe1, 0x62, 0x03, + 0x81, 0x12, 0x82, 0x85, 0xcc, 0x68, 0x6d, 0x03, 0x55, 0x87, 0x6e, 0x09, 0x80, 0x26, 0xe8, 0xd5, + 0x3a, 0x7c, 0xd8, 0x21, 0x02, 0xcf, 0x47, 0x9c, 0x7c, 0xc4, 0xe2, 0x12, 0xfb, 0x28, 0x0d, 0xc5, + 0xdb, 0x5b, 0x81, 0x13, 0x8a, 0xc2, 0xea, 0x1b, 0xf7, 0xd6, 0x1c, 0xca, 0x75, 0x1e, 0x5b, 0x79, + 0xf6, 0x60, 0x45, 0x9a, 0xaf, 0x74, 0x8b, 0x7a, 0x19, 0xf2, 0xa6, 0xaa, 0x97, 0x89, 0x9e, 0x80, + 0x17, 0xff, 0x93, 0xab, 0x6c, 0x39, 0xef, 0xee, 0x16, 0x86, 0x76, 0xbf, 0x30, 0xb4, 0xdf, 0x0b, + 0x43, 0xfb, 0xba, 0x34, 0x1a, 0xf7, 0x4b, 0xa3, 0xf1, 0x73, 0x69, 0x34, 0x3e, 0xbf, 0x22, 0x81, + 0xb8, 0x4e, 0x27, 0x96, 0xc7, 0x22, 0x5b, 0x3d, 0x8d, 0xb3, 0x10, 0x4d, 0x78, 0x79, 0xb6, 0x67, + 0xe7, 0xf6, 0xed, 0xea, 0xd7, 0x11, 0xf3, 0x18, 0xf3, 0xc9, 0xb6, 0x7c, 0xed, 0x83, 0x3f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x3b, 0x45, 0xc0, 0x28, 0xe5, 0x03, 0x00, 0x00, } func (m *MsgLinkChainAccount) Marshal() (dAtA []byte, err error) { @@ -438,6 +546,73 @@ func (m *MsgUnlinkChainAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgSetDefaultExternalAddress) 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 *MsgSetDefaultExternalAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetDefaultExternalAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintMsgsChainLinks(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if len(m.Target) > 0 { + i -= len(m.Target) + copy(dAtA[i:], m.Target) + i = encodeVarintMsgsChainLinks(dAtA, i, uint64(len(m.Target))) + i-- + dAtA[i] = 0x12 + } + if len(m.ChainName) > 0 { + i -= len(m.ChainName) + copy(dAtA[i:], m.ChainName) + i = encodeVarintMsgsChainLinks(dAtA, i, uint64(len(m.ChainName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetDefaultExternalAddressResponse) 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 *MsgSetDefaultExternalAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetDefaultExternalAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintMsgsChainLinks(dAtA []byte, offset int, v uint64) int { offset -= sovMsgsChainLinks(v) base := offset @@ -509,6 +684,36 @@ func (m *MsgUnlinkChainAccountResponse) Size() (n int) { return n } +func (m *MsgSetDefaultExternalAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainName) + if l > 0 { + n += 1 + l + sovMsgsChainLinks(uint64(l)) + } + l = len(m.Target) + if l > 0 { + n += 1 + l + sovMsgsChainLinks(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovMsgsChainLinks(uint64(l)) + } + return n +} + +func (m *MsgSetDefaultExternalAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovMsgsChainLinks(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -945,6 +1150,202 @@ func (m *MsgUnlinkChainAccountResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSetDefaultExternalAddress) 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 ErrIntOverflowMsgsChainLinks + } + 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: MsgSetDefaultExternalAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetDefaultExternalAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgsChainLinks + } + 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 ErrInvalidLengthMsgsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgsChainLinks + } + 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 ErrInvalidLengthMsgsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Target = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgsChainLinks + } + 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 ErrInvalidLengthMsgsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetDefaultExternalAddressResponse) 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 ErrIntOverflowMsgsChainLinks + } + 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: MsgSetDefaultExternalAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetDefaultExternalAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipMsgsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipMsgsChainLinks(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/profiles/types/query.pb.go b/x/profiles/types/query.pb.go index 61b7cd8af3..4723e55933 100644 --- a/x/profiles/types/query.pb.go +++ b/x/profiles/types/query.pb.go @@ -33,46 +33,49 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("desmos/profiles/v3/query.proto", fileDescriptor_bcbdebc2a1cf2f2b) } 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, 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, - 0x6d, 0x13, 0xd9, 0xe5, 0x12, 0x89, 0x98, 0x77, 0x68, 0x44, 0x24, 0xea, 0x37, 0xd1, 0x51, 0x8f, - 0xc4, 0x03, 0x4f, 0xc4, 0x3c, 0xe1, 0x10, 0xea, 0x75, 0xcf, 0xae, 0x7b, 0xfd, 0x66, 0xfe, 0x7a, - 0xc8, 0x43, 0xae, 0x96, 0x51, 0xfa, 0xa4, 0xc9, 0x7c, 0x21, 0xe4, 0x3c, 0x8c, 0x08, 0xc2, 0x82, - 0x22, 0xcc, 0x18, 0x4f, 0x70, 0x42, 0x39, 0x93, 0x66, 0x35, 0x67, 0x56, 0xd5, 0x9b, 0xdf, 0xeb, - 0x20, 0xcc, 0x4c, 0x89, 0x7c, 0x29, 0x4b, 0xa1, 0x65, 0xbe, 0x18, 0xae, 0x96, 0xc9, 0xb5, 0x13, - 0x1c, 0xb6, 0x62, 0x72, 0xd4, 0x23, 0x32, 0xb1, 0x05, 0x8b, 0xd9, 0xbb, 0xe2, 0x18, 0x77, 0x2d, - 0x56, 0xcd, 0xc4, 0x82, 0x43, 0x4c, 0x59, 0x2b, 0xa2, 0xec, 0xb5, 0x65, 0x2b, 0x99, 0x2c, 0x16, - 0xe2, 0x0c, 0x99, 0x0b, 0x78, 0x4a, 0xb6, 0xf4, 0x21, 0xe9, 0x17, 0x5b, 0x50, 0xbf, 0x21, 0x1f, - 0x4b, 0xa2, 0xd3, 0xa8, 0xdf, 0xf0, 0x49, 0x82, 0x1b, 0x48, 0xe0, 0x90, 0x32, 0x75, 0x6a, 0x9a, - 0xdd, 0xfc, 0x06, 0xc0, 0xe5, 0x17, 0x29, 0x02, 0xdf, 0x3b, 0xe0, 0xca, 0xbe, 0x2e, 0x0b, 0xcb, - 0xde, 0xff, 0xff, 0xc4, 0x53, 0x98, 0x21, 0x5e, 0xea, 0x93, 0xc8, 0x57, 0x16, 0x83, 0x52, 0x70, - 0x26, 0xc9, 0xfa, 0xc6, 0xbb, 0x5f, 0x7f, 0x3f, 0x5d, 0x2a, 0xc2, 0xdb, 0x68, 0x46, 0x8b, 0xa7, - 0xcf, 0xc7, 0x3d, 0x49, 0xe2, 0x21, 0xfc, 0xe9, 0x80, 0xc2, 0x1e, 0x0b, 0x78, 0x97, 0xb2, 0x70, - 0xf7, 0x00, 0x87, 0x07, 0x31, 0x66, 0xb2, 0x43, 0x62, 0x53, 0x56, 0xc2, 0x47, 0x99, 0x75, 0xe7, - 0xc5, 0xac, 0xf5, 0xe3, 0x0b, 0xa6, 0x4d, 0x2b, 0x9b, 0xaa, 0x95, 0x1a, 0xac, 0xce, 0x6a, 0x25, - 0x1d, 0x94, 0x7a, 0x62, 0xa2, 0x75, 0x3b, 0x31, 0xf0, 0x83, 0x03, 0xc0, 0x4e, 0xfa, 0xbb, 0x9f, - 0xa5, 0xff, 0x10, 0x56, 0x33, 0x0d, 0x26, 0x90, 0xb5, 0xdd, 0x58, 0x8a, 0x35, 0x6e, 0x65, 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, + // 668 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x95, 0x4f, 0x6b, 0x13, 0x41, + 0x18, 0xc6, 0xbb, 0x82, 0x15, 0x06, 0x41, 0x19, 0x14, 0x6c, 0xa8, 0x5b, 0xac, 0x26, 0x29, 0x6d, + 0x77, 0xc7, 0x34, 0x2a, 0x56, 0xf4, 0xd0, 0x3f, 0x1e, 0x8a, 0x82, 0x55, 0x7a, 0xf2, 0x12, 0x66, + 0x77, 0x27, 0xdb, 0xc5, 0xcd, 0xcc, 0x74, 0x67, 0x36, 0xb6, 0x94, 0x5e, 0x04, 0x0f, 0x5e, 0x44, + 0xf0, 0xee, 0xc9, 0x8f, 0xe0, 0xd9, 0xb3, 0x17, 0xb1, 0xe0, 0xc5, 0xa3, 0xb4, 0x7e, 0x10, 0xd9, + 0xf9, 0xd3, 0xd2, 0x36, 0x9b, 0xa4, 0xb9, 0xed, 0x64, 0x9e, 0x67, 0xde, 0xdf, 0xf3, 0xce, 0x9b, + 0x5d, 0xe0, 0x46, 0x44, 0x74, 0x98, 0x40, 0x3c, 0x63, 0xed, 0x24, 0x25, 0x02, 0x75, 0x9b, 0x68, + 0x2b, 0x27, 0xd9, 0x8e, 0xcf, 0x33, 0x26, 0x19, 0x84, 0x7a, 0xdf, 0xb7, 0xfb, 0x7e, 0xb7, 0x59, + 0xb9, 0x16, 0xb3, 0x98, 0xa9, 0x6d, 0x54, 0x3c, 0x69, 0x65, 0x65, 0x32, 0x66, 0x2c, 0x4e, 0x09, + 0xc2, 0x3c, 0x41, 0x98, 0x52, 0x26, 0xb1, 0x4c, 0x18, 0x15, 0x66, 0x77, 0xc2, 0xec, 0xaa, 0x55, + 0x90, 0xb7, 0x11, 0xa6, 0xa6, 0x44, 0xa5, 0x56, 0x86, 0xd0, 0x32, 0xbf, 0x18, 0xdd, 0x7c, 0xa9, + 0x2e, 0x92, 0x38, 0x6e, 0x65, 0x64, 0x2b, 0x27, 0x42, 0xda, 0x82, 0xd5, 0xf2, 0x53, 0x71, 0x86, + 0x3b, 0x56, 0x36, 0x5b, 0x2a, 0x0b, 0x37, 0x71, 0x42, 0x5b, 0x69, 0x42, 0xdf, 0x58, 0xed, 0x4c, + 0xa9, 0x16, 0x73, 0x7e, 0x42, 0x39, 0x11, 0xb2, 0x42, 0xd9, 0xd2, 0x4d, 0xd2, 0x0b, 0x5b, 0x50, + 0xaf, 0x50, 0x80, 0x05, 0xd1, 0x6e, 0xd4, 0x6d, 0x04, 0x44, 0xe2, 0x06, 0xe2, 0x38, 0x4e, 0xa8, + 0xea, 0x9a, 0xd6, 0x2e, 0xbc, 0xbf, 0x0c, 0x2e, 0xbe, 0x2c, 0x24, 0xf0, 0x83, 0x03, 0x2e, 0xad, + 0xeb, 0xb2, 0xb0, 0xee, 0x9f, 0xbd, 0x13, 0x5f, 0xc9, 0x8c, 0xe2, 0x95, 0xee, 0x44, 0x65, 0x66, + 0xb0, 0x50, 0x70, 0x46, 0x05, 0x99, 0x9e, 0x7b, 0xf7, 0xfb, 0xdf, 0xe7, 0x0b, 0x55, 0x78, 0x1b, + 0xf5, 0x88, 0x78, 0xf4, 0xbc, 0x9b, 0x0b, 0x92, 0xed, 0xc1, 0x5f, 0x0e, 0x98, 0x5c, 0xa3, 0x21, + 0xeb, 0x24, 0x34, 0x5e, 0xdd, 0xc0, 0xf1, 0x46, 0x86, 0xa9, 0x68, 0x93, 0xcc, 0x94, 0x15, 0xf0, + 0x71, 0x69, 0xdd, 0x7e, 0x36, 0x4b, 0xfd, 0x64, 0x44, 0xb7, 0x89, 0xb2, 0xa0, 0xa2, 0xcc, 0xc3, + 0xd9, 0x5e, 0x51, 0x8a, 0x41, 0xf1, 0xa4, 0xb1, 0x7a, 0x76, 0x62, 0xe0, 0x47, 0x07, 0x80, 0x95, + 0xe2, 0xba, 0x9f, 0x17, 0x77, 0x08, 0x67, 0x4b, 0x09, 0x8e, 0x45, 0x96, 0x76, 0x6e, 0x28, 0xad, + 0x61, 0xab, 0x2b, 0xb6, 0x5b, 0x70, 0xaa, 0x17, 0x9b, 0x9a, 0x37, 0x4f, 0x4d, 0x11, 0xfc, 0xea, + 0x80, 0x2b, 0x47, 0xfe, 0x17, 0x6f, 0x29, 0xc9, 0x04, 0x44, 0x83, 0x2b, 0x69, 0xa5, 0x45, 0xbb, + 0x3b, 0xbc, 0xc1, 0xf0, 0xf9, 0x8a, 0x6f, 0x06, 0xd6, 0x06, 0xf0, 0x21, 0xa6, 0x91, 0xbe, 0x3b, + 0xe0, 0xc6, 0x2a, 0x69, 0xe3, 0x3c, 0x95, 0x4f, 0xb7, 0x25, 0xc9, 0x28, 0x4e, 0x97, 0xa2, 0x28, + 0x23, 0x42, 0x10, 0x01, 0x1f, 0x96, 0x96, 0x2f, 0xb3, 0x58, 0xf0, 0xc5, 0x11, 0x9c, 0x26, 0x81, + 0xa7, 0x12, 0xd4, 0x61, 0xf5, 0x6c, 0x82, 0x05, 0x14, 0x69, 0xb7, 0x87, 0x8f, 0x18, 0xbf, 0x38, + 0xe0, 0xea, 0x12, 0xe7, 0x69, 0x12, 0xaa, 0xbf, 0x9d, 0xbe, 0xfe, 0xf2, 0xbe, 0x9d, 0x96, 0x5a, + 0xe0, 0xc6, 0x39, 0x1c, 0x06, 0xb4, 0xaa, 0x40, 0xa7, 0xe0, 0xcd, 0x5e, 0xad, 0xc6, 0x9c, 0x9b, + 0x41, 0xf8, 0xe9, 0x80, 0x89, 0x53, 0x67, 0x2c, 0xef, 0xac, 0xa4, 0x09, 0xa1, 0x72, 0x6d, 0x15, + 0x2e, 0x0e, 0x5b, 0xf7, 0xd8, 0x63, 0x91, 0x1f, 0x8d, 0x62, 0x35, 0xec, 0x8b, 0x8a, 0xbd, 0x09, + 0x1b, 0x7d, 0xd9, 0x51, 0xa8, 0x7c, 0x02, 0xed, 0xea, 0x87, 0x56, 0x12, 0xed, 0xc1, 0x6f, 0x0e, + 0xb8, 0x7e, 0xaa, 0x80, 0x19, 0xef, 0xfb, 0xc3, 0x02, 0x9d, 0x1c, 0xf2, 0x07, 0xe7, 0xb5, 0x99, + 0x0c, 0xf3, 0x2a, 0x43, 0x0d, 0xde, 0xe9, 0x9f, 0xc1, 0x0c, 0xfa, 0x1e, 0x18, 0x5f, 0x57, 0x5f, + 0x0d, 0x58, 0x2b, 0x7f, 0xa7, 0x2a, 0x81, 0xe5, 0xaa, 0x0f, 0xd4, 0x19, 0x90, 0x69, 0x05, 0x32, + 0x09, 0x2b, 0x3d, 0x5f, 0xbd, 0x4a, 0xbb, 0xfc, 0xec, 0xc7, 0x81, 0xeb, 0xec, 0x1f, 0xb8, 0xce, + 0xdf, 0x03, 0xd7, 0xf9, 0x74, 0xe8, 0x8e, 0xed, 0x1f, 0xba, 0x63, 0x7f, 0x0e, 0xdd, 0xb1, 0xd7, + 0x8d, 0x38, 0x91, 0x9b, 0x79, 0xe0, 0x87, 0xac, 0x63, 0xfc, 0x5e, 0x8a, 0x03, 0x61, 0xcf, 0xea, + 0xde, 0x43, 0xdb, 0xc7, 0x07, 0xca, 0x1d, 0x4e, 0x44, 0x30, 0xae, 0xbe, 0x2d, 0xcd, 0xff, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x30, 0x64, 0x6b, 0x48, 0xfa, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -100,6 +103,9 @@ type QueryClient interface { // ChainLinkOwners queries for the owners of chain links, optionally searching // for a specific chain name and external address ChainLinkOwners(ctx context.Context, in *QueryChainLinkOwnersRequest, opts ...grpc.CallOption) (*QueryChainLinkOwnersResponse, error) + // DefaultExternalAddresses queries the default addresses associated to the + // given user and (optionally) chain name + DefaultExternalAddresses(ctx context.Context, in *QueryDefaultExternalAddressesRequest, opts ...grpc.CallOption) (*QueryDefaultExternalAddressesResponse, error) // ApplicationLinks queries the applications links associated to the given // user, if provided. Otherwise, it queries all the application links stored. ApplicationLinks(ctx context.Context, in *QueryApplicationLinksRequest, opts ...grpc.CallOption) (*QueryApplicationLinksResponse, error) @@ -157,6 +163,15 @@ func (c *queryClient) ChainLinkOwners(ctx context.Context, in *QueryChainLinkOwn return out, nil } +func (c *queryClient) DefaultExternalAddresses(ctx context.Context, in *QueryDefaultExternalAddressesRequest, opts ...grpc.CallOption) (*QueryDefaultExternalAddressesResponse, error) { + out := new(QueryDefaultExternalAddressesResponse) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/DefaultExternalAddresses", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) ApplicationLinks(ctx context.Context, in *QueryApplicationLinksRequest, opts ...grpc.CallOption) (*QueryApplicationLinksResponse, error) { out := new(QueryApplicationLinksResponse) err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/ApplicationLinks", in, out, opts...) @@ -208,6 +223,9 @@ type QueryServer interface { // ChainLinkOwners queries for the owners of chain links, optionally searching // for a specific chain name and external address ChainLinkOwners(context.Context, *QueryChainLinkOwnersRequest) (*QueryChainLinkOwnersResponse, error) + // DefaultExternalAddresses queries the default addresses associated to the + // given user and (optionally) chain name + DefaultExternalAddresses(context.Context, *QueryDefaultExternalAddressesRequest) (*QueryDefaultExternalAddressesResponse, error) // ApplicationLinks queries the applications links associated to the given // user, if provided. Otherwise, it queries all the application links stored. ApplicationLinks(context.Context, *QueryApplicationLinksRequest) (*QueryApplicationLinksResponse, error) @@ -237,6 +255,9 @@ func (*UnimplementedQueryServer) ChainLinks(ctx context.Context, req *QueryChain func (*UnimplementedQueryServer) ChainLinkOwners(ctx context.Context, req *QueryChainLinkOwnersRequest) (*QueryChainLinkOwnersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ChainLinkOwners not implemented") } +func (*UnimplementedQueryServer) DefaultExternalAddresses(ctx context.Context, req *QueryDefaultExternalAddressesRequest) (*QueryDefaultExternalAddressesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DefaultExternalAddresses not implemented") +} func (*UnimplementedQueryServer) ApplicationLinks(ctx context.Context, req *QueryApplicationLinksRequest) (*QueryApplicationLinksResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ApplicationLinks not implemented") } @@ -326,6 +347,24 @@ func _Query_ChainLinkOwners_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Query_DefaultExternalAddresses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDefaultExternalAddressesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DefaultExternalAddresses(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/desmos.profiles.v3.Query/DefaultExternalAddresses", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DefaultExternalAddresses(ctx, req.(*QueryDefaultExternalAddressesRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_ApplicationLinks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryApplicationLinksRequest) if err := dec(in); err != nil { @@ -418,6 +457,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "ChainLinkOwners", Handler: _Query_ChainLinkOwners_Handler, }, + { + MethodName: "DefaultExternalAddresses", + Handler: _Query_DefaultExternalAddresses_Handler, + }, { MethodName: "ApplicationLinks", Handler: _Query_ApplicationLinks_Handler, diff --git a/x/profiles/types/query.pb.gw.go b/x/profiles/types/query.pb.gw.go index 5fc0d2acad..6d0ed054d7 100644 --- a/x/profiles/types/query.pb.gw.go +++ b/x/profiles/types/query.pb.gw.go @@ -193,6 +193,42 @@ func local_request_Query_ChainLinkOwners_0(ctx context.Context, marshaler runtim } +var ( + filter_Query_DefaultExternalAddresses_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_DefaultExternalAddresses_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDefaultExternalAddressesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DefaultExternalAddresses_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DefaultExternalAddresses(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DefaultExternalAddresses_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDefaultExternalAddressesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DefaultExternalAddresses_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DefaultExternalAddresses(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_ApplicationLinks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -423,6 +459,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_DefaultExternalAddresses_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DefaultExternalAddresses_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DefaultExternalAddresses_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_ApplicationLinks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -624,6 +680,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_DefaultExternalAddresses_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DefaultExternalAddresses_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DefaultExternalAddresses_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_ApplicationLinks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -716,6 +792,8 @@ var ( 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_DefaultExternalAddresses_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v2", "default-addresses"}, "", 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", "v3", "app-links", "clients", "client_id"}, "", runtime.AssumeColonVerbOpt(true))) @@ -734,6 +812,8 @@ var ( forward_Query_ChainLinkOwners_0 = runtime.ForwardResponseMessage + forward_Query_DefaultExternalAddresses_0 = runtime.ForwardResponseMessage + forward_Query_ApplicationLinks_0 = runtime.ForwardResponseMessage forward_Query_ApplicationLinkByClientID_0 = runtime.ForwardResponseMessage diff --git a/x/profiles/types/query_chain_links.pb.go b/x/profiles/types/query_chain_links.pb.go index 13e853c2b9..cc93ac76f9 100644 --- a/x/profiles/types/query_chain_links.pb.go +++ b/x/profiles/types/query_chain_links.pb.go @@ -348,12 +348,135 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) GetTarget() string return "" } +// QueryDefaultExternalAddressesRequest is the request type for +// Query/DefaultExternalAddresses RPC method +type QueryDefaultExternalAddressesRequest struct { + // (Optional) Owner for which to query the default addresses + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // (Optional) Chain name to query the default address for + ChainName string `protobuf:"bytes,2,opt,name=chain_name,json=chainName,proto3" json:"chain_name,omitempty"` + // Pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDefaultExternalAddressesRequest) Reset() { *m = QueryDefaultExternalAddressesRequest{} } +func (m *QueryDefaultExternalAddressesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDefaultExternalAddressesRequest) ProtoMessage() {} +func (*QueryDefaultExternalAddressesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_17ef8689aa5884e9, []int{4} +} +func (m *QueryDefaultExternalAddressesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDefaultExternalAddressesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDefaultExternalAddressesRequest.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 *QueryDefaultExternalAddressesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDefaultExternalAddressesRequest.Merge(m, src) +} +func (m *QueryDefaultExternalAddressesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDefaultExternalAddressesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDefaultExternalAddressesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDefaultExternalAddressesRequest proto.InternalMessageInfo + +func (m *QueryDefaultExternalAddressesRequest) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *QueryDefaultExternalAddressesRequest) GetChainName() string { + if m != nil { + return m.ChainName + } + return "" +} + +func (m *QueryDefaultExternalAddressesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryDefaultExternalAddressesResponse is the response type for +// Query/DefaultExternalAddresses RPC method +type QueryDefaultExternalAddressesResponse struct { + // List of default addresses, each one represented by the associated chain + // link + Links []ChainLink `protobuf:"bytes,1,rep,name=links,proto3" json:"links"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDefaultExternalAddressesResponse) Reset() { *m = QueryDefaultExternalAddressesResponse{} } +func (m *QueryDefaultExternalAddressesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDefaultExternalAddressesResponse) ProtoMessage() {} +func (*QueryDefaultExternalAddressesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_17ef8689aa5884e9, []int{5} +} +func (m *QueryDefaultExternalAddressesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDefaultExternalAddressesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDefaultExternalAddressesResponse.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 *QueryDefaultExternalAddressesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDefaultExternalAddressesResponse.Merge(m, src) +} +func (m *QueryDefaultExternalAddressesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDefaultExternalAddressesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDefaultExternalAddressesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDefaultExternalAddressesResponse proto.InternalMessageInfo + +func (m *QueryDefaultExternalAddressesResponse) GetLinks() []ChainLink { + if m != nil { + return m.Links + } + return nil +} + +func (m *QueryDefaultExternalAddressesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { 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") + proto.RegisterType((*QueryDefaultExternalAddressesRequest)(nil), "desmos.profiles.v3.QueryDefaultExternalAddressesRequest") + proto.RegisterType((*QueryDefaultExternalAddressesResponse)(nil), "desmos.profiles.v3.QueryDefaultExternalAddressesResponse") } func init() { @@ -361,37 +484,41 @@ func init() { } 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, 0x2b, 0x17, 0xae, 0x03, 0x8d, 0x03, 0x88, 0x3f, 0x3d, 0x72, 0xa9, 0x9c, 0xf6, 0x5d, - 0x66, 0x91, 0xd8, 0x59, 0xec, 0x14, 0xfa, 0x2d, 0xf8, 0x00, 0xf0, 0x09, 0x38, 0xf1, 0x2d, 0x76, - 0xdc, 0x91, 0x13, 0x42, 0xed, 0x17, 0x41, 0xb1, 0xcd, 0x46, 0xd4, 0x30, 0xa4, 0x69, 0x37, 0xbf, - 0x7e, 0x5f, 0xfb, 0xf7, 0xf4, 0x69, 0x8c, 0xf7, 0x67, 0xa0, 0x33, 0xa5, 0x59, 0x5e, 0xa8, 0x63, - 0x91, 0x82, 0x66, 0xf3, 0x11, 0x3b, 0x2d, 0xa1, 0x58, 0x4c, 0xa6, 0x27, 0x5c, 0xc8, 0x49, 0x2a, - 0xe4, 0x07, 0x4d, 0xf3, 0x42, 0x19, 0x45, 0x88, 0x9b, 0xa5, 0x7f, 0x66, 0xe9, 0x7c, 0x14, 0xde, - 0x4e, 0x54, 0xa2, 0x6c, 0x9b, 0x55, 0x2b, 0x37, 0x19, 0xee, 0x24, 0x4a, 0x25, 0x29, 0x30, 0x9e, - 0x0b, 0xc6, 0xa5, 0x54, 0x86, 0x1b, 0xa1, 0xa4, 0xbf, 0x27, 0xdc, 0xf6, 0x5d, 0x5b, 0xc5, 0xe5, - 0x31, 0xe3, 0x72, 0xe1, 0x5b, 0x8f, 0x1a, 0x70, 0x32, 0x35, 0x83, 0x54, 0xaf, 0xf3, 0x84, 0xdb, - 0x53, 0x55, 0x0d, 0x4f, 0x5c, 0xbc, 0x2b, 0x7c, 0x6b, 0xdf, 0x55, 0x2c, 0xe6, 0x1a, 0xdc, 0xef, - 0x61, 0xf3, 0x61, 0x0c, 0x86, 0x0f, 0x59, 0xce, 0x13, 0x21, 0x2d, 0x8f, 0x9b, 0xdd, 0xfb, 0x86, - 0xf0, 0xd6, 0xbb, 0x6a, 0xe4, 0x59, 0x95, 0xf0, 0xaa, 0x0a, 0x18, 0xc3, 0x69, 0x09, 0xda, 0x10, - 0x82, 0xbb, 0xa5, 0x86, 0x22, 0x40, 0x7d, 0x34, 0xd8, 0x18, 0xdb, 0x35, 0xd9, 0xc5, 0xd8, 0xa1, - 0x48, 0x9e, 0x41, 0xd0, 0xb6, 0x9d, 0x0d, 0xbb, 0xf3, 0x9a, 0x67, 0x40, 0xb6, 0x70, 0xcf, 0xf0, - 0x22, 0x01, 0x13, 0x74, 0x6c, 0xcb, 0x57, 0xe4, 0x08, 0xe3, 0xcb, 0xe4, 0xa0, 0xdb, 0x47, 0x83, - 0xcd, 0x83, 0x07, 0xd4, 0x43, 0x57, 0x98, 0xd4, 0x62, 0x52, 0x8f, 0x49, 0xdf, 0xf2, 0x04, 0x3c, - 0xc6, 0xf8, 0xaf, 0x93, 0x7b, 0x5f, 0x11, 0xbe, 0xbb, 0x46, 0xab, 0x73, 0x25, 0x35, 0x90, 0xa7, - 0xf8, 0x96, 0xf5, 0x13, 0xa0, 0x7e, 0x67, 0xb0, 0x79, 0xb0, 0x4b, 0xd7, 0xff, 0x30, 0x7a, 0x71, - 0xec, 0xb0, 0x7b, 0xf6, 0xf3, 0x7e, 0x6b, 0xec, 0x4e, 0x90, 0x17, 0x35, 0xbc, 0xb6, 0xc5, 0x7b, - 0xf8, 0x5f, 0x3c, 0x97, 0x5b, 0xe3, 0xfb, 0x82, 0xf0, 0xbd, 0x3a, 0xdf, 0x9b, 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, + // 530 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0x4f, 0x6f, 0xd3, 0x3e, + 0x18, 0xc7, 0xeb, 0xb6, 0xab, 0x34, 0xef, 0x16, 0xed, 0xb7, 0x5f, 0x17, 0xb6, 0x50, 0x55, 0xfc, + 0xa9, 0x86, 0xb0, 0xd5, 0x95, 0x0b, 0x47, 0xc6, 0x18, 0x07, 0x10, 0x7f, 0x7a, 0xe4, 0x52, 0x39, + 0xcd, 0xd3, 0x2c, 0x22, 0xb1, 0xb3, 0xd8, 0x29, 0xeb, 0xbb, 0xe0, 0x05, 0xc0, 0x89, 0xe3, 0x4e, + 0xbc, 0x8b, 0x1d, 0x77, 0xe4, 0x84, 0x50, 0xfb, 0x46, 0x50, 0x6c, 0xd3, 0x11, 0xb5, 0xac, 0x12, + 0xea, 0x81, 0x9b, 0x1f, 0x3f, 0x5f, 0xfb, 0xfb, 0xf1, 0xd7, 0x89, 0xf1, 0x41, 0x00, 0x32, 0x11, + 0x92, 0xa6, 0x99, 0x18, 0x45, 0x31, 0x48, 0x3a, 0xee, 0xd1, 0xb3, 0x1c, 0xb2, 0xc9, 0x60, 0x78, + 0xca, 0x22, 0x3e, 0x88, 0x23, 0xfe, 0x5e, 0x92, 0x34, 0x13, 0x4a, 0x38, 0x8e, 0xd1, 0x92, 0x5f, + 0x5a, 0x32, 0xee, 0xb9, 0xdb, 0xa1, 0x08, 0x85, 0x6e, 0xd3, 0x62, 0x64, 0x94, 0xee, 0x5e, 0x28, + 0x44, 0x18, 0x03, 0x65, 0x69, 0x44, 0x19, 0xe7, 0x42, 0x31, 0x15, 0x09, 0x6e, 0xf7, 0x71, 0x77, + 0x6d, 0x57, 0x57, 0x7e, 0x3e, 0xa2, 0x8c, 0x4f, 0x6c, 0xeb, 0xc1, 0x12, 0x9c, 0x44, 0x04, 0x10, + 0xcb, 0x45, 0x1e, 0x77, 0x77, 0x28, 0x0a, 0xf1, 0xc0, 0xd8, 0x9b, 0xc2, 0xb6, 0x0e, 0x4c, 0x45, + 0x7d, 0x26, 0xc1, 0x9c, 0x87, 0x8e, 0xbb, 0x3e, 0x28, 0xd6, 0xa5, 0x29, 0x0b, 0x23, 0xae, 0x79, + 0x8c, 0xb6, 0x7d, 0x81, 0xf0, 0xce, 0xdb, 0x42, 0xf2, 0xb4, 0x70, 0x78, 0x59, 0x18, 0xf4, 0xe1, + 0x2c, 0x07, 0xa9, 0x1c, 0x07, 0xd7, 0x73, 0x09, 0x59, 0x13, 0xb5, 0x50, 0x67, 0xb3, 0xaf, 0xc7, + 0xce, 0x3e, 0xc6, 0x06, 0x85, 0xb3, 0x04, 0x9a, 0x55, 0xdd, 0xd9, 0xd4, 0x33, 0xaf, 0x58, 0x02, + 0xce, 0x0e, 0x6e, 0x28, 0x96, 0x85, 0xa0, 0x9a, 0x35, 0xdd, 0xb2, 0x95, 0x73, 0x82, 0xf1, 0xb5, + 0x73, 0xb3, 0xde, 0x42, 0x9d, 0xad, 0xc3, 0x7b, 0xc4, 0x42, 0x17, 0x98, 0x44, 0x63, 0x12, 0x8b, + 0x49, 0xde, 0xb0, 0x10, 0x2c, 0x46, 0xff, 0xb7, 0x95, 0xed, 0xcf, 0x08, 0xff, 0xbf, 0x40, 0x2b, + 0x53, 0xc1, 0x25, 0x38, 0x8f, 0xf1, 0x86, 0xce, 0xa7, 0x89, 0x5a, 0xb5, 0xce, 0xd6, 0xe1, 0x3e, + 0x59, 0xbc, 0x30, 0x32, 0x5f, 0x76, 0x54, 0xbf, 0xfc, 0x7e, 0xbb, 0xd2, 0x37, 0x2b, 0x9c, 0xe7, + 0x25, 0xbc, 0xaa, 0xc6, 0xbb, 0xbf, 0x12, 0xcf, 0xf8, 0x96, 0xf8, 0x3e, 0x21, 0x7c, 0xab, 0xcc, + 0xf7, 0xfa, 0x03, 0x87, 0x6c, 0x1e, 0x69, 0x39, 0x3e, 0xf4, 0xe7, 0xf8, 0xaa, 0x37, 0xc4, 0x57, + 0xfb, 0xeb, 0xf8, 0xbe, 0x56, 0xf1, 0xde, 0x72, 0x3c, 0x9b, 0x61, 0x80, 0x1b, 0x42, 0xcf, 0xd8, + 0x10, 0x4f, 0x96, 0x85, 0x78, 0xd3, 0x0e, 0xa4, 0x3c, 0x7f, 0x0c, 0x8a, 0x45, 0xb1, 0xb4, 0x69, + 0xdb, 0xbd, 0xd7, 0x16, 0xb7, 0xeb, 0xe3, 0xff, 0x96, 0xfa, 0xad, 0xf1, 0xd3, 0x6d, 0x7f, 0x41, + 0xf8, 0x8e, 0x3e, 0xf1, 0x31, 0x8c, 0x58, 0x1e, 0xab, 0x67, 0xe7, 0x0a, 0x32, 0xce, 0xe2, 0x27, + 0x41, 0x90, 0x81, 0x94, 0x30, 0xbf, 0xdb, 0x6d, 0xbc, 0xa1, 0xcf, 0x67, 0x4d, 0x4d, 0xb1, 0xca, + 0x75, 0x5d, 0x37, 0x7b, 0x81, 0xf0, 0xdd, 0x15, 0x94, 0xff, 0xce, 0x6f, 0x72, 0xf4, 0xe2, 0x72, + 0xea, 0xa1, 0xab, 0xa9, 0x87, 0x7e, 0x4c, 0x3d, 0xf4, 0x71, 0xe6, 0x55, 0xae, 0x66, 0x5e, 0xe5, + 0xdb, 0xcc, 0xab, 0xbc, 0xeb, 0x86, 0x91, 0x3a, 0xcd, 0x7d, 0x32, 0x14, 0x09, 0x35, 0x60, 0x0f, + 0x63, 0xe6, 0x4b, 0x3b, 0xa6, 0xe3, 0x47, 0xf4, 0xfc, 0xfa, 0x79, 0x54, 0x93, 0x14, 0xa4, 0xdf, + 0xd0, 0x0f, 0x59, 0xef, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4f, 0xbc, 0x77, 0x5c, 0xcd, 0x05, + 0x00, 0x00, } func (m *QueryChainLinksRequest) Marshal() (dAtA []byte, err error) { @@ -641,6 +768,104 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) MarshalToSizedBuffe return len(dAtA) - i, nil } +func (m *QueryDefaultExternalAddressesRequest) 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 *QueryDefaultExternalAddressesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDefaultExternalAddressesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.ChainName) > 0 { + i -= len(m.ChainName) + copy(dAtA[i:], m.ChainName) + i = encodeVarintQueryChainLinks(dAtA, i, uint64(len(m.ChainName))) + i-- + dAtA[i] = 0x12 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintQueryChainLinks(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDefaultExternalAddressesResponse) 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 *QueryDefaultExternalAddressesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDefaultExternalAddressesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Links) > 0 { + for iNdEx := len(m.Links) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Links[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQueryChainLinks(dAtA []byte, offset int, v uint64) int { offset -= sovQueryChainLinks(v) base := offset @@ -757,6 +982,46 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) Size() (n int) { return n } +func (m *QueryDefaultExternalAddressesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovQueryChainLinks(uint64(l)) + } + l = len(m.ChainName) + if l > 0 { + n += 1 + l + sovQueryChainLinks(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQueryChainLinks(uint64(l)) + } + return n +} + +func (m *QueryDefaultExternalAddressesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Links) > 0 { + for _, e := range m.Links { + l = e.Size() + n += 1 + l + sovQueryChainLinks(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQueryChainLinks(uint64(l)) + } + return n +} + func sovQueryChainLinks(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1481,6 +1746,276 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) Unmarshal(dAtA []by } return nil } +func (m *QueryDefaultExternalAddressesRequest) 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 ErrIntOverflowQueryChainLinks + } + 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: QueryDefaultExternalAddressesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDefaultExternalAddressesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryChainLinks + } + 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 ErrInvalidLengthQueryChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryChainLinks + } + 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 ErrInvalidLengthQueryChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDefaultExternalAddressesResponse) 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 ErrIntOverflowQueryChainLinks + } + 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: QueryDefaultExternalAddressesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDefaultExternalAddressesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Links", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Links = append(m.Links, ChainLink{}) + if err := m.Links[len(m.Links)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQueryChainLinks(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 16df80ede07fcb69518894a8f263b1dc2a96e259 Mon Sep 17 00:00:00 2001 From: RiccardoM Date: Fri, 15 Jul 2022 09:38:39 +0000 Subject: [PATCH 38/64] Updated Swagger definition --- client/docs/swagger-ui/swagger.yaml | 15529 ++++++++++++++------------ 1 file changed, 8516 insertions(+), 7013 deletions(-) diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 4a226c59fa..513fca4e7c 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -4,14 +4,12 @@ info: description: A REST interface for state queries version: 3.0.0 paths: - /desmos/profiles/v3/app-links: + /desmos/profiles/v2/default-addresses: get: - summary: >- - ApplicationLinks queries the applications links associated to the given - - user, if provided. Otherwise, it queries all the application links - stored. - operationId: ApplicationLinks + summary: |- + DefaultExternalAddresses queries the default addresses associated to the + given user and (optionally) chain name + operationId: DefaultExternalAddresses responses: '200': description: A successful response. @@ -25,830 +23,636 @@ paths: properties: user: type: string - title: User to which the link is associated - data: - title: Data contains the details of this specific link - type: object - properties: - application: - type: string - title: 'The application name (eg. Twitter, GitHub, etc)' - username: - type: string - title: >- - Username on the application (eg. Twitter tag, GitHub - profile, etc) - state: - title: State of the link - type: string - enum: - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - - APPLICATION_LINK_STATE_VERIFICATION_STARTED - - APPLICATION_LINK_STATE_VERIFICATION_ERROR - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS - - APPLICATION_LINK_STATE_TIMED_OUT - default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - description: >- - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link - has just been initialized - - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified - - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully - - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification - oracle_request: + title: User defines the destination profile address to link + address: title: >- - OracleRequest represents the request that has been made - to the oracle + Address contains the data of the external chain address + to be connected + + with the Desmos profile type: object properties: - id: - type: string - format: uint64 - title: ID is the ID of the request - oracle_script_id: + type_url: type: string - format: uint64 - title: OracleScriptID is ID of an oracle script - call_data: - title: >- - CallData contains the data used to perform the - oracle request - type: object - properties: - application: - type: string - title: >- - The application for which the ownership should - be verified - call_data: - type: string - title: >- - The hex encoded call data that should be used to - verify the application + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - account ownership - client_id: - type: string - title: >- - ClientID represents the ID of the client that has - called the oracle script - result: - title: |- - Data coming from the result of the verification. - Only available when the state is STATE_SUCCESS - type: object - properties: - success: - title: Success represents a successful verification - type: object - properties: - value: - type: string - title: >- - Hex-encoded value that has be signed by the - profile - signature: - type: string - title: >- - Hex-encoded signature that has been produced by - signing the value - failed: - title: Failed represents a failed verification - type: object - properties: - error: - type: string - title: Error that is associated with the failure - creation_time: - 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 - pagination: - title: Pagination defines the pagination response - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + protocol buffer message. This string must contain at + least - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + one "/" character. The last segment of the URL's + path must represent - corresponding request message has used PageRequest. + the fully qualified name of the type (as in - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QueryApplicationLinksResponse represents the response to the query - used + `path/google.protobuf.Duration`). The name should be + in a canonical form - to get the application links for a specific user - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + (e.g., leading "." is not accepted). - protocol buffer message. This string must contain at - least - one "/" character. The last segment of the URL's path - must represent + In practice, teams usually precompile into the + binary all types that they - the fully qualified name of the type (as in + expect it to use in the context of Any. However, for + URLs which use the - `path/google.protobuf.Duration`). The name should be in - a canonical form + scheme `http`, `https`, or no scheme, one can + optionally set up a type - (e.g., leading "." is not accepted). + server that maps type URLs to message definitions as + follows: - In practice, teams usually precompile into the binary - all types that they + * If no scheme is provided, `https` is assumed. - expect it to use in the context of Any. However, for - URLs which use the + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - scheme `http`, `https`, or no scheme, one can optionally - set up a type + Note: this functionality is not currently available + in the official - server that maps type URLs to message definitions as - follows: + protobuf release, and it is not used for type URLs + beginning with + type.googleapis.com. - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + Schemes other than `http`, `https` (or the empty + scheme) might be - Note: this functionality is not currently available in - the official + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the + above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - protobuf release, and it is not used for type URLs - beginning with + URL that describes the type of the serialized message. - type.googleapis.com. + Protobuf library provides support to pack/unpack Any + values in the form - Schemes other than `http`, `https` (or the empty scheme) - might be + of utility functions or additional generated methods of + the Any type. - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - URL that describes the type of the serialized message. + Example 1: Pack and unpack a message in C++. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Protobuf library provides support to pack/unpack Any values - in the form + Example 2: Pack and unpack a message in Java. - of utility functions or additional generated methods of the - Any type. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. - Example 1: Pack and unpack a message in C++. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Example 4: Pack and unpack a message in Go - Example 2: Pack and unpack a message in Java. + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + The pack methods provided by protobuf library will by + default use - Example 3: Pack and unpack a message in Python. + 'type.googleapis.com/full.type.name' as the type URL and + the unpack - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + methods only use the fully qualified type name after the + last '/' - Example 4: Pack and unpack a message in Go + in the type URL, for example "foo.bar.com/x/y.z" will + yield type - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + name "y.z". - The pack methods provided by protobuf library will by - default use - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - methods only use the fully qualified type name after the - last '/' + JSON - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + ==== - name "y.z". + The JSON representation of an `Any` value uses the + regular + representation of the deserialized, embedded message, + with an + additional field `@type` which contains the type URL. + Example: - JSON + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - ==== + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - The JSON representation of an `Any` value uses the regular + If the embedded message type is well-known and has a + custom JSON - representation of the deserialized, embedded message, with - an + representation, that representation will be embedded + adding a field - additional field `@type` which contains the type URL. - Example: + `value` which holds the custom JSON in addition to the + `@type` - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + field. Example (for message + [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + proof: + title: >- + Proof contains the ownership proof of the external chain + address + type: object + properties: + pub_key: + title: >- + PubKey represents the public key associated with the + address for which to - If the embedded message type is well-known and has a custom - JSON + prove the ownership + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - representation, that representation will be embedded adding - a field + protocol buffer message. This string must + contain at least - `value` which holds the custom JSON in addition to the - `@type` + one "/" character. The last segment of the URL's + path must represent - field. Example (for message [google.protobuf.Duration][]): + the fully qualified name of the type (as in - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: user - description: >- - (Optional) User contains the Desmos profile address associated for - which + `path/google.protobuf.Duration`). The name + should be in a canonical form - the link should be searched for. - in: query - required: false - type: string - - name: application - description: >- - (Optional) Application represents the application name associated - with the + (e.g., leading "." is not accepted). - link. Used only if user is also set. - in: query - required: false - type: string - - name: username - description: >- - Username represents the username inside the application associated - with the - link. Used only if application is also set. - in: query - required: false - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + In practice, teams usually precompile into the + binary all types that they - It is less efficient than using key. Only one of offset or key - should + expect it to use in the context of Any. However, + for URLs which use the - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. + scheme `http`, `https`, or no scheme, one can + optionally set up a type - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + server that maps type URLs to message + definitions as follows: - a count of the total number of items available for pagination in - UIs. - count_total is only respected when offset is used. It is ignored - when key + * If no scheme is provided, `https` is assumed. - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup + results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently + available in the official - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean - tags: - - Query - '/desmos/profiles/v3/app-links/clients/{client_id}': - get: - summary: |- - ApplicationLinkByClientID queries a single application link for a given - client id. - operationId: ApplicationLinkByClientID - responses: - '200': - description: A successful response. - schema: - type: object - properties: - link: - type: object - properties: - user: - type: string - title: User to which the link is associated - data: - title: Data contains the details of this specific link - type: object - properties: - application: - type: string - title: 'The application name (eg. Twitter, GitHub, etc)' - username: - type: string - title: >- - Username on the application (eg. Twitter tag, GitHub - profile, etc) - state: - title: State of the link - type: string - enum: - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - - APPLICATION_LINK_STATE_VERIFICATION_STARTED - - APPLICATION_LINK_STATE_VERIFICATION_ERROR - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS - - APPLICATION_LINK_STATE_TIMED_OUT - default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - description: >- - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link - has just been initialized - - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified - - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully - - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification - oracle_request: - title: >- - OracleRequest represents the request that has been made to - the oracle - type: object - properties: - id: - type: string - format: uint64 - title: ID is the ID of the request - oracle_script_id: - type: string - format: uint64 - title: OracleScriptID is ID of an oracle script - call_data: - title: >- - CallData contains the data used to perform the oracle - request - type: object - properties: - application: - type: string - title: >- - The application for which the ownership should be - verified - call_data: - type: string - title: >- - The hex encoded call data that should be used to - verify the application + protobuf release, and it is not used for type + URLs beginning with - account ownership - client_id: - type: string - title: >- - ClientID represents the ID of the client that has - called the oracle script - result: - title: |- - Data coming from the result of the verification. - Only available when the state is STATE_SUCCESS - type: object - properties: - success: - title: Success represents a successful verification - type: object - properties: - value: - type: string - title: >- - Hex-encoded value that has be signed by the - profile - signature: - type: string - title: >- - Hex-encoded signature that has been produced by - signing the value - failed: - title: Failed represents a failed verification - type: object - properties: - error: - type: string - title: Error that is associated with the failure - creation_time: - 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 + type.googleapis.com. - request allowing to get an application link using a client id - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - protocol buffer message. This string must contain at - least + Schemes other than `http`, `https` (or the empty + scheme) might be - one "/" character. The last segment of the URL's path - must represent + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of + the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol + buffer message along with a - the fully qualified name of the type (as in + URL that describes the type of the serialized + message. - `path/google.protobuf.Duration`). The name should be in - a canonical form - (e.g., leading "." is not accepted). + Protobuf library provides support to pack/unpack Any + values in the form + of utility functions or additional generated methods + of the Any type. - In practice, teams usually precompile into the binary - all types that they - expect it to use in the context of Any. However, for - URLs which use the + Example 1: Pack and unpack a message in C++. - scheme `http`, `https`, or no scheme, one can optionally - set up a type + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - server that maps type URLs to message definitions as - follows: + Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - * If no scheme is provided, `https` is assumed. + Example 3: Pack and unpack a message in Python. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Note: this functionality is not currently available in - the official + Example 4: Pack and unpack a message in Go - protobuf release, and it is not used for type URLs - beginning with + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - type.googleapis.com. + The pack methods provided by protobuf library will + by default use + 'type.googleapis.com/full.type.name' as the type URL + and the unpack - Schemes other than `http`, `https` (or the empty scheme) - might be + methods only use the fully qualified type name after + the last '/' - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + in the type URL, for example "foo.bar.com/x/y.z" + will yield type - URL that describes the type of the serialized message. + name "y.z". - Protobuf library provides support to pack/unpack Any values - in the form - of utility functions or additional generated methods of the - Any type. + JSON + ==== - Example 1: Pack and unpack a message in C++. + The JSON representation of an `Any` value uses the + regular - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + representation of the deserialized, embedded + message, with an - Example 2: Pack and unpack a message in Java. + additional field `@type` which contains the type + URL. Example: - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - Example 3: Pack and unpack a message in Python. + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + If the embedded message type is well-known and has a + custom JSON - Example 4: Pack and unpack a message in Go + representation, that representation will be embedded + adding a field - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + `value` which holds the custom JSON in addition to + the `@type` - The pack methods provided by protobuf library will by - default use + field. Example (for message + [google.protobuf.Duration][]): - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + signature: + title: >- + Signature represents the hex-encoded signature of + the PlainText value + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - methods only use the fully qualified type name after the - last '/' + protocol buffer message. This string must + contain at least - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + one "/" character. The last segment of the URL's + path must represent - name "y.z". + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name + should be in a canonical form + (e.g., leading "." is not accepted). - JSON - ==== + In practice, teams usually precompile into the + binary all types that they - The JSON representation of an `Any` value uses the regular + expect it to use in the context of Any. However, + for URLs which use the - representation of the deserialized, embedded message, with - an + scheme `http`, `https`, or no scheme, one can + optionally set up a type - additional field `@type` which contains the type URL. - Example: + server that maps type URLs to message + definitions as follows: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + * If no scheme is provided, `https` is assumed. - If the embedded message type is well-known and has a custom - JSON + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup + results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - representation, that representation will be embedded adding - a field + Note: this functionality is not currently + available in the official - `value` which holds the custom JSON in addition to the - `@type` + protobuf release, and it is not used for type + URLs beginning with - field. Example (for message [google.protobuf.Duration][]): + type.googleapis.com. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: client_id - description: >- - ClientID represents the ID of the client to which search the link - for - in: path - required: true - type: string - tags: - - Query - /desmos/profiles/v3/app-links/owners: - get: - summary: |- - ApplicationLinkOwners queries for the owners of applications links, - optionally searching for a specific application and username. - operationId: ApplicationLinkOwners - responses: - '200': - description: A successful response. - schema: - type: object - properties: - owners: - type: array - items: - type: object - properties: - user: - type: string - application: - type: string - username: - type: string - title: >- - ApplicationLinkOwnerDetails contains the details of a single - application - link owner - title: Addresses of the application links owners - pagination: - title: Pagination defines the pagination response - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + Schemes other than `http`, `https` (or the empty + scheme) might be - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of + the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol + buffer message along with a - corresponding request message has used PageRequest. + URL that describes the type of the serialized + message. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: >- - QueryApplicationLinkOwnersResponse contains the data returned by - the request - allowing to get application link owners. - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods + of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will + by default use + + 'type.googleapis.com/full.type.name' as the type URL + and the unpack + + methods only use the fully qualified type name after + the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" + will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded + message, with an + + additional field `@type` which contains the type + URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to + the `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + plain_text: + type: string + title: >- + PlainText represents the hex-encoded value signed in + order to produce the + + Signature + chain_config: + title: >- + ChainConfig contains the configuration of the external + chain + type: object + properties: + name: + type: string + description: >- + ChainConfig contains the data of the chain with which + the link is made. + creation_time: + type: string + format: date-time + title: >- + CreationTime represents the time in which the link has + been created + title: >- + ChainLink contains the data representing either an inter- or + cross- chain + + link + title: >- + List of default addresses, each one represented by the + associated chain + + link + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryDefaultExternalAddressesResponse is the response type for + Query/DefaultExternalAddresses RPC method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: type: array items: type: object @@ -1026,19 +830,13 @@ paths: "value": "1.212s" } parameters: - - name: application - description: >- - (Optional) Application name to search link owners of. If not - specified, all - - links stored will be searched instead. + - name: owner + description: (Optional) Owner for which to query the default addresses. in: query required: false type: string - - name: username - description: |- - (Optional) Username to search for. This will only be used if the - application is specified as well. + - name: chain_name + description: (Optional) Chain name to query the default address for. in: query required: false type: string @@ -1102,12 +900,14 @@ paths: format: boolean tags: - Query - /desmos/profiles/v3/chain-links: + /desmos/profiles/v3/app-links: get: - summary: |- - ChainLinks queries the chain links associated to the given user, if - provided. Otherwise it queries all the chain links stored. - operationId: ChainLinks + summary: >- + ApplicationLinks queries the applications links associated to the given + + user, if provided. Otherwise, it queries all the application links + stored. + operationId: ApplicationLinks responses: '200': description: A successful response. @@ -1121,619 +921,817 @@ paths: properties: user: type: string - title: User defines the destination profile address to link - address: + title: User to which the link is associated + data: + title: Data contains the details of this specific link type: object properties: - type_url: + application: type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the - binary all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available - in the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - value: + title: 'The application name (eg. Twitter, GitHub, etc)' + username: type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the - above specified type. + title: >- + Username on the application (eg. Twitter tag, GitHub + profile, etc) + state: + title: State of the link + type: string + enum: + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + - APPLICATION_LINK_STATE_VERIFICATION_STARTED + - APPLICATION_LINK_STATE_VERIFICATION_ERROR + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS + - APPLICATION_LINK_STATE_TIMED_OUT + default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link + has just been initialized + - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified + - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully + - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification + oracle_request: + title: >- + OracleRequest represents the request that has been made + to the oracle + type: object + properties: + id: + type: string + format: uint64 + title: ID is the ID of the request + oracle_script_id: + type: string + format: uint64 + title: OracleScriptID is ID of an oracle script + call_data: + title: >- + CallData contains the data used to perform the + oracle request + type: object + properties: + application: + type: string + title: >- + The application for which the ownership should + be verified + call_data: + type: string + title: >- + The hex encoded call data that should be used to + verify the application - URL that describes the type of the serialized message. + account ownership + client_id: + type: string + title: >- + ClientID represents the ID of the client that has + called the oracle script + result: + title: |- + Data coming from the result of the verification. + Only available when the state is STATE_SUCCESS + type: object + properties: + success: + title: Success represents a successful verification + type: object + properties: + value: + type: string + title: >- + Hex-encoded value that has be signed by the + profile + signature: + type: string + title: >- + Hex-encoded signature that has been produced by + signing the value + failed: + title: Failed represents a failed verification + type: object + properties: + error: + type: string + title: Error that is associated with the failure + creation_time: + 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 + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the - Protobuf library provides support to pack/unpack Any - values in the form + corresponding request message has used PageRequest. - of utility functions or additional generated methods of - the Any type. + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: Pagination defines the pagination response + title: >- + QueryApplicationLinksResponse represents the response to the query + used + to get the application links for a specific user + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - Example 1: Pack and unpack a message in C++. + protocol buffer message. This string must contain at + least - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + one "/" character. The last segment of the URL's path + must represent - Example 2: Pack and unpack a message in Java. + the fully qualified name of the type (as in - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + `path/google.protobuf.Duration`). The name should be in + a canonical form - Example 3: Pack and unpack a message in Python. + (e.g., leading "." is not accepted). - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + In practice, teams usually precompile into the binary + all types that they - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + expect it to use in the context of Any. However, for + URLs which use the - The pack methods provided by protobuf library will by - default use + scheme `http`, `https`, or no scheme, one can optionally + set up a type - 'type.googleapis.com/full.type.name' as the type URL and - the unpack + server that maps type URLs to message definitions as + follows: - methods only use the fully qualified type name after the - last '/' - in the type URL, for example "foo.bar.com/x/y.z" will - yield type + * If no scheme is provided, `https` is assumed. - name "y.z". + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently available in + the official + protobuf release, and it is not used for type URLs + beginning with - JSON + type.googleapis.com. - ==== - The JSON representation of an `Any` value uses the - regular + Schemes other than `http`, `https` (or the empty scheme) + might be - representation of the deserialized, embedded message, - with an + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - additional field `@type` which contains the type URL. - Example: + URL that describes the type of the serialized message. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + Protobuf library provides support to pack/unpack Any values + in the form - If the embedded message type is well-known and has a - custom JSON + of utility functions or additional generated methods of the + Any type. - representation, that representation will be embedded - adding a field - `value` which holds the custom JSON in addition to the - `@type` + Example 1: Pack and unpack a message in C++. - field. Example (for message - [google.protobuf.Duration][]): + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - Address contains the data of the external chain address - to be connected + Example 2: Pack and unpack a message in Java. - with the Desmos profile - proof: - title: >- - Proof contains the ownership proof of the external chain - address - type: object - properties: - pub_key: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - protocol buffer message. This string must - contain at least + Example 3: Pack and unpack a message in Python. - one "/" character. The last segment of the URL's - path must represent + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - the fully qualified name of the type (as in + Example 4: Pack and unpack a message in Go - `path/google.protobuf.Duration`). The name - should be in a canonical form + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - (e.g., leading "." is not accepted). + The pack methods provided by protobuf library will by + default use + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - In practice, teams usually precompile into the - binary all types that they + methods only use the fully qualified type name after the + last '/' - expect it to use in the context of Any. However, - for URLs which use the + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - scheme `http`, `https`, or no scheme, one can - optionally set up a type + name "y.z". - server that maps type URLs to message - definitions as follows: - * If no scheme is provided, `https` is assumed. + JSON - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup - results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + ==== - Note: this functionality is not currently - available in the official + The JSON representation of an `Any` value uses the regular - protobuf release, and it is not used for type - URLs beginning with + representation of the deserialized, embedded message, with + an - type.googleapis.com. + additional field `@type` which contains the type URL. + Example: + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - Schemes other than `http`, `https` (or the empty - scheme) might be + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of - the above specified type. - description: >- - `Any` contains an arbitrary serialized protocol - buffer message along with a + If the embedded message type is well-known and has a custom + JSON - URL that describes the type of the serialized - message. + representation, that representation will be embedded adding + a field + `value` which holds the custom JSON in addition to the + `@type` - Protobuf library provides support to pack/unpack Any - values in the form + field. Example (for message [google.protobuf.Duration][]): - of utility functions or additional generated methods - of the Any type. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: user + description: >- + (Optional) User contains the Desmos profile address associated for + which + the link should be searched for. + in: query + required: false + type: string + - name: application + description: >- + (Optional) Application represents the application name associated + with the - Example 1: Pack and unpack a message in C++. + link. Used only if user is also set. + in: query + required: false + type: string + - name: username + description: >- + Username represents the username inside the application associated + with the - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + link. Used only if application is also set. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - Example 2: Pack and unpack a message in Java. + It is less efficient than using key. Only one of offset or key + should - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - Example 3: Pack and unpack a message in Python. + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + a count of the total number of items available for pagination in + UIs. - Example 4: Pack and unpack a message in Go + count_total is only respected when offset is used. It is ignored + when key - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - The pack methods provided by protobuf library will - by default use - 'type.googleapis.com/full.type.name' as the type URL - and the unpack + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean + tags: + - Query + '/desmos/profiles/v3/app-links/clients/{client_id}': + get: + summary: |- + ApplicationLinkByClientID queries a single application link for a given + client id. + operationId: ApplicationLinkByClientID + responses: + '200': + description: A successful response. + schema: + type: object + properties: + link: + type: object + properties: + user: + type: string + title: User to which the link is associated + data: + title: Data contains the details of this specific link + type: object + properties: + application: + type: string + title: 'The application name (eg. Twitter, GitHub, etc)' + username: + type: string + title: >- + Username on the application (eg. Twitter tag, GitHub + profile, etc) + state: + title: State of the link + type: string + enum: + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + - APPLICATION_LINK_STATE_VERIFICATION_STARTED + - APPLICATION_LINK_STATE_VERIFICATION_ERROR + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS + - APPLICATION_LINK_STATE_TIMED_OUT + default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + description: >- + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link + has just been initialized + - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified + - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully + - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification + oracle_request: + title: >- + OracleRequest represents the request that has been made to + the oracle + type: object + properties: + id: + type: string + format: uint64 + title: ID is the ID of the request + oracle_script_id: + type: string + format: uint64 + title: OracleScriptID is ID of an oracle script + call_data: + title: >- + CallData contains the data used to perform the oracle + request + type: object + properties: + application: + type: string + title: >- + The application for which the ownership should be + verified + call_data: + type: string + title: >- + The hex encoded call data that should be used to + verify the application - methods only use the fully qualified type name after - the last '/' + account ownership + client_id: + type: string + title: >- + ClientID represents the ID of the client that has + called the oracle script + result: + title: |- + Data coming from the result of the verification. + Only available when the state is STATE_SUCCESS + type: object + properties: + success: + title: Success represents a successful verification + type: object + properties: + value: + type: string + title: >- + Hex-encoded value that has be signed by the + profile + signature: + type: string + title: >- + Hex-encoded signature that has been produced by + signing the value + failed: + title: Failed represents a failed verification + type: object + properties: + error: + type: string + title: Error that is associated with the failure + creation_time: + 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 - in the type URL, for example "foo.bar.com/x/y.z" - will yield type + request allowing to get an application link using a client id + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - name "y.z". + protocol buffer message. This string must contain at + least + one "/" character. The last segment of the URL's path + must represent + the fully qualified name of the type (as in - JSON + `path/google.protobuf.Duration`). The name should be in + a canonical form - ==== + (e.g., leading "." is not accepted). - The JSON representation of an `Any` value uses the - regular - representation of the deserialized, embedded - message, with an + In practice, teams usually precompile into the binary + all types that they - additional field `@type` which contains the type - URL. Example: + expect it to use in the context of Any. However, for + URLs which use the - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + scheme `http`, `https`, or no scheme, one can optionally + set up a type - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + server that maps type URLs to message definitions as + follows: - If the embedded message type is well-known and has a - custom JSON - representation, that representation will be embedded - adding a field + * If no scheme is provided, `https` is assumed. - `value` which holds the custom JSON in addition to - the `@type` + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - field. Example (for message - [google.protobuf.Duration][]): + Note: this functionality is not currently available in + the official - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - PubKey represents the public key associated with the - address for which to + protobuf release, and it is not used for type URLs + beginning with - prove the ownership - signature: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized + type.googleapis.com. - protocol buffer message. This string must - contain at least - one "/" character. The last segment of the URL's - path must represent + Schemes other than `http`, `https` (or the empty scheme) + might be - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name - should be in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the - binary all types that they - - expect it to use in the context of Any. However, - for URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - server that maps type URLs to message - definitions as follows: + URL that describes the type of the serialized message. - * If no scheme is provided, `https` is assumed. + Protobuf library provides support to pack/unpack Any values + in the form - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup - results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + of utility functions or additional generated methods of the + Any type. - Note: this functionality is not currently - available in the official - protobuf release, and it is not used for type - URLs beginning with + Example 1: Pack and unpack a message in C++. - type.googleapis.com. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + Example 2: Pack and unpack a message in Java. - Schemes other than `http`, `https` (or the empty - scheme) might be + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of - the above specified type. - description: >- - `Any` contains an arbitrary serialized protocol - buffer message along with a + Example 3: Pack and unpack a message in Python. - URL that describes the type of the serialized - message. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + Example 4: Pack and unpack a message in Go - Protobuf library provides support to pack/unpack Any - values in the form + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - of utility functions or additional generated methods - of the Any type. + The pack methods provided by protobuf library will by + default use + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - Example 1: Pack and unpack a message in C++. + methods only use the fully qualified type name after the + last '/' - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - Example 2: Pack and unpack a message in Java. + name "y.z". - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + JSON - Example 4: Pack and unpack a message in Go + ==== - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + The JSON representation of an `Any` value uses the regular - The pack methods provided by protobuf library will - by default use + representation of the deserialized, embedded message, with + an - 'type.googleapis.com/full.type.name' as the type URL - and the unpack + additional field `@type` which contains the type URL. + Example: - methods only use the fully qualified type name after - the last '/' + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - in the type URL, for example "foo.bar.com/x/y.z" - will yield type + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - name "y.z". + If the embedded message type is well-known and has a custom + JSON + representation, that representation will be embedded adding + a field + `value` which holds the custom JSON in addition to the + `@type` - JSON + field. Example (for message [google.protobuf.Duration][]): - ==== + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: >- + ClientID represents the ID of the client to which search the link + for + in: path + required: true + type: string + tags: + - Query + /desmos/profiles/v3/app-links/owners: + get: + summary: |- + ApplicationLinkOwners queries for the owners of applications links, + optionally searching for a specific application and username. + operationId: ApplicationLinkOwners + responses: + '200': + description: A successful response. + schema: + type: object + properties: + owners: + type: array + items: + type: object + properties: + user: + type: string + application: + type: string + username: + type: string + title: >- + ApplicationLinkOwnerDetails contains the details of a single + application - The JSON representation of an `Any` value uses the - regular + link owner + title: Addresses of the application links owners + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - representation of the deserialized, embedded - message, with an + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the - additional field `@type` which contains the type - URL. Example: + corresponding request message has used PageRequest. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: Pagination defines the pagination response + description: >- + QueryApplicationLinkOwnersResponse contains the data returned by + the request - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to - the `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - Signature represents the hex-encoded signature of - the PlainText value - plain_text: - type: string - title: >- - PlainText represents the hex-encoded value signed in - order to produce the - - Signature - chain_config: - title: >- - ChainConfig contains the configuration of the external - chain - type: object - properties: - name: - type: string - description: >- - ChainConfig contains the data of the chain with which - the link is made. - creation_time: - type: string - format: date-time - title: >- - CreationTime represents the time in which the link has - been created - title: >- - ChainLink contains the data representing either an inter- or - cross- chain - - link - pagination: - title: Pagination defines the pagination response - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: |- - QueryChainLinksResponse is the response type for the - Query/ChainLinks RPC method. + allowing to get application link owners. default: description: An unexpected error response schema: @@ -1924,30 +1922,19 @@ paths: "value": "1.212s" } parameters: - - name: user - description: >- - (optional) User represents the Desmos address of the user to which - search - - the link for. - in: query - required: false - type: string - - name: chain_name + - name: application description: >- - (optional) ChainName contains the name of the chain to which search - the + (Optional) Application name to search link owners of. If not + specified, all - link for. Used only if user is also set. + links stored will be searched instead. in: query required: false type: string - - name: target - description: >- - (optional) Target must contain the external address to which query - the link - - for. Used only if chain name is also set. + - name: username + description: |- + (Optional) Username to search for. This will only be used if the + application is specified as well. in: query required: false type: string @@ -2011,803 +1998,638 @@ paths: format: boolean tags: - Query - /desmos/profiles/v3/chain-links/owners: + /desmos/profiles/v3/chain-links: get: - summary: >- - ChainLinkOwners queries for the owners of chain links, optionally - searching - - for a specific chain name and external address - operationId: ChainLinkOwners + summary: |- + ChainLinks queries the chain links associated to the given user, if + provided. Otherwise it queries all the chain links stored. + operationId: ChainLinks responses: '200': description: A successful response. schema: type: object properties: - owners: + links: type: array items: type: object properties: user: type: string - chain_name: - type: string - target: - type: string - title: >- - ChainLinkOwnerDetails contains the details of a single chain - link owner - title: Addresses of the chain links owners - pagination: - title: Pagination defines the pagination response - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + title: User defines the destination profile address to link + address: + title: >- + Address contains the data of the external chain address + to be connected - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + with the Desmos profile + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - corresponding request message has used PageRequest. + protocol buffer message. This string must contain at + least - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: >- - QueryChainLinkOwnersResponse contains the data returned by the - request + one "/" character. The last segment of the URL's + path must represent - allowing to get chain link owners. - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + the fully qualified name of the type (as in - protocol buffer message. This string must contain at - least + `path/google.protobuf.Duration`). The name should be + in a canonical form - one "/" character. The last segment of the URL's path - must represent + (e.g., leading "." is not accepted). - the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in - a canonical form + In practice, teams usually precompile into the + binary all types that they - (e.g., leading "." is not accepted). + expect it to use in the context of Any. However, for + URLs which use the + scheme `http`, `https`, or no scheme, one can + optionally set up a type - In practice, teams usually precompile into the binary - all types that they + server that maps type URLs to message definitions as + follows: - expect it to use in the context of Any. However, for - URLs which use the - scheme `http`, `https`, or no scheme, one can optionally - set up a type + * If no scheme is provided, `https` is assumed. - server that maps type URLs to message definitions as - follows: + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently available + in the official - * If no scheme is provided, `https` is assumed. + protobuf release, and it is not used for type URLs + beginning with - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + type.googleapis.com. - Note: this functionality is not currently available in - the official - protobuf release, and it is not used for type URLs - beginning with + Schemes other than `http`, `https` (or the empty + scheme) might be - type.googleapis.com. + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the + above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + URL that describes the type of the serialized message. - Schemes other than `http`, `https` (or the empty scheme) - might be - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + Protobuf library provides support to pack/unpack Any + values in the form - URL that describes the type of the serialized message. + of utility functions or additional generated methods of + the Any type. - Protobuf library provides support to pack/unpack Any values - in the form + Example 1: Pack and unpack a message in C++. - of utility functions or additional generated methods of the - Any type. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + Example 2: Pack and unpack a message in Java. - Example 1: Pack and unpack a message in C++. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Example 3: Pack and unpack a message in Python. - Example 2: Pack and unpack a message in Java. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Example 4: Pack and unpack a message in Go - Example 3: Pack and unpack a message in Python. + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + The pack methods provided by protobuf library will by + default use - Example 4: Pack and unpack a message in Go + 'type.googleapis.com/full.type.name' as the type URL and + the unpack - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + methods only use the fully qualified type name after the + last '/' - The pack methods provided by protobuf library will by - default use + in the type URL, for example "foo.bar.com/x/y.z" will + yield type - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + name "y.z". - methods only use the fully qualified type name after the - last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - name "y.z". + JSON + ==== + The JSON representation of an `Any` value uses the + regular - JSON + representation of the deserialized, embedded message, + with an - ==== + additional field `@type` which contains the type URL. + Example: - The JSON representation of an `Any` value uses the regular + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - representation of the deserialized, embedded message, with - an + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - additional field `@type` which contains the type URL. - Example: + If the embedded message type is well-known and has a + custom JSON - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + representation, that representation will be embedded + adding a field - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + `value` which holds the custom JSON in addition to the + `@type` - If the embedded message type is well-known and has a custom - JSON + field. Example (for message + [google.protobuf.Duration][]): - representation, that representation will be embedded adding - a field + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + proof: + title: >- + Proof contains the ownership proof of the external chain + address + type: object + properties: + pub_key: + title: >- + PubKey represents the public key associated with the + address for which to - `value` which holds the custom JSON in addition to the - `@type` + prove the ownership + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - field. Example (for message [google.protobuf.Duration][]): + protocol buffer message. This string must + contain at least - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: chain_name - description: >- - (Optional) Chain name to search link owners of. If not specified, - all + one "/" character. The last segment of the URL's + path must represent - links stored will be searched instead. - in: query - required: false - type: string - - name: target - description: >- - (Optional) External address to search for. This will only be used if - the + the fully qualified name of the type (as in - chain name is specified as well. - in: query - required: false - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + `path/google.protobuf.Duration`). The name + should be in a canonical form - It is less efficient than using key. Only one of offset or key - should + (e.g., leading "." is not accepted). - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + In practice, teams usually precompile into the + binary all types that they - a count of the total number of items available for pagination in - UIs. + expect it to use in the context of Any. However, + for URLs which use the - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + scheme `http`, `https`, or no scheme, one can + optionally set up a type + server that maps type URLs to message + definitions as follows: - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean - tags: - - Query - /desmos/profiles/v3/dtag-transfer-requests: - get: - summary: >- - IncomingDTagTransferRequests queries all the DTag transfers requests - that - have been made towards the user with the given address - operationId: IncomingDTagTransferRequests - responses: - '200': - description: A successful response. - schema: - type: object - properties: - requests: - type: array - items: - type: object - properties: - dtag_to_trade: - type: string - title: >- - DTagToTrade contains the value of the DTag that should - be transferred from + * If no scheme is provided, `https` is assumed. - the receiver of the request to the sender - sender: - type: string - title: >- - Sender represents the address of the account that sent - the request - receiver: - type: string - title: >- - Receiver represents the receiver of the request that, if - accepted, will + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup + results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - give to the sender their DTag - title: >- - DTagTransferRequest represent a DTag transfer request - between two users - title: >- - Requests represent the list of all the DTag transfer requests - made towards + Note: this functionality is not currently + available in the official - the user - pagination: - title: Pagination defines the pagination response - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + protobuf release, and it is not used for type + URLs beginning with - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + type.googleapis.com. - corresponding request message has used PageRequest. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: >- - QueryIncomingDTagTransferRequestsResponse is the response type for - the + Schemes other than `http`, `https` (or the empty + scheme) might be - Query/IncomingDTagTransferRequests RPC method. - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of + the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol + buffer message along with a - protocol buffer message. This string must contain at - least + URL that describes the type of the serialized + message. - one "/" character. The last segment of the URL's path - must represent - the fully qualified name of the type (as in + Protobuf library provides support to pack/unpack Any + values in the form - `path/google.protobuf.Duration`). The name should be in - a canonical form + of utility functions or additional generated methods + of the Any type. - (e.g., leading "." is not accepted). + Example 1: Pack and unpack a message in C++. - In practice, teams usually precompile into the binary - all types that they + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - expect it to use in the context of Any. However, for - URLs which use the + Example 2: Pack and unpack a message in Java. - scheme `http`, `https`, or no scheme, one can optionally - set up a type + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - server that maps type URLs to message definitions as - follows: + Example 3: Pack and unpack a message in Python. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - * If no scheme is provided, `https` is assumed. + Example 4: Pack and unpack a message in Go - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - Note: this functionality is not currently available in - the official + The pack methods provided by protobuf library will + by default use - protobuf release, and it is not used for type URLs - beginning with + 'type.googleapis.com/full.type.name' as the type URL + and the unpack - type.googleapis.com. + methods only use the fully qualified type name after + the last '/' + in the type URL, for example "foo.bar.com/x/y.z" + will yield type - Schemes other than `http`, `https` (or the empty scheme) - might be + name "y.z". - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - URL that describes the type of the serialized message. + JSON - Protobuf library provides support to pack/unpack Any values - in the form + ==== - of utility functions or additional generated methods of the - Any type. + The JSON representation of an `Any` value uses the + regular + representation of the deserialized, embedded + message, with an - Example 1: Pack and unpack a message in C++. + additional field `@type` which contains the type + URL. Example: - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - Example 2: Pack and unpack a message in Java. + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + If the embedded message type is well-known and has a + custom JSON - Example 3: Pack and unpack a message in Python. + representation, that representation will be embedded + adding a field - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + `value` which holds the custom JSON in addition to + the `@type` - Example 4: Pack and unpack a message in Go + field. Example (for message + [google.protobuf.Duration][]): - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + signature: + title: >- + Signature represents the hex-encoded signature of + the PlainText value + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - The pack methods provided by protobuf library will by - default use + protocol buffer message. This string must + contain at least - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + one "/" character. The last segment of the URL's + path must represent - methods only use the fully qualified type name after the - last '/' + the fully qualified name of the type (as in - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + `path/google.protobuf.Duration`). The name + should be in a canonical form - name "y.z". + (e.g., leading "." is not accepted). + In practice, teams usually precompile into the + binary all types that they - JSON + expect it to use in the context of Any. However, + for URLs which use the - ==== + scheme `http`, `https`, or no scheme, one can + optionally set up a type - The JSON representation of an `Any` value uses the regular + server that maps type URLs to message + definitions as follows: - representation of the deserialized, embedded message, with - an - additional field `@type` which contains the type URL. - Example: + * If no scheme is provided, `https` is assumed. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup + results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + Note: this functionality is not currently + available in the official - If the embedded message type is well-known and has a custom - JSON + protobuf release, and it is not used for type + URLs beginning with - representation, that representation will be embedded adding - a field + type.googleapis.com. - `value` which holds the custom JSON in addition to the - `@type` - field. Example (for message [google.protobuf.Duration][]): + Schemes other than `http`, `https` (or the empty + scheme) might be - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: receiver - description: >- - (optional) Receiver represents the address of the user to which - query the + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of + the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol + buffer message along with a - incoming requests for. - in: query - required: false - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + URL that describes the type of the serialized + message. - It is less efficient than using key. Only one of offset or key - should - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. + Protobuf library provides support to pack/unpack Any + values in the form - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + of utility functions or additional generated methods + of the Any type. - a count of the total number of items available for pagination in - UIs. - count_total is only respected when offset is used. It is ignored - when key + Example 1: Pack and unpack a message in C++. - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + Example 2: Pack and unpack a message in Java. - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean - tags: - - Query - /desmos/profiles/v3/params: - get: - summary: Params queries the profiles module params - operationId: ProfilesParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - type: object - properties: - nickname: - type: object - properties: - min_length: - type: string - format: byte - max_length: - type: string - format: byte - title: >- - NicknameParams defines the parameters related to the - profiles nicknames - dtag: - type: object - properties: - reg_ex: - type: string - min_length: - type: string - format: byte - max_length: - type: string - format: byte - title: DTagParams defines the parameters related to profile DTags - bio: - type: object - properties: - max_length: - type: string - format: byte - title: >- - BioParams defines the parameters related to profile - biography - oracle: - type: object - properties: - script_id: - type: string - format: uint64 - title: >- - ScriptID represents the ID of the oracle script to be - called to verify the + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - data - ask_count: - type: string - format: uint64 - title: >- - AskCount represents the number of oracles to which ask - to verify the data - min_count: - type: string - format: uint64 - title: >- - MinCount represents the minimum count of oracles that - should complete the + Example 3: Pack and unpack a message in Python. - verification successfully - prepare_gas: - type: string - format: uint64 - title: >- - PrepareGas represents the amount of gas to be used - during the preparation + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - stage of the oracle script - execute_gas: - type: string - format: uint64 - title: >- - ExecuteGas represents the amount of gas to be used - during the execution of + Example 4: Pack and unpack a message in Go - the oracle script - fee_amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + The pack methods provided by protobuf library will + by default use - NOTE: The amount field is an Int which implements - the custom method + 'type.googleapis.com/full.type.name' as the type URL + and the unpack - signatures required by gogoproto. - title: >- - FeeAmount represents the amount of fees to be payed in - order to execute the + methods only use the fully qualified type name after + the last '/' - oracle script + in the type URL, for example "foo.bar.com/x/y.z" + will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded + message, with an + + additional field `@type` which contains the type + URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to + the `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + plain_text: + type: string + title: >- + PlainText represents the hex-encoded value signed in + order to produce the + + Signature + chain_config: + title: >- + ChainConfig contains the configuration of the external + chain + type: object + properties: + name: + type: string + description: >- + ChainConfig contains the data of the chain with which + the link is made. + creation_time: + type: string + format: date-time + title: >- + CreationTime represents the time in which the link has + been created + title: >- + ChainLink contains the data representing either an inter- or + cross- chain + + link + pagination: + type: object + properties: + next_key: + type: string + format: byte title: |- - 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: - validity_duration: - type: string - title: >- - Default validity duration before an application link - expires + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 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. + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: Pagination defines the pagination response + description: |- + QueryChainLinksResponse is the response type for the + Query/ChainLinks RPC method. default: description: An unexpected error response schema: @@ -2997,198 +2819,156 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - tags: - - Query - '/desmos/profiles/v3/profiles/{user}': - get: - summary: >- - Profile queries the profile of a specific user given their DTag or - address. - - If the queried user does not have a profile, the returned response will - - contain a null profile. - operationId: Profile - responses: - '200': - description: A successful response. - schema: - type: object - properties: - profile: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at least + parameters: + - name: user + description: >- + (optional) User represents the Desmos address of the user to which + search - one "/" character. The last segment of the URL's path must - represent + the link for. + in: query + required: false + type: string + - name: chain_name + description: >- + (optional) ChainName contains the name of the chain to which search + the - the fully qualified name of the type (as in + link for. Used only if user is also set. + in: query + required: false + type: string + - name: target + description: >- + (optional) Target must contain the external address to which query + the link - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: + for. Used only if chain name is also set. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + It is less efficient than using key. Only one of offset or key + should - * If no scheme is provided, `https` is assumed. + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include - Note: this functionality is not currently available in the - official + a count of the total number of items available for pagination in + UIs. - protobuf release, and it is not used for type URLs - beginning with + count_total is only respected when offset is used. It is ignored + when key - type.googleapis.com. + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - Schemes other than `http`, `https` (or the empty scheme) - might be + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean + tags: + - Query + /desmos/profiles/v3/chain-links/owners: + get: + summary: >- + ChainLinkOwners queries for the owners of chain links, optionally + searching - used with implementation specific semantics. - value: + for a specific chain name and external address + operationId: ChainLinkOwners + responses: + '200': + description: A successful response. + schema: + type: object + properties: + owners: + type: array + items: + type: object + properties: + user: + type: string + chain_name: + type: string + target: + type: string + title: >- + ChainLinkOwnerDetails contains the details of a single chain + link owner + title: Addresses of the chain links owners + pagination: + type: object + properties: + next_key: type: string format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding a - field + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - `value` which holds the custom JSON in addition to the `@type` + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the - field. Example (for message [google.protobuf.Duration][]): + corresponding request message has used PageRequest. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: Pagination defines the pagination response description: >- - QueryProfileResponse is the response type for the Query/Profile - RPC method. + QueryChainLinkOwnersResponse contains the data returned by the + request + + allowing to get chain link owners. default: description: An unexpected error response schema: @@ -3379,56 +3159,130 @@ paths: "value": "1.212s" } parameters: - - name: user - description: Address or DTag of the user to query the profile for - in: path - required: true + - name: chain_name + description: >- + (Optional) Chain name to search link owners of. If not specified, + all + + links stored will be searched instead. + in: query + required: false + type: string + - name: target + description: >- + (Optional) External address to search for. This will only be used if + the + + chain name is specified as well. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean tags: - Query - /desmos/relationships/v1/blocks: + /desmos/profiles/v3/dtag-transfer-requests: get: - summary: |- - Blocks queries the blocks for the given user, if provided. - Otherwise, it queries all the stored blocks. - operationId: Blocks + summary: >- + IncomingDTagTransferRequests queries all the DTag transfers requests + that + + have been made towards the user with the given address + operationId: IncomingDTagTransferRequests responses: '200': description: A successful response. schema: type: object properties: - blocks: + requests: type: array items: type: object properties: - blocker: + dtag_to_trade: type: string title: >- - Blocker represents the address of the user blocking - another one - blocked: - type: string - title: Blocked represents the address of the blocked user - reason: + DTagToTrade contains the value of the DTag that should + be transferred from + + the receiver of the request to the sender + sender: type: string - description: >- - Reason represents the optional reason the user has been - blocked for. - subspace_id: + title: >- + Sender represents the address of the account that sent + the request + receiver: type: string - format: uint64 title: >- - SubspaceID represents the ID of the subspace inside - which the user should + Receiver represents the receiver of the request that, if + accepted, will - be blocked - description: >- - UserBlock represents the fact that the Blocker has blocked - the given Blocked + give to the sender their DTag + title: >- + DTagTransferRequest represent a DTag transfer request + between two users + title: >- + Requests represent the list of all the DTag transfer requests + made towards - user. + the user pagination: type: object properties: @@ -3456,9 +3310,12 @@ paths: repeated Bar results = 1; PageResponse page = 2; } - description: |- - QueryBlocksResponse is the response type for the Query/Blocks RPC - method. + title: Pagination defines the pagination response + description: >- + QueryIncomingDTagTransferRequestsResponse is the response type for + the + + Query/IncomingDTagTransferRequests RPC method. default: description: An unexpected error response schema: @@ -3649,23 +3506,12 @@ paths: "value": "1.212s" } parameters: - - name: subspace_id - description: subspace to query the blocks for. - in: query - required: false - type: string - format: uint64 - - name: blocker - description: optional address of the blocker to query the blocks for. - in: query - required: false - type: string - - name: blocked + - name: receiver description: >- - optional address of the blocked user to query the block for (used - only if + (optional) Receiver represents the address of the user to which + query the - the blocker is provided). + incoming requests for. in: query required: false type: string @@ -3729,74 +3575,135 @@ paths: format: boolean tags: - Query - /desmos/relationships/v1/relationships: + /desmos/profiles/v3/params: get: - summary: >- - Relationships queries all relationships present inside a specific - subspace - operationId: Relationships + summary: Params queries the profiles module params + operationId: ProfilesParams responses: '200': description: A successful response. schema: type: object properties: - relationships: - type: array - items: - type: object - properties: - creator: - type: string - title: Creator represents the creator of the relationship - counterparty: - type: string - title: >- - Counterparty represents the other user involved in the - relationship - subspace_id: - type: string - format: uint64 - title: >- - SubspaceID represents the id of the subspace for which - the relationship is - - valid - description: >- - Relationship is the struct of a relationship. - - It represent the concept of "follow" of traditional social - networks. - pagination: + params: type: object properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 + nickname: + type: object + properties: + min_length: + type: string + format: byte + max_length: + type: string + format: byte title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. + NicknameParams defines the parameters related to the + profiles nicknames + dtag: + type: object + properties: + reg_ex: + type: string + min_length: + type: string + format: byte + max_length: + type: string + format: byte + title: DTagParams defines the parameters related to profile DTags + bio: + type: object + properties: + max_length: + type: string + format: byte + title: >- + BioParams defines the parameters related to profile + biography + oracle: + type: object + properties: + script_id: + type: string + format: uint64 + title: >- + ScriptID represents the ID of the oracle script to be + called to verify the - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: |- - QueryRelationshipsResponse is the response type for the - Query/Relationships RPC method. + data + ask_count: + type: string + format: uint64 + title: >- + AskCount represents the number of oracles to which ask + to verify the data + min_count: + type: string + format: uint64 + title: >- + MinCount represents the minimum count of oracles that + should complete the + + verification successfully + prepare_gas: + type: string + format: uint64 + title: >- + PrepareGas represents the amount of gas to be used + during the preparation + + stage of the oracle script + execute_gas: + type: string + format: uint64 + title: >- + ExecuteGas represents the amount of gas to be used + during the execution of + + the oracle script + fee_amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements + the custom method + + signatures required by gogoproto. + title: >- + FeeAmount represents the amount of fees to be payed in + order to execute the + + oracle script + title: |- + 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: + validity_duration: + type: string + 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. default: description: An unexpected error response schema: @@ -3986,293 +3893,198 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - parameters: - - name: subspace_id - description: subspace to query the relationships for. - in: query - required: false - type: string - format: uint64 - - name: user - description: optional address of the user for which to query the relationships. - in: query - required: false - type: string - - name: counterparty - description: >- - optional address of the counterparty of the relationships (used only - if the - - user is provided). - in: query - required: false - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean tags: - Query - /desmos/subspaces/v2/subspaces: + '/desmos/profiles/v3/profiles/{user}': get: - summary: Subspaces queries all the subspaces inside Desmos - operationId: Subspaces + summary: >- + Profile queries the profile of a specific user given their DTag or + address. + + If the queried user does not have a profile, the returned response will + + contain a null profile. + operationId: Profile responses: '200': description: A successful response. schema: type: object properties: - subspaces: - type: array - items: - type: object - properties: - id: - type: string - format: uint64 - title: Unique id that identifies the subspace - name: - type: string - title: Human-readable name of the subspace - description: - type: string - title: Optional description of this subspace - treasury: - type: string - title: >- - Represents the account that is associated with the - subspace and - - should be used to connect external applications to - verify this subspace - owner: - type: string - title: Address of the user that owns the subspace - creator: - type: string - title: Address of the subspace creator - creation_time: - type: string - format: date-time - title: the creation time of the subspace - title: Subspace contains all the data of a Desmos subspace - pagination: + profile: type: object properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + type_url: type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + protocol buffer message. This string must contain at least - corresponding request message has used PageRequest. + one "/" character. The last segment of the URL's path must + represent - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QuerySubspacesResponse is the response type for the - Query/Subspaces RPC + the fully qualified name of the type (as in - method - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + `path/google.protobuf.Duration`). The name should be in a + canonical form - It is less efficient than using key. Only one of offset or key - should + (e.g., leading "." is not accepted). - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + In practice, teams usually precompile into the binary all + types that they - a count of the total number of items available for pagination in - UIs. + expect it to use in the context of Any. However, for URLs + which use the - count_total is only respected when offset is used. It is ignored - when key + scheme `http`, `https`, or no scheme, one can optionally + set up a type - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + server that maps type URLs to message definitions as + follows: - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean - tags: - - Query - '/desmos/subspaces/v2/subspaces/{subspace_id}': - get: - summary: >- - Subspace queries all the information about the subspace with the given - id - operationId: Subspace - responses: - '200': - description: A successful response. - schema: - type: object - properties: - subspace: - type: object - properties: - id: - type: string - format: uint64 - title: Unique id that identifies the subspace - name: - type: string - title: Human-readable name of the subspace - description: - type: string - title: Optional description of this subspace - treasury: - type: string - title: >- - Represents the account that is associated with the - subspace and + * If no scheme is provided, `https` is assumed. - should be used to connect external applications to verify - this subspace - owner: - type: string - title: Address of the user that owns the subspace - creator: - type: string - title: Address of the subspace creator - creation_time: + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: type: string - format: date-time - title: the creation time of the subspace - title: Subspace contains all the data of a Desmos subspace - title: >- - QuerySubspaceResponse is the response type for the Query/Subspace - method + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + QueryProfileResponse is the response type for the Query/Profile + RPC method. default: description: An unexpected error response schema: @@ -4292,65 +4104,227 @@ paths: properties: type_url: type: string - value: - type: string - format: byte - parameters: - - name: subspace_id - description: Id of the subspace to query - in: path - required: true + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: user + description: Address or DTag of the user to query the profile for + in: path + required: true type: string - format: uint64 tags: - Query - '/desmos/subspaces/v2/subspaces/{subspace_id}/groups': + /desmos/relationships/v1/blocks: get: - summary: >- - UserGroups queries all the groups that are present inside the subspace - with - - the given id - operationId: UserGroups + summary: |- + Blocks queries the blocks for the given user, if provided. + Otherwise, it queries all the stored blocks. + operationId: Blocks responses: '200': description: A successful response. schema: type: object properties: - groups: + blocks: type: array items: type: object properties: - subspace_id: + blocker: type: string - format: uint64 - title: ID of the subspace inside which this group exists - section_id: - type: integer - format: int64 title: >- - (optional) Id of the section inside which this group is - valid - id: - type: integer - format: int64 - title: Unique id that identifies the group - name: + Blocker represents the address of the user blocking + another one + blocked: type: string - title: Human-readable name of the user group - description: + title: Blocked represents the address of the blocked user + reason: type: string - title: Optional description of this group - permissions: - type: array - items: - type: string + description: >- + Reason represents the optional reason the user has been + blocked for. + subspace_id: + type: string + format: uint64 title: >- - Permissions that will be granted to all the users part - of this group - title: UserGroup represents a group of users + SubspaceID represents the ID of the subspace inside + which the user should + + be blocked + description: >- + UserBlock represents the fact that the Blocker has blocked + the given Blocked + + user. pagination: type: object properties: @@ -4378,11 +4352,9 @@ paths: repeated Bar results = 1; PageResponse page = 2; } - title: >- - QueryUserGroupsResponse is the response type for the - Query/UserGroups RPC - - method + description: |- + QueryBlocksResponse is the response type for the Query/Blocks RPC + method. default: description: An unexpected error response schema: @@ -4402,22 +4374,197 @@ paths: properties: type_url: type: string - value: - type: string - format: byte - parameters: - - name: subspace_id - description: Id of the subspace to query the groups for - in: path - required: true - type: string - format: uint64 - - name: section_id - description: (optional) Section id to query the groups for. - in: query - required: false - type: integer - format: int64 + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: subspace_id + description: subspace to query the blocks for. + in: query + required: false + type: string + format: uint64 + - name: blocker + description: optional address of the blocker to query the blocks for. + in: query + required: false + type: string + - name: blocked + description: >- + optional address of the blocked user to query the block for (used + only if + + the blocker is provided). + in: query + required: false + type: string - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -4478,105 +4625,44 @@ paths: format: boolean tags: - Query - '/desmos/subspaces/v2/subspaces/{subspace_id}/groups/{group_id}': + /desmos/relationships/v1/relationships: get: - summary: |- - UserGroup queries the user group having the given id inside the specific + summary: >- + Relationships queries all relationships present inside a specific subspace - operationId: UserGroup + operationId: Relationships responses: '200': description: A successful response. schema: type: object properties: - group: - type: object - properties: - subspace_id: - type: string - format: uint64 - title: ID of the subspace inside which this group exists - section_id: - type: integer - format: int64 - title: >- - (optional) Id of the section inside which this group is - valid - id: - type: integer - format: int64 - title: Unique id that identifies the group - name: - type: string - title: Human-readable name of the user group - description: - type: string - title: Optional description of this group - permissions: - type: array - items: - type: string - title: >- - Permissions that will be granted to all the users part of - this group - title: UserGroup represents a group of users - title: >- - QueryUserGroupResponse is the response type for the - Query/UserGroup RPC - - method - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: + relationships: type: array items: type: object properties: - type_url: + creator: type: string - value: + title: Creator represents the creator of the relationship + counterparty: type: string - format: byte - parameters: - - name: subspace_id - description: Id of the subspace that contains the group - in: path - required: true - type: string - format: uint64 - - name: group_id - description: Id of the group to query - in: path - required: true - type: integer - format: int64 - tags: - - Query - '/desmos/subspaces/v2/subspaces/{subspace_id}/groups/{group_id}/members': - get: - summary: UserGroupMembers queries all the members of a given user group - operationId: UserGroupMembers - responses: - '200': - description: A successful response. - schema: - type: object - properties: - members: - type: array - items: - type: string + title: >- + Counterparty represents the other user involved in the + relationship + subspace_id: + type: string + format: uint64 + title: >- + SubspaceID represents the id of the subspace for which + the relationship is + + valid + description: >- + Relationship is the struct of a relationship. + + It represent the concept of "follow" of traditional social + networks. pagination: type: object properties: @@ -4604,9 +4690,9 @@ paths: repeated Bar results = 1; PageResponse page = 2; } - title: |- - QueryUserGroupMembersResponse is the response type for the - Query/UserGroupMembers RPC method + description: |- + QueryRelationshipsResponse is the response type for the + Query/Relationships RPC method. default: description: An unexpected error response schema: @@ -4626,22 +4712,197 @@ paths: properties: type_url: type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. value: type: string format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } parameters: - name: subspace_id - description: Id of the subspace that contains the group - in: path - required: true + description: subspace to query the relationships for. + in: query + required: false type: string format: uint64 - - name: group_id - description: Id of the user group to query the members for - in: path - required: true - type: integer - format: int64 + - name: user + description: optional address of the user for which to query the relationships. + in: query + required: false + type: string + - name: counterparty + description: >- + optional address of the counterparty of the relationships (used only + if the + + user is provided). + in: query + required: false + type: string - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -4702,138 +4963,50 @@ paths: format: boolean tags: - Query - '/desmos/subspaces/v2/subspaces/{subspace_id}/permissions/{user}': + /desmos/subspaces/v2/subspaces: get: - summary: UserPermissions queries the permissions for the given user - operationId: UserPermissions + summary: Subspaces queries all the subspaces inside Desmos + operationId: Subspaces responses: '200': description: A successful response. schema: type: object properties: - permissions: - type: array - items: - type: string - details: + subspaces: type: array items: type: object properties: - subspace_id: + id: type: string format: uint64 - title: Id of the subspace for which this permission is valid - section_id: - type: integer - format: int64 - title: Id of the section for which this permission is valid - user: - title: User represents a user permission - type: object - properties: - user: - type: string - title: User for which the permission was set - permission: - type: array - items: - type: string - title: Permissions set to the user - group: - title: Group represents a group permission - type: object - properties: - group_id: - type: integer - format: int64 - title: Unique id of the group - permission: - type: array - items: - type: string - title: Permissions set to the group - title: PermissionDetail contains the details data of a permission - title: |- - QueryUserPermissionsRequest is the response type for the - Query/UserPermissions method - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: + title: Unique id that identifies the subspace + name: type: string - value: + title: Human-readable name of the subspace + description: type: string - format: byte - parameters: - - name: subspace_id - description: Id of the subspace to query the permissions for - in: path - required: true - type: string - format: uint64 - - name: user - description: Address of the user to query the permissions for - in: path - required: true - type: string - - name: section_id - description: Id of the section to query the permissions for. - in: query - required: false - type: integer - format: int64 - tags: - - Query - '/desmos/subspaces/v2/{subspace_id}/sections': - get: - summary: Sections allows to query for the sections of a specific subspace - operationId: Sections - responses: - '200': - description: A successful response. - schema: - type: object - properties: - sections: - type: array - items: - type: object - properties: - subspace_id: + title: Optional description of this subspace + treasury: type: string - format: uint64 - title: Id of the subspace inside which the section exists - id: - type: integer - format: int64 - title: Unique id of the section within the subspace - parent_id: - type: integer - format: int64 - title: (optional) Id of the parent section - name: + title: >- + Represents the account that is associated with the + subspace and + + should be used to connect external applications to + verify this subspace + owner: type: string - title: Name of the section within the subspace - description: + title: Address of the user that owns the subspace + creator: type: string - title: (optional) Description of the section - title: Section contains the data of a single subspace section + title: Address of the subspace creator + creation_time: + type: string + format: date-time + title: the creation time of the subspace + title: Subspace contains all the data of a Desmos subspace pagination: type: object properties: @@ -4862,7 +5035,9 @@ paths: PageResponse page = 2; } title: >- - QuerySectionsResponse is the response type for Query/Sections RPC + QuerySubspacesResponse is the response type for the + Query/Subspaces RPC + method default: description: An unexpected error response @@ -4887,12 +5062,6 @@ paths: type: string format: byte parameters: - - name: subspace_id - description: Id of the subspace to query the sections for - in: path - required: true - type: string - format: uint64 - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -4953,40 +5122,52 @@ paths: format: boolean tags: - Query - '/desmos/subspaces/v2/{subspace_id}/sections/{section_id}': + '/desmos/subspaces/v2/subspaces/{subspace_id}': get: - summary: Section queries all the information about the section with the given id - operationId: Section + summary: >- + Subspace queries all the information about the subspace with the given + id + operationId: Subspace responses: '200': description: A successful response. schema: type: object properties: - section: + subspace: type: object properties: - subspace_id: + id: type: string format: uint64 - title: Id of the subspace inside which the section exists - id: - type: integer - format: int64 - title: Unique id of the section within the subspace - parent_id: - type: integer - format: int64 - title: (optional) Id of the parent section + title: Unique id that identifies the subspace name: type: string - title: Name of the section within the subspace + title: Human-readable name of the subspace description: type: string - title: (optional) Description of the section - title: Section contains the data of a single subspace section + title: Optional description of this subspace + treasury: + type: string + title: >- + Represents the account that is associated with the + subspace and + + should be used to connect external applications to verify + this subspace + owner: + type: string + title: Address of the user that owns the subspace + creator: + type: string + title: Address of the subspace creator + creation_time: + type: string + format: date-time + title: the creation time of the subspace + title: Subspace contains all the data of a Desmos subspace title: >- - QuerySectionResponse is the response type for Query/Section RPC + QuerySubspaceResponse is the response type for the Query/Subspace method default: description: An unexpected error response @@ -5012,242 +5193,426 @@ paths: format: byte parameters: - name: subspace_id - description: Id of the subspace inside which to search for + description: Id of the subspace to query in: path required: true type: string format: uint64 - - name: section_id - description: Id of the searched section - in: path - required: true - type: integer - format: int64 tags: - Query - /desmos/posts/v1/params: + '/desmos/subspaces/v2/subspaces/{subspace_id}/groups': get: - summary: Params queries the module parameters - operationId: PostsParams + summary: >- + UserGroups queries all the groups that are present inside the subspace + with + + the given id + operationId: UserGroups responses: '200': description: A successful response. schema: type: object properties: - params: - type: object - properties: - max_text_length: - type: integer - format: int64 - title: Maximum length of the post text - title: Params contains the parameters for the posts module - title: >- - QueryParamsResponse is the response type for the Query/Params RPC - method - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: + groups: type: array items: type: object properties: - type_url: + subspace_id: type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with + format: uint64 + title: ID of the subspace inside which this group exists + section_id: + type: integer + format: int64 + title: >- + (optional) Id of the section inside which this group is + valid + id: + type: integer + format: int64 + title: Unique id that identifies the group + name: + type: string + title: Human-readable name of the user group + description: + type: string + title: Optional description of this group + permissions: + type: array + items: + type: string + title: >- + Permissions that will be granted to all the users part + of this group + title: UserGroup represents a group of users + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - type.googleapis.com. + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + corresponding request message has used PageRequest. - Schemes other than `http`, `https` (or the empty scheme) - might be + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: >- + QueryUserGroupsResponse is the response type for the + Query/UserGroups RPC - used with implementation specific semantics. + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string value: type: string format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. + parameters: + - name: subspace_id + description: Id of the subspace to query the groups for + in: path + required: true + type: string + format: uint64 + - name: section_id + description: (optional) Section id to query the groups for. + in: query + required: false + type: integer + format: int64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + It is less efficient than using key. Only one of offset or key + should - Example 1: Pack and unpack a message in C++. + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include - Example 2: Pack and unpack a message in Java. + a count of the total number of items available for pagination in + UIs. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + count_total is only respected when offset is used. It is ignored + when key - Example 3: Pack and unpack a message in Python. + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean + tags: + - Query + '/desmos/subspaces/v2/subspaces/{subspace_id}/groups/{group_id}': + get: + summary: |- + UserGroup queries the user group having the given id inside the specific + subspace + operationId: UserGroup + responses: + '200': + description: A successful response. + schema: + type: object + properties: + group: + type: object + properties: + subspace_id: + type: string + format: uint64 + title: ID of the subspace inside which this group exists + section_id: + type: integer + format: int64 + title: >- + (optional) Id of the section inside which this group is + valid + id: + type: integer + format: int64 + title: Unique id that identifies the group + name: + type: string + title: Human-readable name of the user group + description: + type: string + title: Optional description of this group + permissions: + type: array + items: + type: string + title: >- + Permissions that will be granted to all the users part of + this group + title: UserGroup represents a group of users + title: >- + QueryUserGroupResponse is the response type for the + Query/UserGroup RPC - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: subspace_id + description: Id of the subspace that contains the group + in: path + required: true + type: string + format: uint64 + - name: group_id + description: Id of the group to query + in: path + required: true + type: integer + format: int64 + tags: + - Query + '/desmos/subspaces/v2/subspaces/{subspace_id}/groups/{group_id}/members': + get: + summary: UserGroupMembers queries all the members of a given user group + operationId: UserGroupMembers + responses: + '200': + description: A successful response. + schema: + type: object + properties: + members: + type: array + items: + type: string + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - ==== + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the - The JSON representation of an `Any` value uses the regular + corresponding request message has used PageRequest. - representation of the deserialized, embedded message, with - an + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryUserGroupMembersResponse is the response type for the + Query/UserGroupMembers RPC method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: subspace_id + description: Id of the subspace that contains the group + in: path + required: true + type: string + format: uint64 + - name: group_id + description: Id of the user group to query the members for + in: path + required: true + type: integer + format: int64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - additional field `@type` which contains the type URL. - Example: + It is less efficient than using key. Only one of offset or key + should - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include - If the embedded message type is well-known and has a custom - JSON + a count of the total number of items available for pagination in + UIs. - representation, that representation will be embedded adding - a field + count_total is only respected when offset is used. It is ignored + when key - `value` which holds the custom JSON in addition to the - `@type` + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean tags: - Query - '/desmos/posts/v1/subspaces/{subspace_id}/posts': + '/desmos/subspaces/v2/subspaces/{subspace_id}/permissions/{user}': get: - summary: SubspacePosts queries all the posts inside a given subspace - operationId: SubspacePosts + summary: UserPermissions queries the permissions for the given user + operationId: UserPermissions responses: '200': description: A successful response. schema: type: object properties: - posts: + permissions: + type: array + items: + type: string + details: type: array items: type: object @@ -5255,175 +5620,116 @@ paths: subspace_id: type: string format: uint64 - title: >- - Id of the subspace inside which the post has been - created + title: Id of the subspace for which this permission is valid section_id: type: integer format: int64 - title: Id of the section inside which the post has been created - id: - type: string - format: uint64 - title: Unique id of the post - external_id: - type: string - title: (optional) External id for this post - text: - type: string - title: (optional) Text of the post - entities: - title: (optional) Entities connected to this post + title: Id of the section for which this permission is valid + user: + title: User represents a user permission type: object properties: - hashtags: + user: + type: string + title: User for which the permission was set + permission: type: array items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag ends - tag: - type: string - title: >- - Tag reference (user address, hashtag value, - etc) - title: TextTag represents a tag within the post text - title: Hashtags represent inside the post text - mentions: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag ends - tag: - type: string - title: >- - Tag reference (user address, hashtag value, - etc) - title: TextTag represents a tag within the post text - title: Mentions present inside the post text - urls: + type: string + title: Permissions set to the user + group: + title: Group represents a group permission + type: object + properties: + group_id: + type: integer + format: int64 + title: Unique id of the group + permission: type: array items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the URL starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the URL ends - url: - type: string - title: >- - Value of the URL where the user should be - redirected to - display_url: - type: string - title: (optional) Display value of the URL - title: Url contains the details of a generic URL - title: Links present inside the post text - tags: - type: array - items: - type: string - title: 'Tags related to this post, useful for categorization' - author: + type: string + title: Permissions set to the group + title: PermissionDetail contains the details data of a permission + title: |- + QueryUserPermissionsRequest is the response type for the + Query/UserPermissions method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: type: string - title: Author of the post - conversation_id: + value: type: string - format: uint64 - title: (optional) Id of the original post of the conversation - referenced_posts: - type: array - items: - type: object - properties: - type: - title: Type of reference - type: string - enum: - - POST_REFERENCE_TYPE_UNSPECIFIED - - POST_REFERENCE_TYPE_REPLY - - POST_REFERENCE_TYPE_QUOTE - - POST_REFERENCE_TYPE_REPOST - default: POST_REFERENCE_TYPE_UNSPECIFIED - description: >- - - POST_REFERENCE_TYPE_UNSPECIFIED: No reference - specified - - POST_REFERENCE_TYPE_REPLY: This reference represents a reply to the specified post - - POST_REFERENCE_TYPE_QUOTE: This reference represents a quote of the specified post - - POST_REFERENCE_TYPE_REPOST: This reference represents a repost of the specified post - post_id: - type: string - format: uint64 - title: Id of the referenced post - position: - type: string - format: uint64 - title: >- - Position of the reference inside the post's text. - This should be used only - - with the type set to TYPE_QUOTE - title: PostReference contains the details of a post reference - title: >- - A list this posts references (either as a reply, repost - or quote) - reply_settings: - title: Reply settings of this post + format: byte + parameters: + - name: subspace_id + description: Id of the subspace to query the permissions for + in: path + required: true + type: string + format: uint64 + - name: user + description: Address of the user to query the permissions for + in: path + required: true + type: string + - name: section_id + description: Id of the section to query the permissions for. + in: query + required: false + type: integer + format: int64 + tags: + - Query + '/desmos/subspaces/v2/{subspace_id}/sections': + get: + summary: Sections allows to query for the sections of a specific subspace + operationId: Sections + responses: + '200': + description: A successful response. + schema: + type: object + properties: + sections: + type: array + items: + type: object + properties: + subspace_id: type: string - enum: - - REPLY_SETTING_UNSPECIFIED - - REPLY_SETTING_EVERYONE - - REPLY_SETTING_FOLLOWERS - - REPLY_SETTING_MUTUAL - - REPLY_SETTING_MENTIONS - default: REPLY_SETTING_UNSPECIFIED - description: |- - - REPLY_SETTING_UNSPECIFIED: No reply setting specified - - REPLY_SETTING_EVERYONE: Everyone will be able to reply to this post - - REPLY_SETTING_FOLLOWERS: Only followers of the author will be able to reply to this post - - REPLY_SETTING_MUTUAL: Only the author mutual followers will be able to reply to this post - - REPLY_SETTING_MENTIONS: Only people mentioned inside this post will be able to reply - creation_date: + format: uint64 + title: Id of the subspace inside which the section exists + id: + type: integer + format: int64 + title: Unique id of the section within the subspace + parent_id: + type: integer + format: int64 + title: (optional) Id of the parent section + name: type: string - format: date-time - title: Creation date of the post - last_edited_date: + title: Name of the section within the subspace + description: type: string - format: date-time - title: (optional) Last edited time of the post - title: Post contains all the information about a single post + title: (optional) Description of the section + title: Section contains the data of a single subspace section pagination: type: object properties: @@ -5452,10 +5758,8 @@ paths: PageResponse page = 2; } title: >- - QuerySubspacePostsResponse is the response type for the - Query/SubspacePosts - - RPC method + QuerySectionsResponse is the response type for Query/Sections RPC + method default: description: An unexpected error response schema: @@ -5475,15 +5779,197 @@ paths: properties: type_url: type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least + value: + type: string + format: byte + parameters: + - name: subspace_id + description: Id of the subspace to query the sections for + in: path + required: true + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - one "/" character. The last segment of the URL's path - must represent + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean + tags: + - Query + '/desmos/subspaces/v2/{subspace_id}/sections/{section_id}': + get: + summary: Section queries all the information about the section with the given id + operationId: Section + responses: + '200': + description: A successful response. + schema: + type: object + properties: + section: + type: object + properties: + subspace_id: + type: string + format: uint64 + title: Id of the subspace inside which the section exists + id: + type: integer + format: int64 + title: Unique id of the section within the subspace + parent_id: + type: integer + format: int64 + title: (optional) Id of the parent section + name: + type: string + title: Name of the section within the subspace + description: + type: string + title: (optional) Description of the section + title: Section contains the data of a single subspace section + title: >- + QuerySectionResponse is the response type for Query/Section RPC + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: subspace_id + description: Id of the subspace inside which to search for + in: path + required: true + type: string + format: uint64 + - name: section_id + description: Id of the searched section + in: path + required: true + type: integer + format: int64 + tags: + - Query + /desmos/posts/v1/params: + get: + summary: Params queries the module parameters + operationId: PostsParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + type: object + properties: + max_text_length: + type: integer + format: int64 + title: Maximum length of the post text + title: Params contains the parameters for the posts module + title: >- + QueryParamsResponse is the response type for the Query/Params RPC + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent the fully qualified name of the type (as in @@ -5645,255 +6131,1111 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - parameters: - - name: subspace_id - description: Id of the subspace to query the posts for - in: path - required: true - type: string - format: uint64 - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean tags: - Query - '/desmos/posts/v1/subspaces/{subspace_id}/posts/{post_id}': + '/desmos/posts/v1/subspaces/{subspace_id}/posts': get: - summary: Post queries for a single post inside a given subspace - operationId: Post + summary: SubspacePosts queries all the posts inside a given subspace + operationId: SubspacePosts responses: '200': description: A successful response. schema: type: object properties: - post: - type: object - properties: - subspace_id: - type: string - format: uint64 - title: Id of the subspace inside which the post has been created - section_id: - type: integer - format: int64 - title: Id of the section inside which the post has been created - id: - type: string - format: uint64 - title: Unique id of the post - external_id: - type: string - title: (optional) External id for this post - text: + posts: + type: array + items: + type: object + properties: + subspace_id: + type: string + format: uint64 + title: >- + Id of the subspace inside which the post has been + created + section_id: + type: integer + format: int64 + title: Id of the section inside which the post has been created + id: + type: string + format: uint64 + title: Unique id of the post + external_id: + type: string + title: (optional) External id for this post + text: + type: string + title: (optional) Text of the post + entities: + title: (optional) Entities connected to this post + type: object + properties: + hashtags: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag ends + tag: + type: string + title: >- + Tag reference (user address, hashtag value, + etc) + title: TextTag represents a tag within the post text + title: Hashtags represent inside the post text + mentions: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag ends + tag: + type: string + title: >- + Tag reference (user address, hashtag value, + etc) + title: TextTag represents a tag within the post text + title: Mentions present inside the post text + urls: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the URL starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the URL ends + url: + type: string + title: >- + Value of the URL where the user should be + redirected to + display_url: + type: string + title: (optional) Display value of the URL + title: Url contains the details of a generic URL + title: Links present inside the post text + tags: + type: array + items: + type: string + title: 'Tags related to this post, useful for categorization' + author: + type: string + title: Author of the post + conversation_id: + type: string + format: uint64 + title: (optional) Id of the original post of the conversation + referenced_posts: + type: array + items: + type: object + properties: + type: + title: Type of reference + type: string + enum: + - POST_REFERENCE_TYPE_UNSPECIFIED + - POST_REFERENCE_TYPE_REPLY + - POST_REFERENCE_TYPE_QUOTE + - POST_REFERENCE_TYPE_REPOST + default: POST_REFERENCE_TYPE_UNSPECIFIED + description: >- + - POST_REFERENCE_TYPE_UNSPECIFIED: No reference + specified + - POST_REFERENCE_TYPE_REPLY: This reference represents a reply to the specified post + - POST_REFERENCE_TYPE_QUOTE: This reference represents a quote of the specified post + - POST_REFERENCE_TYPE_REPOST: This reference represents a repost of the specified post + post_id: + type: string + format: uint64 + title: Id of the referenced post + position: + type: string + format: uint64 + title: >- + Position of the reference inside the post's text. + This should be used only + + with the type set to TYPE_QUOTE + title: PostReference contains the details of a post reference + title: >- + A list this posts references (either as a reply, repost + or quote) + reply_settings: + title: Reply settings of this post + type: string + enum: + - REPLY_SETTING_UNSPECIFIED + - REPLY_SETTING_EVERYONE + - REPLY_SETTING_FOLLOWERS + - REPLY_SETTING_MUTUAL + - REPLY_SETTING_MENTIONS + default: REPLY_SETTING_UNSPECIFIED + description: |- + - REPLY_SETTING_UNSPECIFIED: No reply setting specified + - REPLY_SETTING_EVERYONE: Everyone will be able to reply to this post + - REPLY_SETTING_FOLLOWERS: Only followers of the author will be able to reply to this post + - REPLY_SETTING_MUTUAL: Only the author mutual followers will be able to reply to this post + - REPLY_SETTING_MENTIONS: Only people mentioned inside this post will be able to reply + creation_date: + type: string + format: date-time + title: Creation date of the post + last_edited_date: + type: string + format: date-time + title: (optional) Last edited time of the post + title: Post contains all the information about a single post + pagination: + type: object + properties: + next_key: type: string - title: (optional) Text of the post - entities: - title: (optional) Entities connected to this post - type: object - properties: - hashtags: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at which - the tag starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at which - the tag ends - tag: - type: string - title: 'Tag reference (user address, hashtag value, etc)' - title: TextTag represents a tag within the post text - title: Hashtags represent inside the post text - mentions: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at which - the tag starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at which - the tag ends - tag: - type: string - title: 'Tag reference (user address, hashtag value, etc)' - title: TextTag represents a tag within the post text - title: Mentions present inside the post text - urls: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at which - the URL starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at which - the URL ends - url: - type: string - title: >- - Value of the URL where the user should be - redirected to - display_url: - type: string - title: (optional) Display value of the URL - title: Url contains the details of a generic URL + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: >- + QuerySubspacePostsResponse is the response type for the + Query/SubspacePosts + + RPC method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: subspace_id + description: Id of the subspace to query the posts for + in: path + required: true + type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean + tags: + - Query + '/desmos/posts/v1/subspaces/{subspace_id}/posts/{post_id}': + get: + summary: Post queries for a single post inside a given subspace + operationId: Post + responses: + '200': + description: A successful response. + schema: + type: object + properties: + post: + type: object + properties: + subspace_id: + type: string + format: uint64 + title: Id of the subspace inside which the post has been created + section_id: + type: integer + format: int64 + title: Id of the section inside which the post has been created + id: + type: string + format: uint64 + title: Unique id of the post + external_id: + type: string + title: (optional) External id for this post + text: + type: string + title: (optional) Text of the post + entities: + title: (optional) Entities connected to this post + type: object + properties: + hashtags: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at which + the tag starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at which + the tag ends + tag: + type: string + title: 'Tag reference (user address, hashtag value, etc)' + title: TextTag represents a tag within the post text + title: Hashtags represent inside the post text + mentions: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at which + the tag starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at which + the tag ends + tag: + type: string + title: 'Tag reference (user address, hashtag value, etc)' + title: TextTag represents a tag within the post text + title: Mentions present inside the post text + urls: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at which + the URL starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at which + the URL ends + url: + type: string + title: >- + Value of the URL where the user should be + redirected to + display_url: + type: string + title: (optional) Display value of the URL + title: Url contains the details of a generic URL title: Links present inside the post text tags: type: array items: type: string - title: 'Tags related to this post, useful for categorization' - author: - type: string - title: Author of the post - conversation_id: - type: string - format: uint64 - title: (optional) Id of the original post of the conversation - referenced_posts: - type: array - items: + title: 'Tags related to this post, useful for categorization' + author: + type: string + title: Author of the post + conversation_id: + type: string + format: uint64 + title: (optional) Id of the original post of the conversation + referenced_posts: + type: array + items: + type: object + properties: + type: + title: Type of reference + type: string + enum: + - POST_REFERENCE_TYPE_UNSPECIFIED + - POST_REFERENCE_TYPE_REPLY + - POST_REFERENCE_TYPE_QUOTE + - POST_REFERENCE_TYPE_REPOST + default: POST_REFERENCE_TYPE_UNSPECIFIED + description: >- + - POST_REFERENCE_TYPE_UNSPECIFIED: No reference + specified + - POST_REFERENCE_TYPE_REPLY: This reference represents a reply to the specified post + - POST_REFERENCE_TYPE_QUOTE: This reference represents a quote of the specified post + - POST_REFERENCE_TYPE_REPOST: This reference represents a repost of the specified post + post_id: + type: string + format: uint64 + title: Id of the referenced post + position: + type: string + format: uint64 + title: >- + Position of the reference inside the post's text. + This should be used only + + with the type set to TYPE_QUOTE + title: PostReference contains the details of a post reference + title: >- + A list this posts references (either as a reply, repost or + quote) + reply_settings: + title: Reply settings of this post + type: string + enum: + - REPLY_SETTING_UNSPECIFIED + - REPLY_SETTING_EVERYONE + - REPLY_SETTING_FOLLOWERS + - REPLY_SETTING_MUTUAL + - REPLY_SETTING_MENTIONS + default: REPLY_SETTING_UNSPECIFIED + description: |- + - REPLY_SETTING_UNSPECIFIED: No reply setting specified + - REPLY_SETTING_EVERYONE: Everyone will be able to reply to this post + - REPLY_SETTING_FOLLOWERS: Only followers of the author will be able to reply to this post + - REPLY_SETTING_MUTUAL: Only the author mutual followers will be able to reply to this post + - REPLY_SETTING_MENTIONS: Only people mentioned inside this post will be able to reply + creation_date: + type: string + format: date-time + title: Creation date of the post + last_edited_date: + type: string + format: date-time + title: (optional) Last edited time of the post + title: Post contains all the information about a single post + title: >- + QueryPostResponse is the response type for the Query/Post RPC + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: subspace_id + description: Id of the subspace inside which the post lies + in: path + required: true + type: string + format: uint64 + - name: post_id + description: Id of the post to query for + in: path + required: true + type: string + format: uint64 + tags: + - Query + '/desmos/posts/v1/subspaces/{subspace_id}/posts/{post_id}/attachments': + get: + summary: PostAttachments queries the attachments of the post having the given id + operationId: PostAttachments + responses: + '200': + description: A successful response. + schema: + type: object + properties: + attachments: + type: array + items: + type: object + properties: + subspace_id: + type: string + format: uint64 + title: >- + Id of the subspace inside which the post to which this + attachment should be + + connected is + post_id: + type: string + format: uint64 + title: >- + Id of the post to which this attachment should be + connected + id: + type: integer + format: int64 + title: If of this attachment + content: type: object properties: - type: - title: Type of reference + type_url: type: string - enum: - - POST_REFERENCE_TYPE_UNSPECIFIED - - POST_REFERENCE_TYPE_REPLY - - POST_REFERENCE_TYPE_QUOTE - - POST_REFERENCE_TYPE_REPOST - default: POST_REFERENCE_TYPE_UNSPECIFIED description: >- - - POST_REFERENCE_TYPE_UNSPECIFIED: No reference - specified - - POST_REFERENCE_TYPE_REPLY: This reference represents a reply to the specified post - - POST_REFERENCE_TYPE_QUOTE: This reference represents a quote of the specified post - - POST_REFERENCE_TYPE_REPOST: This reference represents a repost of the specified post - post_id: - type: string - format: uint64 - title: Id of the referenced post - position: + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + value: type: string - format: uint64 - title: >- - Position of the reference inside the post's text. - This should be used only + format: byte + description: >- + Must be a valid serialized protocol buffer of the + above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - with the type set to TYPE_QUOTE - title: PostReference contains the details of a post reference - title: >- - A list this posts references (either as a reply, repost or - quote) - reply_settings: - title: Reply settings of this post - type: string - enum: - - REPLY_SETTING_UNSPECIFIED - - REPLY_SETTING_EVERYONE - - REPLY_SETTING_FOLLOWERS - - REPLY_SETTING_MUTUAL - - REPLY_SETTING_MENTIONS - default: REPLY_SETTING_UNSPECIFIED - description: |- - - REPLY_SETTING_UNSPECIFIED: No reply setting specified - - REPLY_SETTING_EVERYONE: Everyone will be able to reply to this post - - REPLY_SETTING_FOLLOWERS: Only followers of the author will be able to reply to this post - - REPLY_SETTING_MUTUAL: Only the author mutual followers will be able to reply to this post - - REPLY_SETTING_MENTIONS: Only people mentioned inside this post will be able to reply - creation_date: + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: Content of the attachment + title: Attachment contains the data of a single post attachment + pagination: + type: object + properties: + next_key: type: string - format: date-time - title: Creation date of the post - last_edited_date: + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: type: string - format: date-time - title: (optional) Last edited time of the post - title: Post contains all the information about a single post - title: >- - QueryPostResponse is the response type for the Query/Post RPC - method + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: |- + QueryPostAttachmentsResponse is the response type for the + Query/PostAttachments RPC method default: description: An unexpected error response schema: @@ -6085,30 +7427,88 @@ paths: } parameters: - name: subspace_id - description: Id of the subspace inside which the post lies + description: Id of the subspace where the post is stored in: path required: true type: string format: uint64 - name: post_id - description: Id of the post to query for + description: Id of the post to query the attachments for in: path required: true type: string format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean tags: - Query - '/desmos/posts/v1/subspaces/{subspace_id}/posts/{post_id}/attachments': + '/desmos/posts/v1/subspaces/{subspace_id}/posts/{post_id}/polls/{poll_id}/answers': get: - summary: PostAttachments queries the attachments of the post having the given id - operationId: PostAttachments + summary: PollAnswers queries the answers for the poll having the given id + operationId: PollAnswers responses: '200': description: A successful response. schema: type: object properties: - attachments: + answers: type: array items: type: object @@ -6117,199 +7517,518 @@ paths: type: string format: uint64 title: >- - Id of the subspace inside which the post to which this - attachment should be - - connected is + Subspace id inside which the post related to this + attachment is located post_id: type: string format: uint64 - title: >- - Id of the post to which this attachment should be - connected - id: + title: Id of the post associated to this attachment + poll_id: type: integer format: int64 - title: If of this attachment - content: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized + title: Id of the poll to which this answer is associated + answers_indexes: + type: array + items: + type: integer + format: int64 + title: Indexes of the answers inside the ProvidedAnswers array + user: + type: string + title: Address of the user answering the poll + title: UserAnswer represents a user answer to a poll + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - protocol buffer message. This string must contain at - least + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the - one "/" character. The last segment of the URL's - path must represent + corresponding request message has used PageRequest. - the fully qualified name of the type (as in + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: >- + QueryPollAnswersResponse is the response type for the + Query/PollAnswers RPC - `path/google.protobuf.Duration`). The name should be - in a canonical form + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - (e.g., leading "." is not accepted). + protocol buffer message. This string must contain at + least + one "/" character. The last segment of the URL's path + must represent - In practice, teams usually precompile into the - binary all types that they + the fully qualified name of the type (as in - expect it to use in the context of Any. However, for - URLs which use the + `path/google.protobuf.Duration`). The name should be in + a canonical form - scheme `http`, `https`, or no scheme, one can - optionally set up a type + (e.g., leading "." is not accepted). - server that maps type URLs to message definitions as - follows: + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - * If no scheme is provided, `https` is assumed. + URL that describes the type of the serialized message. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - Note: this functionality is not currently available - in the official + Protobuf library provides support to pack/unpack Any values + in the form - protobuf release, and it is not used for type URLs - beginning with + of utility functions or additional generated methods of the + Any type. - type.googleapis.com. + Example 1: Pack and unpack a message in C++. - Schemes other than `http`, `https` (or the empty - scheme) might be + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the - above specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + Example 2: Pack and unpack a message in Java. - URL that describes the type of the serialized message. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. - Protobuf library provides support to pack/unpack Any - values in the form + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - of utility functions or additional generated methods of - the Any type. + Example 4: Pack and unpack a message in Go + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - Example 1: Pack and unpack a message in C++. + The pack methods provided by protobuf library will by + default use - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - Example 2: Pack and unpack a message in Java. + methods only use the fully qualified type name after the + last '/' - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - Example 3: Pack and unpack a message in Python. + name "y.z". - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + JSON - The pack methods provided by protobuf library will by - default use + ==== - 'type.googleapis.com/full.type.name' as the type URL and - the unpack + The JSON representation of an `Any` value uses the regular - methods only use the fully qualified type name after the - last '/' + representation of the deserialized, embedded message, with + an - in the type URL, for example "foo.bar.com/x/y.z" will - yield type + additional field `@type` which contains the type URL. + Example: - name "y.z". + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + If the embedded message type is well-known and has a custom + JSON - JSON + representation, that representation will be embedded adding + a field - ==== + `value` which holds the custom JSON in addition to the + `@type` - The JSON representation of an `Any` value uses the - regular + field. Example (for message [google.protobuf.Duration][]): - representation of the deserialized, embedded message, - with an + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: subspace_id + description: Id of the subspace where the post is stored + in: path + required: true + type: string + format: uint64 + - name: post_id + description: Id of the post that holds the poll + in: path + required: true + type: string + format: uint64 + - name: poll_id + description: Id of the poll to query the answers for + in: path + required: true + type: integer + format: int64 + - name: user + description: (Optional) Address of the user to query the responses for. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - additional field `@type` which contains the type URL. - Example: + It is less efficient than using key. Only one of offset or key + should - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include - If the embedded message type is well-known and has a - custom JSON + a count of the total number of items available for pagination in + UIs. - representation, that representation will be embedded - adding a field + count_total is only respected when offset is used. It is ignored + when key - `value` which holds the custom JSON in addition to the - `@type` + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - field. Example (for message - [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: Content of the attachment - title: Attachment contains the data of a single post attachment + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean + tags: + - Query + '/desmos/posts/v1/subspaces/{subspace_id}/sections/{section_id}/posts': + get: + summary: SectionPosts queries all the posts inside a given section + operationId: SectionPosts + responses: + '200': + description: A successful response. + schema: + type: object + properties: + posts: + type: array + items: + type: object + properties: + subspace_id: + type: string + format: uint64 + title: >- + Id of the subspace inside which the post has been + created + section_id: + type: integer + format: int64 + title: Id of the section inside which the post has been created + id: + type: string + format: uint64 + title: Unique id of the post + external_id: + type: string + title: (optional) External id for this post + text: + type: string + title: (optional) Text of the post + entities: + title: (optional) Entities connected to this post + type: object + properties: + hashtags: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag ends + tag: + type: string + title: >- + Tag reference (user address, hashtag value, + etc) + title: TextTag represents a tag within the post text + title: Hashtags represent inside the post text + mentions: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the tag ends + tag: + type: string + title: >- + Tag reference (user address, hashtag value, + etc) + title: TextTag represents a tag within the post text + title: Mentions present inside the post text + urls: + type: array + items: + type: object + properties: + start: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the URL starts + end: + type: string + format: uint64 + title: >- + Index of the character inside the text at + which the URL ends + url: + type: string + title: >- + Value of the URL where the user should be + redirected to + display_url: + type: string + title: (optional) Display value of the URL + title: Url contains the details of a generic URL + title: Links present inside the post text + tags: + type: array + items: + type: string + title: 'Tags related to this post, useful for categorization' + author: + type: string + title: Author of the post + conversation_id: + type: string + format: uint64 + title: (optional) Id of the original post of the conversation + referenced_posts: + type: array + items: + type: object + properties: + type: + title: Type of reference + type: string + enum: + - POST_REFERENCE_TYPE_UNSPECIFIED + - POST_REFERENCE_TYPE_REPLY + - POST_REFERENCE_TYPE_QUOTE + - POST_REFERENCE_TYPE_REPOST + default: POST_REFERENCE_TYPE_UNSPECIFIED + description: >- + - POST_REFERENCE_TYPE_UNSPECIFIED: No reference + specified + - POST_REFERENCE_TYPE_REPLY: This reference represents a reply to the specified post + - POST_REFERENCE_TYPE_QUOTE: This reference represents a quote of the specified post + - POST_REFERENCE_TYPE_REPOST: This reference represents a repost of the specified post + post_id: + type: string + format: uint64 + title: Id of the referenced post + position: + type: string + format: uint64 + title: >- + Position of the reference inside the post's text. + This should be used only + + with the type set to TYPE_QUOTE + title: PostReference contains the details of a post reference + title: >- + A list this posts references (either as a reply, repost + or quote) + reply_settings: + title: Reply settings of this post + type: string + enum: + - REPLY_SETTING_UNSPECIFIED + - REPLY_SETTING_EVERYONE + - REPLY_SETTING_FOLLOWERS + - REPLY_SETTING_MUTUAL + - REPLY_SETTING_MENTIONS + default: REPLY_SETTING_UNSPECIFIED + description: |- + - REPLY_SETTING_UNSPECIFIED: No reply setting specified + - REPLY_SETTING_EVERYONE: Everyone will be able to reply to this post + - REPLY_SETTING_FOLLOWERS: Only followers of the author will be able to reply to this post + - REPLY_SETTING_MUTUAL: Only the author mutual followers will be able to reply to this post + - REPLY_SETTING_MENTIONS: Only people mentioned inside this post will be able to reply + creation_date: + type: string + format: date-time + title: Creation date of the post + last_edited_date: + type: string + format: date-time + title: (optional) Last edited time of the post + title: Post contains all the information about a single post pagination: type: object properties: @@ -6337,9 +8056,11 @@ paths: repeated Bar results = 1; PageResponse page = 2; } - title: |- - QueryPostAttachmentsResponse is the response type for the - Query/PostAttachments RPC method + title: >- + QuerySectionPostsResponse is the response type for the + Query/SectionPosts RPC + + method default: description: An unexpected error response schema: @@ -6531,17 +8252,17 @@ paths: } parameters: - name: subspace_id - description: Id of the subspace where the post is stored + description: Id of the subspace to query the posts for in: path required: true type: string format: uint64 - - name: post_id - description: Id of the post to query the attachments for + - name: section_id + description: Id of the section to query the posts for in: path required: true - type: string - format: uint64 + type: integer + format: int64 - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -6598,81 +8319,66 @@ paths: Since: cosmos-sdk 0.43 in: query required: false - type: boolean - format: boolean - tags: - - Query - '/desmos/posts/v1/subspaces/{subspace_id}/posts/{post_id}/polls/{poll_id}/answers': - get: - summary: PollAnswers queries the answers for the poll having the given id - operationId: PollAnswers - responses: - '200': - description: A successful response. - schema: - type: object - properties: - answers: - type: array - items: - type: object - properties: - subspace_id: - type: string - format: uint64 - title: >- - Subspace id inside which the post related to this - attachment is located - post_id: - type: string - format: uint64 - title: Id of the post associated to this attachment - poll_id: - type: integer - format: int64 - title: Id of the poll to which this answer is associated - answers_indexes: - type: array - items: - type: integer - format: int64 - title: Indexes of the answers inside the ProvidedAnswers array - user: - type: string - title: Address of the user answering the poll - title: UserAnswer represents a user answer to a poll - pagination: + type: boolean + format: boolean + tags: + - Query + '/desmos/reactions/v1/subspaces/{subspace_id}/params': + get: + summary: ReactionsParams allows to query the reaction params of a subspace + operationId: ReactionsParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: type: object properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + subspace_id: type: string format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. + title: Id of the subspace for which these params are valid + registered_reaction: + title: Params related to RegisteredReactionValue reactions + type: object + properties: + enabled: + type: boolean + format: boolean + title: >- + Whether RegisteredReactionValue reactions should be + enabled + free_text: + title: Params related to FreeTextValue reactions + type: object + properties: + enabled: + type: boolean + format: boolean + title: Whether FreeTextValue reactions should be enabled + max_length: + type: integer + format: int64 + title: >- + The max length that FreeTextValue reactions should + have + reg_ex: + type: string + description: >- + RegEx that each FreeTextValue should respect. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QueryPollAnswersResponse is the response type for the - Query/PollAnswers RPC + This is useful to limit what characters can be used as + a reaction. + title: >- + SubspaceReactionsParams contains the params related to a + single subspace - method + reactions + title: |- + QueryReactionsParamsResponse is the response type for the + Query/ReactionsParam RPC method default: description: An unexpected error response schema: @@ -6856,283 +8562,231 @@ paths: `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: subspace_id + description: Id of the subspace for which to query the params + in: path + required: true + type: string + format: uint64 + tags: + - Query + '/desmos/reactions/v1/subspaces/{subspace_id}/posts/{post_id}/reactions': + get: + summary: Reactions allows to query the reactions for a given post + operationId: Reactions + responses: + '200': + description: A successful response. + schema: + type: object + properties: + reactions: + type: array + items: + type: object + properties: + subspace_id: + type: string + format: uint64 + title: >- + Id of the subspace inside which the reaction has been + put + post_id: + type: string + format: uint64 + title: Id of the post to which the reaction is associated + id: + type: integer + format: int64 + title: Id of the reaction within the post + value: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the + above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: subspace_id - description: Id of the subspace where the post is stored - in: path - required: true - type: string - format: uint64 - - name: post_id - description: Id of the post that holds the poll - in: path - required: true - type: string - format: uint64 - - name: poll_id - description: Id of the poll to query the answers for - in: path - required: true - type: integer - format: int64 - - name: user - description: (Optional) Address of the user to query the responses for. - in: query - required: false - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - It is less efficient than using key. Only one of offset or key - should + JSON - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. + ==== - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + The JSON representation of an `Any` value uses the + regular - a count of the total number of items available for pagination in - UIs. + representation of the deserialized, embedded message, + with an - count_total is only respected when offset is used. It is ignored - when key + additional field `@type` which contains the type URL. + Example: - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean - tags: - - Query - '/desmos/posts/v1/subspaces/{subspace_id}/sections/{section_id}/posts': - get: - summary: SectionPosts queries all the posts inside a given section - operationId: SectionPosts - responses: - '200': - description: A successful response. - schema: - type: object - properties: - posts: - type: array - items: - type: object - properties: - subspace_id: - type: string - format: uint64 - title: >- - Id of the subspace inside which the post has been - created - section_id: - type: integer - format: int64 - title: Id of the section inside which the post has been created - id: - type: string - format: uint64 - title: Unique id of the post - external_id: - type: string - title: (optional) External id for this post - text: - type: string - title: (optional) Text of the post - entities: - title: (optional) Entities connected to this post - type: object - properties: - hashtags: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag ends - tag: - type: string - title: >- - Tag reference (user address, hashtag value, - etc) - title: TextTag represents a tag within the post text - title: Hashtags represent inside the post text - mentions: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the tag ends - tag: - type: string - title: >- - Tag reference (user address, hashtag value, - etc) - title: TextTag represents a tag within the post text - title: Mentions present inside the post text - urls: - type: array - items: - type: object - properties: - start: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the URL starts - end: - type: string - format: uint64 - title: >- - Index of the character inside the text at - which the URL ends - url: - type: string - title: >- - Value of the URL where the user should be - redirected to - display_url: - type: string - title: (optional) Display value of the URL - title: Url contains the details of a generic URL - title: Links present inside the post text - tags: - type: array - items: - type: string - title: 'Tags related to this post, useful for categorization' - author: - type: string - title: Author of the post - conversation_id: - type: string - format: uint64 - title: (optional) Id of the original post of the conversation - referenced_posts: - type: array - items: - type: object - properties: - type: - title: Type of reference - type: string - enum: - - POST_REFERENCE_TYPE_UNSPECIFIED - - POST_REFERENCE_TYPE_REPLY - - POST_REFERENCE_TYPE_QUOTE - - POST_REFERENCE_TYPE_REPOST - default: POST_REFERENCE_TYPE_UNSPECIFIED - description: >- - - POST_REFERENCE_TYPE_UNSPECIFIED: No reference - specified - - POST_REFERENCE_TYPE_REPLY: This reference represents a reply to the specified post - - POST_REFERENCE_TYPE_QUOTE: This reference represents a quote of the specified post - - POST_REFERENCE_TYPE_REPOST: This reference represents a repost of the specified post - post_id: - type: string - format: uint64 - title: Id of the referenced post - position: - type: string - format: uint64 - title: >- - Position of the reference inside the post's text. - This should be used only + If the embedded message type is well-known and has a + custom JSON - with the type set to TYPE_QUOTE - title: PostReference contains the details of a post reference - title: >- - A list this posts references (either as a reply, repost - or quote) - reply_settings: - title: Reply settings of this post - type: string - enum: - - REPLY_SETTING_UNSPECIFIED - - REPLY_SETTING_EVERYONE - - REPLY_SETTING_FOLLOWERS - - REPLY_SETTING_MUTUAL - - REPLY_SETTING_MENTIONS - default: REPLY_SETTING_UNSPECIFIED - description: |- - - REPLY_SETTING_UNSPECIFIED: No reply setting specified - - REPLY_SETTING_EVERYONE: Everyone will be able to reply to this post - - REPLY_SETTING_FOLLOWERS: Only followers of the author will be able to reply to this post - - REPLY_SETTING_MUTUAL: Only the author mutual followers will be able to reply to this post - - REPLY_SETTING_MENTIONS: Only people mentioned inside this post will be able to reply - creation_date: - type: string - format: date-time - title: Creation date of the post - last_edited_date: + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + author: type: string - format: date-time - title: (optional) Last edited time of the post - title: Post contains all the information about a single post + title: Author of the reaction + title: Reaction contains the data of a single post reaction pagination: type: object properties: @@ -7161,8 +8815,8 @@ paths: PageResponse page = 2; } title: >- - QuerySectionPostsResponse is the response type for the - Query/SectionPosts RPC + QueryReactionsResponse is the response type for the + Query/Reactions RPC method default: @@ -7356,17 +9010,24 @@ paths: } parameters: - name: subspace_id - description: Id of the subspace to query the posts for + description: Id of the subspace that contains the post to query the reactions for in: path required: true type: string format: uint64 - - name: section_id - description: Id of the section to query the posts for + - name: post_id + description: Post id to query the reactions for in: path required: true - type: integer - format: int64 + type: string + format: uint64 + - name: user + description: |- + (optional) User to query the reactions for. + This is going to be used only if a post id is specified as well. + in: query + required: false + type: string - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -7427,62 +9088,215 @@ paths: format: boolean tags: - Query - '/desmos/reactions/v1/subspaces/{subspace_id}/params': + '/desmos/reactions/v1/subspaces/{subspace_id}/posts/{post_id}/reactions/{reaction_id}': get: - summary: ReactionsParams allows to query the reaction params of a subspace - operationId: ReactionsParams + summary: Reaction allows to query the reaction with the given id + operationId: Reaction responses: '200': description: A successful response. schema: type: object properties: - params: + reaction: type: object properties: subspace_id: type: string format: uint64 - title: Id of the subspace for which these params are valid - registered_reaction: - title: Params related to RegisteredReactionValue reactions - type: object - properties: - enabled: - type: boolean - format: boolean - title: >- - Whether RegisteredReactionValue reactions should be - enabled - free_text: - title: Params related to FreeTextValue reactions + title: Id of the subspace inside which the reaction has been put + post_id: + type: string + format: uint64 + title: Id of the post to which the reaction is associated + id: + type: integer + format: int64 + title: Id of the reaction within the post + value: type: object properties: - enabled: - type: boolean - format: boolean - title: Whether FreeTextValue reactions should be enabled - max_length: - type: integer - format: int64 - title: >- - The max length that FreeTextValue reactions should - have - reg_ex: + type_url: type: string description: >- - RegEx that each FreeTextValue should respect. + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the + above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - This is useful to limit what characters can be used as - a reaction. - title: >- - SubspaceReactionsParams contains the params related to a - single subspace + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - reactions - title: |- - QueryReactionsParamsResponse is the response type for the - Query/ReactionsParam RPC method + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + author: + type: string + title: Author of the reaction + title: Reaction contains the data of a single post reaction + title: >- + QueryReactionResponse is the response type for the Query/Reaction + RPC + + method default: description: An unexpected error response schema: @@ -7640,257 +9454,97 @@ paths: The JSON representation of an `Any` value uses the regular representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: subspace_id - description: Id of the subspace for which to query the params - in: path - required: true - type: string - format: uint64 - tags: - - Query - '/desmos/reactions/v1/subspaces/{subspace_id}/posts/{post_id}/reactions': - get: - summary: Reactions allows to query the reactions for a given post - operationId: Reactions - responses: - '200': - description: A successful response. - schema: - type: object - properties: - reactions: - type: array - items: - type: object - properties: - subspace_id: - type: string - format: uint64 - title: >- - Id of the subspace inside which the reaction has been - put - post_id: - type: string - format: uint64 - title: Id of the post to which the reaction is associated - id: - type: integer - format: int64 - title: Id of the reaction within the post - value: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the - binary all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available - in the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the - above specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an + an - additional field `@type` which contains the type URL. - Example: + additional field `@type` which contains the type URL. + Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a - custom JSON + If the embedded message type is well-known and has a custom + JSON - representation, that representation will be embedded - adding a field + representation, that representation will be embedded adding + a field - `value` which holds the custom JSON in addition to the - `@type` + `value` which holds the custom JSON in addition to the + `@type` - field. Example (for message - [google.protobuf.Duration][]): + field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - author: + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: subspace_id + description: Id of the subspace that contains the post to query the reactions for + in: path + required: true + type: string + format: uint64 + - name: post_id + description: Post id to query the reactions for + in: path + required: true + type: string + format: uint64 + - name: reaction_id + description: Id of the reaction to query + in: path + required: true + type: integer + format: int64 + tags: + - Query + '/desmos/reactions/v1/subspaces/{subspace_id}/registered-reactions': + get: + summary: >- + RegisteredReactions allows to query the registered reaction of a + subspace + operationId: RegisteredReactions + responses: + '200': + description: A successful response. + schema: + type: object + properties: + registered_reactions: + type: array + items: + type: object + properties: + subspace_id: type: string - title: Author of the reaction - title: Reaction contains the data of a single post reaction + format: uint64 + title: >- + Id of the subspace for which this reaction has been + registered + id: + type: integer + format: int64 + title: Id of the registered reaction + shorthand_code: + type: string + title: Unique shorthand code associated to this reaction + display_value: + type: string + title: Value that should be displayed when using this reaction + title: >- + RegisteredReaction contains the details of a registered + reaction within a + + subspace pagination: type: object properties: @@ -7918,11 +9572,9 @@ paths: repeated Bar results = 1; PageResponse page = 2; } - title: >- - QueryReactionsResponse is the response type for the - Query/Reactions RPC - - method + title: |- + QueryRegisteredReactionsResponse is the response type for the + Query/RegisteredReactions RPC method default: description: An unexpected error response schema: @@ -8114,24 +9766,11 @@ paths: } parameters: - name: subspace_id - description: Id of the subspace that contains the post to query the reactions for - in: path - required: true - type: string - format: uint64 - - name: post_id - description: Post id to query the reactions for + description: Id of the subspace to query the registered reactions for in: path required: true type: string format: uint64 - - name: user - description: |- - (optional) User to query the reactions for. - This is going to be used only if a post id is specified as well. - in: query - required: false - type: string - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -8192,214 +9831,290 @@ paths: format: boolean tags: - Query - '/desmos/reactions/v1/subspaces/{subspace_id}/posts/{post_id}/reactions/{reaction_id}': + '/desmos/reactions/v1/subspaces/{subspace_id}/registered-reactions/{reaction_id}': get: - summary: Reaction allows to query the reaction with the given id - operationId: Reaction + summary: RegisteredReaction allows to query the registered reaction of a subspace + operationId: RegisteredReaction responses: '200': description: A successful response. schema: type: object properties: - reaction: + registered_reaction: type: object properties: subspace_id: type: string format: uint64 - title: Id of the subspace inside which the reaction has been put - post_id: - type: string - format: uint64 - title: Id of the post to which the reaction is associated + title: >- + Id of the subspace for which this reaction has been + registered id: type: integer format: int64 - title: Id of the reaction within the post - value: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type - of the serialized + title: Id of the registered reaction + shorthand_code: + type: string + title: Unique shorthand code associated to this reaction + display_value: + type: string + title: Value that should be displayed when using this reaction + title: >- + RegisteredReaction contains the details of a registered + reaction within a - protocol buffer message. This string must contain at - least + subspace + title: |- + QueryRegisteredReactionResponse is the response type for the + Query/RegisteredReaction RPC method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - one "/" character. The last segment of the URL's path - must represent + protocol buffer message. This string must contain at + least - the fully qualified name of the type (as in + one "/" character. The last segment of the URL's path + must represent - `path/google.protobuf.Duration`). The name should be - in a canonical form + the fully qualified name of the type (as in - (e.g., leading "." is not accepted). + `path/google.protobuf.Duration`). The name should be in + a canonical form + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary - all types that they - expect it to use in the context of Any. However, for - URLs which use the + In practice, teams usually precompile into the binary + all types that they - scheme `http`, `https`, or no scheme, one can - optionally set up a type + expect it to use in the context of Any. However, for + URLs which use the - server that maps type URLs to message definitions as - follows: + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in - the official + Note: this functionality is not currently available in + the official - protobuf release, and it is not used for type URLs - beginning with + protobuf release, and it is not used for type URLs + beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty - scheme) might be + Schemes other than `http`, `https` (or the empty scheme) + might be - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the - above specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any - values in the form + Protobuf library provides support to pack/unpack Any values + in the form - of utility functions or additional generated methods of - the Any type. + of utility functions or additional generated methods of the + Any type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { ... - if (any.UnpackTo(&foo)) { - ... - } + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + } - The pack methods provided by protobuf library will by - default use + The pack methods provided by protobuf library will by + default use - 'type.googleapis.com/full.type.name' as the type URL and - the unpack + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - methods only use the fully qualified type name after the - last '/' + methods only use the fully qualified type name after the + last '/' - in the type URL, for example "foo.bar.com/x/y.z" will - yield type + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the regular + The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with - an + representation of the deserialized, embedded message, with + an - additional field `@type` which contains the type URL. - Example: + additional field `@type` which contains the type URL. + Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a - custom JSON + If the embedded message type is well-known and has a custom + JSON - representation, that representation will be embedded - adding a field + representation, that representation will be embedded adding + a field - `value` which holds the custom JSON in addition to the - `@type` + `value` which holds the custom JSON in addition to the + `@type` - field. Example (for message [google.protobuf.Duration][]): + field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - author: - type: string - title: Author of the reaction - title: Reaction contains the data of a single post reaction - title: >- - QueryReactionResponse is the response type for the Query/Reaction - RPC + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: subspace_id + description: Id of the subspace to query the registered reactions for + in: path + required: true + type: string + format: uint64 + - name: reaction_id + description: Id of the registered reaction to query for + in: path + required: true + type: integer + format: int64 + tags: + - Query + /desmos/reports/v1/params: + get: + summary: Params allows to query the module parameters + operationId: ReportsParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + type: object + properties: + standard_reasons: + type: array + items: + type: object + properties: + id: + type: integer + format: int64 + title: Id of the reason inside the subspace + title: + type: string + title: Title of the reason + description: + type: string + title: >- + (optional) Extended description of the reason and + the cases it applies to + title: >- + StandardReason contains the data of a standard reason + that can be picked and + + used from different subspaces + title: >- + List of available reasons from which new subspaces can + pick their default + ones + title: Params contains the module parameters + title: >- + QueryParamsResponse is the response type for Query/Params RPC method default: description: An unexpected error response @@ -8581,49 +10296,28 @@ paths: representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: subspace_id - description: Id of the subspace that contains the post to query the reactions for - in: path - required: true - type: string - format: uint64 - - name: post_id - description: Post id to query the reactions for - in: path - required: true - type: string - format: uint64 - - name: reaction_id - description: Id of the reaction to query - in: path - required: true - type: integer - format: int64 + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } tags: - Query - '/desmos/reactions/v1/subspaces/{subspace_id}/registered-reactions': + '/desmos/reports/v1/subspaces/{subspace_id}/reasons': get: - summary: >- - RegisteredReactions allows to query the registered reaction of a - subspace - operationId: RegisteredReactions + summary: Reasons allows to query the supported reporting reasons for a subspace + operationId: Reasons responses: '200': description: A successful response. schema: type: object properties: - registered_reactions: + reasons: type: array items: type: object @@ -8631,24 +10325,20 @@ paths: subspace_id: type: string format: uint64 - title: >- - Id of the subspace for which this reaction has been - registered + title: Id of the subspace for which this reason is valid id: type: integer format: int64 - title: Id of the registered reaction - shorthand_code: + title: Id of the reason inside the subspace + title: type: string - title: Unique shorthand code associated to this reaction - display_value: + title: Title of the reason + description: type: string - title: Value that should be displayed when using this reaction - title: >- - RegisteredReaction contains the details of a registered - reaction within a - - subspace + title: >- + (optional) Extended description of the reason and the + cases it applies to + title: Reason contains the data about a reporting reason pagination: type: object properties: @@ -8676,9 +10366,9 @@ paths: repeated Bar results = 1; PageResponse page = 2; } - title: |- - QueryRegisteredReactionsResponse is the response type for the - Query/RegisteredReactions RPC method + title: >- + QueryReasonsResponse is the response type for Query/Reasons RPC + method default: description: An unexpected error response schema: @@ -8870,7 +10560,7 @@ paths: } parameters: - name: subspace_id - description: Id of the subspace to query the registered reactions for + description: Id of the subspace to query the supported reporting reasons for in: path required: true type: string @@ -8935,43 +10625,39 @@ paths: format: boolean tags: - Query - '/desmos/reactions/v1/subspaces/{subspace_id}/registered-reactions/{reaction_id}': + '/desmos/reports/v1/subspaces/{subspace_id}/reasons/{reason_id}': get: - summary: RegisteredReaction allows to query the registered reaction of a subspace - operationId: RegisteredReaction + summary: Reason allows to query the reason having the given id + operationId: Reason responses: '200': description: A successful response. schema: type: object properties: - registered_reaction: + reason: type: object properties: subspace_id: type: string format: uint64 - title: >- - Id of the subspace for which this reaction has been - registered + title: Id of the subspace for which this reason is valid id: type: integer format: int64 - title: Id of the registered reaction - shorthand_code: + title: Id of the reason inside the subspace + title: type: string - title: Unique shorthand code associated to this reaction - display_value: + title: Title of the reason + description: type: string - title: Value that should be displayed when using this reaction - title: >- - RegisteredReaction contains the details of a registered - reaction within a - - subspace - title: |- - QueryRegisteredReactionResponse is the response type for the - Query/RegisteredReaction RPC method + title: >- + (optional) Extended description of the reason and the + cases it applies to + title: Reason contains the data about a reporting reason + title: >- + QueryReasonResponse is the response type for Query/Reason RPC + method default: description: An unexpected error response schema: @@ -9163,286 +10849,237 @@ paths: } parameters: - name: subspace_id - description: Id of the subspace to query the registered reactions for + description: Id of the subspace that holds the reason to query for in: path required: true type: string format: uint64 - - name: reaction_id - description: Id of the registered reaction to query for + - name: reason_id + description: Id of the reason to query for in: path required: true type: integer format: int64 tags: - Query - /desmos/reports/v1/params: + '/desmos/reports/v1/subspaces/{subspace_id}/reports': get: - summary: Params allows to query the module parameters - operationId: ReportsParams + summary: Reports allows to query the reports for a specific target + operationId: Reports responses: '200': description: A successful response. schema: type: object properties: - params: - type: object - properties: - standard_reasons: - type: array - items: - type: object - properties: - id: - type: integer - format: int64 - title: Id of the reason inside the subspace - title: - type: string - title: Title of the reason - description: - type: string - title: >- - (optional) Extended description of the reason and - the cases it applies to - title: >- - StandardReason contains the data of a standard reason - that can be picked and - - used from different subspaces - title: >- - List of available reasons from which new subspaces can - pick their default - - ones - title: Params contains the module parameters - title: >- - QueryParamsResponse is the response type for Query/Params RPC - method - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: + reports: type: array items: type: object properties: - type_url: + subspace_id: type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + format: uint64 + title: Id of the subspace for which the report has been created + id: + type: string + format: uint64 + title: Id of the report + reasons_ids: + type: array + items: + type: integer + format: int64 + title: Id of the reason this report has been created for + message: + type: string + title: (optional) Message attached to this report + reporter: + type: string + title: Address of the reporter + target: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - protocol buffer message. This string must contain at - least + protocol buffer message. This string must contain at + least - one "/" character. The last segment of the URL's path - must represent + one "/" character. The last segment of the URL's + path must represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in - a canonical form + `path/google.protobuf.Duration`). The name should be + in a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary - all types that they + In practice, teams usually precompile into the + binary all types that they - expect it to use in the context of Any. However, for - URLs which use the + expect it to use in the context of Any. However, for + URLs which use the - scheme `http`, `https`, or no scheme, one can optionally - set up a type + scheme `http`, `https`, or no scheme, one can + optionally set up a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in - the official + Note: this functionality is not currently available + in the official - protobuf release, and it is not used for type URLs - beginning with + protobuf release, and it is not used for type URLs + beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) - might be + Schemes other than `http`, `https` (or the empty + scheme) might be - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the + above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values - in the form + Protobuf library provides support to pack/unpack Any + values in the form - of utility functions or additional generated methods of the - Any type. + of utility functions or additional generated methods of + the Any type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - The pack methods provided by protobuf library will by - default use + The pack methods provided by protobuf library will by + default use - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + 'type.googleapis.com/full.type.name' as the type URL and + the unpack - methods only use the fully qualified type name after the - last '/' + methods only use the fully qualified type name after the + last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + in the type URL, for example "foo.bar.com/x/y.z" will + yield type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the regular + The JSON representation of an `Any` value uses the + regular - representation of the deserialized, embedded message, with - an + representation of the deserialized, embedded message, + with an - additional field `@type` which contains the type URL. - Example: + additional field `@type` which contains the type URL. + Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a custom - JSON + If the embedded message type is well-known and has a + custom JSON - representation, that representation will be embedded adding - a field + representation, that representation will be embedded + adding a field - `value` which holds the custom JSON in addition to the - `@type` + `value` which holds the custom JSON in addition to the + `@type` - field. Example (for message [google.protobuf.Duration][]): + field. Example (for message + [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Query - '/desmos/reports/v1/subspaces/{subspace_id}/reasons': - get: - summary: Reasons allows to query the supported reporting reasons for a subspace - operationId: Reasons - responses: - '200': - description: A successful response. - schema: - type: object - properties: - reasons: - type: array - items: - type: object - properties: - subspace_id: - type: string - format: uint64 - title: Id of the subspace for which this reason is valid - id: - type: integer - format: int64 - title: Id of the reason inside the subspace - title: - type: string - title: Title of the reason - description: + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: Target of the report + creation_date: type: string - title: >- - (optional) Extended description of the reason and the - cases it applies to - title: Reason contains the data about a reporting reason + format: date-time + title: Time in which the report was created + title: Report contains the data of a generic report pagination: type: object properties: @@ -9471,7 +11108,7 @@ paths: PageResponse page = 2; } title: >- - QueryReasonsResponse is the response type for Query/Reasons RPC + QueryReportsResponse is the response type for Query/Reports RPC method default: description: An unexpected error response @@ -9641,34 +11278,101 @@ paths: string last_name = 2; } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: subspace_id + description: Id of the subspace to query the reports for + in: path + required: true + type: string + format: uint64 + - name: target.type_url + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical + form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that + they + + expect it to use in the context of Any. However, for URLs which use + the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official - If the embedded message type is well-known and has a custom - JSON + protobuf release, and it is not used for type URLs beginning with - representation, that representation will be embedded adding - a field + type.googleapis.com. - `value` which holds the custom JSON in addition to the - `@type` - field. Example (for message [google.protobuf.Duration][]): + Schemes other than `http`, `https` (or the empty scheme) might be - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: subspace_id - description: Id of the subspace to query the supported reporting reasons for - in: path - required: true + used with implementation specific semantics. + in: query + required: false + type: string + - name: target.value + description: >- + Must be a valid serialized protocol buffer of the above specified + type. + in: query + required: false + type: string + format: byte + - name: reporter + description: |- + (optional) User that reported the target. + This is going to be used only if the target is also specified. + in: query + required: false type: string - format: uint64 - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -9729,38 +11433,222 @@ paths: format: boolean tags: - Query - '/desmos/reports/v1/subspaces/{subspace_id}/reasons/{reason_id}': + '/desmos/reports/v1/subspaces/{subspace_id}/reports/{report_id}': get: - summary: Reason allows to query the reason having the given id - operationId: Reason + summary: Report allows to query the report having the given id + operationId: Report responses: '200': description: A successful response. schema: type: object properties: - reason: + report: type: object properties: subspace_id: type: string format: uint64 - title: Id of the subspace for which this reason is valid + title: Id of the subspace for which the report has been created id: - type: integer - format: int64 - title: Id of the reason inside the subspace - title: type: string - title: Title of the reason - description: + format: uint64 + title: Id of the report + reasons_ids: + type: array + items: + type: integer + format: int64 + title: Id of the reason this report has been created for + message: + type: string + title: (optional) Message attached to this report + reporter: + type: string + title: Address of the reporter + target: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the + above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: Target of the report + creation_date: type: string - title: >- - (optional) Extended description of the reason and the - cases it applies to - title: Reason contains the data about a reporting reason + format: date-time + title: Time in which the report was created + title: Report contains the data of a generic report title: >- - QueryReasonResponse is the response type for Query/Reason RPC + QueryReportResponse is the response type for Query/Report RPC method default: description: An unexpected error response @@ -9953,266 +11841,108 @@ paths: } parameters: - name: subspace_id - description: Id of the subspace that holds the reason to query for + description: Id of the subspace that holds the report to query for in: path required: true type: string format: uint64 - - name: reason_id - description: Id of the reason to query for + - name: report_id + description: Id of the report to query for in: path required: true - type: integer - format: int64 + type: string + format: uint64 tags: - Query - '/desmos/reports/v1/subspaces/{subspace_id}/reports': + /desmos/fees/v1/params: get: - summary: Reports allows to query the reports for a specific target - operationId: Reports + summary: Params queries the fees module params + operationId: FeesParams responses: '200': description: A successful response. schema: type: object properties: - reports: - type: array - items: - type: object - properties: - subspace_id: - type: string - format: uint64 - title: Id of the subspace for which the report has been created - id: - type: string - format: uint64 - title: Id of the report - reasons_ids: - type: array - items: - type: integer - format: int64 - title: Id of the reason this report has been created for - message: - type: string - title: (optional) Message attached to this report - reporter: - type: string - title: Address of the reporter - target: + params: + type: object + properties: + min_fees: + type: array + items: type: object properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the - binary all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available - in the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - value: + message_type: type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the - above specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: Target of the report - creation_date: - type: string - format: date-time - title: Time in which the report was created - title: Report contains the data of a generic report - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - corresponding request message has used PageRequest. + NOTE: The amount field is an Int which implements + the custom method - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } + signatures required by gogoproto. + title: >- + MinFee contains the minimum amount of coins that should + be paid as a fee for + + each message of the specific type sent + title: Params contains the parameters for the fees module + title: QueryParamsResponse is the response type for the Query/Params RPC + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query + '/desmos/supply/v1/circulating/{denom}': + get: + summary: >- + Circulating queries the amount of tokens circulating in the market of + the + + given denom + operationId: Circulating + responses: + '200': + description: A successful response. + schema: + type: object + properties: + circulating_supply: + type: string title: >- - QueryReportsResponse is the response type for Query/Reports RPC + QueryCirculatingResponse is the response type for the + Query/Circulating RPC + method default: description: An unexpected error response @@ -10404,1314 +12134,1294 @@ paths: "value": "1.212s" } parameters: - - name: subspace_id - description: Id of the subspace to query the reports for + - name: denom + description: coin denom to query the circulating supply for in: path required: true type: string - format: uint64 - - name: target.type_url - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a canonical - form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all types that - they - - expect it to use in the context of Any. However, for URLs which use - the - - scheme `http`, `https`, or no scheme, one can optionally set up a - type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the official - - protobuf release, and it is not used for type URLs beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) might be - - used with implementation specific semantics. - in: query - required: false - type: string - - name: target.value - description: >- - Must be a valid serialized protocol buffer of the above specified - type. - in: query - required: false - type: string - format: byte - - name: reporter - description: |- - (optional) User that reported the target. - This is going to be used only if the target is also specified. - in: query - required: false - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit + - name: divider_exponent description: >- - limit is the total number of results to be returned in the result - page. + divider_exponent is a factor used to power the divider used to + convert the - If left empty it will default to a value to be set by each app. + supply to the desired representation. in: query required: false type: string format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean tags: - Query - '/desmos/reports/v1/subspaces/{subspace_id}/reports/{report_id}': + '/desmos/supply/v1/total/{denom}': get: - summary: Report allows to query the report having the given id - operationId: Report + summary: Total queries the total supply of the given denom + operationId: Total responses: '200': description: A successful response. schema: type: object properties: - report: - type: object - properties: - subspace_id: - type: string - format: uint64 - title: Id of the subspace for which the report has been created - id: - type: string - format: uint64 - title: Id of the report - reasons_ids: - type: array - items: - type: integer - format: int64 - title: Id of the reason this report has been created for - message: - type: string - title: (optional) Message attached to this report - reporter: - type: string - title: Address of the reporter - target: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type - of the serialized + total_supply: + type: string + title: >- + QueryTotalResponse is the response type for the Query/Total RPC + method + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - protocol buffer message. This string must contain at - least + protocol buffer message. This string must contain at + least - one "/" character. The last segment of the URL's path - must represent + one "/" character. The last segment of the URL's path + must represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be - in a canonical form + `path/google.protobuf.Duration`). The name should be in + a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary - all types that they + In practice, teams usually precompile into the binary + all types that they - expect it to use in the context of Any. However, for - URLs which use the + expect it to use in the context of Any. However, for + URLs which use the - scheme `http`, `https`, or no scheme, one can - optionally set up a type + scheme `http`, `https`, or no scheme, one can optionally + set up a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in - the official + Note: this functionality is not currently available in + the official - protobuf release, and it is not used for type URLs - beginning with + protobuf release, and it is not used for type URLs + beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty - scheme) might be + Schemes other than `http`, `https` (or the empty scheme) + might be - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the - above specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any - values in the form + Protobuf library provides support to pack/unpack Any values + in the form - of utility functions or additional generated methods of - the Any type. + of utility functions or additional generated methods of the + Any type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { ... - if (any.UnpackTo(&foo)) { - ... - } + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + } - The pack methods provided by protobuf library will by - default use + The pack methods provided by protobuf library will by + default use - 'type.googleapis.com/full.type.name' as the type URL and - the unpack + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - methods only use the fully qualified type name after the - last '/' + methods only use the fully qualified type name after the + last '/' - in the type URL, for example "foo.bar.com/x/y.z" will - yield type + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the regular + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: denom + description: coin denom to query the circulating supply for + in: path + required: true + type: string + - name: divider_exponent + description: >- + divider_exponent is a factor used to power the divider used to + convert the + + supply to the desired representation. + in: query + required: false + type: string + format: uint64 + tags: + - Query +definitions: + cosmos.base.query.v1beta1.PageRequest: + type: object + properties: + key: + type: string + format: byte + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + offset: + type: string + format: uint64 + description: |- + offset is a numeric offset that can be used when key is unavailable. + It is less efficient than using key. Only one of offset or key should + be set. + limit: + type: string + format: uint64 + description: >- + limit is the total number of results to be returned in the result + page. - representation of the deserialized, embedded message, with - an + If left empty it will default to a value to be set by each app. + count_total: + type: boolean + format: boolean + description: >- + count_total is set to true to indicate that the result set should + include - additional field `@type` which contains the type URL. - Example: + a count of the total number of items available for pagination in UIs. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + count_total is only respected when offset is used. It is ignored when + key - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + is set. + reverse: + type: boolean + format: boolean + description: >- + reverse is set to true if results are to be returned in the descending + order. - If the embedded message type is well-known and has a - custom JSON - representation, that representation will be embedded - adding a field + Since: cosmos-sdk 0.43 + description: |- + message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } + title: |- + PageRequest is to be embedded in gRPC request messages for efficient + pagination. Ex: + cosmos.base.query.v1beta1.PageResponse: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: |- + total is total number of results available if PageRequest.count_total + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. - `value` which holds the custom JSON in addition to the - `@type` + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + cosmos.base.v1beta1.Coin: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. - field. Example (for message [google.protobuf.Duration][]): + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + desmos.profiles.v3.AppLinksParams: + type: object + properties: + validity_duration: + type: string + 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 + properties: + user: + type: string + title: User to which the link is associated + data: + title: Data contains the details of this specific link + type: object + properties: + application: + type: string + title: 'The application name (eg. Twitter, GitHub, etc)' + username: + type: string + title: 'Username on the application (eg. Twitter tag, GitHub profile, etc)' + state: + title: State of the link + type: string + enum: + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + - APPLICATION_LINK_STATE_VERIFICATION_STARTED + - APPLICATION_LINK_STATE_VERIFICATION_ERROR + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS + - APPLICATION_LINK_STATE_TIMED_OUT + default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + description: >- + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has just been + initialized + - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified + - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully + - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification + oracle_request: + title: OracleRequest represents the request that has been made to the oracle + type: object + properties: + id: + type: string + format: uint64 + title: ID is the ID of the request + oracle_script_id: + type: string + format: uint64 + title: OracleScriptID is ID of an oracle script + call_data: + title: CallData contains the data used to perform the oracle request + type: object + properties: + application: + type: string + title: The application for which the ownership should be verified + call_data: + type: string + title: >- + The hex encoded call data that should be used to verify the + application - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: Target of the report - creation_date: - type: string - format: date-time - title: Time in which the report was created - title: Report contains the data of a generic report + account ownership + client_id: + type: string title: >- - QueryReportResponse is the response type for Query/Report RPC - method - default: - description: An unexpected error response - schema: + ClientID represents the ID of the client that has called the + oracle script + result: + title: |- + Data coming from the result of the verification. + Only available when the state is STATE_SUCCESS + type: object + properties: + success: + title: Success represents a successful verification type: object properties: - error: + value: type: string - code: - type: integer - format: int32 - message: + title: Hex-encoded value that has be signed by the profile + signature: type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the + title: >- + Hex-encoded signature that has been produced by signing the + value + failed: + title: Failed represents a failed verification + type: object + properties: + error: + type: string + title: Error that is associated with the failure + creation_time: + 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 + enum: + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + - APPLICATION_LINK_STATE_VERIFICATION_STARTED + - APPLICATION_LINK_STATE_VERIFICATION_ERROR + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS + - APPLICATION_LINK_STATE_TIMED_OUT + default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + description: >- + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has just been + initialized + - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified + - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully + - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification + title: |- + ApplicationLinkState defines if an application link is in the following + states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT + desmos.profiles.v3.BioParams: + type: object + properties: + max_length: + type: string + format: byte + title: BioParams defines the parameters related to profile biography + 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.v3.ChainLink: + type: object + properties: + user: + type: string + title: User defines the destination profile address to link + address: + title: >- + Address contains the data of the external chain address to be + connected - scheme `http`, `https`, or no scheme, one can optionally - set up a type + with the Desmos profile + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - server that maps type URLs to message definitions as - follows: + protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must + represent - * If no scheme is provided, `https` is assumed. + the fully qualified name of the type (as in - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + `path/google.protobuf.Duration`). The name should be in a + canonical form - Note: this functionality is not currently available in - the official + (e.g., leading "." is not accepted). - protobuf release, and it is not used for type URLs - beginning with - type.googleapis.com. + In practice, teams usually precompile into the binary all types + that they + expect it to use in the context of Any. However, for URLs which + use the - Schemes other than `http`, `https` (or the empty scheme) - might be + scheme `http`, `https`, or no scheme, one can optionally set up a + type - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + server that maps type URLs to message definitions as follows: - URL that describes the type of the serialized message. + * If no scheme is provided, `https` is assumed. - Protobuf library provides support to pack/unpack Any values - in the form + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - of utility functions or additional generated methods of the - Any type. + Note: this functionality is not currently available in the + official + protobuf release, and it is not used for type URLs beginning with - Example 1: Pack and unpack a message in C++. + type.googleapis.com. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - Example 2: Pack and unpack a message in Java. + Schemes other than `http`, `https` (or the empty scheme) might be - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - Example 3: Pack and unpack a message in Python. + URL that describes the type of the serialized message. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Protobuf library provides support to pack/unpack Any values in the + form - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + of utility functions or additional generated methods of the Any type. - The pack methods provided by protobuf library will by - default use - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + Example 1: Pack and unpack a message in C++. - methods only use the fully qualified type name after the - last '/' + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + Example 2: Pack and unpack a message in Java. - name "y.z". + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - JSON + Example 4: Pack and unpack a message in Go - ==== + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - The JSON representation of an `Any` value uses the regular + The pack methods provided by protobuf library will by default use - representation of the deserialized, embedded message, with - an + 'type.googleapis.com/full.type.name' as the type URL and the unpack - additional field `@type` which contains the type URL. - Example: + methods only use the fully qualified type name after the last '/' - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + in the type URL, for example "foo.bar.com/x/y.z" will yield type - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + name "y.z". - If the embedded message type is well-known and has a custom - JSON - representation, that representation will be embedded adding - a field - `value` which holds the custom JSON in addition to the - `@type` + JSON - field. Example (for message [google.protobuf.Duration][]): + ==== - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: subspace_id - description: Id of the subspace that holds the report to query for - in: path - required: true - type: string - format: uint64 - - name: report_id - description: Id of the report to query for - in: path - required: true - type: string - format: uint64 - tags: - - Query - /desmos/fees/v1/params: - get: - summary: Params queries the fees module params - operationId: FeesParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - type: object - properties: - min_fees: - type: array - items: - type: object - properties: - message_type: - type: string - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. + The JSON representation of an `Any` value uses the regular + representation of the deserialized, embedded message, with an - NOTE: The amount field is an Int which implements - the custom method + additional field `@type` which contains the type URL. Example: - signatures required by gogoproto. - title: >- - MinFee contains the minimum amount of coins that should - be paid as a fee for + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - each message of the specific type sent - title: Params contains the parameters for the fees module - title: QueryParamsResponse is the response type for the Query/Params RPC - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - tags: - - Query - '/desmos/supply/v1/circulating/{denom}': - get: - summary: >- - Circulating queries the amount of tokens circulating in the market of - the + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - given denom - operationId: Circulating - responses: - '200': - description: A successful response. - schema: - type: object - properties: - circulating_supply: - type: string + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + proof: + title: Proof contains the ownership proof of the external chain address + type: object + properties: + pub_key: title: >- - QueryCirculatingResponse is the response type for the - Query/Circulating RPC + PubKey represents the public key associated with the address for + which to - method - default: - description: An unexpected error response - schema: + prove the ownership type: object properties: - error: - type: string - code: - type: integer - format: int32 - message: + type_url: type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - the fully qualified name of the type (as in + protocol buffer message. This string must contain at least - `path/google.protobuf.Duration`). The name should be in - a canonical form + one "/" character. The last segment of the URL's path must + represent - (e.g., leading "." is not accepted). + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should be in a + canonical form - In practice, teams usually precompile into the binary - all types that they + (e.g., leading "." is not accepted). - expect it to use in the context of Any. However, for - URLs which use the - scheme `http`, `https`, or no scheme, one can optionally - set up a type + In practice, teams usually precompile into the binary all + types that they - server that maps type URLs to message definitions as - follows: + expect it to use in the context of Any. However, for URLs + which use the + scheme `http`, `https`, or no scheme, one can optionally set + up a type - * If no scheme is provided, `https` is assumed. + server that maps type URLs to message definitions as follows: - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - Note: this functionality is not currently available in - the official + * If no scheme is provided, `https` is assumed. - protobuf release, and it is not used for type URLs - beginning with + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - type.googleapis.com. + Note: this functionality is not currently available in the + official + protobuf release, and it is not used for type URLs beginning + with - Schemes other than `http`, `https` (or the empty scheme) - might be + type.googleapis.com. - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - URL that describes the type of the serialized message. + Schemes other than `http`, `https` (or the empty scheme) might + be + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - Protobuf library provides support to pack/unpack Any values - in the form + URL that describes the type of the serialized message. - of utility functions or additional generated methods of the - Any type. + Protobuf library provides support to pack/unpack Any values in the + form - Example 1: Pack and unpack a message in C++. + of utility functions or additional generated methods of the Any + type. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - Example 2: Pack and unpack a message in Java. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 3: Pack and unpack a message in Python. + Example 2: Pack and unpack a message in Java. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 4: Pack and unpack a message in Go + Example 3: Pack and unpack a message in Python. - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - The pack methods provided by protobuf library will by - default use + Example 4: Pack and unpack a message in Go - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - methods only use the fully qualified type name after the - last '/' + The pack methods provided by protobuf library will by default use - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - name "y.z". + methods only use the fully qualified type name after the last '/' + in the type URL, for example "foo.bar.com/x/y.z" will yield type + name "y.z". - JSON - ==== - The JSON representation of an `Any` value uses the regular + JSON - representation of the deserialized, embedded message, with - an + ==== - additional field `@type` which contains the type URL. - Example: + The JSON representation of an `Any` value uses the regular - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + representation of the deserialized, embedded message, with an - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + additional field `@type` which contains the type URL. Example: - If the embedded message type is well-known and has a custom - JSON + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - representation, that representation will be embedded adding - a field + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - `value` which holds the custom JSON in addition to the - `@type` + If the embedded message type is well-known and has a custom JSON - field. Example (for message [google.protobuf.Duration][]): + representation, that representation will be embedded adding a + field - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: denom - description: coin denom to query the circulating supply for - in: path - required: true - type: string - - name: divider_exponent - description: >- - divider_exponent is a factor used to power the divider used to - convert the + `value` which holds the custom JSON in addition to the `@type` - supply to the desired representation. - in: query - required: false - type: string - format: uint64 - tags: - - Query - '/desmos/supply/v1/total/{denom}': - get: - summary: Total queries the total supply of the given denom - operationId: Total - responses: - '200': - description: A successful response. - schema: - type: object - properties: - total_supply: - type: string + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + signature: title: >- - QueryTotalResponse is the response type for the Query/Total RPC - method - default: - description: An unexpected error response - schema: + Signature represents the hex-encoded signature of the PlainText + value type: object properties: - error: - type: string - code: - type: integer - format: int32 - message: + type_url: type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - protocol buffer message. This string must contain at - least + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path - must represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in - a canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary - all types that they + In practice, teams usually precompile into the binary all + types that they - expect it to use in the context of Any. However, for - URLs which use the + expect it to use in the context of Any. However, for URLs + which use the - scheme `http`, `https`, or no scheme, one can optionally - set up a type + scheme `http`, `https`, or no scheme, one can optionally set + up a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in - the official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs - beginning with + protobuf release, and it is not used for type URLs beginning + with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) - might be + Schemes other than `http`, `https` (or the empty scheme) might + be - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values - in the form + Protobuf library provides support to pack/unpack Any values in the + form - of utility functions or additional generated methods of the - Any type. + of utility functions or additional generated methods of the Any + type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - The pack methods provided by protobuf library will by - default use + The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - methods only use the fully qualified type name after the - last '/' + methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the regular + The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with - an + representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. - Example: + additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a custom - JSON + If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding - a field + representation, that representation will be embedded adding a + field - `value` which holds the custom JSON in addition to the - `@type` + `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: denom - description: coin denom to query the circulating supply for - in: path - required: true - type: string - - name: divider_exponent - description: >- - divider_exponent is a factor used to power the divider used to - convert the + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + plain_text: + type: string + title: >- + PlainText represents the hex-encoded value signed in order to + produce the - supply to the desired representation. - in: query - required: false - type: string - format: uint64 - tags: - - Query -definitions: - cosmos.base.query.v1beta1.PageRequest: + Signature + chain_config: + title: ChainConfig contains the configuration of the external chain + type: object + properties: + name: + type: string + description: >- + ChainConfig contains the data of the chain with which the link is + made. + creation_time: + type: string + format: date-time + title: CreationTime represents the time in which the link has been created + title: |- + ChainLink contains the data representing either an inter- or cross- chain + link + desmos.profiles.v3.DTagParams: type: object properties: - key: + reg_ex: + type: string + min_length: type: string format: byte - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - offset: + max_length: type: string - format: uint64 - description: |- - offset is a numeric offset that can be used when key is unavailable. - It is less efficient than using key. Only one of offset or key should - be set. - limit: + format: byte + title: DTagParams defines the parameters related to profile DTags + desmos.profiles.v3.DTagTransferRequest: + type: object + properties: + dtag_to_trade: type: string - format: uint64 - description: >- - limit is the total number of results to be returned in the result - page. + title: >- + DTagToTrade contains the value of the DTag that should be transferred + from - If left empty it will default to a value to be set by each app. - count_total: - type: boolean - format: boolean - description: >- - count_total is set to true to indicate that the result set should - include + the receiver of the request to the sender + sender: + type: string + title: Sender represents the address of the account that sent the request + receiver: + type: string + title: >- + Receiver represents the receiver of the request that, if accepted, + will - a count of the total number of items available for pagination in UIs. + give to the sender their DTag + title: DTagTransferRequest represent a DTag transfer request between two users + desmos.profiles.v3.Data: + type: object + properties: + application: + type: string + title: 'The application name (eg. Twitter, GitHub, etc)' + username: + type: string + title: 'Username on the application (eg. Twitter tag, GitHub profile, etc)' + title: |- + Data contains the data associated to a specific user of a + generic centralized application + desmos.profiles.v3.NicknameParams: + type: object + properties: + min_length: + type: string + format: byte + max_length: + type: string + format: byte + title: NicknameParams defines the parameters related to the profiles nicknames + desmos.profiles.v3.OracleParams: + type: object + properties: + script_id: + type: string + format: uint64 + title: >- + ScriptID represents the ID of the oracle script to be called to verify + the - count_total is only respected when offset is used. It is ignored when - key + data + ask_count: + type: string + format: uint64 + title: >- + AskCount represents the number of oracles to which ask to verify the + data + min_count: + type: string + format: uint64 + title: >- + MinCount represents the minimum count of oracles that should complete + the - is set. - reverse: - type: boolean - format: boolean - description: >- - reverse is set to true if results are to be returned in the descending - order. + verification successfully + prepare_gas: + type: string + format: uint64 + title: >- + PrepareGas represents the amount of gas to be used during the + preparation + + stage of the oracle script + execute_gas: + type: string + format: uint64 + title: >- + ExecuteGas represents the amount of gas to be used during the + execution of + the oracle script + fee_amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. - Since: cosmos-sdk 0.43 - description: |- - message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: >- + FeeAmount represents the amount of fees to be payed in order to + execute the + + oracle script title: |- - PageRequest is to be embedded in gRPC request messages for efficient - pagination. Ex: - cosmos.base.query.v1beta1.PageResponse: + 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.v3.OracleRequest: type: object properties: - next_key: + id: type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: + format: uint64 + title: ID is the ID of the request + oracle_script_id: type: string format: uint64 - title: |- - total is total number of results available if PageRequest.count_total - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + title: OracleScriptID is ID of an oracle script + call_data: + title: CallData contains the data used to perform the oracle request + type: object + properties: + application: + type: string + title: The application for which the ownership should be verified + call_data: + type: string + title: >- + The hex encoded call data that should be used to verify the + application - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - cosmos.base.v1beta1.Coin: + account ownership + client_id: + type: string + title: >- + ClientID represents the ID of the client that has called the oracle + script + title: |- + OracleRequest represents a generic oracle request used to + verify the ownership of a centralized application account + desmos.profiles.v3.OracleRequest.CallData: type: object properties: - denom: + application: type: string - amount: + title: The application for which the ownership should be verified + call_data: type: string - description: |- - Coin defines a token with a denomination and an amount. + title: >- + The hex encoded call data that should be used to verify the + application - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - desmos.profiles.v3.AppLinksParams: - type: object - properties: - validity_duration: - type: string - title: Default validity duration before an application link expires - title: AppLinksParams define the parameters related to the app links - desmos.profiles.v3.ApplicationLink: + account ownership + 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.v3.Params: type: object properties: - user: - type: string - title: User to which the link is associated - data: - title: Data contains the details of this specific link + nickname: type: object properties: - application: + min_length: type: string - title: 'The application name (eg. Twitter, GitHub, etc)' - username: + format: byte + max_length: type: string - title: 'Username on the application (eg. Twitter tag, GitHub profile, etc)' - state: - title: State of the link - type: string - enum: - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - - APPLICATION_LINK_STATE_VERIFICATION_STARTED - - APPLICATION_LINK_STATE_VERIFICATION_ERROR - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS - - APPLICATION_LINK_STATE_TIMED_OUT - default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - description: >- - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has just been - initialized - - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified - - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully - - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification - oracle_request: - title: OracleRequest represents the request that has been made to the oracle + format: byte + title: >- + NicknameParams defines the parameters related to the profiles + nicknames + dtag: type: object properties: - id: + reg_ex: type: string - format: uint64 - title: ID is the ID of the request - oracle_script_id: + min_length: + type: string + format: byte + max_length: + type: string + format: byte + title: DTagParams defines the parameters related to profile DTags + bio: + type: object + properties: + max_length: + type: string + format: byte + title: BioParams defines the parameters related to profile biography + oracle: + type: object + properties: + script_id: type: string format: uint64 - title: OracleScriptID is ID of an oracle script - call_data: - title: CallData contains the data used to perform the oracle request - type: object - properties: - application: - type: string - title: The application for which the ownership should be verified - call_data: - type: string - title: >- - The hex encoded call data that should be used to verify the - application + title: >- + ScriptID represents the ID of the oracle script to be called to + verify the - account ownership - client_id: + data + ask_count: type: string + format: uint64 title: >- - ClientID represents the ID of the client that has called the - oracle script - result: - title: |- - Data coming from the result of the verification. - Only available when the state is STATE_SUCCESS - type: object - properties: - success: - title: Success represents a successful verification - type: object - properties: - value: - type: string - title: Hex-encoded value that has be signed by the profile - signature: - type: string - title: >- - Hex-encoded signature that has been produced by signing the - value - failed: - title: Failed represents a failed verification - type: object - properties: - error: - type: string - title: Error that is associated with the failure - creation_time: - 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 - enum: - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - - APPLICATION_LINK_STATE_VERIFICATION_STARTED - - APPLICATION_LINK_STATE_VERIFICATION_ERROR - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS - - APPLICATION_LINK_STATE_TIMED_OUT - default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - description: >- - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has just been - initialized - - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified - - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully - - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification - title: |- - ApplicationLinkState defines if an application link is in the following - states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT - desmos.profiles.v3.BioParams: - type: object - properties: - max_length: - type: string - format: byte - title: BioParams defines the parameters related to profile biography - 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.v3.ChainLink: + AskCount represents the number of oracles to which ask to verify + the data + min_count: + type: string + format: uint64 + title: >- + MinCount represents the minimum count of oracles that should + complete the + + verification successfully + prepare_gas: + type: string + format: uint64 + title: >- + PrepareGas represents the amount of gas to be used during the + preparation + + stage of the oracle script + execute_gas: + type: string + format: uint64 + title: >- + ExecuteGas represents the amount of gas to be used during the + execution of + + the oracle script + fee_amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: >- + FeeAmount represents the amount of fees to be payed in order to + execute the + + oracle script + title: |- + 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: + validity_duration: + type: string + 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: type: object properties: - user: - type: string - title: User defines the destination profile address to link - address: + pub_key: + title: >- + PubKey represents the public key associated with the address for which + to + + prove the ownership type: object properties: type_url: @@ -11737,1458 +13447,1256 @@ definitions: that they expect it to use in the context of Any. However, for URLs which - use the - - scheme `http`, `https`, or no scheme, one can optionally set up a - type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) might be - - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above specified - type. - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - Address contains the data of the external chain address to be - connected - - with the Desmos profile - proof: - title: Proof contains the ownership proof of the external chain address - type: object - properties: - pub_key: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally set - up a type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official + use the - protobuf release, and it is not used for type URLs beginning - with + scheme `http`, `https`, or no scheme, one can optionally set up a + type - type.googleapis.com. + server that maps type URLs to message definitions as follows: - Schemes other than `http`, `https` (or the empty scheme) might - be + * If no scheme is provided, `https` is assumed. - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - URL that describes the type of the serialized message. + Note: this functionality is not currently available in the + official + protobuf release, and it is not used for type URLs beginning with - Protobuf library provides support to pack/unpack Any values in the - form + type.googleapis.com. - of utility functions or additional generated methods of the Any - type. + Schemes other than `http`, `https` (or the empty scheme) might be - Example 1: Pack and unpack a message in C++. + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above specified + type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + URL that describes the type of the serialized message. - Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Protobuf library provides support to pack/unpack Any values in the + form - Example 3: Pack and unpack a message in Python. + of utility functions or additional generated methods of the Any type. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Example 1: Pack and unpack a message in C++. - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - The pack methods provided by protobuf library will by default use + Example 2: Pack and unpack a message in Java. - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - methods only use the fully qualified type name after the last '/' + Example 3: Pack and unpack a message in Python. - in the type URL, for example "foo.bar.com/x/y.z" will yield type + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - name "y.z". + Example 4: Pack and unpack a message in Go + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + The pack methods provided by protobuf library will by default use - JSON + 'type.googleapis.com/full.type.name' as the type URL and the unpack - ==== + methods only use the fully qualified type name after the last '/' - The JSON representation of an `Any` value uses the regular + in the type URL, for example "foo.bar.com/x/y.z" will yield type - representation of the deserialized, embedded message, with an + name "y.z". - additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + JSON - If the embedded message type is well-known and has a custom JSON + ==== - representation, that representation will be embedded adding a - field + The JSON representation of an `Any` value uses the regular - `value` which holds the custom JSON in addition to the `@type` + representation of the deserialized, embedded message, with an - field. Example (for message [google.protobuf.Duration][]): + additional field `@type` which contains the type URL. Example: - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - PubKey represents the public key associated with the address for - which to + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - prove the ownership - signature: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - protocol buffer message. This string must contain at least + If the embedded message type is well-known and has a custom JSON - one "/" character. The last segment of the URL's path must - represent + representation, that representation will be embedded adding a field - the fully qualified name of the type (as in + `value` which holds the custom JSON in addition to the `@type` - `path/google.protobuf.Duration`). The name should be in a - canonical form + field. Example (for message [google.protobuf.Duration][]): - (e.g., leading "." is not accepted). + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + signature: + title: Signature represents the hex-encoded signature of the PlainText value + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + protocol buffer message. This string must contain at least - In practice, teams usually precompile into the binary all - types that they + one "/" character. The last segment of the URL's path must + represent - expect it to use in the context of Any. However, for URLs - which use the + the fully qualified name of the type (as in - scheme `http`, `https`, or no scheme, one can optionally set - up a type + `path/google.protobuf.Duration`). The name should be in a + canonical form - server that maps type URLs to message definitions as follows: + (e.g., leading "." is not accepted). - * If no scheme is provided, `https` is assumed. + In practice, teams usually precompile into the binary all types + that they - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + expect it to use in the context of Any. However, for URLs which + use the - Note: this functionality is not currently available in the - official + scheme `http`, `https`, or no scheme, one can optionally set up a + type - protobuf release, and it is not used for type URLs beginning - with + server that maps type URLs to message definitions as follows: - type.googleapis.com. + * If no scheme is provided, `https` is assumed. - Schemes other than `http`, `https` (or the empty scheme) might - be + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + Note: this functionality is not currently available in the + official - URL that describes the type of the serialized message. + protobuf release, and it is not used for type URLs beginning with + type.googleapis.com. - Protobuf library provides support to pack/unpack Any values in the - form - of utility functions or additional generated methods of the Any + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + URL that describes the type of the serialized message. - Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Protobuf library provides support to pack/unpack Any values in the + form - Example 2: Pack and unpack a message in Java. + of utility functions or additional generated methods of the Any type. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - Example 3: Pack and unpack a message in Python. + Example 1: Pack and unpack a message in C++. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 4: Pack and unpack a message in Go + Example 2: Pack and unpack a message in Java. - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - The pack methods provided by protobuf library will by default use + Example 3: Pack and unpack a message in Python. - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - methods only use the fully qualified type name after the last '/' + Example 4: Pack and unpack a message in Go - in the type URL, for example "foo.bar.com/x/y.z" will yield type + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - name "y.z". + The pack methods provided by protobuf library will by default use + 'type.googleapis.com/full.type.name' as the type URL and the unpack + methods only use the fully qualified type name after the last '/' - JSON + in the type URL, for example "foo.bar.com/x/y.z" will yield type - ==== + name "y.z". - The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + JSON - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + ==== - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + The JSON representation of an `Any` value uses the regular - If the embedded message type is well-known and has a custom JSON + representation of the deserialized, embedded message, with an - representation, that representation will be embedded adding a - field + additional field `@type` which contains the type URL. Example: - `value` which holds the custom JSON in addition to the `@type` + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - field. Example (for message [google.protobuf.Duration][]): + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + plain_text: + type: string + title: >- + PlainText represents the hex-encoded value signed in order to produce + the + + Signature + title: |- + Proof contains all the data used to verify a signature when linking an + account to a profile + desmos.profiles.v3.QueryApplicationLinkByClientIDResponse: + type: object + properties: + link: + type: object + properties: + user: + type: string + title: User to which the link is associated + data: + title: Data contains the details of this specific link + type: object + properties: + application: + type: string + title: 'The application name (eg. Twitter, GitHub, etc)' + username: + type: string + title: >- + Username on the application (eg. Twitter tag, GitHub profile, + etc) + state: + title: State of the link + type: string + enum: + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + - APPLICATION_LINK_STATE_VERIFICATION_STARTED + - APPLICATION_LINK_STATE_VERIFICATION_ERROR + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS + - APPLICATION_LINK_STATE_TIMED_OUT + default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + description: >- + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has just + been initialized + - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified + - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully + - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification + oracle_request: title: >- - Signature represents the hex-encoded signature of the PlainText - value - plain_text: + OracleRequest represents the request that has been made to the + oracle + type: object + properties: + id: + type: string + format: uint64 + title: ID is the ID of the request + oracle_script_id: + type: string + format: uint64 + title: OracleScriptID is ID of an oracle script + call_data: + title: CallData contains the data used to perform the oracle request + type: object + properties: + application: + type: string + title: The application for which the ownership should be verified + call_data: + type: string + title: >- + The hex encoded call data that should be used to verify + the application + + account ownership + client_id: + type: string + title: >- + ClientID represents the ID of the client that has called the + oracle script + result: + title: |- + Data coming from the result of the verification. + Only available when the state is STATE_SUCCESS + type: object + properties: + success: + title: Success represents a successful verification + type: object + properties: + value: + type: string + title: Hex-encoded value that has be signed by the profile + signature: + type: string + title: >- + Hex-encoded signature that has been produced by signing + the value + failed: + title: Failed represents a failed verification + type: object + properties: + error: + type: string + title: Error that is associated with the failure + creation_time: + type: string + format: date-time + title: CreationTime represents the time in which the link was created + expiration_time: type: string - title: >- - PlainText represents the hex-encoded value signed in order to - produce the + 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.v3.QueryApplicationLinkOwnersResponse: + type: object + properties: + owners: + type: array + items: + type: object + properties: + user: + type: string + application: + type: string + username: + type: string + title: >- + ApplicationLinkOwnerDetails contains the details of a single + application - Signature - chain_config: - title: ChainConfig contains the configuration of the external chain + link owner + title: Addresses of the application links owners + pagination: type: object properties: - name: + next_key: type: string - description: >- - ChainConfig contains the data of the chain with which the link is - made. - creation_time: - type: string - format: date-time - title: CreationTime represents the time in which the link has been created - title: |- - ChainLink contains the data representing either an inter- or cross- chain - link - desmos.profiles.v3.DTagParams: - type: object - properties: - reg_ex: - type: string - min_length: - type: string - format: byte - max_length: - type: string - format: byte - title: DTagParams defines the parameters related to profile DTags - desmos.profiles.v3.DTagTransferRequest: - type: object - properties: - dtag_to_trade: - type: string - title: >- - DTagToTrade contains the value of the DTag that should be transferred - from + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - the receiver of the request to the sender - sender: - type: string - title: Sender represents the address of the account that sent the request - receiver: - type: string - title: >- - Receiver represents the receiver of the request that, if accepted, - will + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. - give to the sender their DTag - title: DTagTransferRequest represent a DTag transfer request between two users - desmos.profiles.v3.Data: + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: Pagination defines the pagination response + description: >- + QueryApplicationLinkOwnersResponse contains the data returned by the + request + + allowing to get application link owners. + desmos.profiles.v3.QueryApplicationLinkOwnersResponse.ApplicationLinkOwnerDetails: type: object properties: + user: + type: string application: type: string - title: 'The application name (eg. Twitter, GitHub, etc)' username: type: string - title: 'Username on the application (eg. Twitter tag, GitHub profile, etc)' title: |- - Data contains the data associated to a specific user of a - generic centralized application - desmos.profiles.v3.NicknameParams: - type: object - properties: - min_length: - type: string - format: byte - max_length: - type: string - format: byte - title: NicknameParams defines the parameters related to the profiles nicknames - desmos.profiles.v3.OracleParams: + ApplicationLinkOwnerDetails contains the details of a single application + link owner + desmos.profiles.v3.QueryApplicationLinksResponse: type: object properties: - script_id: - type: string - format: uint64 - title: >- - ScriptID represents the ID of the oracle script to be called to verify - the - - data - ask_count: - type: string - format: uint64 - title: >- - AskCount represents the number of oracles to which ask to verify the - data - min_count: - type: string - format: uint64 - title: >- - MinCount represents the minimum count of oracles that should complete - the + links: + type: array + items: + type: object + properties: + user: + type: string + title: User to which the link is associated + data: + title: Data contains the details of this specific link + type: object + properties: + application: + type: string + title: 'The application name (eg. Twitter, GitHub, etc)' + username: + type: string + title: >- + Username on the application (eg. Twitter tag, GitHub + profile, etc) + state: + title: State of the link + type: string + enum: + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + - APPLICATION_LINK_STATE_VERIFICATION_STARTED + - APPLICATION_LINK_STATE_VERIFICATION_ERROR + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS + - APPLICATION_LINK_STATE_TIMED_OUT + default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + description: >- + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has + just been initialized + - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified + - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully + - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification + oracle_request: + title: >- + OracleRequest represents the request that has been made to the + oracle + type: object + properties: + id: + type: string + format: uint64 + title: ID is the ID of the request + oracle_script_id: + type: string + format: uint64 + title: OracleScriptID is ID of an oracle script + call_data: + title: >- + CallData contains the data used to perform the oracle + request + type: object + properties: + application: + type: string + title: >- + The application for which the ownership should be + verified + call_data: + type: string + title: >- + The hex encoded call data that should be used to verify + the application - verification successfully - prepare_gas: - type: string - format: uint64 - title: >- - PrepareGas represents the amount of gas to be used during the - preparation + account ownership + client_id: + type: string + title: >- + ClientID represents the ID of the client that has called the + oracle script + result: + title: |- + Data coming from the result of the verification. + Only available when the state is STATE_SUCCESS + type: object + properties: + success: + title: Success represents a successful verification + type: object + properties: + value: + type: string + title: Hex-encoded value that has be signed by the profile + signature: + type: string + title: >- + Hex-encoded signature that has been produced by signing + the value + failed: + title: Failed represents a failed verification + type: object + properties: + error: + type: string + title: Error that is associated with the failure + creation_time: + 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 + pagination: + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - stage of the oracle script - execute_gas: - type: string - format: uint64 - title: >- - ExecuteGas represents the amount of gas to be used during the - execution of + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. - the oracle script - fee_amount: + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: Pagination defines the pagination response + title: |- + QueryApplicationLinksResponse represents the response to the query used + to get the application links for a specific user + desmos.profiles.v3.QueryChainLinkOwnersResponse: + type: object + properties: + owners: type: array items: type: object properties: - denom: + user: type: string - amount: + chain_name: type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - title: >- - FeeAmount represents the amount of fees to be payed in order to - execute the - - oracle script - title: |- - 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.v3.OracleRequest: - type: object - properties: - id: - type: string - format: uint64 - title: ID is the ID of the request - oracle_script_id: - type: string - format: uint64 - title: OracleScriptID is ID of an oracle script - call_data: - title: CallData contains the data used to perform the oracle request + target: + type: string + title: >- + ChainLinkOwnerDetails contains the details of a single chain link + owner + title: Addresses of the chain links owners + pagination: type: object properties: - application: + next_key: type: string - title: The application for which the ownership should be verified - call_data: + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: type: string + format: uint64 title: >- - The hex encoded call data that should be used to verify the - application + total is total number of results available if + PageRequest.count_total - account ownership - client_id: - type: string - title: >- - ClientID represents the ID of the client that has called the oracle - script - title: |- - OracleRequest represents a generic oracle request used to - verify the ownership of a centralized application account - desmos.profiles.v3.OracleRequest.CallData: + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: Pagination defines the pagination response + description: |- + QueryChainLinkOwnersResponse contains the data returned by the request + allowing to get chain link owners. + desmos.profiles.v3.QueryChainLinkOwnersResponse.ChainLinkOwnerDetails: type: object properties: - application: + user: type: string - title: The application for which the ownership should be verified - call_data: + chain_name: type: string - title: >- - The hex encoded call data that should be used to verify the - application - - account ownership - 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.v3.Params: + target: + type: string + title: ChainLinkOwnerDetails contains the details of a single chain link owner + desmos.profiles.v3.QueryChainLinksResponse: type: object properties: - nickname: - type: object - properties: - min_length: - type: string - format: byte - max_length: - type: string - format: byte - title: >- - NicknameParams defines the parameters related to the profiles - nicknames - dtag: - type: object - properties: - reg_ex: - type: string - min_length: - type: string - format: byte - max_length: - type: string - format: byte - title: DTagParams defines the parameters related to profile DTags - bio: - type: object - properties: - max_length: - type: string - format: byte - title: BioParams defines the parameters related to profile biography - oracle: - type: object - properties: - script_id: - type: string - format: uint64 - title: >- - ScriptID represents the ID of the oracle script to be called to - verify the + links: + type: array + items: + type: object + properties: + user: + type: string + title: User defines the destination profile address to link + address: + title: >- + Address contains the data of the external chain address to be + connected - data - ask_count: - type: string - format: uint64 - title: >- - AskCount represents the number of oracles to which ask to verify - the data - min_count: - type: string - format: uint64 - title: >- - MinCount represents the minimum count of oracles that should - complete the + with the Desmos profile + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with - verification successfully - prepare_gas: - type: string - format: uint64 - title: >- - PrepareGas represents the amount of gas to be used during the - preparation + type.googleapis.com. - stage of the oracle script - execute_gas: - type: string - format: uint64 - title: >- - ExecuteGas represents the amount of gas to be used during the - execution of - the oracle script - fee_amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. description: >- - Coin defines a token with a denomination and an amount. + `Any` contains an arbitrary serialized protocol buffer message + along with a + URL that describes the type of the serialized message. - NOTE: The amount field is an Int which implements the custom - method - signatures required by gogoproto. - title: >- - FeeAmount represents the amount of fees to be payed in order to - execute the + Protobuf library provides support to pack/unpack Any values in + the form - oracle script - title: |- - 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: - validity_duration: - type: string - 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: - type: object - properties: - pub_key: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + of utility functions or additional generated methods of the Any + type. - protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + Example 1: Pack and unpack a message in C++. - the fully qualified name of the type (as in + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - `path/google.protobuf.Duration`). The name should be in a - canonical form + Example 2: Pack and unpack a message in Java. - (e.g., leading "." is not accepted). + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. - In practice, teams usually precompile into the binary all types - that they + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - expect it to use in the context of Any. However, for URLs which - use the + Example 4: Pack and unpack a message in Go - scheme `http`, `https`, or no scheme, one can optionally set up a - type + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - server that maps type URLs to message definitions as follows: + The pack methods provided by protobuf library will by default + use + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - * If no scheme is provided, `https` is assumed. + methods only use the fully qualified type name after the last + '/' - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + in the type URL, for example "foo.bar.com/x/y.z" will yield type - Note: this functionality is not currently available in the - official + name "y.z". - protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + JSON - Schemes other than `http`, `https` (or the empty scheme) might be + ==== - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above specified - type. - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + The JSON representation of an `Any` value uses the regular - URL that describes the type of the serialized message. + representation of the deserialized, embedded message, with an + additional field `@type` which contains the type URL. Example: - Protobuf library provides support to pack/unpack Any values in the - form + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - of utility functions or additional generated methods of the Any type. + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + If the embedded message type is well-known and has a custom JSON - Example 1: Pack and unpack a message in C++. + representation, that representation will be embedded adding a + field - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + `value` which holds the custom JSON in addition to the `@type` - Example 2: Pack and unpack a message in Java. + field. Example (for message [google.protobuf.Duration][]): - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + proof: + title: Proof contains the ownership proof of the external chain address + type: object + properties: + pub_key: + title: >- + PubKey represents the public key associated with the address + for which to - Example 3: Pack and unpack a message in Python. + prove the ownership + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with - Example 4: Pack and unpack a message in Go + type.googleapis.com. - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - The pack methods provided by protobuf library will by default use + Schemes other than `http`, `https` (or the empty scheme) + might be - 'type.googleapis.com/full.type.name' as the type URL and the unpack + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - methods only use the fully qualified type name after the last '/' + URL that describes the type of the serialized message. - in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". + Protobuf library provides support to pack/unpack Any values + in the form + of utility functions or additional generated methods of the + Any type. - JSON + Example 1: Pack and unpack a message in C++. - ==== + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - The JSON representation of an `Any` value uses the regular + Example 2: Pack and unpack a message in Java. - representation of the deserialized, embedded message, with an + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - additional field `@type` which contains the type URL. Example: + Example 3: Pack and unpack a message in Python. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + Example 4: Pack and unpack a message in Go - If the embedded message type is well-known and has a custom JSON + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - representation, that representation will be embedded adding a field + The pack methods provided by protobuf library will by + default use - `value` which holds the custom JSON in addition to the `@type` + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - field. Example (for message [google.protobuf.Duration][]): + methods only use the fully qualified type name after the + last '/' - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - PubKey represents the public key associated with the address for which - to + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - prove the ownership - signature: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + name "y.z". - protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent - the fully qualified name of the type (as in + JSON - `path/google.protobuf.Duration`). The name should be in a - canonical form + ==== - (e.g., leading "." is not accepted). + The JSON representation of an `Any` value uses the regular + representation of the deserialized, embedded message, with + an - In practice, teams usually precompile into the binary all types - that they + additional field `@type` which contains the type URL. + Example: - expect it to use in the context of Any. However, for URLs which - use the + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - scheme `http`, `https`, or no scheme, one can optionally set up a - type + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - server that maps type URLs to message definitions as follows: + If the embedded message type is well-known and has a custom + JSON + representation, that representation will be embedded adding + a field - * If no scheme is provided, `https` is assumed. + `value` which holds the custom JSON in addition to the + `@type` - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + field. Example (for message [google.protobuf.Duration][]): - Note: this functionality is not currently available in the - official + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + signature: + title: >- + Signature represents the hex-encoded signature of the + PlainText value + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - protobuf release, and it is not used for type URLs beginning with + protocol buffer message. This string must contain at + least - type.googleapis.com. + one "/" character. The last segment of the URL's path + must represent + the fully qualified name of the type (as in - Schemes other than `http`, `https` (or the empty scheme) might be + `path/google.protobuf.Duration`). The name should be in + a canonical form - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above specified - type. - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + (e.g., leading "." is not accepted). - URL that describes the type of the serialized message. + In practice, teams usually precompile into the binary + all types that they - Protobuf library provides support to pack/unpack Any values in the - form + expect it to use in the context of Any. However, for + URLs which use the - of utility functions or additional generated methods of the Any type. + scheme `http`, `https`, or no scheme, one can optionally + set up a type + server that maps type URLs to message definitions as + follows: - Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + * If no scheme is provided, `https` is assumed. - Example 2: Pack and unpack a message in Java. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Note: this functionality is not currently available in + the official - Example 3: Pack and unpack a message in Python. + protobuf release, and it is not used for type URLs + beginning with - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - Example 4: Pack and unpack a message in Go + URL that describes the type of the serialized message. - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - The pack methods provided by protobuf library will by default use + Protobuf library provides support to pack/unpack Any values + in the form - 'type.googleapis.com/full.type.name' as the type URL and the unpack + of utility functions or additional generated methods of the + Any type. - methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type + Example 1: Pack and unpack a message in C++. - name "y.z". + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - JSON + Example 3: Pack and unpack a message in Python. - ==== + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - The JSON representation of an `Any` value uses the regular + Example 4: Pack and unpack a message in Go - representation of the deserialized, embedded message, with an + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - additional field `@type` which contains the type URL. Example: + The pack methods provided by protobuf library will by + default use - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + methods only use the fully qualified type name after the + last '/' - If the embedded message type is well-known and has a custom JSON + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - representation, that representation will be embedded adding a field + name "y.z". - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: Signature represents the hex-encoded signature of the PlainText value - plain_text: - type: string - title: >- - PlainText represents the hex-encoded value signed in order to produce - the + JSON - Signature - title: |- - Proof contains all the data used to verify a signature when linking an - account to a profile - desmos.profiles.v3.QueryApplicationLinkByClientIDResponse: - type: object - properties: - link: - type: object - properties: - user: - type: string - title: User to which the link is associated - data: - title: Data contains the details of this specific link - type: object - properties: - application: - type: string - title: 'The application name (eg. Twitter, GitHub, etc)' - username: - type: string - title: >- - Username on the application (eg. Twitter tag, GitHub profile, - etc) - state: - title: State of the link - type: string - enum: - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - - APPLICATION_LINK_STATE_VERIFICATION_STARTED - - APPLICATION_LINK_STATE_VERIFICATION_ERROR - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS - - APPLICATION_LINK_STATE_TIMED_OUT - default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - description: >- - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has just - been initialized - - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified - - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully - - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification - oracle_request: - title: >- - OracleRequest represents the request that has been made to the - oracle - type: object - properties: - id: - type: string - format: uint64 - title: ID is the ID of the request - oracle_script_id: - type: string - format: uint64 - title: OracleScriptID is ID of an oracle script - call_data: - title: CallData contains the data used to perform the oracle request - type: object - properties: - application: - type: string - title: The application for which the ownership should be verified - call_data: - type: string - title: >- - The hex encoded call data that should be used to verify - the application + ==== - account ownership - client_id: - type: string - title: >- - ClientID represents the ID of the client that has called the - oracle script - result: - title: |- - Data coming from the result of the verification. - Only available when the state is STATE_SUCCESS - type: object - properties: - success: - title: Success represents a successful verification - type: object - properties: - value: - type: string - title: Hex-encoded value that has be signed by the profile - signature: - type: string - title: >- - Hex-encoded signature that has been produced by signing - the value - failed: - title: Failed represents a failed verification - type: object - properties: - error: - type: string - title: Error that is associated with the failure - creation_time: - 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.v3.QueryApplicationLinkOwnersResponse: - type: object - properties: - owners: - type: array - items: - type: object - properties: - user: - type: string - application: - type: string - username: - type: string - title: >- - ApplicationLinkOwnerDetails contains the details of a single - application + The JSON representation of an `Any` value uses the regular - link owner - title: Addresses of the application links owners - pagination: - title: Pagination defines the pagination response - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + If the embedded message type is well-known and has a custom + JSON - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: >- - QueryApplicationLinkOwnersResponse contains the data returned by the - request + representation, that representation will be embedded adding + a field - allowing to get application link owners. - desmos.profiles.v3.QueryApplicationLinkOwnersResponse.ApplicationLinkOwnerDetails: - type: object - properties: - user: - type: string - application: - type: string - username: - type: string - title: |- - ApplicationLinkOwnerDetails contains the details of a single application - link owner - desmos.profiles.v3.QueryApplicationLinksResponse: - type: object - properties: - links: - type: array - items: - type: object - properties: - user: - type: string - title: User to which the link is associated - data: - title: Data contains the details of this specific link - type: object - properties: - application: - type: string - title: 'The application name (eg. Twitter, GitHub, etc)' - username: - type: string - title: >- - Username on the application (eg. Twitter tag, GitHub - profile, etc) - state: - title: State of the link - type: string - enum: - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - - APPLICATION_LINK_STATE_VERIFICATION_STARTED - - APPLICATION_LINK_STATE_VERIFICATION_ERROR - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS - - APPLICATION_LINK_STATE_TIMED_OUT - default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - description: >- - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link has - just been initialized - - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified - - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully - - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification - oracle_request: - title: >- - OracleRequest represents the request that has been made to the - oracle - type: object - properties: - id: - type: string - format: uint64 - title: ID is the ID of the request - oracle_script_id: - type: string - format: uint64 - title: OracleScriptID is ID of an oracle script - call_data: - title: >- - CallData contains the data used to perform the oracle - request - type: object - properties: - application: - type: string - title: >- - The application for which the ownership should be - verified - call_data: - type: string - title: >- - The hex encoded call data that should be used to verify - the application + `value` which holds the custom JSON in addition to the + `@type` - account ownership - client_id: + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + plain_text: type: string title: >- - ClientID represents the ID of the client that has called the - oracle script - result: - title: |- - Data coming from the result of the verification. - Only available when the state is STATE_SUCCESS + PlainText represents the hex-encoded value signed in order + to produce the + + Signature + chain_config: + title: ChainConfig contains the configuration of the external chain type: object properties: - success: - title: Success represents a successful verification - type: object - properties: - value: - type: string - title: Hex-encoded value that has be signed by the profile - signature: - type: string - title: >- - Hex-encoded signature that has been produced by signing - the value - failed: - title: Failed represents a failed verification - type: object - properties: - error: - type: string - title: Error that is associated with the failure + name: + type: string + description: >- + ChainConfig contains the data of the chain with which the link + is made. creation_time: 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: >- + CreationTime represents the time in which the link has been + created title: >- - ApplicationLink contains the data of a link to a centralized - application - pagination: - title: Pagination defines the pagination response - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + ChainLink contains the data representing either an inter- or cross- + chain - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: |- - QueryApplicationLinksResponse represents the response to the query used - to get the application links for a specific user - desmos.profiles.v3.QueryChainLinkOwnersResponse: - type: object - properties: - owners: - type: array - items: - type: object - properties: - user: - type: string - chain_name: - type: string - target: - type: string - title: >- - ChainLinkOwnerDetails contains the details of a single chain link - owner - title: Addresses of the chain links owners + link pagination: - title: Pagination defines the pagination response type: object properties: next_key: @@ -13213,20 +14721,11 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + title: Pagination defines the pagination response description: |- - QueryChainLinkOwnersResponse contains the data returned by the request - allowing to get chain link owners. - desmos.profiles.v3.QueryChainLinkOwnersResponse.ChainLinkOwnerDetails: - type: object - properties: - user: - type: string - chain_name: - type: string - target: - type: string - title: ChainLinkOwnerDetails contains the details of a single chain link owner - desmos.profiles.v3.QueryChainLinksResponse: + QueryChainLinksResponse is the response type for the + Query/ChainLinks RPC method. + desmos.profiles.v3.QueryDefaultExternalAddressesResponse: type: object properties: links: @@ -13238,6 +14737,11 @@ definitions: type: string title: User defines the destination profile address to link address: + title: >- + Address contains the data of the external chain address to be + connected + + with the Desmos profile type: object properties: type_url: @@ -13406,16 +14910,16 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - title: >- - Address contains the data of the external chain address to be - connected - - with the Desmos profile proof: title: Proof contains the ownership proof of the external chain address type: object properties: pub_key: + title: >- + PubKey represents the public key associated with the address + for which to + + prove the ownership type: object properties: type_url: @@ -13590,12 +15094,10 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - title: >- - PubKey represents the public key associated with the address - for which to - - prove the ownership signature: + title: >- + Signature represents the hex-encoded signature of the + PlainText value type: object properties: type_url: @@ -13770,9 +15272,6 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - title: >- - Signature represents the hex-encoded signature of the - PlainText value plain_text: type: string title: >- @@ -13800,8 +15299,12 @@ definitions: chain link + title: >- + List of default addresses, each one represented by the associated + chain + + link pagination: - title: Pagination defines the pagination response type: object properties: next_key: @@ -13826,9 +15329,9 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - description: |- - QueryChainLinksResponse is the response type for the - Query/ChainLinks RPC method. + title: |- + QueryDefaultExternalAddressesResponse is the response type for + Query/DefaultExternalAddresses RPC method desmos.profiles.v3.QueryIncomingDTagTransferRequestsResponse: type: object properties: @@ -13865,7 +15368,6 @@ definitions: the user pagination: - title: Pagination defines the pagination response type: object properties: next_key: @@ -13890,6 +15392,7 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + title: Pagination defines the pagination response description: |- QueryIncomingDTagTransferRequestsResponse is the response type for the Query/IncomingDTagTransferRequests RPC method. From d46f469f52f2b23dbcf8b7c40d9f15cbc7027bc0 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 15 Jul 2022 17:45:31 +0800 Subject: [PATCH 39/64] Update proto/desmos/profiles/v3/query.proto Co-authored-by: Riccardo Montagnin --- proto/desmos/profiles/v3/query.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/desmos/profiles/v3/query.proto b/proto/desmos/profiles/v3/query.proto index d7cc8baa09..c7abe263ec 100644 --- a/proto/desmos/profiles/v3/query.proto +++ b/proto/desmos/profiles/v3/query.proto @@ -47,7 +47,7 @@ service Query { // given user and (optionally) chain name rpc DefaultExternalAddresses(QueryDefaultExternalAddressesRequest) returns (QueryDefaultExternalAddressesResponse) { - option (google.api.http).get = "/desmos/profiles/v2/default-addresses"; + option (google.api.http).get = "/desmos/profiles/v3/default-addresses"; } // ApplicationLinks queries the applications links associated to the given From 2aa9bcad42fa44262d22907c0431344b2cf225ae Mon Sep 17 00:00:00 2001 From: dadamu Date: Fri, 15 Jul 2022 09:46:28 +0000 Subject: [PATCH 40/64] Updated Swagger definition --- client/docs/swagger-ui/swagger.yaml | 3654 +++++++++++++-------------- 1 file changed, 1827 insertions(+), 1827 deletions(-) diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 513fca4e7c..395eb3b28b 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -4,12 +4,14 @@ info: description: A REST interface for state queries version: 3.0.0 paths: - /desmos/profiles/v2/default-addresses: + /desmos/profiles/v3/app-links: get: - summary: |- - DefaultExternalAddresses queries the default addresses associated to the - given user and (optionally) chain name - operationId: DefaultExternalAddresses + summary: >- + ApplicationLinks queries the applications links associated to the given + + user, if provided. Otherwise, it queries all the application links + stored. + operationId: ApplicationLinks responses: '200': description: A successful response. @@ -23,1454 +25,1715 @@ paths: properties: user: type: string - title: User defines the destination profile address to link - address: + title: User to which the link is associated + data: + title: Data contains the details of this specific link + type: object + properties: + application: + type: string + title: 'The application name (eg. Twitter, GitHub, etc)' + username: + type: string + title: >- + Username on the application (eg. Twitter tag, GitHub + profile, etc) + state: + title: State of the link + type: string + enum: + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + - APPLICATION_LINK_STATE_VERIFICATION_STARTED + - APPLICATION_LINK_STATE_VERIFICATION_ERROR + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS + - APPLICATION_LINK_STATE_TIMED_OUT + default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + description: >- + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link + has just been initialized + - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified + - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully + - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification + oracle_request: title: >- - Address contains the data of the external chain address - to be connected - - with the Desmos profile + OracleRequest represents the request that has been made + to the oracle type: object properties: - type_url: + id: type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least + format: uint64 + title: ID is the ID of the request + oracle_script_id: + type: string + format: uint64 + title: OracleScriptID is ID of an oracle script + call_data: + title: >- + CallData contains the data used to perform the + oracle request + type: object + properties: + application: + type: string + title: >- + The application for which the ownership should + be verified + call_data: + type: string + title: >- + The hex encoded call data that should be used to + verify the application - one "/" character. The last segment of the URL's - path must represent + account ownership + client_id: + type: string + title: >- + ClientID represents the ID of the client that has + called the oracle script + result: + title: |- + Data coming from the result of the verification. + Only available when the state is STATE_SUCCESS + type: object + properties: + success: + title: Success represents a successful verification + type: object + properties: + value: + type: string + title: >- + Hex-encoded value that has be signed by the + profile + signature: + type: string + title: >- + Hex-encoded signature that has been produced by + signing the value + failed: + title: Failed represents a failed verification + type: object + properties: + error: + type: string + title: Error that is associated with the failure + creation_time: + 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 + pagination: + title: Pagination defines the pagination response + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - the fully qualified name of the type (as in + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the - `path/google.protobuf.Duration`). The name should be - in a canonical form + corresponding request message has used PageRequest. - (e.g., leading "." is not accepted). + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: >- + QueryApplicationLinksResponse represents the response to the query + used + to get the application links for a specific user + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - In practice, teams usually precompile into the - binary all types that they + protocol buffer message. This string must contain at + least - expect it to use in the context of Any. However, for - URLs which use the + one "/" character. The last segment of the URL's path + must represent - scheme `http`, `https`, or no scheme, one can - optionally set up a type + the fully qualified name of the type (as in - server that maps type URLs to message definitions as - follows: + `path/google.protobuf.Duration`). The name should be in + a canonical form + (e.g., leading "." is not accepted). - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + In practice, teams usually precompile into the binary + all types that they - Note: this functionality is not currently available - in the official + expect it to use in the context of Any. However, for + URLs which use the - protobuf release, and it is not used for type URLs - beginning with + scheme `http`, `https`, or no scheme, one can optionally + set up a type - type.googleapis.com. + server that maps type URLs to message definitions as + follows: - Schemes other than `http`, `https` (or the empty - scheme) might be + * If no scheme is provided, `https` is assumed. - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the - above specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - URL that describes the type of the serialized message. + Note: this functionality is not currently available in + the official + protobuf release, and it is not used for type URLs + beginning with - Protobuf library provides support to pack/unpack Any - values in the form + type.googleapis.com. - of utility functions or additional generated methods of - the Any type. + Schemes other than `http`, `https` (or the empty scheme) + might be - Example 1: Pack and unpack a message in C++. + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + URL that describes the type of the serialized message. - Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Protobuf library provides support to pack/unpack Any values + in the form - Example 3: Pack and unpack a message in Python. + of utility functions or additional generated methods of the + Any type. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Example 1: Pack and unpack a message in C++. - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - The pack methods provided by protobuf library will by - default use + Example 2: Pack and unpack a message in Java. - 'type.googleapis.com/full.type.name' as the type URL and - the unpack + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - methods only use the fully qualified type name after the - last '/' + Example 3: Pack and unpack a message in Python. - in the type URL, for example "foo.bar.com/x/y.z" will - yield type + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - name "y.z". + Example 4: Pack and unpack a message in Go + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + The pack methods provided by protobuf library will by + default use - JSON + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - ==== + methods only use the fully qualified type name after the + last '/' - The JSON representation of an `Any` value uses the - regular + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - representation of the deserialized, embedded message, - with an + name "y.z". - additional field `@type` which contains the type URL. - Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + JSON - If the embedded message type is well-known and has a - custom JSON + ==== - representation, that representation will be embedded - adding a field + The JSON representation of an `Any` value uses the regular - `value` which holds the custom JSON in addition to the - `@type` + representation of the deserialized, embedded message, with + an - field. Example (for message - [google.protobuf.Duration][]): + additional field `@type` which contains the type URL. + Example: - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - proof: - title: >- - Proof contains the ownership proof of the external chain - address - type: object - properties: - pub_key: - title: >- - PubKey represents the public key associated with the - address for which to + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - prove the ownership - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - protocol buffer message. This string must - contain at least + If the embedded message type is well-known and has a custom + JSON - one "/" character. The last segment of the URL's - path must represent + representation, that representation will be embedded adding + a field - the fully qualified name of the type (as in + `value` which holds the custom JSON in addition to the + `@type` - `path/google.protobuf.Duration`). The name - should be in a canonical form + field. Example (for message [google.protobuf.Duration][]): - (e.g., leading "." is not accepted). + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: user + description: >- + (Optional) User contains the Desmos profile address associated for + which + the link should be searched for. + in: query + required: false + type: string + - name: application + description: >- + (Optional) Application represents the application name associated + with the - In practice, teams usually precompile into the - binary all types that they + link. Used only if user is also set. + in: query + required: false + type: string + - name: username + description: >- + Username represents the username inside the application associated + with the - expect it to use in the context of Any. However, - for URLs which use the + link. Used only if application is also set. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - scheme `http`, `https`, or no scheme, one can - optionally set up a type + It is less efficient than using key. Only one of offset or key + should - server that maps type URLs to message - definitions as follows: + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include - * If no scheme is provided, `https` is assumed. + a count of the total number of items available for pagination in + UIs. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup - results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + count_total is only respected when offset is used. It is ignored + when key - Note: this functionality is not currently - available in the official + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - protobuf release, and it is not used for type - URLs beginning with - type.googleapis.com. + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean + tags: + - Query + '/desmos/profiles/v3/app-links/clients/{client_id}': + get: + summary: |- + ApplicationLinkByClientID queries a single application link for a given + client id. + operationId: ApplicationLinkByClientID + responses: + '200': + description: A successful response. + schema: + type: object + properties: + link: + type: object + properties: + user: + type: string + title: User to which the link is associated + data: + title: Data contains the details of this specific link + type: object + properties: + application: + type: string + title: 'The application name (eg. Twitter, GitHub, etc)' + username: + type: string + title: >- + Username on the application (eg. Twitter tag, GitHub + profile, etc) + state: + title: State of the link + type: string + enum: + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + - APPLICATION_LINK_STATE_VERIFICATION_STARTED + - APPLICATION_LINK_STATE_VERIFICATION_ERROR + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS + - APPLICATION_LINK_STATE_TIMED_OUT + default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED + description: >- + - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link + has just been initialized + - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified + - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process + - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully + - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification + oracle_request: + title: >- + OracleRequest represents the request that has been made to + the oracle + type: object + properties: + id: + type: string + format: uint64 + title: ID is the ID of the request + oracle_script_id: + type: string + format: uint64 + title: OracleScriptID is ID of an oracle script + call_data: + title: >- + CallData contains the data used to perform the oracle + request + type: object + properties: + application: + type: string + title: >- + The application for which the ownership should be + verified + call_data: + type: string + title: >- + The hex encoded call data that should be used to + verify the application + account ownership + client_id: + type: string + title: >- + ClientID represents the ID of the client that has + called the oracle script + result: + title: |- + Data coming from the result of the verification. + Only available when the state is STATE_SUCCESS + type: object + properties: + success: + title: Success represents a successful verification + type: object + properties: + value: + type: string + title: >- + Hex-encoded value that has be signed by the + profile + signature: + type: string + title: >- + Hex-encoded signature that has been produced by + signing the value + failed: + title: Failed represents a failed verification + type: object + properties: + error: + type: string + title: Error that is associated with the failure + creation_time: + 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 - Schemes other than `http`, `https` (or the empty - scheme) might be + request allowing to get an application link using a client id + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of - the above specified type. - description: >- - `Any` contains an arbitrary serialized protocol - buffer message along with a + protocol buffer message. This string must contain at + least - URL that describes the type of the serialized - message. + one "/" character. The last segment of the URL's path + must represent + the fully qualified name of the type (as in - Protobuf library provides support to pack/unpack Any - values in the form + `path/google.protobuf.Duration`). The name should be in + a canonical form - of utility functions or additional generated methods - of the Any type. + (e.g., leading "." is not accepted). - Example 1: Pack and unpack a message in C++. + In practice, teams usually precompile into the binary + all types that they - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + expect it to use in the context of Any. However, for + URLs which use the - Example 2: Pack and unpack a message in Java. + scheme `http`, `https`, or no scheme, one can optionally + set up a type - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + server that maps type URLs to message definitions as + follows: - Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' - Example 4: Pack and unpack a message in Go + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + name "y.z". - The pack methods provided by protobuf library will - by default use - 'type.googleapis.com/full.type.name' as the type URL - and the unpack - methods only use the fully qualified type name after - the last '/' + JSON - in the type URL, for example "foo.bar.com/x/y.z" - will yield type + ==== - name "y.z". + The JSON representation of an `Any` value uses the regular + representation of the deserialized, embedded message, with + an + additional field `@type` which contains the type URL. + Example: - JSON + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - ==== + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - The JSON representation of an `Any` value uses the - regular + If the embedded message type is well-known and has a custom + JSON - representation of the deserialized, embedded - message, with an + representation, that representation will be embedded adding + a field - additional field `@type` which contains the type - URL. Example: + `value` which holds the custom JSON in addition to the + `@type` - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: client_id + description: >- + ClientID represents the ID of the client to which search the link + for + in: path + required: true + type: string + tags: + - Query + /desmos/profiles/v3/app-links/owners: + get: + summary: |- + ApplicationLinkOwners queries for the owners of applications links, + optionally searching for a specific application and username. + operationId: ApplicationLinkOwners + responses: + '200': + description: A successful response. + schema: + type: object + properties: + owners: + type: array + items: + type: object + properties: + user: + type: string + application: + type: string + username: + type: string + title: >- + ApplicationLinkOwnerDetails contains the details of a single + application - If the embedded message type is well-known and has a - custom JSON + link owner + title: Addresses of the application links owners + pagination: + title: Pagination defines the pagination response + type: object + properties: + next_key: + type: string + format: byte + title: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - representation, that representation will be embedded - adding a field + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the - `value` which holds the custom JSON in addition to - the `@type` + corresponding request message has used PageRequest. - field. Example (for message - [google.protobuf.Duration][]): + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + description: >- + QueryApplicationLinkOwnersResponse contains the data returned by + the request - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - signature: - title: >- - Signature represents the hex-encoded signature of - the PlainText value - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized + allowing to get application link owners. + default: + description: An unexpected error response + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - protocol buffer message. This string must - contain at least + protocol buffer message. This string must contain at + least - one "/" character. The last segment of the URL's - path must represent + one "/" character. The last segment of the URL's path + must represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name - should be in a canonical form + `path/google.protobuf.Duration`). The name should be in + a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the - binary all types that they + In practice, teams usually precompile into the binary + all types that they - expect it to use in the context of Any. However, - for URLs which use the + expect it to use in the context of Any. However, for + URLs which use the - scheme `http`, `https`, or no scheme, one can - optionally set up a type + scheme `http`, `https`, or no scheme, one can optionally + set up a type - server that maps type URLs to message - definitions as follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup - results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently - available in the official + Note: this functionality is not currently available in + the official - protobuf release, and it is not used for type - URLs beginning with + protobuf release, and it is not used for type URLs + beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty - scheme) might be + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of - the above specified type. - description: >- - `Any` contains an arbitrary serialized protocol - buffer message along with a + URL that describes the type of the serialized message. - URL that describes the type of the serialized - message. + Protobuf library provides support to pack/unpack Any values + in the form - Protobuf library provides support to pack/unpack Any - values in the form + of utility functions or additional generated methods of the + Any type. - of utility functions or additional generated methods - of the Any type. + Example 1: Pack and unpack a message in C++. - Example 1: Pack and unpack a message in C++. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Example 2: Pack and unpack a message in Java. - Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Example 3: Pack and unpack a message in Python. - Example 3: Pack and unpack a message in Python. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + Example 4: Pack and unpack a message in Go - Example 4: Pack and unpack a message in Go + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + The pack methods provided by protobuf library will by + default use - The pack methods provided by protobuf library will - by default use + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - 'type.googleapis.com/full.type.name' as the type URL - and the unpack + methods only use the fully qualified type name after the + last '/' - methods only use the fully qualified type name after - the last '/' + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - in the type URL, for example "foo.bar.com/x/y.z" - will yield type + name "y.z". - name "y.z". + JSON - JSON + ==== - ==== + The JSON representation of an `Any` value uses the regular - The JSON representation of an `Any` value uses the - regular + representation of the deserialized, embedded message, with + an - representation of the deserialized, embedded - message, with an + additional field `@type` which contains the type URL. + Example: - additional field `@type` which contains the type - URL. Example: + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + If the embedded message type is well-known and has a custom + JSON - If the embedded message type is well-known and has a - custom JSON + representation, that representation will be embedded adding + a field - representation, that representation will be embedded - adding a field + `value` which holds the custom JSON in addition to the + `@type` - `value` which holds the custom JSON in addition to - the `@type` + field. Example (for message [google.protobuf.Duration][]): - field. Example (for message - [google.protobuf.Duration][]): + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: application + description: >- + (Optional) Application name to search link owners of. If not + specified, all - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - plain_text: - type: string - title: >- - PlainText represents the hex-encoded value signed in - order to produce the + links stored will be searched instead. + in: query + required: false + type: string + - name: username + description: |- + (Optional) Username to search for. This will only be used if the + application is specified as well. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - Signature - chain_config: - title: >- - ChainConfig contains the configuration of the external - chain - type: object - properties: - name: - type: string - description: >- - ChainConfig contains the data of the chain with which - the link is made. - creation_time: - type: string - format: date-time - title: >- - CreationTime represents the time in which the link has - been created - title: >- - ChainLink contains the data representing either an inter- or - cross- chain + It is less efficient than using key. Only one of offset or key + should - link - title: >- - List of default addresses, each one represented by the - associated chain + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - link - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + count_total is only respected when offset is used. It is ignored + when key - corresponding request message has used PageRequest. + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: |- - QueryDefaultExternalAddressesResponse is the response type for - Query/DefaultExternalAddresses RPC method - default: - description: An unexpected error response + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean + tags: + - Query + /desmos/profiles/v3/chain-links: + get: + summary: |- + ChainLinks queries the chain links associated to the given user, if + provided. Otherwise it queries all the chain links stored. + operationId: ChainLinks + responses: + '200': + description: A successful response. schema: type: object properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: + links: type: array items: type: object properties: - type_url: + user: type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + title: User defines the destination profile address to link + address: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - protocol buffer message. This string must contain at - least + protocol buffer message. This string must contain at + least - one "/" character. The last segment of the URL's path - must represent + one "/" character. The last segment of the URL's + path must represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in - a canonical form + `path/google.protobuf.Duration`). The name should be + in a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary - all types that they + In practice, teams usually precompile into the + binary all types that they - expect it to use in the context of Any. However, for - URLs which use the + expect it to use in the context of Any. However, for + URLs which use the - scheme `http`, `https`, or no scheme, one can optionally - set up a type + scheme `http`, `https`, or no scheme, one can + optionally set up a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in - the official + Note: this functionality is not currently available + in the official - protobuf release, and it is not used for type URLs - beginning with + protobuf release, and it is not used for type URLs + beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) - might be + Schemes other than `http`, `https` (or the empty + scheme) might be - used with implementation specific semantics. - value: - type: string - format: byte + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the + above specified type. description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + `Any` contains an arbitrary serialized protocol buffer + message along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values - in the form + Protobuf library provides support to pack/unpack Any + values in the form - of utility functions or additional generated methods of the - Any type. + of utility functions or additional generated methods of + the Any type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - The pack methods provided by protobuf library will by - default use + The pack methods provided by protobuf library will by + default use - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + 'type.googleapis.com/full.type.name' as the type URL and + the unpack - methods only use the fully qualified type name after the - last '/' + methods only use the fully qualified type name after the + last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". - name "y.z". + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - JSON + If the embedded message type is well-known and has a + custom JSON - ==== + representation, that representation will be embedded + adding a field - The JSON representation of an `Any` value uses the regular + `value` which holds the custom JSON in addition to the + `@type` - representation of the deserialized, embedded message, with - an + field. Example (for message + [google.protobuf.Duration][]): - additional field `@type` which contains the type URL. - Example: + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + Address contains the data of the external chain address + to be connected - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + with the Desmos profile + proof: + title: >- + Proof contains the ownership proof of the external chain + address + type: object + properties: + pub_key: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + protocol buffer message. This string must + contain at least - If the embedded message type is well-known and has a custom - JSON + one "/" character. The last segment of the URL's + path must represent - representation, that representation will be embedded adding - a field + the fully qualified name of the type (as in - `value` which holds the custom JSON in addition to the - `@type` + `path/google.protobuf.Duration`). The name + should be in a canonical form - field. Example (for message [google.protobuf.Duration][]): + (e.g., leading "." is not accepted). - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: owner - description: (Optional) Owner for which to query the default addresses. - in: query - required: false - type: string - - name: chain_name - description: (Optional) Chain name to query the default address for. - in: query - required: false - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - It is less efficient than using key. Only one of offset or key - should + In practice, teams usually precompile into the + binary all types that they - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. + expect it to use in the context of Any. However, + for URLs which use the - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + scheme `http`, `https`, or no scheme, one can + optionally set up a type - a count of the total number of items available for pagination in - UIs. + server that maps type URLs to message + definitions as follows: - count_total is only respected when offset is used. It is ignored - when key - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + * If no scheme is provided, `https` is assumed. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup + results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean - tags: - - Query - /desmos/profiles/v3/app-links: - get: - summary: >- - ApplicationLinks queries the applications links associated to the given + Note: this functionality is not currently + available in the official - user, if provided. Otherwise, it queries all the application links - stored. - operationId: ApplicationLinks - responses: - '200': - description: A successful response. - schema: - type: object - properties: - links: - type: array - items: - type: object - properties: - user: - type: string - title: User to which the link is associated - data: - title: Data contains the details of this specific link - type: object - properties: - application: - type: string - title: 'The application name (eg. Twitter, GitHub, etc)' - username: - type: string - title: >- - Username on the application (eg. Twitter tag, GitHub - profile, etc) - state: - title: State of the link - type: string - enum: - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - - APPLICATION_LINK_STATE_VERIFICATION_STARTED - - APPLICATION_LINK_STATE_VERIFICATION_ERROR - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS - - APPLICATION_LINK_STATE_TIMED_OUT - default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - description: >- - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link - has just been initialized - - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified - - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully - - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification - oracle_request: - title: >- - OracleRequest represents the request that has been made - to the oracle - type: object - properties: - id: - type: string - format: uint64 - title: ID is the ID of the request - oracle_script_id: - type: string - format: uint64 - title: OracleScriptID is ID of an oracle script - call_data: - title: >- - CallData contains the data used to perform the - oracle request - type: object - properties: - application: - type: string - title: >- - The application for which the ownership should - be verified - call_data: - type: string - title: >- - The hex encoded call data that should be used to - verify the application + protobuf release, and it is not used for type + URLs beginning with - account ownership - client_id: - type: string - title: >- - ClientID represents the ID of the client that has - called the oracle script - result: - title: |- - Data coming from the result of the verification. - Only available when the state is STATE_SUCCESS - type: object - properties: - success: - title: Success represents a successful verification - type: object - properties: + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. value: type: string - title: >- - Hex-encoded value that has be signed by the - profile - signature: - type: string - title: >- - Hex-encoded signature that has been produced by - signing the value - failed: - title: Failed represents a failed verification - type: object - properties: - error: - type: string - title: Error that is associated with the failure - creation_time: - 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 - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + format: byte + description: >- + Must be a valid serialized protocol buffer of + the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol + buffer message along with a - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + URL that describes the type of the serialized + message. - corresponding request message has used PageRequest. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: Pagination defines the pagination response - title: >- - QueryApplicationLinksResponse represents the response to the query - used + Protobuf library provides support to pack/unpack Any + values in the form - to get the application links for a specific user - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + of utility functions or additional generated methods + of the Any type. - protocol buffer message. This string must contain at - least - one "/" character. The last segment of the URL's path - must represent + Example 1: Pack and unpack a message in C++. - the fully qualified name of the type (as in + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - `path/google.protobuf.Duration`). The name should be in - a canonical form + Example 2: Pack and unpack a message in Java. - (e.g., leading "." is not accepted). + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. - In practice, teams usually precompile into the binary - all types that they + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - expect it to use in the context of Any. However, for - URLs which use the + Example 4: Pack and unpack a message in Go - scheme `http`, `https`, or no scheme, one can optionally - set up a type + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - server that maps type URLs to message definitions as - follows: + The pack methods provided by protobuf library will + by default use + 'type.googleapis.com/full.type.name' as the type URL + and the unpack - * If no scheme is provided, `https` is assumed. + methods only use the fully qualified type name after + the last '/' - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + in the type URL, for example "foo.bar.com/x/y.z" + will yield type - Note: this functionality is not currently available in - the official + name "y.z". - protobuf release, and it is not used for type URLs - beginning with - type.googleapis.com. + JSON - Schemes other than `http`, `https` (or the empty scheme) - might be + ==== - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded + message, with an + + additional field `@type` which contains the type + URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to + the `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + PubKey represents the public key associated with the + address for which to + + prove the ownership + signature: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must + contain at least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name + should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, + for URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type - URL that describes the type of the serialized message. + server that maps type URLs to message + definitions as follows: - Protobuf library provides support to pack/unpack Any values - in the form + * If no scheme is provided, `https` is assumed. - of utility functions or additional generated methods of the - Any type. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup + results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently + available in the official - Example 1: Pack and unpack a message in C++. + protobuf release, and it is not used for type + URLs beginning with - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + type.googleapis.com. - Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Schemes other than `http`, `https` (or the empty + scheme) might be - Example 3: Pack and unpack a message in Python. + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of + the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol + buffer message along with a - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + URL that describes the type of the serialized + message. - Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + Protobuf library provides support to pack/unpack Any + values in the form - The pack methods provided by protobuf library will by - default use + of utility functions or additional generated methods + of the Any type. - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - methods only use the fully qualified type name after the - last '/' + Example 1: Pack and unpack a message in C++. - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - name "y.z". + Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. - JSON + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - ==== + Example 4: Pack and unpack a message in Go - The JSON representation of an `Any` value uses the regular + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - representation of the deserialized, embedded message, with - an + The pack methods provided by protobuf library will + by default use - additional field `@type` which contains the type URL. - Example: + 'type.googleapis.com/full.type.name' as the type URL + and the unpack - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + methods only use the fully qualified type name after + the last '/' - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + in the type URL, for example "foo.bar.com/x/y.z" + will yield type - If the embedded message type is well-known and has a custom - JSON + name "y.z". - representation, that representation will be embedded adding - a field - `value` which holds the custom JSON in addition to the - `@type` - field. Example (for message [google.protobuf.Duration][]): + JSON - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: user - description: >- - (Optional) User contains the Desmos profile address associated for - which + ==== - the link should be searched for. - in: query - required: false - type: string - - name: application - description: >- - (Optional) Application represents the application name associated - with the + The JSON representation of an `Any` value uses the + regular - link. Used only if user is also set. - in: query - required: false - type: string - - name: username - description: >- - Username represents the username inside the application associated - with the + representation of the deserialized, embedded + message, with an - link. Used only if application is also set. - in: query - required: false - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + additional field `@type` which contains the type + URL. Example: - It is less efficient than using key. Only one of offset or key - should + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + If the embedded message type is well-known and has a + custom JSON - a count of the total number of items available for pagination in - UIs. + representation, that representation will be embedded + adding a field - count_total is only respected when offset is used. It is ignored - when key + `value` which holds the custom JSON in addition to + the `@type` - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + Signature represents the hex-encoded signature of + the PlainText value + plain_text: + type: string + title: >- + PlainText represents the hex-encoded value signed in + order to produce the + Signature + chain_config: + title: >- + ChainConfig contains the configuration of the external + chain + type: object + properties: + name: + type: string + description: >- + ChainConfig contains the data of the chain with which + the link is made. + creation_time: + type: string + format: date-time + title: >- + CreationTime represents the time in which the link has + been created + title: >- + ChainLink contains the data representing either an inter- or + cross- chain - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean - tags: - - Query - '/desmos/profiles/v3/app-links/clients/{client_id}': - get: - summary: |- - ApplicationLinkByClientID queries a single application link for a given - client id. - operationId: ApplicationLinkByClientID - responses: - '200': - description: A successful response. - schema: - type: object - properties: - link: + link + pagination: + title: Pagination defines the pagination response type: object properties: - user: - type: string - title: User to which the link is associated - data: - title: Data contains the details of this specific link - type: object - properties: - application: - type: string - title: 'The application name (eg. Twitter, GitHub, etc)' - username: - type: string - title: >- - Username on the application (eg. Twitter tag, GitHub - profile, etc) - state: - title: State of the link + next_key: type: string - enum: - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - - APPLICATION_LINK_STATE_VERIFICATION_STARTED - - APPLICATION_LINK_STATE_VERIFICATION_ERROR - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS - - APPLICATION_LINK_STATE_TIMED_OUT - default: APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED - description: >- - - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED: A link - has just been initialized - - APPLICATION_LINK_STATE_VERIFICATION_STARTED: A link has just started being verified - - APPLICATION_LINK_STATE_VERIFICATION_ERROR: A link has errored during the verification process - - APPLICATION_LINK_STATE_VERIFICATION_SUCCESS: A link has being verified successfully - - APPLICATION_LINK_STATE_TIMED_OUT: A link has timed out while waiting for the verification - oracle_request: - title: >- - OracleRequest represents the request that has been made to - the oracle - type: object - properties: - id: - type: string - format: uint64 - title: ID is the ID of the request - oracle_script_id: - type: string - format: uint64 - title: OracleScriptID is ID of an oracle script - call_data: - title: >- - CallData contains the data used to perform the oracle - request - type: object - properties: - application: - type: string - title: >- - The application for which the ownership should be - verified - call_data: - type: string - title: >- - The hex encoded call data that should be used to - verify the application - - account ownership - client_id: - type: string - title: >- - ClientID represents the ID of the client that has - called the oracle script - result: + format: byte title: |- - Data coming from the result of the verification. - Only available when the state is STATE_SUCCESS - type: object - properties: - success: - title: Success represents a successful verification - type: object - properties: - value: - type: string - title: >- - Hex-encoded value that has be signed by the - profile - signature: - type: string - title: >- - Hex-encoded signature that has been produced by - signing the value - failed: - title: Failed represents a failed verification - type: object - properties: - error: - type: string - title: Error that is associated with the failure - creation_time: - type: string - format: date-time - title: >- - CreationTime represents the time in which the link was - created - expiration_time: + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently + total: type: string - format: date-time + format: uint64 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 + total is total number of results available if + PageRequest.count_total - request allowing to get an application link using a client id + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + description: |- + QueryChainLinksResponse is the response type for the + Query/ChainLinks RPC method. default: description: An unexpected error response schema: @@ -1661,21 +1924,101 @@ paths: "value": "1.212s" } parameters: - - name: client_id + - name: user description: >- - ClientID represents the ID of the client to which search the link - for - in: path - required: true + (optional) User represents the Desmos address of the user to which + search + + the link for. + in: query + required: false type: string + - name: chain_name + description: >- + (optional) ChainName contains the name of the chain to which search + the + + link for. Used only if user is also set. + in: query + required: false + type: string + - name: target + description: >- + (optional) Target must contain the external address to which query + the link + + for. Used only if chain name is also set. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + format: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + format: boolean tags: - Query - /desmos/profiles/v3/app-links/owners: + /desmos/profiles/v3/chain-links/owners: get: - summary: |- - ApplicationLinkOwners queries for the owners of applications links, - optionally searching for a specific application and username. - operationId: ApplicationLinkOwners + summary: >- + ChainLinkOwners queries for the owners of chain links, optionally + searching + + for a specific chain name and external address + operationId: ChainLinkOwners responses: '200': description: A successful response. @@ -1689,17 +2032,16 @@ paths: properties: user: type: string - application: + chain_name: type: string - username: + target: type: string title: >- - ApplicationLinkOwnerDetails contains the details of a single - application - + ChainLinkOwnerDetails contains the details of a single chain link owner - title: Addresses of the application links owners + title: Addresses of the chain links owners pagination: + title: Pagination defines the pagination response type: object properties: next_key: @@ -1726,12 +2068,11 @@ paths: repeated Bar results = 1; PageResponse page = 2; } - title: Pagination defines the pagination response description: >- - QueryApplicationLinkOwnersResponse contains the data returned by - the request + QueryChainLinkOwnersResponse contains the data returned by the + request - allowing to get application link owners. + allowing to get chain link owners. default: description: An unexpected error response schema: @@ -1922,19 +2263,21 @@ paths: "value": "1.212s" } parameters: - - name: application + - name: chain_name description: >- - (Optional) Application name to search link owners of. If not - specified, all + (Optional) Chain name to search link owners of. If not specified, + all links stored will be searched instead. in: query required: false type: string - - name: username - description: |- - (Optional) Username to search for. This will only be used if the - application is specified as well. + - name: target + description: >- + (Optional) External address to search for. This will only be used if + the + + chain name is specified as well. in: query required: false type: string @@ -1998,12 +2341,12 @@ paths: format: boolean tags: - Query - /desmos/profiles/v3/chain-links: + /desmos/profiles/v3/default-addresses: get: summary: |- - ChainLinks queries the chain links associated to the given user, if - provided. Otherwise it queries all the chain links stored. - operationId: ChainLinks + DefaultExternalAddresses queries the default addresses associated to the + given user and (optionally) chain name + operationId: DefaultExternalAddresses responses: '200': description: A successful response. @@ -2019,11 +2362,6 @@ paths: type: string title: User defines the destination profile address to link address: - title: >- - Address contains the data of the external chain address - to be connected - - with the Desmos profile type: object properties: type_url: @@ -2118,281 +2456,100 @@ paths: Foo foo = ...; Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - proof: - title: >- - Proof contains the ownership proof of the external chain - address - type: object - properties: - pub_key: - title: >- - PubKey represents the public key associated with the - address for which to - - prove the ownership - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must - contain at least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name - should be in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the - binary all types that they - - expect it to use in the context of Any. However, - for URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message - definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup - results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently - available in the official - - protobuf release, and it is not used for type - URLs beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of - the above specified type. - description: >- - `Any` contains an arbitrary serialized protocol - buffer message along with a - - URL that describes the type of the serialized - message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods - of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Example 3: Pack and unpack a message in Python. - Example 3: Pack and unpack a message in Python. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + Example 4: Pack and unpack a message in Go - Example 4: Pack and unpack a message in Go + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + The pack methods provided by protobuf library will by + default use - The pack methods provided by protobuf library will - by default use + 'type.googleapis.com/full.type.name' as the type URL and + the unpack - 'type.googleapis.com/full.type.name' as the type URL - and the unpack + methods only use the fully qualified type name after the + last '/' - methods only use the fully qualified type name after - the last '/' + in the type URL, for example "foo.bar.com/x/y.z" will + yield type - in the type URL, for example "foo.bar.com/x/y.z" - will yield type + name "y.z". - name "y.z". + JSON - JSON + ==== - ==== + The JSON representation of an `Any` value uses the + regular - The JSON representation of an `Any` value uses the - regular + representation of the deserialized, embedded message, + with an - representation of the deserialized, embedded - message, with an + additional field `@type` which contains the type URL. + Example: - additional field `@type` which contains the type - URL. Example: + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + If the embedded message type is well-known and has a + custom JSON - If the embedded message type is well-known and has a - custom JSON + representation, that representation will be embedded + adding a field - representation, that representation will be embedded - adding a field + `value` which holds the custom JSON in addition to the + `@type` - `value` which holds the custom JSON in addition to - the `@type` + field. Example (for message + [google.protobuf.Duration][]): - field. Example (for message - [google.protobuf.Duration][]): + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + Address contains the data of the external chain address + to be connected - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - signature: - title: >- - Signature represents the hex-encoded signature of - the PlainText value + with the Desmos profile + proof: + title: >- + Proof contains the ownership proof of the external chain + address + type: object + properties: + pub_key: type: object properties: type_url: @@ -2551,391 +2708,245 @@ paths: { "@type": "type.googleapis.com/google.profile.Person", "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to - the `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - plain_text: - type: string - title: >- - PlainText represents the hex-encoded value signed in - order to produce the - - Signature - chain_config: - title: >- - ChainConfig contains the configuration of the external - chain - type: object - properties: - name: - type: string - description: >- - ChainConfig contains the data of the chain with which - the link is made. - creation_time: - type: string - format: date-time - title: >- - CreationTime represents the time in which the link has - been created - title: >- - ChainLink contains the data representing either an inter- or - cross- chain - - link - pagination: - type: object - properties: - next_key: - type: string - format: byte - title: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: Pagination defines the pagination response - description: |- - QueryChainLinksResponse is the response type for the - Query/ChainLinks RPC method. - default: - description: An unexpected error response - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the + "lastName": + } - scheme `http`, `https`, or no scheme, one can optionally - set up a type + If the embedded message type is well-known and has a + custom JSON - server that maps type URLs to message definitions as - follows: + representation, that representation will be embedded + adding a field + `value` which holds the custom JSON in addition to + the `@type` - * If no scheme is provided, `https` is assumed. + field. Example (for message + [google.protobuf.Duration][]): - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + PubKey represents the public key associated with the + address for which to - Note: this functionality is not currently available in - the official + prove the ownership + signature: + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - protobuf release, and it is not used for type URLs - beginning with + protocol buffer message. This string must + contain at least - type.googleapis.com. + one "/" character. The last segment of the URL's + path must represent + the fully qualified name of the type (as in - Schemes other than `http`, `https` (or the empty scheme) - might be + `path/google.protobuf.Duration`). The name + should be in a canonical form - used with implementation specific semantics. - value: - type: string - format: byte - description: >- - Must be a valid serialized protocol buffer of the above - specified type. - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + (e.g., leading "." is not accepted). - URL that describes the type of the serialized message. + In practice, teams usually precompile into the + binary all types that they - Protobuf library provides support to pack/unpack Any values - in the form + expect it to use in the context of Any. However, + for URLs which use the - of utility functions or additional generated methods of the - Any type. + scheme `http`, `https`, or no scheme, one can + optionally set up a type + server that maps type URLs to message + definitions as follows: - Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + * If no scheme is provided, `https` is assumed. - Example 2: Pack and unpack a message in Java. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup + results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Note: this functionality is not currently + available in the official - Example 3: Pack and unpack a message in Python. + protobuf release, and it is not used for type + URLs beginning with - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + type.googleapis.com. - Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := ptypes.MarshalAny(foo) - ... - foo := &pb.Foo{} - if err := ptypes.UnmarshalAny(any, foo); err != nil { - ... - } + Schemes other than `http`, `https` (or the empty + scheme) might be - The pack methods provided by protobuf library will by - default use + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of + the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol + buffer message along with a - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + URL that describes the type of the serialized + message. - methods only use the fully qualified type name after the - last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + Protobuf library provides support to pack/unpack Any + values in the form - name "y.z". + of utility functions or additional generated methods + of the Any type. + Example 1: Pack and unpack a message in C++. - JSON + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - ==== + Example 2: Pack and unpack a message in Java. - The JSON representation of an `Any` value uses the regular + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - representation of the deserialized, embedded message, with - an + Example 3: Pack and unpack a message in Python. - additional field `@type` which contains the type URL. - Example: + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + Example 4: Pack and unpack a message in Go - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } - If the embedded message type is well-known and has a custom - JSON + The pack methods provided by protobuf library will + by default use - representation, that representation will be embedded adding - a field + 'type.googleapis.com/full.type.name' as the type URL + and the unpack - `value` which holds the custom JSON in addition to the - `@type` + methods only use the fully qualified type name after + the last '/' - field. Example (for message [google.protobuf.Duration][]): + in the type URL, for example "foo.bar.com/x/y.z" + will yield type - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: user - description: >- - (optional) User represents the Desmos address of the user to which - search + name "y.z". - the link for. - in: query - required: false - type: string - - name: chain_name - description: >- - (optional) ChainName contains the name of the chain to which search - the - link for. Used only if user is also set. - in: query - required: false - type: string - - name: target - description: >- - (optional) Target must contain the external address to which query - the link - for. Used only if chain name is also set. - in: query - required: false - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + JSON - It is less efficient than using key. Only one of offset or key - should + ==== - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. + The JSON representation of an `Any` value uses the + regular - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + representation of the deserialized, embedded + message, with an - a count of the total number of items available for pagination in - UIs. + additional field `@type` which contains the type + URL. Example: - count_total is only respected when offset is used. It is ignored - when key + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - is set. - in: query - required: false - type: boolean - format: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + If the embedded message type is well-known and has a + custom JSON - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - format: boolean - tags: - - Query - /desmos/profiles/v3/chain-links/owners: - get: - summary: >- - ChainLinkOwners queries for the owners of chain links, optionally - searching + representation, that representation will be embedded + adding a field - for a specific chain name and external address - operationId: ChainLinkOwners - responses: - '200': - description: A successful response. - schema: - type: object - properties: - owners: - type: array - items: - type: object - properties: - user: - type: string - chain_name: - type: string - target: + `value` which holds the custom JSON in addition to + the `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + Signature represents the hex-encoded signature of + the PlainText value + plain_text: + type: string + title: >- + PlainText represents the hex-encoded value signed in + order to produce the + + Signature + chain_config: + title: >- + ChainConfig contains the configuration of the external + chain + type: object + properties: + name: + type: string + description: >- + ChainConfig contains the data of the chain with which + the link is made. + creation_time: type: string + format: date-time + title: >- + CreationTime represents the time in which the link has + been created title: >- - ChainLinkOwnerDetails contains the details of a single chain - link owner - title: Addresses of the chain links owners + ChainLink contains the data representing either an inter- or + cross- chain + + link + title: >- + List of default addresses, each one represented by the + associated chain + + link pagination: type: object properties: @@ -2963,12 +2974,9 @@ paths: repeated Bar results = 1; PageResponse page = 2; } - title: Pagination defines the pagination response - description: >- - QueryChainLinkOwnersResponse contains the data returned by the - request - - allowing to get chain link owners. + title: |- + QueryDefaultExternalAddressesResponse is the response type for + Query/DefaultExternalAddresses RPC method default: description: An unexpected error response schema: @@ -3159,21 +3167,13 @@ paths: "value": "1.212s" } parameters: - - name: chain_name - description: >- - (Optional) Chain name to search link owners of. If not specified, - all - - links stored will be searched instead. + - name: owner + description: (Optional) Owner for which to query the default addresses. in: query required: false type: string - - name: target - description: >- - (Optional) External address to search for. This will only be used if - the - - chain name is specified as well. + - name: chain_name + description: (Optional) Chain name to query the default address for. in: query required: false type: string @@ -12608,11 +12608,6 @@ definitions: type: string title: User defines the destination profile address to link address: - title: >- - Address contains the data of the external chain address to be - connected - - with the Desmos profile type: object properties: type_url: @@ -12771,16 +12766,16 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + title: >- + Address contains the data of the external chain address to be + connected + + with the Desmos profile proof: title: Proof contains the ownership proof of the external chain address type: object properties: pub_key: - title: >- - PubKey represents the public key associated with the address for - which to - - prove the ownership type: object properties: type_url: @@ -12945,10 +12940,12 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - signature: title: >- - Signature represents the hex-encoded signature of the PlainText - value + PubKey represents the public key associated with the address for + which to + + prove the ownership + signature: type: object properties: type_url: @@ -13113,6 +13110,9 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + title: >- + Signature represents the hex-encoded signature of the PlainText + value plain_text: type: string title: >- @@ -13417,11 +13417,6 @@ definitions: type: object properties: pub_key: - title: >- - PubKey represents the public key associated with the address for which - to - - prove the ownership type: object properties: type_url: @@ -13580,8 +13575,12 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + title: >- + PubKey represents the public key associated with the address for which + to + + prove the ownership signature: - title: Signature represents the hex-encoded signature of the PlainText value type: object properties: type_url: @@ -13740,6 +13739,7 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + title: Signature represents the hex-encoded signature of the PlainText value plain_text: type: string title: >- @@ -13881,6 +13881,7 @@ definitions: link owner title: Addresses of the application links owners pagination: + title: Pagination defines the pagination response type: object properties: next_key: @@ -13905,7 +13906,6 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - title: Pagination defines the pagination response description: >- QueryApplicationLinkOwnersResponse contains the data returned by the request @@ -14037,6 +14037,7 @@ definitions: ApplicationLink contains the data of a link to a centralized application pagination: + title: Pagination defines the pagination response type: object properties: next_key: @@ -14061,7 +14062,6 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - title: Pagination defines the pagination response title: |- QueryApplicationLinksResponse represents the response to the query used to get the application links for a specific user @@ -14084,6 +14084,7 @@ definitions: owner title: Addresses of the chain links owners pagination: + title: Pagination defines the pagination response type: object properties: next_key: @@ -14108,7 +14109,6 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - title: Pagination defines the pagination response description: |- QueryChainLinkOwnersResponse contains the data returned by the request allowing to get chain link owners. @@ -14134,11 +14134,6 @@ definitions: type: string title: User defines the destination profile address to link address: - title: >- - Address contains the data of the external chain address to be - connected - - with the Desmos profile type: object properties: type_url: @@ -14307,16 +14302,16 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + title: >- + Address contains the data of the external chain address to be + connected + + with the Desmos profile proof: title: Proof contains the ownership proof of the external chain address type: object properties: pub_key: - title: >- - PubKey represents the public key associated with the address - for which to - - prove the ownership type: object properties: type_url: @@ -14491,10 +14486,12 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - signature: title: >- - Signature represents the hex-encoded signature of the - PlainText value + PubKey represents the public key associated with the address + for which to + + prove the ownership + signature: type: object properties: type_url: @@ -14669,6 +14666,9 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + title: >- + Signature represents the hex-encoded signature of the + PlainText value plain_text: type: string title: >- @@ -14697,6 +14697,7 @@ definitions: link pagination: + title: Pagination defines the pagination response type: object properties: next_key: @@ -14721,7 +14722,6 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - title: Pagination defines the pagination response description: |- QueryChainLinksResponse is the response type for the Query/ChainLinks RPC method. @@ -14737,11 +14737,6 @@ definitions: type: string title: User defines the destination profile address to link address: - title: >- - Address contains the data of the external chain address to be - connected - - with the Desmos profile type: object properties: type_url: @@ -14910,16 +14905,16 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + title: >- + Address contains the data of the external chain address to be + connected + + with the Desmos profile proof: title: Proof contains the ownership proof of the external chain address type: object properties: pub_key: - title: >- - PubKey represents the public key associated with the address - for which to - - prove the ownership type: object properties: type_url: @@ -15094,10 +15089,12 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - signature: title: >- - Signature represents the hex-encoded signature of the - PlainText value + PubKey represents the public key associated with the address + for which to + + prove the ownership + signature: type: object properties: type_url: @@ -15272,6 +15269,9 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + title: >- + Signature represents the hex-encoded signature of the + PlainText value plain_text: type: string title: >- From 85b1ea1eee8f67ae48359ea749681393dd62e329 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Fri, 15 Jul 2022 12:57:39 +0200 Subject: [PATCH 41/64] removed useless events attributes Signed-off-by: Riccardo Montagnin --- x/profiles/types/events.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/x/profiles/types/events.go b/x/profiles/types/events.go index c8251345df..26aeebd6f5 100644 --- a/x/profiles/types/events.go +++ b/x/profiles/types/events.go @@ -26,9 +26,6 @@ const ( 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" AttributeKeyChainLinkExternalAddress = "chain_link_external_address" AttributeKeyChainLinkOwner = "chain_link_owner" AttributeKeyChainLinkChainName = "chain_link_chain_name" @@ -42,7 +39,6 @@ const ( AttributeKeyOracleID = "oracle_id" AttributeKeyClientID = "client_id" AttributeKeyRequestID = "request_id" - AttributeKeyRequestKey = "request_key" AttributeKeyResolveStatus = "resolve_status" AttributeKeyAck = "acknowledgement" AttributeKeyAckError = "error" From 5dfb0e54f2be03e4dce7eab08d2f10eac3b55a39 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 18 Jul 2022 10:58:20 +0800 Subject: [PATCH 42/64] Update x/profiles/keeper/keeper_chain_links.go Co-authored-by: Riccardo Montagnin --- x/profiles/keeper/keeper_chain_links.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/x/profiles/keeper/keeper_chain_links.go b/x/profiles/keeper/keeper_chain_links.go index 51446671a7..178f99e283 100644 --- a/x/profiles/keeper/keeper_chain_links.go +++ b/x/profiles/keeper/keeper_chain_links.go @@ -121,17 +121,16 @@ func (k Keeper) getOldestUserChainByChain(ctx sdk.Context, owner, chainName stri func (k Keeper) updateOwnerDefaultExternalAddress(ctx sdk.Context, owner, chainName string) { store := ctx.KVStore(k.storeKey) link, found := k.getOldestUserChainByChain(ctx, owner, chainName) - if found { - srcAddrData, err := types.UnpackAddressData(k.cdc, link.Address) - if err != nil { - panic(err) - } - k.SaveDefaultExternalAddress(ctx, owner, chainName, srcAddrData.GetValue()) - return + if !found { + // If the owner has no chain link on the given chain name, then delete the key + store.Delete(types.DefaultExternalAddressKey(owner, chainName)) } - - // If owner has no chain link on the given chain name, then delete the key - store.Delete(types.DefaultExternalAddressKey(owner, chainName)) + + srcAddrData, err := types.UnpackAddressData(k.cdc, link.Address) + if err != nil { + panic(err) + } + k.SaveDefaultExternalAddress(ctx, owner, chainName, srcAddrData.GetValue()) } // SaveDefaultExternalAddress stores the given address as a default external address From d8caf2ea9aac05f3266cf61cf2e0ec3a38d0ef5f Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 18 Jul 2022 11:25:24 +0800 Subject: [PATCH 43/64] fix: apply suggestions --- x/profiles/keeper/keeper_chain_links.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/x/profiles/keeper/keeper_chain_links.go b/x/profiles/keeper/keeper_chain_links.go index 178f99e283..cfdfaced83 100644 --- a/x/profiles/keeper/keeper_chain_links.go +++ b/x/profiles/keeper/keeper_chain_links.go @@ -95,9 +95,9 @@ func (k Keeper) DeleteAllUserChainLinks(ctx sdk.Context, user string) { } } -// getOldestUserChainByChain returns the oldest chain link of the given owner associated to the given chain name -// If the such the chain link is not exists, return false instead. -func (k Keeper) getOldestUserChainByChain(ctx sdk.Context, owner, chainName string) (types.ChainLink, bool) { +// getOldestUserChainLink returns the oldest chain link of the given owner associated to the given chain name. +// If such chain link does not exist, returns false instead. +func (k Keeper) getOldestUserChainLink(ctx sdk.Context, owner, chainName string) (types.ChainLink, bool) { var oldestLink types.ChainLink found := false k.IterateUserChainLinksByChain(ctx, owner, chainName, func(link types.ChainLink) (stop bool) { @@ -120,12 +120,12 @@ func (k Keeper) getOldestUserChainByChain(ctx sdk.Context, owner, chainName stri // It must be performed after deleting the default external address chain link func (k Keeper) updateOwnerDefaultExternalAddress(ctx sdk.Context, owner, chainName string) { store := ctx.KVStore(k.storeKey) - link, found := k.getOldestUserChainByChain(ctx, owner, chainName) + link, found := k.getOldestUserChainLink(ctx, owner, chainName) if !found { // If the owner has no chain link on the given chain name, then delete the key store.Delete(types.DefaultExternalAddressKey(owner, chainName)) } - + srcAddrData, err := types.UnpackAddressData(k.cdc, link.Address) if err != nil { panic(err) From 8f8b85da21cc6f0f66c88f788cee5cda0ed1b64c Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 18 Jul 2022 11:32:33 +0800 Subject: [PATCH 44/64] fix: apply suggestions and lint --- x/profiles/keeper/grpc_query.go | 3 ++- x/profiles/keeper/keeper_chain_links.go | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/x/profiles/keeper/grpc_query.go b/x/profiles/keeper/grpc_query.go index e68871627b..a1e36eea75 100644 --- a/x/profiles/keeper/grpc_query.go +++ b/x/profiles/keeper/grpc_query.go @@ -176,7 +176,8 @@ func (k Keeper) DefaultExternalAddresses(ctx context.Context, request *types.Que defaultStore := prefix.NewStore(store, defaultPrefix) pageRes, err := query.Paginate(defaultStore, request.Pagination, func(key []byte, value []byte) error { // Re-add the prefix because the prefix store trims it out, and we need it to get the data - keyWithPrefix := append(defaultPrefix, key...) + keyWithPrefix := append([]byte(nil), defaultPrefix...) + keyWithPrefix = append(defaultPrefix, key...) owner, chainName := types.GetDefaultExternalAddressData(keyWithPrefix) link, found := k.GetChainLink(sdkCtx, owner, chainName, string(value)) if !found { diff --git a/x/profiles/keeper/keeper_chain_links.go b/x/profiles/keeper/keeper_chain_links.go index cfdfaced83..6e0a540522 100644 --- a/x/profiles/keeper/keeper_chain_links.go +++ b/x/profiles/keeper/keeper_chain_links.go @@ -148,9 +148,6 @@ func (k Keeper) HasDefaultExternalAddress(ctx sdk.Context, owner, chainName stri // isDefaultExternalAddress tells whether the given chain link is a default external address or not func (k Keeper) isDefaultExternalAddress(ctx sdk.Context, link types.ChainLink) bool { store := ctx.KVStore(k.storeKey) - if !k.HasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { - return false - } addressBz := store.Get(types.DefaultExternalAddressKey(link.User, link.ChainConfig.Name)) return string(addressBz) == link.GetAddressData().GetValue() } From ab96ff16519f83682ce0231a79439c07cdc17159 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 18 Jul 2022 12:09:29 +0800 Subject: [PATCH 45/64] fix: make lint --- x/profiles/keeper/grpc_query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/profiles/keeper/grpc_query.go b/x/profiles/keeper/grpc_query.go index a1e36eea75..c8f331839c 100644 --- a/x/profiles/keeper/grpc_query.go +++ b/x/profiles/keeper/grpc_query.go @@ -177,7 +177,7 @@ func (k Keeper) DefaultExternalAddresses(ctx context.Context, request *types.Que pageRes, err := query.Paginate(defaultStore, request.Pagination, func(key []byte, value []byte) error { // Re-add the prefix because the prefix store trims it out, and we need it to get the data keyWithPrefix := append([]byte(nil), defaultPrefix...) - keyWithPrefix = append(defaultPrefix, key...) + keyWithPrefix = append(keyWithPrefix, key...) owner, chainName := types.GetDefaultExternalAddressData(keyWithPrefix) link, found := k.GetChainLink(sdkCtx, owner, chainName, string(value)) if !found { From b3fb4a40e322d7f927e92dcc161f30aca6db252c Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 18 Jul 2022 13:24:15 +0800 Subject: [PATCH 46/64] docs: added missing docs --- x/profiles/keeper/msg_server_app_link.go | 1 + x/profiles/keeper/msg_server_chain_link.go | 3 +++ x/profiles/keeper/msg_server_dtag_transfers.go | 4 ++++ x/profiles/keeper/msgs_server_profile.go | 2 ++ 4 files changed, 10 insertions(+) diff --git a/x/profiles/keeper/msg_server_app_link.go b/x/profiles/keeper/msg_server_app_link.go index 4101779c6b..49252eacd7 100644 --- a/x/profiles/keeper/msg_server_app_link.go +++ b/x/profiles/keeper/msg_server_app_link.go @@ -65,6 +65,7 @@ func (k Keeper) LinkApplication( return &types.MsgLinkApplicationResponse{}, nil } +// UnlinkApplication defines a rpc method for MsgUnlinkApplication func (k msgServer) UnlinkApplication( goCtx context.Context, msg *types.MsgUnlinkApplication, ) (*types.MsgUnlinkApplicationResponse, error) { diff --git a/x/profiles/keeper/msg_server_chain_link.go b/x/profiles/keeper/msg_server_chain_link.go index 970ab79e51..0d9c79eaf5 100644 --- a/x/profiles/keeper/msg_server_chain_link.go +++ b/x/profiles/keeper/msg_server_chain_link.go @@ -11,6 +11,7 @@ import ( "github.com/desmos-labs/desmos/v4/x/profiles/types" ) +// LinkChainAccount defines a rpc method for MsgLinkChainAccount func (k msgServer) LinkChainAccount(goCtx context.Context, msg *types.MsgLinkChainAccount) (*types.MsgLinkChainAccountResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -49,6 +50,7 @@ func (k msgServer) LinkChainAccount(goCtx context.Context, msg *types.MsgLinkCha return &types.MsgLinkChainAccountResponse{}, nil } +// UnlinkChainAccount defines a rpc method for MsgUnlinkChainAccount func (k msgServer) UnlinkChainAccount(goCtx context.Context, msg *types.MsgUnlinkChainAccount) (*types.MsgUnlinkChainAccountResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -83,6 +85,7 @@ func (k msgServer) UnlinkChainAccount(goCtx context.Context, msg *types.MsgUnlin return &types.MsgUnlinkChainAccountResponse{}, nil } +// SetDefaultExternalAddress defines a rpc method for MsgSetDefaultExternalAddress func (k msgServer) SetDefaultExternalAddress(goCtx context.Context, msg *types.MsgSetDefaultExternalAddress) (*types.MsgSetDefaultExternalAddressResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) diff --git a/x/profiles/keeper/msg_server_dtag_transfers.go b/x/profiles/keeper/msg_server_dtag_transfers.go index 0172a92f4a..afe386de6b 100644 --- a/x/profiles/keeper/msg_server_dtag_transfers.go +++ b/x/profiles/keeper/msg_server_dtag_transfers.go @@ -10,6 +10,7 @@ import ( "github.com/desmos-labs/desmos/v4/x/profiles/types" ) +// RequestDTagTransfer defines a rpc method for MsgRequestDTagTransfer func (k msgServer) RequestDTagTransfer(goCtx context.Context, msg *types.MsgRequestDTagTransfer) (*types.MsgRequestDTagTransferResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -60,6 +61,7 @@ func (k msgServer) RequestDTagTransfer(goCtx context.Context, msg *types.MsgRequ return &types.MsgRequestDTagTransferResponse{}, nil } +// CancelDTagTransferRequest defines a rpc method for MsgCancelDTagTransferRequest func (k msgServer) CancelDTagTransferRequest(goCtx context.Context, msg *types.MsgCancelDTagTransferRequest) (*types.MsgCancelDTagTransferRequestResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -88,6 +90,7 @@ func (k msgServer) CancelDTagTransferRequest(goCtx context.Context, msg *types.M return &types.MsgCancelDTagTransferRequestResponse{}, nil } +// AcceptDTagTransferRequest defines a rpc method for MsgAcceptDTagTransferRequest func (k msgServer) AcceptDTagTransferRequest(goCtx context.Context, msg *types.MsgAcceptDTagTransferRequest) (*types.MsgAcceptDTagTransferRequestResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -195,6 +198,7 @@ func (k msgServer) AcceptDTagTransferRequest(goCtx context.Context, msg *types.M return &types.MsgAcceptDTagTransferRequestResponse{}, nil } +// RefuseDTagTransferRequest defines a rpc method for MsgRefuseDTagTransferRequest func (k msgServer) RefuseDTagTransferRequest(goCtx context.Context, msg *types.MsgRefuseDTagTransferRequest) (*types.MsgRefuseDTagTransferRequestResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) diff --git a/x/profiles/keeper/msgs_server_profile.go b/x/profiles/keeper/msgs_server_profile.go index 6aefb690b3..d399100b4e 100644 --- a/x/profiles/keeper/msgs_server_profile.go +++ b/x/profiles/keeper/msgs_server_profile.go @@ -22,6 +22,7 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { return &msgServer{keeper} } +// SaveProfile defines a rpc method for MsgSaveProfile func (k msgServer) SaveProfile(goCtx context.Context, msg *types.MsgSaveProfile) (*types.MsgSaveProfileResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -84,6 +85,7 @@ func (k msgServer) SaveProfile(goCtx context.Context, msg *types.MsgSaveProfile) return &types.MsgSaveProfileResponse{}, nil } +// DeleteProfile defines a rpc method for MsgDeleteProfile func (k msgServer) DeleteProfile(goCtx context.Context, msg *types.MsgDeleteProfile) (*types.MsgDeleteProfileResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) From cae5353f499b674114065d1e60a201b8562d061f Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 18 Jul 2022 17:48:50 +0800 Subject: [PATCH 47/64] fix: applied suggestions --- x/profiles/keeper/keeper_chain_links.go | 12 ++ x/profiles/keeper/keeper_chain_links_test.go | 145 ++++++++++++++++++ x/profiles/keeper/msg_server_chain_link.go | 9 -- .../keeper/msg_server_chain_link_test.go | 15 -- 4 files changed, 157 insertions(+), 24 deletions(-) diff --git a/x/profiles/keeper/keeper_chain_links.go b/x/profiles/keeper/keeper_chain_links.go index 6e0a540522..4571d92427 100644 --- a/x/profiles/keeper/keeper_chain_links.go +++ b/x/profiles/keeper/keeper_chain_links.go @@ -8,6 +8,7 @@ import ( ) // SaveChainLink stores the given chain link +// The first chain link of each chain for the owner will be set as default external address // Chain links are stored using two keys: // 1. ChainLinkStoreKey (user + chain name + target) -> types.ChainLink // 2. ChainLinkOwnerKey (chain name + target + user) -> 0x01 @@ -50,6 +51,11 @@ func (k Keeper) SaveChainLink(ctx sdk.Context, link types.ChainLink) error { store.Set(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, target), types.MustMarshalChainLink(k.cdc, link)) store.Set(types.ChainLinkOwnerKey(link.ChainConfig.Name, target, link.User), []byte{0x01}) + // Set the link as default external address if there is no default external address + if !k.HasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { + k.SaveDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name, srcAddrData.GetValue()) + } + k.AfterChainLinkSaved(ctx, link) return nil } @@ -79,6 +85,11 @@ func (k Keeper) DeleteChainLink(ctx sdk.Context, link types.ChainLink) { store.Delete(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, link.GetAddressData().GetValue())) store.Delete(types.ChainLinkOwnerKey(link.ChainConfig.Name, link.GetAddressData().GetValue(), link.User)) + // Update the default external address to be the oldest link if the deleted link is default exnternal address + if k.isDefaultExternalAddress(ctx, link) { + k.updateOwnerDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) + } + k.AfterChainLinkDeleted(ctx, link) } @@ -124,6 +135,7 @@ func (k Keeper) updateOwnerDefaultExternalAddress(ctx sdk.Context, owner, chainN if !found { // If the owner has no chain link on the given chain name, then delete the key store.Delete(types.DefaultExternalAddressKey(owner, chainName)) + return } srcAddrData, err := types.UnpackAddressData(k.cdc, link.Address) diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index 0e012ec751..48cb6446df 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -188,6 +188,63 @@ func (suite *KeeperTestSuite) TestKeeper_SaveChainLink() { ext.GetAddress().String(), "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", ))) + + // Check the default external address + external := store.Get(types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")) + suite.Require().True(string(external) == ext.GetAddress().String()) + }, + }, + { + name: "valid conditions return no error - default address no overwritten", + store: func(ctx sdk.Context) { + profile := profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x") + err := suite.k.SaveProfile(ctx, profile) + suite.Require().NoError(err) + + store := ctx.KVStore(suite.storeKey) + store.Set( + types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos"), + []byte("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), + ) + }, + link: types.NewChainLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + types.NewBech32Address(ext.GetAddress().String(), "cosmos"), + types.NewProof( + ext.GetPubKey(), + profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), + hex.EncodeToString([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), + ), + types.NewChainConfig("cosmos"), + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + ), + shouldErr: false, + check: func(ctx sdk.Context) { + links := suite.k.GetChainLinks(ctx) + suite.Require().Len(links, 1) + suite.Require().Contains(links, types.NewChainLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + types.NewBech32Address(ext.GetAddress().String(), "cosmos"), + types.NewProof( + ext.GetPubKey(), + profilestesting.SingleSignatureProtoFromHex(hex.EncodeToString(ext.Sign([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")))), + hex.EncodeToString([]byte("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x")), + ), + types.NewChainConfig("cosmos"), + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + )) + + // Check the additional keys + store := ctx.KVStore(suite.storeKey) + suite.Require().True(store.Has(types.ChainLinkOwnerKey( + "cosmos", + ext.GetAddress().String(), + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + ))) + + // Check the default external address + external := store.Get(types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")) + suite.Require().True(string(external) == "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns") }, }, } @@ -270,6 +327,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetChainLink() { func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { account := profilestesting.GetChainLinkAccount("cosmos", "cosmos") + secondAccount := profilestesting.GetChainLinkAccount("cosmos", "cosmos") testCases := []struct { name string store func(ctx sdk.Context) @@ -379,6 +437,93 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { account.Bech32Address().GetValue(), "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", ))) + + suite.Require().False(suite.k.HasDefaultExternalAddress(ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos")) + }, + }, + { + name: "proper data delete the link - update default external address", + store: func(ctx sdk.Context) { + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x"))) + err := suite.k.SaveChainLink(ctx, account.GetBech32ChainLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + )) + suite.Require().NoError(err) + err = suite.k.SaveChainLink(ctx, secondAccount.GetBech32ChainLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + )) + suite.Require().NoError(err) + }, + link: account.GetBech32ChainLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + ), + check: func(ctx sdk.Context) { + suite.Require().False(suite.k.HasChainLink(ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + account.Bech32Address().GetValue(), + )) + + // Check the additional keys + store := ctx.KVStore(suite.storeKey) + suite.Require().False(store.Has(types.ChainLinkOwnerKey( + "cosmos", + account.Bech32Address().GetValue(), + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + ))) + + // Check the default external address + suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos")) + external := store.Get(types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")) + suite.Require().True(string(external) == secondAccount.Bech32Address().Value) + }, + }, + { + name: "proper data delete the link - non default external address", + store: func(ctx sdk.Context) { + suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x"))) + err := suite.k.SaveChainLink(ctx, account.GetBech32ChainLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + )) + suite.Require().NoError(err) + + // Set the default external address + store := ctx.KVStore(suite.storeKey) + store.Set( + types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos"), + []byte("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns"), + ) + }, + link: account.GetBech32ChainLink( + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + ), + check: func(ctx sdk.Context) { + suite.Require().False(suite.k.HasChainLink(ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + account.Bech32Address().GetValue(), + )) + + // Check the additional keys + store := ctx.KVStore(suite.storeKey) + suite.Require().False(store.Has(types.ChainLinkOwnerKey( + "cosmos", + account.Bech32Address().GetValue(), + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + ))) + + suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos")) }, }, } diff --git a/x/profiles/keeper/msg_server_chain_link.go b/x/profiles/keeper/msg_server_chain_link.go index 0d9c79eaf5..5cdb4592c4 100644 --- a/x/profiles/keeper/msg_server_chain_link.go +++ b/x/profiles/keeper/msg_server_chain_link.go @@ -26,11 +26,6 @@ func (k msgServer) LinkChainAccount(goCtx context.Context, msg *types.MsgLinkCha return nil, err } - // The first chain link of each chain for the owner will be set as default external address - if !k.HasDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) { - k.SaveDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name, srcAddrData.GetValue()) - } - ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( sdk.EventTypeMessage, @@ -63,10 +58,6 @@ func (k msgServer) UnlinkChainAccount(goCtx context.Context, msg *types.MsgUnlin // Delete the link k.DeleteChainLink(ctx, link) - if k.isDefaultExternalAddress(ctx, link) { - k.updateOwnerDefaultExternalAddress(ctx, link.User, link.ChainConfig.Name) - } - ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( sdk.EventTypeMessage, diff --git a/x/profiles/keeper/msg_server_chain_link_test.go b/x/profiles/keeper/msg_server_chain_link_test.go index 92dc9995ac..460de7dcb0 100644 --- a/x/profiles/keeper/msg_server_chain_link_test.go +++ b/x/profiles/keeper/msg_server_chain_link_test.go @@ -128,11 +128,6 @@ func (suite *KeeperTestSuite) TestMsgServer_LinkChainAccount() { _, found, err := suite.k.GetProfile(ctx, destAddr) suite.Require().NoError(err) suite.Require().True(found) - - // check the default address is set properly - store := ctx.KVStore(suite.storeKey) - defaultAddr := store.Get(types.DefaultExternalAddressKey(destAddr, "cosmos")) - suite.Require().True(true, string(defaultAddr) == srcAddr) }, }, } @@ -201,12 +196,6 @@ func (suite *KeeperTestSuite) TestMsgServer_UnlinkChainAccount() { types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, link.GetAddressData().GetValue()), suite.cdc.MustMarshal(&link), ) - - // Set the default external address - store.Set( - types.DefaultExternalAddressKey(link.ChainConfig.Name, link.User), - []byte(link.GetAddressData().GetValue()), - ) }, msg: types.NewMsgUnlinkChainAccount( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", @@ -229,7 +218,6 @@ func (suite *KeeperTestSuite) TestMsgServer_UnlinkChainAccount() { ), }, check: func(ctx sdk.Context) { - store := ctx.KVStore(suite.storeKey) _, found := suite.k.GetChainLink( ctx, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", @@ -237,9 +225,6 @@ func (suite *KeeperTestSuite) TestMsgServer_UnlinkChainAccount() { "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", ) suite.Require().False(found) - - // Check the default external address is removed properly - suite.Require().False(store.Has(types.DefaultExternalAddressKey("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos"))) }, }, } From dedcdf93fef8994ab0c36d22fe181e1b3fb12c04 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 18 Jul 2022 18:31:12 +0800 Subject: [PATCH 48/64] fix: fix command string --- x/profiles/client/cli/cli_chain_links.go | 8 ++++---- x/profiles/client/cli/query.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x/profiles/client/cli/cli_chain_links.go b/x/profiles/client/cli/cli_chain_links.go index 3808051d4e..028e41edfe 100644 --- a/x/profiles/client/cli/cli_chain_links.go +++ b/x/profiles/client/cli/cli_chain_links.go @@ -245,11 +245,11 @@ func GetCmdQueryChainLinkOwners() *cobra.Command { return cmd } -// GetCmdQueryDefaultExternalAddress returns the command allowing to query the default chain links, optionally associated with a owner and chain name -func GetCmdQueryDefaultExternalAddress() *cobra.Command { +// GetCmdQueryDefaultExternalAddresses returns the command allowing to query the default chain links, optionally associated with a owner and chain name +func GetCmdQueryDefaultExternalAddresses() *cobra.Command { cmd := &cobra.Command{ - Use: "default-external-address [[owner]] [[chain_name]]", - Short: "Retrieve all default chain links with optional owner, chain name and pagination", + Use: "default-external-addresses [[owner]] [[chain_name]]", + Short: "Retrieve all default addresses in chain link with optional owner, chain name and pagination", Example: fmt.Sprintf(`%s query profiles chain-link-owners %s query profiles default-external-address --page=2 --limit=100 %s query profiles default-external-address "desmos13p5pamrljhza3fp4es5m3llgmnde5fzcpq6nud" diff --git a/x/profiles/client/cli/query.go b/x/profiles/client/cli/query.go index 26ad2141f9..b7b06dce95 100644 --- a/x/profiles/client/cli/query.go +++ b/x/profiles/client/cli/query.go @@ -25,7 +25,7 @@ func GetQueryCmd() *cobra.Command { GetCmdQueryParams(), GetCmdQueryChainLinks(), GetCmdQueryChainLinkOwners(), - GetCmdQueryDefaultExternalAddress(), + GetCmdQueryDefaultExternalAddresses(), GetCmdQueryApplicationsLinks(), GetCmdQueryApplicationLinkOwners(), ) From d89b31b0278c65902f149160814c045f0f595c01 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 18 Jul 2022 19:14:17 +0800 Subject: [PATCH 49/64] docs: update specs --- x/profiles/spec/01-overview.md | 3 ++ x/profiles/spec/02-concepts.md | 3 ++ x/profiles/spec/03-state.md | 5 ++ x/profiles/spec/04-messages.md | 9 ++++ x/profiles/spec/05-events.md | 11 ++++ x/profiles/spec/07-client.md | 92 ++++++++++++++++++++++++++++++++++ 6 files changed, 123 insertions(+) diff --git a/x/profiles/spec/01-overview.md b/x/profiles/spec/01-overview.md index abb1162f99..ca9b695593 100644 --- a/x/profiles/spec/01-overview.md +++ b/x/profiles/spec/01-overview.md @@ -17,11 +17,13 @@ This module allows the creation and management of an on-chain social profile tha - [Profile](02-concepts.md#profile) - [DTag Transfer Request](02-concepts.md#dtag-transfer-request) - [Chain Link](02-concepts.md#chain-link) + - [Default External Address](02-concepts.md#default-external-address) - [Application Link](02-concepts.md#application-link) 2. **[State](03-state.md)** - [Profile](03-state.md#profile) - [DTag Transfer Request](03-state.md#dtag-transfer-request) - [Chain Link](03-state.md#chain-link) + - [Default External Address](03-state.md#default-external-address) - [Application Link](03-state.md#application-link) - [IBC Port](03-state.md#ibc-port) 3. **[Msg Service](04-messages.md)** @@ -33,6 +35,7 @@ This module allows the creation and management of an on-chain social profile tha - [Msg/RefuseDTagTransferRequest](04-messages.md#msgrefusedtagtransferrequest) - [Msg/LinkChainAccount](04-messages.md#msglinkchainaccount) - [Msg/UnlinkChainAccount](04-messages.md#msgunlinkchainaccount) + - [Msg/SetDefaultExternalAddress](04-messages.md#msgsetdefaultexternaladdress) - [Msg/LinkApplication](04-messages.md#msglinkapplication) - [Msg/UnlinkApplication](04-messages.md#msgunlinkapplication) 4. **[Events](05-events.md)** diff --git a/x/profiles/spec/02-concepts.md b/x/profiles/spec/02-concepts.md index 53232362b1..0b0a65e6db 100644 --- a/x/profiles/spec/02-concepts.md +++ b/x/profiles/spec/02-concepts.md @@ -119,6 +119,9 @@ This will start an interactive prompt session allowing you to generate the prope This will effectively link your Desmos profile to the external chain address. The required argument is the (absolute) path to the file generated using the `create-chain-link-json` command. +## Default External Address +A default external address represents a default chain link which makes dealing with a single chain link per chain for a profile easier. Each chain must have a chain link as a default external address for interaction, it will pick up the oldest chain link as a default external address if the link of the default external address is unlinked. + ## Application Link An application link (abbr. _app link_) represents a link to an external (and possibly centralized) application. Such links are one of the easiest way for Desmos profile owners to verify they are trustworthy: if you have a lot of followers on Twitter, connecting your Desmos profile to your Twitter account will make it easier for users to make sure no other people is trying to impersonate you. diff --git a/x/profiles/spec/03-state.md b/x/profiles/spec/03-state.md index 780eefbe62..b6e381faef 100644 --- a/x/profiles/spec/03-state.md +++ b/x/profiles/spec/03-state.md @@ -25,6 +25,11 @@ To make it possible to query chain links given a user address or given a chain n * Chain Link: `0x12 | User address | Chain name | External address | -> ProtocolBuffer(ChainLink)` * Chain Link Owner: `0x15 | ChainName | 0x00 | External address | 0x00 | User address | -> 0x01 ` +## Default External Address +An external address to a spcified chain is stored using owner address and chain name as the key, which allows to easily query all the default addresses: + +* Default External Address: `0x18 | Owner address | Chain name | -> bytes(ExternalAddress)` + ## Application Link Storing a single application link requires the usage of three different keys to allow for the following queries: * application links of a user, given their address; diff --git a/x/profiles/spec/04-messages.md b/x/profiles/spec/04-messages.md index abd07f598a..e898f0b6ba 100644 --- a/x/profiles/spec/04-messages.md +++ b/x/profiles/spec/04-messages.md @@ -87,6 +87,15 @@ https://github.com/desmos-labs/desmos/blob/v4.1.0/proto/desmos/profiles/v2/msgs_ It's expected to fail if the chain link does not exist. +## Msg/SetDefaultExternalAddress +A new default external address can be set using `MsgSetDefaultExternalAddress`. + +```js reference +TODO: update it after upgrading +``` + +It's expected to fail if the chain link does not exist. + ## Msg/LinkApplication A new application link can be created using the `MsgLinkApplication` diff --git a/x/profiles/spec/05-events.md b/x/profiles/spec/05-events.md index 53d475d7bf..fbaa6f2eb6 100644 --- a/x/profiles/spec/05-events.md +++ b/x/profiles/spec/05-events.md @@ -97,6 +97,17 @@ The profiles module emits the following events: | message | action | desmos.profiles.v2.MsgUnlinkChainAccount | | message | sender | {userAddress} | +## MsgSetDefaultExternalAddress + +| **Type** | **Attribute Key** | **Attribute Value** | +|:-----------------------------|:----------------------------|:----------------------------------------| +| set_default_external_address | chain_link_chain_name | {chainName} | +| set_default_external_address | chain_link_external_address | {externalAddress} | +| set_default_external_address | chain_link_owner | {chainLinkOwner} | +| message | module | profiles | +| message | action | desmos.profiles.v3.MsgSetDefaultAddress | +| message | sender | {userAddress} | + ## MsgLinkApplication | **Type** | **Attribute Key** | **Attribute Value** | diff --git a/x/profiles/spec/07-client.md b/x/profiles/spec/07-client.md index 89b71c48ff..fe29d8dabb 100644 --- a/x/profiles/spec/07-client.md +++ b/x/profiles/spec/07-client.md @@ -116,6 +116,46 @@ pagination: total: "0" ``` +#### default-external-addresses +The `default-external-addresses` command allows users to query for default external addresses in chain link optionally specifying an owner address and a chain name. + +```bash +desmos query profiles default-external-addresses [[owner]] [[chain_name]] [flags] +``` + +**Notes** +- The `chain_name` paremeter will only be used if the `owner` is specified + +Example: +```bash +desmos query profiles default-external-address desmos1evj20rymftvecmgn8t0xv700wkjlgucwfy4f0c cosmos +``` + +Example Output: +```yaml +links: +- address: + '@type': /desmos.profiles.v3.Bech32Address + prefix: cosmos + value: cosmos13n9wek2ktpxhpgfrd39zlaqaeahxuyusxrsfvn + chain_config: + name: cosmos + creation_time: "2022-07-18T10:07:51.899288600Z" + proof: + plain_text: 6465736d6f733165766a323072796d66747665636d676e3874307876373030776b6a6c67756377667934663063 + pub_key: + '@type': /cosmos.crypto.secp256k1.PubKey + key: AqYZhHKaeBcrYktZEvor/SUDlHCkv5JBplaG2vc2bvfS + signature: + '@type': /desmos.profiles.v3.SingleSignatureData + mode: SIGN_MODE_DIRECT + signature: 3yCU8/HKv7Vn0sf7HB+AhV/hK37DCBAkQkXdruaFSvMjRZB1XrYkpKWZVi+xnhSenc1p951Q1058rrYjuNCk9g== + user: desmos1evj20rymftvecmgn8t0xv700wkjlgucwfy4f0c +pagination: + next_key: null + total: "0" +``` + #### app-links The `app-links` allows users to query application links optionally specifying a user, an application name and a username. @@ -298,6 +338,18 @@ Example: desmos tx profiles unlink-chain "cosmos" cosmos18xnmlzqrqr6zt526pnczxe65zk3f4xgmndpxn2` ``` +#### set-default-external-address +The `set-default-external-address` allows user to set a default external address. + +```bash +set-default-external-address [chain-name] [target] +``` + +Example: +```bash +desmos tx profiles set-default-external-address "cosmos" cosmos18xnmlzqrqr6zt526pnczxe65zk3f4xgmndpxn2 +``` + #### link-app The `link-app` command allows users to link an external app account to their Desmos profile. @@ -473,6 +525,46 @@ Example Output: } ``` +### DefaultExternalAddresses +The `DefaultExternalAddresses` endpoint allows user to query for external default address optionally specifying an owner and chain name. + +```bash +desmos.profiles.v2.Query/desmos.profiles.v3.Query/DefaultExternalAddresses +``` + +**Notes** +- The `chainName` parameter will only be used if the `owner` one is specified + +Example +```bash +grpcurl -plaintext \ + -d '{"owner": "desmos1evj20rymftvecmgn8t0xv700wkjlgucwfy4f0c", "chainName": "cosmos"}' localhost:9090 desmos.profiles.v3.Query/DefaultExternalAddresses +``` + +Example Output: +```json +{ + "links": [ + { + "user": "desmos1evj20rymftvecmgn8t0xv700wkjlgucwfy4f0c", + "address": {"@type":"/desmos.profiles.v3.Bech32Address","prefix":"cosmos","value":"cosmos13n9wek2ktpxhpgfrd39zlaqaeahxuyusxrsfvn"}, + "proof": { + "pubKey": {"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AqYZhHKaeBcrYktZEvor/SUDlHCkv5JBplaG2vc2bvfS"}, + "signature": {"@type":"/desmos.profiles.v3.SingleSignatureData","mode":"SIGN_MODE_DIRECT","signature":"3yCU8/HKv7Vn0sf7HB+AhV/hK37DCBAkQkXdruaFSvMjRZB1XrYkpKWZVi+xnhSenc1p951Q1058rrYjuNCk9g=="}, + "plainText": "6465736d6f733165766a323072796d66747665636d676e3874307876373030776b6a6c67756377667934663063" + }, + "chainConfig": { + "name": "cosmos" + }, + "creationTime": "2022-07-18T10:07:51.899288600Z" + } + ], + "pagination": { + "total": "1" + } +} +``` + ### ApplicationLinks The `ApplicationLinks` endpoint allows users to query for application links optionally specifying a user, application name and username. From fae66a1b00ec9803ba520e6290fe7eff7ed7576d Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 19 Jul 2022 14:24:17 +0800 Subject: [PATCH 50/64] Update x/profiles/keeper/keeper_chain_links_test.go Co-authored-by: Riccardo Montagnin --- x/profiles/keeper/keeper_chain_links_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index 48cb6446df..584f298d9c 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -438,9 +438,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", ))) - suite.Require().False(suite.k.HasDefaultExternalAddress(ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos")) + suite.Require().False(suite.k.HasDefaultExternalAddress(ctx, "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")) }, }, { From d30eef01ea7604e3918a0af373b5e76cae76bb61 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 19 Jul 2022 14:24:28 +0800 Subject: [PATCH 51/64] Update x/profiles/keeper/keeper_chain_links_test.go Co-authored-by: Riccardo Montagnin --- x/profiles/keeper/keeper_chain_links_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index 584f298d9c..667a6ea10c 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -476,9 +476,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { ))) // Check the default external address - suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos")) + suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")) external := store.Get(types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")) suite.Require().True(string(external) == secondAccount.Bech32Address().Value) }, From 9117f7e77c7036f3f9a7a7ff46276e4ee846bce3 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 19 Jul 2022 14:24:41 +0800 Subject: [PATCH 52/64] Update x/profiles/keeper/keeper_chain_links_test.go Co-authored-by: Riccardo Montagnin --- x/profiles/keeper/keeper_chain_links_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index 667a6ea10c..6dffe6d7ef 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -517,9 +517,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteChainLink() { "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", ))) - suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, - "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", - "cosmos")) + suite.Require().True(suite.k.HasDefaultExternalAddress(ctx, "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")) }, }, } From 5f158ada7068eedd5bbfd59d1fdd4e21862f88c8 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 19 Jul 2022 14:24:48 +0800 Subject: [PATCH 53/64] Update x/profiles/keeper/keeper_chain_links_test.go Co-authored-by: Riccardo Montagnin --- x/profiles/keeper/keeper_chain_links_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index 6dffe6d7ef..f3f2a80f12 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -644,8 +644,8 @@ func (suite *KeeperTestSuite) TestKeeper_SaveDefaultExternalAddress() { target: "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", check: func(ctx sdk.Context) { store := ctx.KVStore(suite.storeKey) - suite.Require().Equal("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", - string(store.Get(types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")))) + stored := store.Get(types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")) + suite.Require().Equal("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", string(stored))) }, }, { From 996c96d491c3833e83b9f874cc070c90a0da1e8e Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 19 Jul 2022 14:24:58 +0800 Subject: [PATCH 54/64] Update x/profiles/keeper/keeper_chain_links_test.go Co-authored-by: Riccardo Montagnin --- x/profiles/keeper/keeper_chain_links_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index f3f2a80f12..4cda47c757 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -658,8 +658,8 @@ func (suite *KeeperTestSuite) TestKeeper_SaveDefaultExternalAddress() { target: "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", check: func(ctx sdk.Context) { store := ctx.KVStore(suite.storeKey) - suite.Require().Equal("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", - string(store.Get(types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")))) + stored := store.Get(types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")) + suite.Require().Equal("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", string(stored)) }, }, } From e3e2026dcb3c5635c9dd6180a37c641189a1cbdb Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 19 Jul 2022 14:25:07 +0800 Subject: [PATCH 55/64] Update x/profiles/keeper/keeper_chain_links_test.go Co-authored-by: Riccardo Montagnin --- x/profiles/keeper/keeper_chain_links_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index 4cda47c757..46b6280102 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -678,5 +678,4 @@ func (suite *KeeperTestSuite) TestKeeper_SaveDefaultExternalAddress() { } }) } - } From 9c8da12b5e52a68b64ee0bf52382b0953323bceb Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 19 Jul 2022 14:25:15 +0800 Subject: [PATCH 56/64] Update x/profiles/spec/07-client.md Co-authored-by: Riccardo Montagnin --- x/profiles/spec/07-client.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/profiles/spec/07-client.md b/x/profiles/spec/07-client.md index fe29d8dabb..a00c6176f5 100644 --- a/x/profiles/spec/07-client.md +++ b/x/profiles/spec/07-client.md @@ -117,7 +117,7 @@ pagination: ``` #### default-external-addresses -The `default-external-addresses` command allows users to query for default external addresses in chain link optionally specifying an owner address and a chain name. +The `default-external-addresses` command allows users to query for default external addresses optionally specifying an owner address and a chain name. ```bash desmos query profiles default-external-addresses [[owner]] [[chain_name]] [flags] From 8f114c155f558009baf5adcb54e76cc24d82ed20 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 19 Jul 2022 14:25:20 +0800 Subject: [PATCH 57/64] Update x/profiles/spec/07-client.md Co-authored-by: Riccardo Montagnin --- x/profiles/spec/07-client.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/profiles/spec/07-client.md b/x/profiles/spec/07-client.md index a00c6176f5..1a1e140bb1 100644 --- a/x/profiles/spec/07-client.md +++ b/x/profiles/spec/07-client.md @@ -339,7 +339,7 @@ desmos tx profiles unlink-chain "cosmos" cosmos18xnmlzqrqr6zt526pnczxe65zk3f4xgm ``` #### set-default-external-address -The `set-default-external-address` allows user to set a default external address. +The `set-default-external-address` command allows user to set a default external address. ```bash set-default-external-address [chain-name] [target] From 65c25e2b8d6ce71a877ad7c18f8dd072288c43ac Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 19 Jul 2022 14:25:34 +0800 Subject: [PATCH 58/64] Update x/profiles/spec/07-client.md Co-authored-by: Riccardo Montagnin --- x/profiles/spec/07-client.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/profiles/spec/07-client.md b/x/profiles/spec/07-client.md index 1a1e140bb1..6e69b632d2 100644 --- a/x/profiles/spec/07-client.md +++ b/x/profiles/spec/07-client.md @@ -526,7 +526,7 @@ Example Output: ``` ### DefaultExternalAddresses -The `DefaultExternalAddresses` endpoint allows user to query for external default address optionally specifying an owner and chain name. +The `DefaultExternalAddresses` endpoint allows to query for external default addresses optionally specifying an owner and chain name. ```bash desmos.profiles.v2.Query/desmos.profiles.v3.Query/DefaultExternalAddresses From 891e4d5a5faeeb858ba045c235e6c34059bd40fe Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 19 Jul 2022 14:25:49 +0800 Subject: [PATCH 59/64] Update x/profiles/spec/03-state.md Co-authored-by: Riccardo Montagnin --- x/profiles/spec/03-state.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/profiles/spec/03-state.md b/x/profiles/spec/03-state.md index b6e381faef..fef56600d1 100644 --- a/x/profiles/spec/03-state.md +++ b/x/profiles/spec/03-state.md @@ -26,7 +26,7 @@ To make it possible to query chain links given a user address or given a chain n * Chain Link Owner: `0x15 | ChainName | 0x00 | External address | 0x00 | User address | -> 0x01 ` ## Default External Address -An external address to a spcified chain is stored using owner address and chain name as the key, which allows to easily query all the default addresses: +A chain external address is stored using the owner address and the chain name as the key: * Default External Address: `0x18 | Owner address | Chain name | -> bytes(ExternalAddress)` From a7648e3c39cfd6227b8459d00df930bec4d9b161 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 19 Jul 2022 14:26:27 +0800 Subject: [PATCH 60/64] Update x/profiles/spec/02-concepts.md Co-authored-by: Riccardo Montagnin --- x/profiles/spec/02-concepts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/profiles/spec/02-concepts.md b/x/profiles/spec/02-concepts.md index 0b0a65e6db..cb15a3aa11 100644 --- a/x/profiles/spec/02-concepts.md +++ b/x/profiles/spec/02-concepts.md @@ -120,7 +120,7 @@ This will start an interactive prompt session allowing you to generate the prope ## Default External Address -A default external address represents a default chain link which makes dealing with a single chain link per chain for a profile easier. Each chain must have a chain link as a default external address for interaction, it will pick up the oldest chain link as a default external address if the link of the default external address is unlinked. +Since each user can have multiple links to the same chain, we allow users to specify which address should be considered as the default one for each chain. By default, the first link created for each chain will be considered as the default one. Also, if a chain link was set as the default one and is later deleted, the oldest chain link for the same chain (if any) will be used as the default one. ## Application Link An application link (abbr. _app link_) represents a link to an external (and possibly centralized) application. Such links are one of the easiest way for Desmos profile owners to verify they are trustworthy: if you have a lot of followers on Twitter, connecting your Desmos profile to your Twitter account will make it easier for users to make sure no other people is trying to impersonate you. From 0ab71f07fb32482d79819848a951416a95924028 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Tue, 19 Jul 2022 08:39:49 +0200 Subject: [PATCH 61/64] fixed tests Signed-off-by: Riccardo Montagnin --- x/profiles/client/cli/cli_chain_links_test.go | 4 ++-- x/profiles/keeper/keeper_chain_links_test.go | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/x/profiles/client/cli/cli_chain_links_test.go b/x/profiles/client/cli/cli_chain_links_test.go index e056aba2fd..5c37673ee0 100644 --- a/x/profiles/client/cli/cli_chain_links_test.go +++ b/x/profiles/client/cli/cli_chain_links_test.go @@ -200,7 +200,7 @@ func (s *IntegrationTestSuite) TestCmdQueryChainLinkOwners() { } } -func (s *IntegrationTestSuite) TestCmdQueryDefaultExternalAddress() { +func (s *IntegrationTestSuite) TestCmdQueryDefaultExternalAddresses() { val := s.network.Validators[0] useCases := []struct { name string @@ -268,7 +268,7 @@ func (s *IntegrationTestSuite) TestCmdQueryDefaultExternalAddress() { uc := uc s.Run(uc.name, func() { - cmd := cli.GetCmdQueryDefaultExternalAddress() + cmd := cli.GetCmdQueryDefaultExternalAddresses() clientCtx := val.ClientCtx out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, uc.args) diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index 46b6280102..49aeb8f6ef 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -645,13 +645,17 @@ func (suite *KeeperTestSuite) TestKeeper_SaveDefaultExternalAddress() { check: func(ctx sdk.Context) { store := ctx.KVStore(suite.storeKey) stored := store.Get(types.DefaultExternalAddressKey("cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos")) - suite.Require().Equal("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", string(stored))) + suite.Require().Equal("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", string(stored)) }, }, { name: "existing external address is overridden properly", store: func(ctx sdk.Context) { - suite.k.SaveDefaultExternalAddress(ctx, "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", "cosmos", "cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn") + suite.k.SaveDefaultExternalAddress(ctx, + "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", + "cosmos", + "cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn", + ) }, owner: "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", chainName: "cosmos", From 45d47db991fcc1ee8d44af391c5a7ec40b163680 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 19 Jul 2022 15:48:06 +0800 Subject: [PATCH 62/64] fix: fix rest endpoint --- proto/desmos/profiles/v3/query.proto | 3 +- x/profiles/types/query.pb.go | 86 ++++++++++++++-------------- x/profiles/types/query.pb.gw.go | 2 +- 3 files changed, 46 insertions(+), 45 deletions(-) diff --git a/proto/desmos/profiles/v3/query.proto b/proto/desmos/profiles/v3/query.proto index c7abe263ec..5963331e89 100644 --- a/proto/desmos/profiles/v3/query.proto +++ b/proto/desmos/profiles/v3/query.proto @@ -47,7 +47,8 @@ service Query { // given user and (optionally) chain name rpc DefaultExternalAddresses(QueryDefaultExternalAddressesRequest) returns (QueryDefaultExternalAddressesResponse) { - option (google.api.http).get = "/desmos/profiles/v3/default-addresses"; + option (google.api.http).get = + "/desmos/profiles/v3/default-external-addresses"; } // ApplicationLinks queries the applications links associated to the given diff --git a/x/profiles/types/query.pb.go b/x/profiles/types/query.pb.go index 4723e55933..4fc6c7534f 100644 --- a/x/profiles/types/query.pb.go +++ b/x/profiles/types/query.pb.go @@ -33,49 +33,49 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("desmos/profiles/v3/query.proto", fileDescriptor_bcbdebc2a1cf2f2b) } var fileDescriptor_bcbdebc2a1cf2f2b = []byte{ - // 668 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x95, 0x4f, 0x6b, 0x13, 0x41, - 0x18, 0xc6, 0xbb, 0x82, 0x15, 0x06, 0x41, 0x19, 0x14, 0x6c, 0xa8, 0x5b, 0xac, 0x26, 0x29, 0x6d, - 0x77, 0xc7, 0x34, 0x2a, 0x56, 0xf4, 0xd0, 0x3f, 0x1e, 0x8a, 0x82, 0x55, 0x7a, 0xf2, 0x12, 0x66, - 0x77, 0x27, 0xdb, 0xc5, 0xcd, 0xcc, 0x74, 0x67, 0x36, 0xb6, 0x94, 0x5e, 0x04, 0x0f, 0x5e, 0x44, - 0xf0, 0xee, 0xc9, 0x8f, 0xe0, 0xd9, 0xb3, 0x17, 0xb1, 0xe0, 0xc5, 0xa3, 0xb4, 0x7e, 0x10, 0xd9, - 0xf9, 0xd3, 0xd2, 0x36, 0x9b, 0xa4, 0xb9, 0xed, 0x64, 0x9e, 0x67, 0xde, 0xdf, 0xf3, 0xce, 0x9b, - 0x5d, 0xe0, 0x46, 0x44, 0x74, 0x98, 0x40, 0x3c, 0x63, 0xed, 0x24, 0x25, 0x02, 0x75, 0x9b, 0x68, - 0x2b, 0x27, 0xd9, 0x8e, 0xcf, 0x33, 0x26, 0x19, 0x84, 0x7a, 0xdf, 0xb7, 0xfb, 0x7e, 0xb7, 0x59, - 0xb9, 0x16, 0xb3, 0x98, 0xa9, 0x6d, 0x54, 0x3c, 0x69, 0x65, 0x65, 0x32, 0x66, 0x2c, 0x4e, 0x09, - 0xc2, 0x3c, 0x41, 0x98, 0x52, 0x26, 0xb1, 0x4c, 0x18, 0x15, 0x66, 0x77, 0xc2, 0xec, 0xaa, 0x55, - 0x90, 0xb7, 0x11, 0xa6, 0xa6, 0x44, 0xa5, 0x56, 0x86, 0xd0, 0x32, 0xbf, 0x18, 0xdd, 0x7c, 0xa9, - 0x2e, 0x92, 0x38, 0x6e, 0x65, 0x64, 0x2b, 0x27, 0x42, 0xda, 0x82, 0xd5, 0xf2, 0x53, 0x71, 0x86, - 0x3b, 0x56, 0x36, 0x5b, 0x2a, 0x0b, 0x37, 0x71, 0x42, 0x5b, 0x69, 0x42, 0xdf, 0x58, 0xed, 0x4c, - 0xa9, 0x16, 0x73, 0x7e, 0x42, 0x39, 0x11, 0xb2, 0x42, 0xd9, 0xd2, 0x4d, 0xd2, 0x0b, 0x5b, 0x50, - 0xaf, 0x50, 0x80, 0x05, 0xd1, 0x6e, 0xd4, 0x6d, 0x04, 0x44, 0xe2, 0x06, 0xe2, 0x38, 0x4e, 0xa8, - 0xea, 0x9a, 0xd6, 0x2e, 0xbc, 0xbf, 0x0c, 0x2e, 0xbe, 0x2c, 0x24, 0xf0, 0x83, 0x03, 0x2e, 0xad, - 0xeb, 0xb2, 0xb0, 0xee, 0x9f, 0xbd, 0x13, 0x5f, 0xc9, 0x8c, 0xe2, 0x95, 0xee, 0x44, 0x65, 0x66, - 0xb0, 0x50, 0x70, 0x46, 0x05, 0x99, 0x9e, 0x7b, 0xf7, 0xfb, 0xdf, 0xe7, 0x0b, 0x55, 0x78, 0x1b, - 0xf5, 0x88, 0x78, 0xf4, 0xbc, 0x9b, 0x0b, 0x92, 0xed, 0xc1, 0x5f, 0x0e, 0x98, 0x5c, 0xa3, 0x21, - 0xeb, 0x24, 0x34, 0x5e, 0xdd, 0xc0, 0xf1, 0x46, 0x86, 0xa9, 0x68, 0x93, 0xcc, 0x94, 0x15, 0xf0, - 0x71, 0x69, 0xdd, 0x7e, 0x36, 0x4b, 0xfd, 0x64, 0x44, 0xb7, 0x89, 0xb2, 0xa0, 0xa2, 0xcc, 0xc3, - 0xd9, 0x5e, 0x51, 0x8a, 0x41, 0xf1, 0xa4, 0xb1, 0x7a, 0x76, 0x62, 0xe0, 0x47, 0x07, 0x80, 0x95, - 0xe2, 0xba, 0x9f, 0x17, 0x77, 0x08, 0x67, 0x4b, 0x09, 0x8e, 0x45, 0x96, 0x76, 0x6e, 0x28, 0xad, - 0x61, 0xab, 0x2b, 0xb6, 0x5b, 0x70, 0xaa, 0x17, 0x9b, 0x9a, 0x37, 0x4f, 0x4d, 0x11, 0xfc, 0xea, - 0x80, 0x2b, 0x47, 0xfe, 0x17, 0x6f, 0x29, 0xc9, 0x04, 0x44, 0x83, 0x2b, 0x69, 0xa5, 0x45, 0xbb, - 0x3b, 0xbc, 0xc1, 0xf0, 0xf9, 0x8a, 0x6f, 0x06, 0xd6, 0x06, 0xf0, 0x21, 0xa6, 0x91, 0xbe, 0x3b, - 0xe0, 0xc6, 0x2a, 0x69, 0xe3, 0x3c, 0x95, 0x4f, 0xb7, 0x25, 0xc9, 0x28, 0x4e, 0x97, 0xa2, 0x28, - 0x23, 0x42, 0x10, 0x01, 0x1f, 0x96, 0x96, 0x2f, 0xb3, 0x58, 0xf0, 0xc5, 0x11, 0x9c, 0x26, 0x81, - 0xa7, 0x12, 0xd4, 0x61, 0xf5, 0x6c, 0x82, 0x05, 0x14, 0x69, 0xb7, 0x87, 0x8f, 0x18, 0xbf, 0x38, - 0xe0, 0xea, 0x12, 0xe7, 0x69, 0x12, 0xaa, 0xbf, 0x9d, 0xbe, 0xfe, 0xf2, 0xbe, 0x9d, 0x96, 0x5a, - 0xe0, 0xc6, 0x39, 0x1c, 0x06, 0xb4, 0xaa, 0x40, 0xa7, 0xe0, 0xcd, 0x5e, 0xad, 0xc6, 0x9c, 0x9b, - 0x41, 0xf8, 0xe9, 0x80, 0x89, 0x53, 0x67, 0x2c, 0xef, 0xac, 0xa4, 0x09, 0xa1, 0x72, 0x6d, 0x15, - 0x2e, 0x0e, 0x5b, 0xf7, 0xd8, 0x63, 0x91, 0x1f, 0x8d, 0x62, 0x35, 0xec, 0x8b, 0x8a, 0xbd, 0x09, - 0x1b, 0x7d, 0xd9, 0x51, 0xa8, 0x7c, 0x02, 0xed, 0xea, 0x87, 0x56, 0x12, 0xed, 0xc1, 0x6f, 0x0e, - 0xb8, 0x7e, 0xaa, 0x80, 0x19, 0xef, 0xfb, 0xc3, 0x02, 0x9d, 0x1c, 0xf2, 0x07, 0xe7, 0xb5, 0x99, - 0x0c, 0xf3, 0x2a, 0x43, 0x0d, 0xde, 0xe9, 0x9f, 0xc1, 0x0c, 0xfa, 0x1e, 0x18, 0x5f, 0x57, 0x5f, - 0x0d, 0x58, 0x2b, 0x7f, 0xa7, 0x2a, 0x81, 0xe5, 0xaa, 0x0f, 0xd4, 0x19, 0x90, 0x69, 0x05, 0x32, - 0x09, 0x2b, 0x3d, 0x5f, 0xbd, 0x4a, 0xbb, 0xfc, 0xec, 0xc7, 0x81, 0xeb, 0xec, 0x1f, 0xb8, 0xce, - 0xdf, 0x03, 0xd7, 0xf9, 0x74, 0xe8, 0x8e, 0xed, 0x1f, 0xba, 0x63, 0x7f, 0x0e, 0xdd, 0xb1, 0xd7, - 0x8d, 0x38, 0x91, 0x9b, 0x79, 0xe0, 0x87, 0xac, 0x63, 0xfc, 0x5e, 0x8a, 0x03, 0x61, 0xcf, 0xea, - 0xde, 0x43, 0xdb, 0xc7, 0x07, 0xca, 0x1d, 0x4e, 0x44, 0x30, 0xae, 0xbe, 0x2d, 0xcd, 0xff, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x30, 0x64, 0x6b, 0x48, 0xfa, 0x07, 0x00, 0x00, + // 669 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x95, 0x4f, 0x4f, 0x13, 0x4f, + 0x18, 0xc7, 0xd9, 0x5f, 0xf2, 0xc3, 0x64, 0x62, 0xa2, 0x99, 0x68, 0x22, 0x0d, 0x2e, 0x11, 0xa5, + 0x10, 0x60, 0x77, 0x28, 0x55, 0x22, 0x46, 0x0f, 0xfc, 0xf1, 0x40, 0x34, 0x11, 0x0d, 0x27, 0x2f, + 0xcd, 0xec, 0x76, 0xba, 0x6c, 0xdc, 0xce, 0x0c, 0x3b, 0xb3, 0x15, 0x42, 0xb8, 0x78, 0xf3, 0x42, + 0x4c, 0xbc, 0x7b, 0xf2, 0x25, 0xf8, 0x1e, 0xf4, 0x62, 0x24, 0xf1, 0xe2, 0xd1, 0x80, 0x2f, 0xc4, + 0xec, 0xfc, 0xa1, 0xa1, 0xee, 0xb6, 0xa5, 0xb7, 0x9d, 0x3e, 0xdf, 0xef, 0x7c, 0x3f, 0xcf, 0xcc, + 0xd3, 0x5d, 0xe0, 0x36, 0x89, 0x68, 0x33, 0x81, 0x78, 0xca, 0x5a, 0x71, 0x42, 0x04, 0xea, 0xd4, + 0xd1, 0x5e, 0x46, 0xd2, 0x03, 0x9f, 0xa7, 0x4c, 0x32, 0x08, 0x75, 0xdd, 0xb7, 0x75, 0xbf, 0x53, + 0xaf, 0xdc, 0x88, 0x58, 0xc4, 0x54, 0x19, 0xe5, 0x4f, 0x5a, 0x59, 0x99, 0x8c, 0x18, 0x8b, 0x12, + 0x82, 0x30, 0x8f, 0x11, 0xa6, 0x94, 0x49, 0x2c, 0x63, 0x46, 0x85, 0xa9, 0x4e, 0x98, 0xaa, 0x5a, + 0x05, 0x59, 0x0b, 0x61, 0x6a, 0x22, 0x2a, 0xd5, 0x32, 0x84, 0x86, 0xf9, 0xc5, 0xe8, 0x16, 0x4b, + 0x75, 0x4d, 0x89, 0xa3, 0x46, 0x4a, 0xf6, 0x32, 0x22, 0xa4, 0x0d, 0x9c, 0x29, 0xdf, 0x15, 0xa7, + 0xb8, 0x6d, 0x65, 0xf3, 0xa5, 0xb2, 0x70, 0x17, 0xc7, 0xb4, 0x91, 0xc4, 0xf4, 0x8d, 0xd5, 0xce, + 0x95, 0x6a, 0x31, 0xe7, 0x17, 0x94, 0x13, 0x21, 0xcb, 0x95, 0x0d, 0x7d, 0x48, 0x7a, 0x61, 0x03, + 0xf5, 0x0a, 0x05, 0x58, 0x10, 0xed, 0x46, 0x9d, 0x5a, 0x40, 0x24, 0xae, 0x21, 0x8e, 0xa3, 0x98, + 0xaa, 0x53, 0xd3, 0xda, 0xe5, 0xe3, 0xab, 0xe0, 0xff, 0x97, 0xb9, 0x04, 0xbe, 0x77, 0xc0, 0x95, + 0x6d, 0x1d, 0x0b, 0x67, 0xfd, 0x7f, 0xef, 0xc4, 0x57, 0x32, 0xa3, 0x78, 0xa5, 0x4f, 0xa2, 0x32, + 0x37, 0x58, 0x28, 0x38, 0xa3, 0x82, 0x4c, 0x2f, 0xbc, 0xfb, 0xf9, 0xe7, 0xe3, 0x7f, 0x33, 0xf0, + 0x2e, 0x2a, 0x68, 0xf1, 0xfc, 0xf9, 0x30, 0x13, 0x24, 0x3d, 0x82, 0x3f, 0x1c, 0x30, 0xb9, 0x45, + 0x43, 0xd6, 0x8e, 0x69, 0xb4, 0xb9, 0x83, 0xa3, 0x9d, 0x14, 0x53, 0xd1, 0x22, 0xa9, 0x89, 0x15, + 0xf0, 0x71, 0x69, 0x6e, 0x3f, 0x9b, 0xa5, 0x7e, 0x32, 0xa2, 0xdb, 0xb4, 0xb2, 0xac, 0x5a, 0x59, + 0x84, 0xf3, 0x45, 0xad, 0xe4, 0x83, 0xe2, 0x49, 0x63, 0xf5, 0xec, 0xc4, 0xc0, 0x63, 0x07, 0x80, + 0x8d, 0xfc, 0xba, 0x9f, 0xe7, 0x77, 0x08, 0xe7, 0x4b, 0x09, 0xba, 0x22, 0x4b, 0xbb, 0x30, 0x94, + 0xd6, 0xb0, 0xcd, 0x2a, 0xb6, 0x3b, 0x70, 0xaa, 0x88, 0x4d, 0xcd, 0x9b, 0xa7, 0xa6, 0x08, 0x7e, + 0x76, 0xc0, 0xb5, 0x73, 0xff, 0x8b, 0xb7, 0x94, 0xa4, 0x02, 0xa2, 0xc1, 0x49, 0x5a, 0x69, 0xd1, + 0x96, 0x86, 0x37, 0x18, 0x3e, 0x5f, 0xf1, 0xcd, 0xc1, 0xea, 0x00, 0x3e, 0xc4, 0x34, 0xd2, 0x57, + 0x07, 0xdc, 0xda, 0x24, 0x2d, 0x9c, 0x25, 0xf2, 0xe9, 0xbe, 0x24, 0x29, 0xc5, 0xc9, 0x5a, 0xb3, + 0x99, 0x12, 0x21, 0x88, 0x80, 0x0f, 0x4b, 0xe3, 0xcb, 0x2c, 0x16, 0x7c, 0x75, 0x04, 0xa7, 0xe9, + 0x60, 0x45, 0x75, 0xb0, 0x04, 0xfd, 0xc2, 0xdb, 0xd7, 0x6e, 0x8f, 0x18, 0xbb, 0x87, 0xcf, 0x61, + 0x3f, 0x39, 0xe0, 0xfa, 0x1a, 0xe7, 0x49, 0x1c, 0xaa, 0xff, 0x9f, 0x9e, 0x83, 0xf2, 0x03, 0xec, + 0x95, 0x5a, 0xf2, 0xda, 0x25, 0x1c, 0x86, 0x78, 0x46, 0x11, 0x4f, 0xc1, 0xdb, 0x45, 0xc4, 0x98, + 0x73, 0x33, 0x11, 0xdf, 0x1d, 0x30, 0xd1, 0xb3, 0xc7, 0xfa, 0xc1, 0x46, 0x12, 0x13, 0x2a, 0xb7, + 0x36, 0xe1, 0xea, 0xb0, 0xb9, 0x5d, 0x8f, 0x45, 0x7e, 0x34, 0x8a, 0xd5, 0xb0, 0xaf, 0x2a, 0xf6, + 0x3a, 0xac, 0xf5, 0x65, 0x47, 0xa1, 0xf2, 0x09, 0x74, 0xa8, 0x1f, 0x1a, 0x71, 0xf3, 0x08, 0x7e, + 0x71, 0xc0, 0xcd, 0x9e, 0x00, 0x33, 0xe7, 0x0f, 0x86, 0x05, 0xba, 0x38, 0xed, 0x2b, 0x97, 0xb5, + 0x99, 0x1e, 0x16, 0x55, 0x0f, 0x55, 0x78, 0xaf, 0x7f, 0x0f, 0x66, 0xe2, 0x8f, 0xc0, 0xf8, 0xb6, + 0xfa, 0x7c, 0xc0, 0x6a, 0xf9, 0xcb, 0x55, 0x09, 0x2c, 0xd7, 0xec, 0x40, 0x9d, 0x01, 0x99, 0x56, + 0x20, 0x93, 0xb0, 0x52, 0xf8, 0x0e, 0x56, 0xda, 0xf5, 0x67, 0xdf, 0x4e, 0x5d, 0xe7, 0xe4, 0xd4, + 0x75, 0x7e, 0x9f, 0xba, 0xce, 0x87, 0x33, 0x77, 0xec, 0xe4, 0xcc, 0x1d, 0xfb, 0x75, 0xe6, 0x8e, + 0xbd, 0xae, 0x45, 0xb1, 0xdc, 0xcd, 0x02, 0x3f, 0x64, 0x6d, 0xe3, 0xf7, 0x12, 0x1c, 0x08, 0xbb, + 0x57, 0xe7, 0x3e, 0xda, 0xef, 0x6e, 0x28, 0x0f, 0x38, 0x11, 0xc1, 0xb8, 0xfa, 0xc8, 0xd4, 0xff, + 0x06, 0x00, 0x00, 0xff, 0xff, 0x04, 0xd5, 0x63, 0xc8, 0x03, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/profiles/types/query.pb.gw.go b/x/profiles/types/query.pb.gw.go index 6d0ed054d7..ba39402e13 100644 --- a/x/profiles/types/query.pb.gw.go +++ b/x/profiles/types/query.pb.gw.go @@ -792,7 +792,7 @@ var ( 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_DefaultExternalAddresses_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v2", "default-addresses"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_DefaultExternalAddresses_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v3", "default-external-addresses"}, "", 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))) From a957026f0f4bebfb95594b3f1f0c1c73aaae1a7c Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 19 Jul 2022 15:48:34 +0800 Subject: [PATCH 63/64] docs: update defaul exnternal addresses rest docs --- x/profiles/spec/07-client.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/x/profiles/spec/07-client.md b/x/profiles/spec/07-client.md index fe29d8dabb..d318f2c2d8 100644 --- a/x/profiles/spec/07-client.md +++ b/x/profiles/spec/07-client.md @@ -769,6 +769,16 @@ The `chain-links/owners` endpoint allows users to query for chain link owners gi **Note** The `target` parameter will be used only if the `chain_name` is specified as well. +### DefaultExternalAddresses +The `default-external-addresses` endpoint allows users to query for default external addresses given an optional owner address and chain name. + +``` +/desmos/profiles/v3/default-external-addresses?owner={owner}&chain_name={chainName} +``` + +**Note** +- The `chain_name` parameter will be used only if the `owner` is specified as well. + ### Application Links The `app-links` endpoint allows users to query for application links given an optional user, application name and username. From 2328cbcd8e42ff6f3fad2e6e6dcfc2134529057d Mon Sep 17 00:00:00 2001 From: dadamu Date: Tue, 19 Jul 2022 07:49:47 +0000 Subject: [PATCH 64/64] Updated Swagger definition --- client/docs/swagger-ui/swagger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 395eb3b28b..1f641534e6 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -2341,7 +2341,7 @@ paths: format: boolean tags: - Query - /desmos/profiles/v3/default-addresses: + /desmos/profiles/v3/default-external-addresses: get: summary: |- DefaultExternalAddresses queries the default addresses associated to the