From d1e650edc532488881589b44051305228ac2ced2 Mon Sep 17 00:00:00 2001 From: Leonardo Bragagnolo Date: Fri, 15 Jul 2022 11:04:58 +0200 Subject: [PATCH] feat: ADR-004: Application links expiration time (#723) ## Description Closes: #562 This PR introduce a new field `ExpirationTime` in the `AppLinks` object. It will allow to automatically delete app links when they expires. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html) - [x] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- ...1d1afee8015075d801dcaea4c9783ed128cca.yaml | 6 + app/desmos/cmd/chainlink/create_json_test.go | 2 +- client/docs/config.json | 2 +- client/docs/swagger-ui/swagger.yaml | 126 +- .../submit_upgrade_proposal.sh | 6 + .../adr-004-application-links-expiration.md | 9 +- .../profiles/v1beta1/models_app_links.proto | 155 ++ .../profiles/v1beta1/models_chain_links.proto | 2 +- .../v1beta1/models_dtag_requests.proto | 31 + .../profiles/v1beta1/models_profile.proto | 2 +- .../v1beta1/models_relationships.proto | 2 +- .../desmos/profiles/v2/models_app_links.proto | 2 +- .../profiles/v2/models_chain_links.proto | 2 +- .../profiles/v2/models_dtag_requests.proto | 3 +- proto/desmos/profiles/v2/models_params.proto | 4 +- proto/desmos/profiles/v2/models_profile.proto | 3 +- .../profiles/{v2 => v3}/client/cli.proto | 8 +- .../desmos/profiles/{v2 => v3}/genesis.proto | 34 +- .../desmos/profiles/v3/models_app_links.proto | 162 ++ .../profiles/v3/models_chain_links.proto | 142 + .../profiles/v3/models_dtag_requests.proto | 30 + .../profiles/{v2 => v3}/models_packets.proto | 10 +- proto/desmos/profiles/v3/models_params.proto | 135 + proto/desmos/profiles/v3/models_profile.proto | 59 + .../profiles/{v2 => v3}/msg_server.proto | 14 +- .../profiles/{v2 => v3}/msgs_app_links.proto | 4 +- .../{v2 => v3}/msgs_chain_links.proto | 8 +- .../{v2 => v3}/msgs_dtag_requests.proto | 6 +- .../profiles/{v2 => v3}/msgs_profile.proto | 6 +- proto/desmos/profiles/{v2 => v3}/query.proto | 28 +- .../profiles/{v2 => v3}/query_app_links.proto | 4 +- .../{v2 => v3}/query_chain_links.proto | 4 +- .../{v2 => v3}/query_dtag_requests.proto | 6 +- .../profiles/{v2 => v3}/query_params.proto | 6 +- .../profiles/{v2 => v3}/query_profile.proto | 2 +- testutil/profilestesting/chain_links.go | 12 +- x/posts/legacy/v2/models.pb.go | 2 +- x/profiles/abci.go | 18 + x/profiles/abci_benchmarks_test.go | 128 + x/profiles/abci_test.go | 140 + x/profiles/client/cli/cli_app_links_test.go | 2 + x/profiles/client/cli/cli_test.go | 1 + x/profiles/client/utils/cli.pb.go | 34 +- x/profiles/keeper/alias_functions.go | 50 + x/profiles/keeper/alias_functions_test.go | 94 + x/profiles/keeper/genesis_test.go | 8 + x/profiles/keeper/grpc_query_test.go | 23 + x/profiles/keeper/invariants_test.go | 1 + x/profiles/keeper/keeper_app_links.go | 15 + x/profiles/keeper/keeper_app_links_test.go | 17 + x/profiles/keeper/keeper_params_test.go | 3 + x/profiles/keeper/migrations.go | 23 +- x/profiles/keeper/relay_app_links.go | 1 + x/profiles/keeper/relay_app_links_test.go | 25 + x/profiles/legacy/v4/keeper.go | 58 +- x/profiles/legacy/v4/store.go | 61 +- x/profiles/legacy/v4/store_test.go | 187 +- x/profiles/legacy/v4/{ => types}/codec.go | 2 +- x/profiles/legacy/v4/{ => types}/keys.go | 2 +- .../legacy/v4/types/models_app_links.go | 224 ++ .../legacy/v4/types/models_app_links.pb.go | 2293 +++++++++++++++++ .../v4/{ => types}/models_chain_links.go | 2 +- .../v4/{ => types}/models_chain_links.pb.go | 82 +- .../v4/types/models_dtag_requests.pb.go | 452 ++++ .../legacy/v4/{ => types}/models_profile.go | 2 +- .../v4/{ => types}/models_profile.pb.go | 66 +- .../v4/{ => types}/models_relationships.pb.go | 55 +- x/profiles/legacy/v5/store.go | 15 +- x/profiles/legacy/v5/store_test.go | 60 +- x/profiles/legacy/v5/types/codec.go | 27 + .../legacy/v5/types/models_app_links.go | 224 ++ .../legacy/v5/types/models_app_links.pb.go | 2293 +++++++++++++++++ .../legacy/v5/types/models_chain_links.go | 563 ++++ .../legacy/v5/types/models_chain_links.pb.go | 2237 ++++++++++++++++ .../legacy/v5/types/models_dtag_requests.go | 51 + .../v5/types/models_dtag_requests.pb.go | 449 ++++ .../legacy/v5/types/models_params.pb.go | 1450 +++++++++++ x/profiles/legacy/v5/types/models_profile.go | 353 +++ .../legacy/v5/types/models_profile.pb.go | 826 ++++++ x/profiles/legacy/v6/store.go | 266 ++ x/profiles/legacy/v6/store_test.go | 252 ++ x/profiles/module.go | 18 +- x/profiles/simulation/decoder.go | 11 +- x/profiles/simulation/decoder_test.go | 13 +- x/profiles/simulation/genesis.go | 1 + x/profiles/simulation/params.go | 6 + x/profiles/simulation/utils.go | 6 + x/profiles/types/codec.go | 4 +- x/profiles/types/events.go | 46 +- x/profiles/types/genesis.pb.go | 166 +- x/profiles/types/genesis_test.go | 3 + x/profiles/types/keys.go | 20 +- x/profiles/types/models_app_links.go | 23 +- x/profiles/types/models_app_links.pb.go | 219 +- x/profiles/types/models_app_links_test.go | 49 + x/profiles/types/models_chain_links.pb.go | 106 +- x/profiles/types/models_dtag_requests.pb.go | 57 +- x/profiles/types/models_packets.pb.go | 48 +- x/profiles/types/models_params.go | 54 +- x/profiles/types/models_params.pb.go | 338 ++- x/profiles/types/models_params_test.go | 52 +- x/profiles/types/models_profile.pb.go | 79 +- x/profiles/types/msg_server.pb.go | 98 +- x/profiles/types/msgs_app_links.pb.go | 68 +- x/profiles/types/msgs_chain_links.pb.go | 62 +- x/profiles/types/msgs_dtag_requests.pb.go | 88 +- x/profiles/types/msgs_profile.pb.go | 74 +- x/profiles/types/query.pb.go | 92 +- x/profiles/types/query.pb.gw.go | 18 +- x/profiles/types/query_app_links.pb.go | 100 +- x/profiles/types/query_chain_links.pb.go | 82 +- x/profiles/types/query_dtag_requests.pb.go | 64 +- x/profiles/types/query_params.pb.go | 28 +- x/profiles/types/query_profile.pb.go | 56 +- x/profiles/wasm/querier_test.go | 5 + x/relationships/legacy/v1/store_test.go | 14 +- 116 files changed, 15062 insertions(+), 1280 deletions(-) create mode 100644 .changeset/entries/7d2f19ca69bf6b743fe24a744181d1afee8015075d801dcaea4c9783ed128cca.yaml create mode 100644 proto/desmos/profiles/v1beta1/models_app_links.proto create mode 100644 proto/desmos/profiles/v1beta1/models_dtag_requests.proto rename proto/desmos/profiles/{v2 => v3}/client/cli.proto (84%) rename proto/desmos/profiles/{v2 => v3}/genesis.proto (60%) create mode 100644 proto/desmos/profiles/v3/models_app_links.proto create mode 100644 proto/desmos/profiles/v3/models_chain_links.proto create mode 100644 proto/desmos/profiles/v3/models_dtag_requests.proto rename proto/desmos/profiles/{v2 => v3}/models_packets.proto (87%) create mode 100644 proto/desmos/profiles/v3/models_params.proto create mode 100644 proto/desmos/profiles/v3/models_profile.proto rename proto/desmos/profiles/{v2 => v3}/msg_server.proto (86%) rename proto/desmos/profiles/{v2 => v3}/msgs_app_links.proto (97%) rename proto/desmos/profiles/{v2 => v3}/msgs_chain_links.proto (91%) rename proto/desmos/profiles/{v2 => v3}/msgs_dtag_requests.proto (96%) rename proto/desmos/profiles/{v2 => v3}/msgs_profile.proto (91%) rename proto/desmos/profiles/{v2 => v3}/query.proto (74%) rename proto/desmos/profiles/{v2 => v3}/query_app_links.proto (97%) rename proto/desmos/profiles/{v2 => v3}/query_chain_links.proto (96%) rename proto/desmos/profiles/{v2 => v3}/query_dtag_requests.proto (89%) rename proto/desmos/profiles/{v2 => v3}/query_params.proto (78%) rename proto/desmos/profiles/{v2 => v3}/query_profile.proto (96%) create mode 100644 x/profiles/abci.go create mode 100644 x/profiles/abci_benchmarks_test.go create mode 100644 x/profiles/abci_test.go rename x/profiles/legacy/v4/{ => types}/codec.go (97%) rename x/profiles/legacy/v4/{ => types}/keys.go (99%) create mode 100644 x/profiles/legacy/v4/types/models_app_links.go create mode 100644 x/profiles/legacy/v4/types/models_app_links.pb.go rename x/profiles/legacy/v4/{ => types}/models_chain_links.go (99%) rename x/profiles/legacy/v4/{ => types}/models_chain_links.pb.go (91%) create mode 100644 x/profiles/legacy/v4/types/models_dtag_requests.pb.go rename x/profiles/legacy/v4/{ => types}/models_profile.go (99%) rename x/profiles/legacy/v4/{ => types}/models_profile.pb.go (86%) rename x/profiles/legacy/v4/{ => types}/models_relationships.pb.go (88%) create mode 100644 x/profiles/legacy/v5/types/codec.go create mode 100644 x/profiles/legacy/v5/types/models_app_links.go create mode 100644 x/profiles/legacy/v5/types/models_app_links.pb.go create mode 100644 x/profiles/legacy/v5/types/models_chain_links.go create mode 100644 x/profiles/legacy/v5/types/models_chain_links.pb.go create mode 100644 x/profiles/legacy/v5/types/models_dtag_requests.go create mode 100644 x/profiles/legacy/v5/types/models_dtag_requests.pb.go create mode 100644 x/profiles/legacy/v5/types/models_params.pb.go create mode 100644 x/profiles/legacy/v5/types/models_profile.go create mode 100644 x/profiles/legacy/v5/types/models_profile.pb.go create mode 100644 x/profiles/legacy/v6/store.go create mode 100644 x/profiles/legacy/v6/store_test.go diff --git a/.changeset/entries/7d2f19ca69bf6b743fe24a744181d1afee8015075d801dcaea4c9783ed128cca.yaml b/.changeset/entries/7d2f19ca69bf6b743fe24a744181d1afee8015075d801dcaea4c9783ed128cca.yaml new file mode 100644 index 0000000000..3ec1c17c0b --- /dev/null +++ b/.changeset/entries/7d2f19ca69bf6b743fe24a744181d1afee8015075d801dcaea4c9783ed128cca.yaml @@ -0,0 +1,6 @@ +type: feat +module: x/profiles +pull_request: 723 +description: Added ExpirationTime field to ApplicationLinks +backward_compatible: false +date: 2022-01-24T14:49:03.724641Z diff --git a/app/desmos/cmd/chainlink/create_json_test.go b/app/desmos/cmd/chainlink/create_json_test.go index 7ec6bb08ee..5581d81e93 100644 --- a/app/desmos/cmd/chainlink/create_json_test.go +++ b/app/desmos/cmd/chainlink/create_json_test.go @@ -179,7 +179,7 @@ func (suite *CreateJSONChainLinkTestSuite) TestMultiSignatureAccount() { suite.GetPubKeyFromTxFile(txFile), profilestesting.MultiSignatureProtoFromAnyHex( suite.Codec, - "0a262f6465736d6f732e70726f66696c65732e76322e4d756c74695369676e61747572654461746112e9010a0508031201c0126f0a272f6465736d6f732e70726f66696c65732e76322e53696e676c655369676e6174757265446174611244087f124027fc4567818a29803ec13f429404c7131c818acc1954f512f3d71a3379e7ec741d25de8b142f61151652b06ef78aaeffd58707023e6e8dfbe98c990185016476126f0a272f6465736d6f732e70726f66696c65732e76322e53696e676c655369676e6174757265446174611244087f12409394c86630e7afb961899add8fc1a211d14b8cc38702c53caa701851557f35832c11e11510da4d676578a19b342865317547549b2b4bd78cdf809dafa55041f7", + "0a262f6465736d6f732e70726f66696c65732e76332e4d756c74695369676e61747572654461746112e9010a0508031201c0126f0a272f6465736d6f732e70726f66696c65732e76332e53696e676c655369676e6174757265446174611244087f124027fc4567818a29803ec13f429404c7131c818acc1954f512f3d71a3379e7ec741d25de8b142f61151652b06ef78aaeffd58707023e6e8dfbe98c990185016476126f0a272f6465736d6f732e70726f66696c65732e76332e53696e676c655369676e6174757265446174611244087f12409394c86630e7afb961899add8fc1a211d14b8cc38702c53caa701851557f35832c11e11510da4d676578a19b342865317547549b2b4bd78cdf809dafa55041f7", ), "7b226163636f756e745f6e756d626572223a2230222c22636861696e5f6964223a22636f736d6f73222c22666565223a7b22616d6f756e74223a5b5d2c22676173223a22323030303030227d2c226d656d6f223a226465736d6f73316e3833343574767a6b67336a756d6b6d3835397232717a3076367873633368656e7a6464636a222c226d736773223a5b7b2274797065223a22636f736d6f732d73646b2f4d7367566f7465222c2276616c7565223a7b226f7074696f6e223a312c2270726f706f73616c5f6964223a2231222c22766f746572223a22636f736d6f73316578646a6b6678756438797a7174767561336864643933787530676d656b356c343772387261227d7d5d2c2273657175656e6365223a2230227d", ), diff --git a/client/docs/config.json b/client/docs/config.json index bbd19672e5..de4b6ca98b 100644 --- a/client/docs/config.json +++ b/client/docs/config.json @@ -7,7 +7,7 @@ }, "apis": [ { - "url": "./tmp-swagger-gen/desmos/profiles/v2/query.swagger.json", + "url": "./tmp-swagger-gen/desmos/profiles/v3/query.swagger.json", "operationIds": { "rename": { "Params": "ProfilesParams" diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index fbdf80f140..4a226c59fa 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -4,7 +4,7 @@ info: description: A REST interface for state queries version: 3.0.0 paths: - /desmos/profiles/v2/app-links: + /desmos/profiles/v3/app-links: get: summary: >- ApplicationLinks queries the applications links associated to the given @@ -125,6 +125,12 @@ paths: title: >- CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: >- + ExpirationTime represents the time in which the link + will expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -438,7 +444,7 @@ paths: format: boolean tags: - Query - '/desmos/profiles/v2/app-links/clients/{client_id}': + '/desmos/profiles/v3/app-links/clients/{client_id}': get: summary: |- ApplicationLinkByClientID queries a single application link for a given @@ -555,6 +561,12 @@ paths: title: >- CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: >- + ExpirationTime represents the time in which the link will + expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -762,7 +774,7 @@ paths: type: string tags: - Query - /desmos/profiles/v2/app-links/owners: + /desmos/profiles/v3/app-links/owners: get: summary: |- ApplicationLinkOwners queries for the owners of applications links, @@ -1090,7 +1102,7 @@ paths: format: boolean tags: - Query - /desmos/profiles/v2/chain-links: + /desmos/profiles/v3/chain-links: get: summary: |- ChainLinks queries the chain links associated to the given user, if @@ -1999,7 +2011,7 @@ paths: format: boolean tags: - Query - /desmos/profiles/v2/chain-links/owners: + /desmos/profiles/v3/chain-links/owners: get: summary: >- ChainLinkOwners queries for the owners of chain links, optionally @@ -2329,7 +2341,7 @@ paths: format: boolean tags: - Query - /desmos/profiles/v2/dtag-transfer-requests: + /desmos/profiles/v3/dtag-transfer-requests: get: summary: >- IncomingDTagTransferRequests queries all the DTag transfers requests @@ -2667,7 +2679,7 @@ paths: format: boolean tags: - Query - /desmos/profiles/v2/params: + /desmos/profiles/v3/params: get: summary: Params queries the profiles module params operationId: ProfilesParams @@ -2781,6 +2793,17 @@ paths: OracleParams defines the parameters related to the oracle that will be used to verify the ownership of a centralized application account by a Desmos profile + app_links: + type: object + properties: + 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 @@ -2976,7 +2999,7 @@ paths: } tags: - Query - '/desmos/profiles/v2/profiles/{user}': + '/desmos/profiles/v3/profiles/{user}': get: summary: >- Profile queries the profile of a specific user given their DTag or @@ -11545,7 +11568,14 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. - desmos.profiles.v2.ApplicationLink: + 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: @@ -11638,8 +11668,12 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: ExpirationTime represents the time in which the link will expire title: ApplicationLink contains the data of a link to a centralized application - desmos.profiles.v2.ApplicationLinkState: + desmos.profiles.v3.ApplicationLinkState: type: string enum: - APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED @@ -11658,20 +11692,20 @@ definitions: title: |- ApplicationLinkState defines if an application link is in the following states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT - desmos.profiles.v2.BioParams: + desmos.profiles.v3.BioParams: type: object properties: max_length: type: string format: byte title: BioParams defines the parameters related to profile biography - desmos.profiles.v2.ChainConfig: + desmos.profiles.v3.ChainConfig: type: object properties: name: type: string description: ChainConfig contains the data of the chain with which the link is made. - desmos.profiles.v2.ChainLink: + desmos.profiles.v3.ChainLink: type: object properties: user: @@ -12206,7 +12240,7 @@ definitions: title: |- ChainLink contains the data representing either an inter- or cross- chain link - desmos.profiles.v2.DTagParams: + desmos.profiles.v3.DTagParams: type: object properties: reg_ex: @@ -12218,7 +12252,7 @@ definitions: type: string format: byte title: DTagParams defines the parameters related to profile DTags - desmos.profiles.v2.DTagTransferRequest: + desmos.profiles.v3.DTagTransferRequest: type: object properties: dtag_to_trade: @@ -12239,7 +12273,7 @@ definitions: give to the sender their DTag title: DTagTransferRequest represent a DTag transfer request between two users - desmos.profiles.v2.Data: + desmos.profiles.v3.Data: type: object properties: application: @@ -12251,7 +12285,7 @@ definitions: title: |- Data contains the data associated to a specific user of a generic centralized application - desmos.profiles.v2.NicknameParams: + desmos.profiles.v3.NicknameParams: type: object properties: min_length: @@ -12261,7 +12295,7 @@ definitions: type: string format: byte title: NicknameParams defines the parameters related to the profiles nicknames - desmos.profiles.v2.OracleParams: + desmos.profiles.v3.OracleParams: type: object properties: script_id: @@ -12325,7 +12359,7 @@ definitions: OracleParams defines the parameters related to the oracle that will be used to verify the ownership of a centralized application account by a Desmos profile - desmos.profiles.v2.OracleRequest: + desmos.profiles.v3.OracleRequest: type: object properties: id: @@ -12358,7 +12392,7 @@ definitions: title: |- OracleRequest represents a generic oracle request used to verify the ownership of a centralized application account - desmos.profiles.v2.OracleRequest.CallData: + desmos.profiles.v3.OracleRequest.CallData: type: object properties: application: @@ -12374,7 +12408,7 @@ definitions: title: |- CallData contains the data sent to a single oracle request in order to verify the ownership of a centralized application by a Desmos profile - desmos.profiles.v2.Params: + desmos.profiles.v3.Params: type: object properties: nickname: @@ -12475,8 +12509,15 @@ definitions: OracleParams defines the parameters related to the oracle that will be used to verify the ownership of a centralized application account by a Desmos profile + app_links: + type: object + properties: + 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.v2.Proof: + desmos.profiles.v3.Proof: type: object properties: pub_key: @@ -12813,7 +12854,7 @@ definitions: title: |- Proof contains all the data used to verify a signature when linking an account to a profile - desmos.profiles.v2.QueryApplicationLinkByClientIDResponse: + desmos.profiles.v3.QueryApplicationLinkByClientIDResponse: type: object properties: link: @@ -12913,13 +12954,17 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: ExpirationTime represents the time in which the link will expire title: >- ApplicationLink contains the data of a link to a centralized application title: |- QueryApplicationLinkByClientIDResponse contains the data returned by the request allowing to get an application link using a client id - desmos.profiles.v2.QueryApplicationLinkOwnersResponse: + desmos.profiles.v3.QueryApplicationLinkOwnersResponse: type: object properties: owners: @@ -12970,7 +13015,7 @@ definitions: request allowing to get application link owners. - desmos.profiles.v2.QueryApplicationLinkOwnersResponse.ApplicationLinkOwnerDetails: + desmos.profiles.v3.QueryApplicationLinkOwnersResponse.ApplicationLinkOwnerDetails: type: object properties: user: @@ -12982,7 +13027,7 @@ definitions: title: |- ApplicationLinkOwnerDetails contains the details of a single application link owner - desmos.profiles.v2.QueryApplicationLinksResponse: + desmos.profiles.v3.QueryApplicationLinksResponse: type: object properties: links: @@ -13088,6 +13133,10 @@ definitions: type: string format: date-time title: CreationTime represents the time in which the link was created + expiration_time: + type: string + format: date-time + title: ExpirationTime represents the time in which the link will expire title: >- ApplicationLink contains the data of a link to a centralized application @@ -13120,7 +13169,7 @@ definitions: title: |- QueryApplicationLinksResponse represents the response to the query used to get the application links for a specific user - desmos.profiles.v2.QueryChainLinkOwnersResponse: + desmos.profiles.v3.QueryChainLinkOwnersResponse: type: object properties: owners: @@ -13167,7 +13216,7 @@ definitions: description: |- QueryChainLinkOwnersResponse contains the data returned by the request allowing to get chain link owners. - desmos.profiles.v2.QueryChainLinkOwnersResponse.ChainLinkOwnerDetails: + desmos.profiles.v3.QueryChainLinkOwnersResponse.ChainLinkOwnerDetails: type: object properties: user: @@ -13177,7 +13226,7 @@ definitions: target: type: string title: ChainLinkOwnerDetails contains the details of a single chain link owner - desmos.profiles.v2.QueryChainLinksResponse: + desmos.profiles.v3.QueryChainLinksResponse: type: object properties: links: @@ -13780,7 +13829,7 @@ definitions: description: |- QueryChainLinksResponse is the response type for the Query/ChainLinks RPC method. - desmos.profiles.v2.QueryIncomingDTagTransferRequestsResponse: + desmos.profiles.v3.QueryIncomingDTagTransferRequestsResponse: type: object properties: requests: @@ -13844,7 +13893,7 @@ definitions: description: |- QueryIncomingDTagTransferRequestsResponse is the response type for the Query/IncomingDTagTransferRequests RPC method. - desmos.profiles.v2.QueryParamsResponse: + desmos.profiles.v3.QueryParamsResponse: type: object properties: params: @@ -13948,9 +13997,16 @@ definitions: OracleParams defines the parameters related to the oracle that will be used to verify the ownership of a centralized application account by a Desmos profile + app_links: + type: object + properties: + 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. - desmos.profiles.v2.QueryProfileResponse: + desmos.profiles.v3.QueryProfileResponse: type: object properties: profile: @@ -14115,7 +14171,7 @@ definitions: description: >- QueryProfileResponse is the response type for the Query/Profile RPC method. - desmos.profiles.v2.Result: + desmos.profiles.v3.Result: type: object properties: success: @@ -14136,7 +14192,7 @@ definitions: type: string title: Error that is associated with the failure title: Result represents a verification result - desmos.profiles.v2.Result.Failed: + desmos.profiles.v3.Result.Failed: type: object properties: error: @@ -14145,7 +14201,7 @@ definitions: title: |- Failed is the result of an application link that has not been verified successfully - desmos.profiles.v2.Result.Success: + desmos.profiles.v3.Result.Success: type: object properties: value: diff --git a/contrib/upgrade_testnet/submit_upgrade_proposal.sh b/contrib/upgrade_testnet/submit_upgrade_proposal.sh index 92b3e83ef4..bc99dc842f 100755 --- a/contrib/upgrade_testnet/submit_upgrade_proposal.sh +++ b/contrib/upgrade_testnet/submit_upgrade_proposal.sh @@ -25,6 +25,12 @@ while [ ${CNT} -lt $ITER ]; do sleep $SLEEP done +curr_block=$(curl -s $NODE/status | jq -r '.result.sync_info.latest_block_height') +if [ -z ${curr_block} ] ; then + echo "===> Failed to start the chain" + exit 1 +fi + echo "====> Chain is online. Ready to submit proposal" CHAIN_ID=$(curl -s $NODE/status | jq -r '.result.node_info.network') diff --git a/docs/architecture/adr-004-application-links-expiration.md b/docs/architecture/adr-004-application-links-expiration.md index df07a6e582..b6c45c84e8 100644 --- a/docs/architecture/adr-004-application-links-expiration.md +++ b/docs/architecture/adr-004-application-links-expiration.md @@ -11,11 +11,11 @@ ## Status -ACCEPTED Not Implemented +ACCEPTED Implemented ## Abstract -Currently when a user links a centralized application with their Desmos profile, the created link contains a timestamp of when it has been created. +Currently, when a user links a centralized application with their Desmos profile, the created link contains a timestamp of when it has been created. Since centralized applications' username can be switched and sold, we SHOULD implement an "expiration date" system on links. This means that after a certain amount of time passes, the link will be automatically marked deleted and the user has to connect it again in order to keep it valid. @@ -61,11 +61,10 @@ from the previous versions to the one that will include the additions contained (none known) -## Further Discussions - ## Test Cases [optional] + - The expired `AppLinks` are deleted correctly when they expire. -- + ## References - Issue [#516](https://github.com/desmos-labs/desmos/issues/516) diff --git a/proto/desmos/profiles/v1beta1/models_app_links.proto b/proto/desmos/profiles/v1beta1/models_app_links.proto new file mode 100644 index 0000000000..588bb21f74 --- /dev/null +++ b/proto/desmos/profiles/v1beta1/models_app_links.proto @@ -0,0 +1,155 @@ +syntax = "proto3"; +package desmos.profiles.v1beta1; + +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +// ApplicationLink contains the data of a link to a centralized application +message ApplicationLink { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // User to which the link is associated + string user = 1 [ (gogoproto.moretags) = "yaml:\"user\"" ]; + + // Data contains the details of this specific link + Data data = 2 + [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"data\"" ]; + + // State of the link + ApplicationLinkState state = 3 [ (gogoproto.moretags) = "yaml:\"state\"" ]; + + // OracleRequest represents the request that has been made to the oracle + OracleRequest oracle_request = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"oracle_request\"" + ]; + + // Data coming from the result of the verification. + // Only available when the state is STATE_SUCCESS + Result result = 5 [ (gogoproto.moretags) = "yaml:\"result\"" ]; + + // CreationTime represents the time in which the link was created + google.protobuf.Timestamp creation_time = 6 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"creation_time\"" + ]; +} + +// Data contains the data associated to a specific user of a +// generic centralized application +message Data { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // The application name (eg. Twitter, GitHub, etc) + string application = 1 [ (gogoproto.moretags) = "yaml:\"application\"" ]; + // Username on the application (eg. Twitter tag, GitHub profile, etc) + string username = 2 [ (gogoproto.moretags) = "yaml:\"username\"" ]; +} + +// OracleRequest represents a generic oracle request used to +// verify the ownership of a centralized application account +message OracleRequest { + option (gogoproto.goproto_getters) = false; + + option (gogoproto.equal) = true; + + // ID is the ID of the request + uint64 id = 1 + [ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ]; + + // OracleScriptID is ID of an oracle script + uint64 oracle_script_id = 2 [ + (gogoproto.customname) = "OracleScriptID", + (gogoproto.moretags) = "yaml:\"oracle_script_id\"" + ]; + + // CallData contains the data used to perform the oracle request + CallData call_data = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"call_data\"" + ]; + + // ClientID represents the ID of the client that has called the oracle script + string client_id = 4 [ + (gogoproto.customname) = "ClientID", + (gogoproto.moretags) = "yaml:\"client_id\"" + ]; + + // CallData contains the data sent to a single oracle request in order to + // verify the ownership of a centralized application by a Desmos profile + message CallData { + option (gogoproto.equal) = true; + + // The application for which the ownership should be verified + string application = 1 [ (gogoproto.moretags) = "yaml:\"application\"" ]; + + // The hex encoded call data that should be used to verify the application + // account ownership + string call_data = 2 [ (gogoproto.moretags) = "yaml:\"call_data\"" ]; + } +} + +// ApplicationLinkState defines if an application link is in the following +// states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT +enum ApplicationLinkState { + option (gogoproto.goproto_enum_prefix) = false; + + // A link has just been initialized + APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED = 0 + [ (gogoproto.enumvalue_customname) = "ApplicationLinkStateInitialized" ]; + // A link has just started being verified + APPLICATION_LINK_STATE_VERIFICATION_STARTED = 1 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationStarted" ]; + // A link has errored during the verification process + APPLICATION_LINK_STATE_VERIFICATION_ERROR = 2 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationError" ]; + // A link has being verified successfully + APPLICATION_LINK_STATE_VERIFICATION_SUCCESS = 3 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationSuccess" ]; + // A link has timed out while waiting for the verification + APPLICATION_LINK_STATE_TIMED_OUT = 4 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationTimedOut" ]; +} + +// Result represents a verification result +message Result { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // sum is the oneof that specifies whether this represents a success or + // failure result + oneof sum { + // Success represents a successful verification + Success success = 1; + + // Failed represents a failed verification + Failed failed = 2; + } + + // Success is the result of an application link that has been successfully + // verified + message Success { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // Hex-encoded value that has be signed by the profile + string value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; + // Hex-encoded signature that has been produced by signing the value + string signature = 2 [ (gogoproto.moretags) = "yaml:\"signature\"" ]; + } + + // Failed is the result of an application link that has not been verified + // successfully + message Failed { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // Error that is associated with the failure + string error = 1 [ (gogoproto.moretags) = "yaml:\"error\"" ]; + } +} diff --git a/proto/desmos/profiles/v1beta1/models_chain_links.proto b/proto/desmos/profiles/v1beta1/models_chain_links.proto index 463537ab04..d65c0408a2 100644 --- a/proto/desmos/profiles/v1beta1/models_chain_links.proto +++ b/proto/desmos/profiles/v1beta1/models_chain_links.proto @@ -6,7 +6,7 @@ import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types"; // ChainLink contains the data representing either an inter- or cross- chain // link diff --git a/proto/desmos/profiles/v1beta1/models_dtag_requests.proto b/proto/desmos/profiles/v1beta1/models_dtag_requests.proto new file mode 100644 index 0000000000..0aea977918 --- /dev/null +++ b/proto/desmos/profiles/v1beta1/models_dtag_requests.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package desmos.profiles.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "desmos/profiles/v3/models_chain_links.proto"; + +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types"; + +// DTagTransferRequest represent a DTag transfer request between two users +message DTagTransferRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // DTagToTrade contains the value of the DTag that should be transferred from + // the receiver of the request to the sender + string dtag_to_trade = 1 [ + (gogoproto.moretags) = "yaml:\"dtag_to_trade\"", + (gogoproto.customname) = "DTagToTrade" + ]; + + // Sender represents the address of the account that sent the request + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + // Receiver represents the receiver of the request that, if accepted, will + // give to the sender their DTag + string receiver = 3 [ (gogoproto.moretags) = "yaml:\"receiver\"" ]; +} \ No newline at end of file diff --git a/proto/desmos/profiles/v1beta1/models_profile.proto b/proto/desmos/profiles/v1beta1/models_profile.proto index 740f1e2e77..f563354cfe 100644 --- a/proto/desmos/profiles/v1beta1/models_profile.proto +++ b/proto/desmos/profiles/v1beta1/models_profile.proto @@ -6,7 +6,7 @@ import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types"; // -------------------------------------------------------------------------------------------------------------------- diff --git a/proto/desmos/profiles/v1beta1/models_relationships.proto b/proto/desmos/profiles/v1beta1/models_relationships.proto index 1f28ae4691..0ddc603896 100644 --- a/proto/desmos/profiles/v1beta1/models_relationships.proto +++ b/proto/desmos/profiles/v1beta1/models_relationships.proto @@ -6,7 +6,7 @@ import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types"; // Relationship is the struct of a relationship. // It represent the concept of "follow" of traditional social networks. diff --git a/proto/desmos/profiles/v2/models_app_links.proto b/proto/desmos/profiles/v2/models_app_links.proto index 4ccde4a8f2..813d0de3ad 100644 --- a/proto/desmos/profiles/v2/models_app_links.proto +++ b/proto/desmos/profiles/v2/models_app_links.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package desmos.profiles.v2; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/desmos/profiles/v2/models_chain_links.proto b/proto/desmos/profiles/v2/models_chain_links.proto index fad482e3ba..53760fc6b1 100644 --- a/proto/desmos/profiles/v2/models_chain_links.proto +++ b/proto/desmos/profiles/v2/models_chain_links.proto @@ -8,7 +8,7 @@ import "cosmos_proto/cosmos.proto"; import "cosmos/tx/signing/v1beta1/signing.proto"; import "cosmos/crypto/multisig/v1beta1/multisig.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types"; // ChainLink contains the data representing either an inter- or cross- chain // link diff --git a/proto/desmos/profiles/v2/models_dtag_requests.proto b/proto/desmos/profiles/v2/models_dtag_requests.proto index af6c57722c..5f6577d389 100644 --- a/proto/desmos/profiles/v2/models_dtag_requests.proto +++ b/proto/desmos/profiles/v2/models_dtag_requests.proto @@ -5,9 +5,8 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types"; // DTagTransferRequest represent a DTag transfer request between two users message DTagTransferRequest { diff --git a/proto/desmos/profiles/v2/models_params.proto b/proto/desmos/profiles/v2/models_params.proto index f49f5f45eb..b3887751c2 100644 --- a/proto/desmos/profiles/v2/models_params.proto +++ b/proto/desmos/profiles/v2/models_params.proto @@ -4,7 +4,7 @@ package desmos.profiles.v2; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types"; // Params contains the parameters for the profiles module message Params { @@ -114,4 +114,4 @@ message OracleParams { (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.moretags) = "yaml:\"fee_amount\"" ]; -} +} \ No newline at end of file diff --git a/proto/desmos/profiles/v2/models_profile.proto b/proto/desmos/profiles/v2/models_profile.proto index 812e4c0179..1c95d48a5f 100644 --- a/proto/desmos/profiles/v2/models_profile.proto +++ b/proto/desmos/profiles/v2/models_profile.proto @@ -5,9 +5,8 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; -option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types"; // -------------------------------------------------------------------------------------------------------------------- diff --git a/proto/desmos/profiles/v2/client/cli.proto b/proto/desmos/profiles/v3/client/cli.proto similarity index 84% rename from proto/desmos/profiles/v2/client/cli.proto rename to proto/desmos/profiles/v3/client/cli.proto index 8a68178971..4934552c74 100644 --- a/proto/desmos/profiles/v2/client/cli.proto +++ b/proto/desmos/profiles/v3/client/cli.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package desmos.profiles.v2.client; +package desmos.profiles.v3.client; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; +import "desmos/profiles/v3/models_chain_links.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/client/utils"; @@ -23,11 +23,11 @@ message ChainLinkJSON { ]; // Proof contains the ownership proof of the external chain address - desmos.profiles.v2.Proof proof = 2 + desmos.profiles.v3.Proof proof = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"proof\"" ]; // ChainConfig contains the configuration of the external chain - desmos.profiles.v2.ChainConfig chain_config = 3 [ + desmos.profiles.v3.ChainConfig chain_config = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"chain_config\"" ]; diff --git a/proto/desmos/profiles/v2/genesis.proto b/proto/desmos/profiles/v3/genesis.proto similarity index 60% rename from proto/desmos/profiles/v2/genesis.proto rename to proto/desmos/profiles/v3/genesis.proto index 7c1b49e393..829eb728f2 100644 --- a/proto/desmos/profiles/v2/genesis.proto +++ b/proto/desmos/profiles/v3/genesis.proto @@ -1,12 +1,12 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; -import "desmos/profiles/v2/models_params.proto"; -import "desmos/profiles/v2/models_profile.proto"; -import "desmos/profiles/v2/models_dtag_requests.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; -import "desmos/profiles/v2/models_app_links.proto"; +import "desmos/profiles/v3/models_params.proto"; +import "desmos/profiles/v3/models_profile.proto"; +import "desmos/profiles/v3/models_dtag_requests.proto"; +import "desmos/profiles/v3/models_chain_links.proto"; +import "desmos/profiles/v3/models_app_links.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; @@ -14,29 +14,29 @@ option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; message GenesisState { option (gogoproto.goproto_getters) = false; - repeated desmos.profiles.v2.DTagTransferRequest dtag_transfer_requests = 1 [ + repeated desmos.profiles.v3.DTagTransferRequest dtag_transfer_requests = 1 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"dtag_transfer_requests\"", (gogoproto.customname) = "DTagTransferRequests" ]; - desmos.profiles.v2.Params params = 2 [ + repeated desmos.profiles.v3.ChainLink chain_links = 2 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"params\"" + (gogoproto.moretags) = "yaml:\"chain_links\"" ]; - string ibc_port_id = 3 [ - (gogoproto.moretags) = "yaml:\"ibc_port_id\"", - (gogoproto.customname) = "IBCPortID" + repeated ApplicationLink application_links = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"application_links\"" ]; - repeated desmos.profiles.v2.ChainLink chain_links = 4 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"chain_links\"" + string ibc_port_id = 4 [ + (gogoproto.moretags) = "yaml:\"ibc_port_id\"", + (gogoproto.customname) = "IBCPortID" ]; - repeated ApplicationLink application_links = 5 [ + desmos.profiles.v3.Params params = 5 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"application_links\"" + (gogoproto.moretags) = "yaml:\"params\"" ]; } diff --git a/proto/desmos/profiles/v3/models_app_links.proto b/proto/desmos/profiles/v3/models_app_links.proto new file mode 100644 index 0000000000..4a15cbc381 --- /dev/null +++ b/proto/desmos/profiles/v3/models_app_links.proto @@ -0,0 +1,162 @@ +syntax = "proto3"; +package desmos.profiles.v3; + +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +// ApplicationLink contains the data of a link to a centralized application +message ApplicationLink { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // User to which the link is associated + string user = 1 [ (gogoproto.moretags) = "yaml:\"user\"" ]; + + // Data contains the details of this specific link + Data data = 2 + [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"data\"" ]; + + // State of the link + ApplicationLinkState state = 3 [ (gogoproto.moretags) = "yaml:\"state\"" ]; + + // OracleRequest represents the request that has been made to the oracle + OracleRequest oracle_request = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"oracle_request\"" + ]; + + // Data coming from the result of the verification. + // Only available when the state is STATE_SUCCESS + Result result = 5 [ (gogoproto.moretags) = "yaml:\"result\"" ]; + + // CreationTime represents the time in which the link was created + google.protobuf.Timestamp creation_time = 6 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"creation_time\"" + ]; + + // ExpirationTime represents the time in which the link will expire + google.protobuf.Timestamp expiration_time = 7 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"expiration_time\"" + ]; +} + +// Data contains the data associated to a specific user of a +// generic centralized application +message Data { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // The application name (eg. Twitter, GitHub, etc) + string application = 1 [ (gogoproto.moretags) = "yaml:\"application\"" ]; + // Username on the application (eg. Twitter tag, GitHub profile, etc) + string username = 2 [ (gogoproto.moretags) = "yaml:\"username\"" ]; +} + +// OracleRequest represents a generic oracle request used to +// verify the ownership of a centralized application account +message OracleRequest { + option (gogoproto.goproto_getters) = false; + + option (gogoproto.equal) = true; + + // ID is the ID of the request + uint64 id = 1 + [ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ]; + + // OracleScriptID is ID of an oracle script + uint64 oracle_script_id = 2 [ + (gogoproto.customname) = "OracleScriptID", + (gogoproto.moretags) = "yaml:\"oracle_script_id\"" + ]; + + // CallData contains the data used to perform the oracle request + CallData call_data = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"call_data\"" + ]; + + // ClientID represents the ID of the client that has called the oracle script + string client_id = 4 [ + (gogoproto.customname) = "ClientID", + (gogoproto.moretags) = "yaml:\"client_id\"" + ]; + + // CallData contains the data sent to a single oracle request in order to + // verify the ownership of a centralized application by a Desmos profile + message CallData { + option (gogoproto.equal) = true; + + // The application for which the ownership should be verified + string application = 1 [ (gogoproto.moretags) = "yaml:\"application\"" ]; + + // The hex encoded call data that should be used to verify the application + // account ownership + string call_data = 2 [ (gogoproto.moretags) = "yaml:\"call_data\"" ]; + } +} + +// ApplicationLinkState defines if an application link is in the following +// states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT +enum ApplicationLinkState { + option (gogoproto.goproto_enum_prefix) = false; + + // A link has just been initialized + APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED = 0 + [ (gogoproto.enumvalue_customname) = "ApplicationLinkStateInitialized" ]; + // A link has just started being verified + APPLICATION_LINK_STATE_VERIFICATION_STARTED = 1 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationStarted" ]; + // A link has errored during the verification process + APPLICATION_LINK_STATE_VERIFICATION_ERROR = 2 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationError" ]; + // A link has being verified successfully + APPLICATION_LINK_STATE_VERIFICATION_SUCCESS = 3 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationSuccess" ]; + // A link has timed out while waiting for the verification + APPLICATION_LINK_STATE_TIMED_OUT = 4 + [ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationTimedOut" ]; +} + +// Result represents a verification result +message Result { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // sum is the oneof that specifies whether this represents a success or + // failure result + oneof sum { + // Success represents a successful verification + Success success = 1; + + // Failed represents a failed verification + Failed failed = 2; + } + + // Success is the result of an application link that has been successfully + // verified + message Success { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // Hex-encoded value that has be signed by the profile + string value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; + // Hex-encoded signature that has been produced by signing the value + string signature = 2 [ (gogoproto.moretags) = "yaml:\"signature\"" ]; + } + + // Failed is the result of an application link that has not been verified + // successfully + message Failed { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + + // Error that is associated with the failure + string error = 1 [ (gogoproto.moretags) = "yaml:\"error\"" ]; + } +} diff --git a/proto/desmos/profiles/v3/models_chain_links.proto b/proto/desmos/profiles/v3/models_chain_links.proto new file mode 100644 index 0000000000..12190a2a28 --- /dev/null +++ b/proto/desmos/profiles/v3/models_chain_links.proto @@ -0,0 +1,142 @@ +syntax = "proto3"; +package desmos.profiles.v3; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/tx/signing/v1beta1/signing.proto"; +import "cosmos/crypto/multisig/v1beta1/multisig.proto"; + +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; + +// ChainLink contains the data representing either an inter- or cross- chain +// link +message ChainLink { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // User defines the destination profile address to link + string user = 1 [ (gogoproto.moretags) = "yaml:\"user\"" ]; + + // Address contains the data of the external chain address to be connected + // with the Desmos profile + google.protobuf.Any address = 2 [ + (gogoproto.moretags) = "yaml:\"address\"", + (cosmos_proto.accepts_interface) = "AddressData" + ]; + + // Proof contains the ownership proof of the external chain address + Proof proof = 3 + [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"proof\"" ]; + + // ChainConfig contains the configuration of the external chain + ChainConfig chain_config = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"chain_config\"" + ]; + + // CreationTime represents the time in which the link has been created + google.protobuf.Timestamp creation_time = 5 [ + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"creation_time\"", + (gogoproto.nullable) = false + ]; +} + +// ChainConfig contains the data of the chain with which the link is made. +message ChainConfig { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + string name = 1 [ (gogoproto.moretags) = "yaml:\"name\"" ]; +} + +// Proof contains all the data used to verify a signature when linking an +// account to a profile +message Proof { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // PubKey represents the public key associated with the address for which to + // prove the ownership + google.protobuf.Any pub_key = 1 [ (gogoproto.moretags) = "yaml:\"pub_key\"" ]; + + // Signature represents the hex-encoded signature of the PlainText value + google.protobuf.Any signature = 2 + [ (gogoproto.moretags) = "yaml:\"signature\"" ]; + + // PlainText represents the hex-encoded value signed in order to produce the + // Signature + string plain_text = 3 [ (gogoproto.moretags) = "yaml:\"plain_text\"" ]; +} + +// Bech32Address represents a Bech32-encoded address +message Bech32Address { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "AddressData"; + + // Value represents the Bech-32 encoded address value + string value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; + + // Prefix represents the HRP of the Bech32 address + string prefix = 2 [ (gogoproto.moretags) = "yaml:\"prefix\"" ]; +} + +// Base58Address represents a Base58-encoded address +message Base58Address { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "AddressData"; + + // Value contains the Base58-encoded address + string value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; +} + +// HexAddress represents an Hex-encoded address +// NOTE: Currently it only supports keccak256-uncompressed addresses +message HexAddress { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "AddressData"; + + // Value represents the hex address value + string value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; + + // Prefix represents the optional prefix used during address encoding (e.g. + // 0x) + string prefix = 2 [ (gogoproto.moretags) = "yaml:\"prefix\"" ]; +} + +// SingleSignatureData is the signature data for a single signer +message SingleSignatureData { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (cosmos_proto.implements_interface) = "SignatureData"; + + // Mode is the signing mode of the single signer + cosmos.tx.signing.v1beta1.SignMode mode = 1; + + // Signature is the raw signature bytes + bytes signature = 2; +} + +// MultiSignatureData is the signature data for a multisig public key +message MultiSignatureData { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (cosmos_proto.implements_interface) = "SignatureData"; + + // Bitarray specifies which keys within the multisig are signing + cosmos.crypto.multisig.v1beta1.CompactBitArray bit_array = 1; + + // Signatures is the signatures of the multi-signature + repeated google.protobuf.Any signatures = 2; +} \ No newline at end of file diff --git a/proto/desmos/profiles/v3/models_dtag_requests.proto b/proto/desmos/profiles/v3/models_dtag_requests.proto new file mode 100644 index 0000000000..ad443954d4 --- /dev/null +++ b/proto/desmos/profiles/v3/models_dtag_requests.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package desmos.profiles.v3; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; + +// DTagTransferRequest represent a DTag transfer request between two users +message DTagTransferRequest { + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // DTagToTrade contains the value of the DTag that should be transferred from + // the receiver of the request to the sender + string dtag_to_trade = 1 [ + (gogoproto.moretags) = "yaml:\"dtag_to_trade\"", + (gogoproto.customname) = "DTagToTrade" + ]; + + // Sender represents the address of the account that sent the request + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + // Receiver represents the receiver of the request that, if accepted, will + // give to the sender their DTag + string receiver = 3 [ (gogoproto.moretags) = "yaml:\"receiver\"" ]; +} \ No newline at end of file diff --git a/proto/desmos/profiles/v2/models_packets.proto b/proto/desmos/profiles/v3/models_packets.proto similarity index 87% rename from proto/desmos/profiles/v2/models_packets.proto rename to proto/desmos/profiles/v3/models_packets.proto index 8a7971270c..fbd83f4ac1 100644 --- a/proto/desmos/profiles/v2/models_packets.proto +++ b/proto/desmos/profiles/v3/models_packets.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; +import "desmos/profiles/v3/models_chain_links.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; @@ -21,13 +21,13 @@ message LinkChainAccountPacketData { ]; // SourceProof represents the proof of ownership of the source address - desmos.profiles.v2.Proof source_proof = 2 [ + desmos.profiles.v3.Proof source_proof = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"source_proof\"" ]; // SourceChainConfig contains the details of the source chain - desmos.profiles.v2.ChainConfig source_chain_config = 3 [ + desmos.profiles.v3.ChainConfig source_chain_config = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"source_chain_config\"" ]; @@ -38,7 +38,7 @@ message LinkChainAccountPacketData { [ (gogoproto.moretags) = "yaml:\"destination_address\"" ]; // DestinationProof contains the proof of ownership of the DestinationAddress - desmos.profiles.v2.Proof destination_proof = 5 [ + desmos.profiles.v3.Proof destination_proof = 5 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"destination_proof\"" ]; diff --git a/proto/desmos/profiles/v3/models_params.proto b/proto/desmos/profiles/v3/models_params.proto new file mode 100644 index 0000000000..9f5badf4d2 --- /dev/null +++ b/proto/desmos/profiles/v3/models_params.proto @@ -0,0 +1,135 @@ +syntax = "proto3"; +package desmos.profiles.v3; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; + +// Params contains the parameters for the profiles module +message Params { + option (gogoproto.goproto_getters) = false; + + NicknameParams nickname = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"nickname\"" + ]; + + DTagParams dtag = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"dtag\"", + (gogoproto.customname) = "DTag" + ]; + + BioParams bio = 3 + [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"bio\"" ]; + + OracleParams oracle = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"oracle\"" + ]; + + AppLinksParams app_links = 5 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"app_links\"" + ]; +} + +// NicknameParams defines the parameters related to the profiles nicknames +message NicknameParams { + option (gogoproto.goproto_getters) = false; + + bytes min_length = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"min_length\"" + ]; + + bytes max_length = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"max_length\"" + ]; +} + +// DTagParams defines the parameters related to profile DTags +message DTagParams { + option (gogoproto.goproto_getters) = false; + + string reg_ex = 1 [ (gogoproto.moretags) = "yaml:\"reg_ex\"" ]; + + bytes min_length = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"min_length\"", + (gogoproto.customname) = "MinLength" + ]; + + bytes max_length = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"max_length\"", + (gogoproto.customname) = "MaxLength" + ]; +} + +// BioParams defines the parameters related to profile biography +message BioParams { + option (gogoproto.goproto_getters) = false; + + bytes max_length = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"max_length\"" + ]; +} + +// OracleParams defines the parameters related to the oracle +// that will be used to verify the ownership of a centralized +// application account by a Desmos profile +message OracleParams { + option (gogoproto.goproto_getters) = false; + + // ScriptID represents the ID of the oracle script to be called to verify the + // data + uint64 script_id = 1 [ + (gogoproto.customname) = "ScriptID", + (gogoproto.moretags) = "yaml:\"script_id\"" + ]; + + // AskCount represents the number of oracles to which ask to verify the data + uint64 ask_count = 2 [ (gogoproto.moretags) = "yaml:\"ask_count\"" ]; + + // MinCount represents the minimum count of oracles that should complete the + // verification successfully + uint64 min_count = 3 [ (gogoproto.moretags) = "yaml:\"min_count\"" ]; + + // PrepareGas represents the amount of gas to be used during the preparation + // stage of the oracle script + uint64 prepare_gas = 4 [ (gogoproto.moretags) = "yaml:\"prepare_gas\"" ]; + + // ExecuteGas represents the amount of gas to be used during the execution of + // the oracle script + uint64 execute_gas = 5 [ (gogoproto.moretags) = "yaml:\"execute_gas\"" ]; + + // FeeAmount represents the amount of fees to be payed in order to execute the + // oracle script + repeated cosmos.base.v1beta1.Coin fee_amount = 6 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"fee_amount\"" + ]; +} + +// AppLinksParams define the parameters related to the app links +message AppLinksParams { + option (gogoproto.goproto_getters) = false; + + // Default validity duration before an application link expires + google.protobuf.Duration validity_duration = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"validity_duration\"" + ]; +} \ No newline at end of file diff --git a/proto/desmos/profiles/v3/models_profile.proto b/proto/desmos/profiles/v3/models_profile.proto new file mode 100644 index 0000000000..addb2aa829 --- /dev/null +++ b/proto/desmos/profiles/v3/models_profile.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; +package desmos.profiles.v3; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; + +// -------------------------------------------------------------------------------------------------------------------- + +// Profile represents a generic first on Desmos, containing the information of a +// single user +message Profile { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // Account represents the base Cosmos account associated with this profile + google.protobuf.Any account = 1 + [ (cosmos_proto.accepts_interface) = "AccountI" ]; + + // DTag represents the unique tag of this profile + string dtag = 2 [ + (gogoproto.moretags) = "yaml:\"dtag\"", + (gogoproto.customname) = "DTag" + ]; + + // Nickname contains the custom human readable name of the profile + string nickname = 3 [ (gogoproto.moretags) = "yaml:\"nickname\"" ]; + + // Bio contains the biography of the profile + string bio = 4 [ (gogoproto.moretags) = "yaml:\"bio\"" ]; + + // Pictures contains the data about the pictures associated with he profile + Pictures pictures = 5 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"pictures\"" + ]; + + // CreationTime represents the time in which the profile has been created + google.protobuf.Timestamp creation_date = 6 [ + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"creation_date\"", + (gogoproto.nullable) = false + ]; +} + +// Pictures contains the data of a user profile's related pictures +message Pictures { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // Profile contains the URL to the profile picture + string profile = 1 [ (gogoproto.moretags) = "yaml:\"profile\"" ]; + + // Cover contains the URL to the cover picture + string cover = 2 [ (gogoproto.moretags) = "yaml:\"cover\"" ]; +} \ No newline at end of file diff --git a/proto/desmos/profiles/v2/msg_server.proto b/proto/desmos/profiles/v3/msg_server.proto similarity index 86% rename from proto/desmos/profiles/v2/msg_server.proto rename to proto/desmos/profiles/v3/msg_server.proto index 6025c84e63..0fd65a8446 100644 --- a/proto/desmos/profiles/v2/msg_server.proto +++ b/proto/desmos/profiles/v3/msg_server.proto @@ -1,15 +1,15 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_profile.proto"; -import "desmos/profiles/v2/models_dtag_requests.proto"; -import "desmos/profiles/v2/msgs_profile.proto"; -import "desmos/profiles/v2/msgs_dtag_requests.proto"; -import "desmos/profiles/v2/msgs_chain_links.proto"; -import "desmos/profiles/v2/msgs_app_links.proto"; +import "desmos/profiles/v3/models_profile.proto"; +import "desmos/profiles/v3/models_dtag_requests.proto"; +import "desmos/profiles/v3/msgs_profile.proto"; +import "desmos/profiles/v3/msgs_dtag_requests.proto"; +import "desmos/profiles/v3/msgs_chain_links.proto"; +import "desmos/profiles/v3/msgs_app_links.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; diff --git a/proto/desmos/profiles/v2/msgs_app_links.proto b/proto/desmos/profiles/v3/msgs_app_links.proto similarity index 97% rename from proto/desmos/profiles/v2/msgs_app_links.proto rename to proto/desmos/profiles/v3/msgs_app_links.proto index 4a01969e01..d44669fea6 100644 --- a/proto/desmos/profiles/v2/msgs_app_links.proto +++ b/proto/desmos/profiles/v3/msgs_app_links.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; -import "desmos/profiles/v2/models_app_links.proto"; +import "desmos/profiles/v3/models_app_links.proto"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; diff --git a/proto/desmos/profiles/v2/msgs_chain_links.proto b/proto/desmos/profiles/v3/msgs_chain_links.proto similarity index 91% rename from proto/desmos/profiles/v2/msgs_chain_links.proto rename to proto/desmos/profiles/v3/msgs_chain_links.proto index c8cabe6dc6..845a6e1cab 100644 --- a/proto/desmos/profiles/v2/msgs_chain_links.proto +++ b/proto/desmos/profiles/v3/msgs_chain_links.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; +import "desmos/profiles/v3/models_chain_links.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; @@ -18,13 +18,13 @@ message MsgLinkChainAccount { ]; // Proof contains the proof of ownership of the external chain address - desmos.profiles.v2.Proof proof = 2 [ + desmos.profiles.v3.Proof proof = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"source_proof\"" ]; // ChainConfig contains the configuration of the external chain - desmos.profiles.v2.ChainConfig chain_config = 3 [ + desmos.profiles.v3.ChainConfig chain_config = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"source_chain_config\"" ]; diff --git a/proto/desmos/profiles/v2/msgs_dtag_requests.proto b/proto/desmos/profiles/v3/msgs_dtag_requests.proto similarity index 96% rename from proto/desmos/profiles/v2/msgs_dtag_requests.proto rename to proto/desmos/profiles/v3/msgs_dtag_requests.proto index dfee30ffdf..097878477a 100644 --- a/proto/desmos/profiles/v2/msgs_dtag_requests.proto +++ b/proto/desmos/profiles/v3/msgs_dtag_requests.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_profile.proto"; -import "desmos/profiles/v2/models_dtag_requests.proto"; +import "desmos/profiles/v3/models_profile.proto"; +import "desmos/profiles/v3/models_dtag_requests.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; diff --git a/proto/desmos/profiles/v2/msgs_profile.proto b/proto/desmos/profiles/v3/msgs_profile.proto similarity index 91% rename from proto/desmos/profiles/v2/msgs_profile.proto rename to proto/desmos/profiles/v3/msgs_profile.proto index a804790472..fdd0e2db8e 100644 --- a/proto/desmos/profiles/v2/msgs_profile.proto +++ b/proto/desmos/profiles/v3/msgs_profile.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; -import "desmos/profiles/v2/models_profile.proto"; -import "desmos/profiles/v2/models_dtag_requests.proto"; +import "desmos/profiles/v3/models_profile.proto"; +import "desmos/profiles/v3/models_dtag_requests.proto"; option go_package = "github.com/desmos-labs/desmos/v4/x/profiles/types"; diff --git a/proto/desmos/profiles/v2/query.proto b/proto/desmos/profiles/v3/query.proto similarity index 74% rename from proto/desmos/profiles/v2/query.proto rename to proto/desmos/profiles/v3/query.proto index 529a4099f4..86e61a5ab5 100644 --- a/proto/desmos/profiles/v2/query.proto +++ b/proto/desmos/profiles/v3/query.proto @@ -1,14 +1,14 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; -import "desmos/profiles/v2/query_profile.proto"; -import "desmos/profiles/v2/query_dtag_requests.proto"; -import "desmos/profiles/v2/query_params.proto"; -import "desmos/profiles/v2/query_chain_links.proto"; -import "desmos/profiles/v2/query_app_links.proto"; +import "desmos/profiles/v3/query_profile.proto"; +import "desmos/profiles/v3/query_dtag_requests.proto"; +import "desmos/profiles/v3/query_params.proto"; +import "desmos/profiles/v3/query_chain_links.proto"; +import "desmos/profiles/v3/query_app_links.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; @@ -20,34 +20,34 @@ service Query { // If the queried user does not have a profile, the returned response will // contain a null profile. rpc Profile(QueryProfileRequest) returns (QueryProfileResponse) { - option (google.api.http).get = "/desmos/profiles/v2/profiles/{user}"; + option (google.api.http).get = "/desmos/profiles/v3/profiles/{user}"; } // IncomingDTagTransferRequests queries all the DTag transfers requests that // have been made towards the user with the given address rpc IncomingDTagTransferRequests(QueryIncomingDTagTransferRequestsRequest) returns (QueryIncomingDTagTransferRequestsResponse) { - option (google.api.http).get = "/desmos/profiles/v2/dtag-transfer-requests"; + option (google.api.http).get = "/desmos/profiles/v3/dtag-transfer-requests"; } // ChainLinks queries the chain links associated to the given user, if // provided. Otherwise it queries all the chain links stored. rpc ChainLinks(QueryChainLinksRequest) returns (QueryChainLinksResponse) { - option (google.api.http).get = "/desmos/profiles/v2/chain-links"; + option (google.api.http).get = "/desmos/profiles/v3/chain-links"; } // ChainLinkOwners queries for the owners of chain links, optionally searching // for a specific chain name and external address rpc ChainLinkOwners(QueryChainLinkOwnersRequest) returns (QueryChainLinkOwnersResponse) { - option (google.api.http).get = "/desmos/profiles/v2/chain-links/owners"; + option (google.api.http).get = "/desmos/profiles/v3/chain-links/owners"; } // ApplicationLinks queries the applications links associated to the given // user, if provided. Otherwise, it queries all the application links stored. rpc ApplicationLinks(QueryApplicationLinksRequest) returns (QueryApplicationLinksResponse) { - option (google.api.http).get = "/desmos/profiles/v2/app-links"; + option (google.api.http).get = "/desmos/profiles/v3/app-links"; } // ApplicationLinkByClientID queries a single application link for a given @@ -55,18 +55,18 @@ service Query { rpc ApplicationLinkByClientID(QueryApplicationLinkByClientIDRequest) returns (QueryApplicationLinkByClientIDResponse) { option (google.api.http).get = - "/desmos/profiles/v2/app-links/clients/{client_id}"; + "/desmos/profiles/v3/app-links/clients/{client_id}"; } // ApplicationLinkOwners queries for the owners of applications links, // optionally searching for a specific application and username. rpc ApplicationLinkOwners(QueryApplicationLinkOwnersRequest) returns (QueryApplicationLinkOwnersResponse) { - option (google.api.http).get = "/desmos/profiles/v2/app-links/owners"; + option (google.api.http).get = "/desmos/profiles/v3/app-links/owners"; } // Params queries the profiles module params rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/desmos/profiles/v2/params"; + option (google.api.http).get = "/desmos/profiles/v3/params"; } } diff --git a/proto/desmos/profiles/v2/query_app_links.proto b/proto/desmos/profiles/v3/query_app_links.proto similarity index 97% rename from proto/desmos/profiles/v2/query_app_links.proto rename to proto/desmos/profiles/v3/query_app_links.proto index bd8c3f63a0..5cd88542c6 100644 --- a/proto/desmos/profiles/v2/query_app_links.proto +++ b/proto/desmos/profiles/v3/query_app_links.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; -import "desmos/profiles/v2/models_app_links.proto"; +import "desmos/profiles/v3/models_app_links.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; diff --git a/proto/desmos/profiles/v2/query_chain_links.proto b/proto/desmos/profiles/v3/query_chain_links.proto similarity index 96% rename from proto/desmos/profiles/v2/query_chain_links.proto rename to proto/desmos/profiles/v3/query_chain_links.proto index 370d978779..12f9dc869b 100644 --- a/proto/desmos/profiles/v2/query_chain_links.proto +++ b/proto/desmos/profiles/v3/query_chain_links.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; -import "desmos/profiles/v2/models_chain_links.proto"; +import "desmos/profiles/v3/models_chain_links.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; diff --git a/proto/desmos/profiles/v2/query_dtag_requests.proto b/proto/desmos/profiles/v3/query_dtag_requests.proto similarity index 89% rename from proto/desmos/profiles/v2/query_dtag_requests.proto rename to proto/desmos/profiles/v3/query_dtag_requests.proto index 9d33588959..8351b9491f 100644 --- a/proto/desmos/profiles/v2/query_dtag_requests.proto +++ b/proto/desmos/profiles/v3/query_dtag_requests.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; -import "desmos/profiles/v2/models_dtag_requests.proto"; +import "desmos/profiles/v3/models_dtag_requests.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; @@ -29,7 +29,7 @@ message QueryIncomingDTagTransferRequestsRequest { message QueryIncomingDTagTransferRequestsResponse { // Requests represent the list of all the DTag transfer requests made towards // the user - repeated desmos.profiles.v2.DTagTransferRequest requests = 1 + repeated desmos.profiles.v3.DTagTransferRequest requests = 1 [ (gogoproto.nullable) = false ]; // Pagination defines the pagination response diff --git a/proto/desmos/profiles/v2/query_params.proto b/proto/desmos/profiles/v3/query_params.proto similarity index 78% rename from proto/desmos/profiles/v2/query_params.proto rename to proto/desmos/profiles/v3/query_params.proto index bd3a4023d4..dc712e08ad 100644 --- a/proto/desmos/profiles/v2/query_params.proto +++ b/proto/desmos/profiles/v3/query_params.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; -import "desmos/profiles/v2/models_params.proto"; +import "desmos/profiles/v3/models_params.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; @@ -15,5 +15,5 @@ message QueryParamsRequest {} // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { - desmos.profiles.v2.Params params = 1 [ (gogoproto.nullable) = false ]; + desmos.profiles.v3.Params params = 1 [ (gogoproto.nullable) = false ]; } \ No newline at end of file diff --git a/proto/desmos/profiles/v2/query_profile.proto b/proto/desmos/profiles/v3/query_profile.proto similarity index 96% rename from proto/desmos/profiles/v2/query_profile.proto rename to proto/desmos/profiles/v3/query_profile.proto index cdcd2a48d1..501a23266e 100644 --- a/proto/desmos/profiles/v2/query_profile.proto +++ b/proto/desmos/profiles/v3/query_profile.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package desmos.profiles.v2; +package desmos.profiles.v3; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; diff --git a/testutil/profilestesting/chain_links.go b/testutil/profilestesting/chain_links.go index 935329c776..36dac06577 100644 --- a/testutil/profilestesting/chain_links.go +++ b/testutil/profilestesting/chain_links.go @@ -35,20 +35,28 @@ func (a ChainLinkAccount) ChainName() string { return a.chainName } +func (a ChainLinkAccount) PubKey() cryptotypes.PubKey { + return a.pubKey +} + func (a ChainLinkAccount) PubKeyAny() *codectypes.Any { return NewAny(a.pubKey) } +func (a ChainLinkAccount) Sign(value string) []byte { + bech32Sig, _ := a.privKey.Sign([]byte(value)) + return bech32Sig +} + func (a ChainLinkAccount) Bech32Address() *types.Bech32Address { addr, _ := sdk.Bech32ifyAddressBytes(a.bech32Prefix, a.pubKey.Address()) return types.NewBech32Address(addr, a.bech32Prefix) } func (a ChainLinkAccount) Bech32SignatureData(signedValue string) types.SignatureData { - bech32Sig, _ := a.privKey.Sign([]byte(signedValue)) return &types.SingleSignatureData{ Mode: signing.SignMode_SIGN_MODE_TEXTUAL, - Signature: bech32Sig, + Signature: a.Sign(signedValue), } } diff --git a/x/posts/legacy/v2/models.pb.go b/x/posts/legacy/v2/models.pb.go index b93b270e34..a87bc4ebc4 100644 --- a/x/posts/legacy/v2/models.pb.go +++ b/x/posts/legacy/v2/models.pb.go @@ -523,7 +523,7 @@ type Attachment struct { SectionID uint32 `protobuf:"varint,2,opt,name=section_id,json=sectionId,proto3" json:"section_id,omitempty"` // Id of the post to which this attachment should be connected PostID uint64 `protobuf:"varint,3,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` - // If of this attachment + // Id of this attachment ID uint32 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"` // Content of the attachment Content *types.Any `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` diff --git a/x/profiles/abci.go b/x/profiles/abci.go new file mode 100644 index 0000000000..edd5647b76 --- /dev/null +++ b/x/profiles/abci.go @@ -0,0 +1,18 @@ +package profiles + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/desmos-labs/desmos/v4/x/profiles/keeper" + "github.com/desmos-labs/desmos/v4/x/profiles/types" +) + +// BeginBlocker is called every block, processes expired application links +func BeginBlocker(ctx sdk.Context, keeper keeper.Keeper) { + // Iterate over all the expiring application links + keeper.IterateExpiringApplicationLinks(ctx, func(_ int64, link types.ApplicationLink) (stop bool) { + // Delete the application link + keeper.DeleteApplicationLink(ctx, link) + return false + }) +} diff --git a/x/profiles/abci_benchmarks_test.go b/x/profiles/abci_benchmarks_test.go new file mode 100644 index 0000000000..7b976d176e --- /dev/null +++ b/x/profiles/abci_benchmarks_test.go @@ -0,0 +1,128 @@ +package profiles_test + +import ( + "math/rand" + "testing" + "time" + + "github.com/desmos-labs/desmos/v4/x/profiles" + + "github.com/desmos-labs/desmos/v4/testutil/profilestesting" + + "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + db "github.com/tendermint/tm-db" + + "github.com/desmos-labs/desmos/v4/app" + "github.com/desmos-labs/desmos/v4/x/profiles/keeper" + "github.com/desmos-labs/desmos/v4/x/profiles/types" +) + +func setupBenchTest() (sdk.Context, authkeeper.AccountKeeper, keeper.Keeper) { + // Define the store keys + keys := sdk.NewKVStoreKeys(types.StoreKey, authtypes.StoreKey, paramstypes.StoreKey) + tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + + storeKey := keys[types.StoreKey] + + // Create an in-memory db + memDB := db.NewMemDB() + ms := store.NewCommitMultiStore(memDB) + for _, key := range keys { + ms.MountStoreWithDB(key, sdk.StoreTypeIAVL, memDB) + } + for _, tKey := range tKeys { + ms.MountStoreWithDB(tKey, sdk.StoreTypeTransient, memDB) + } + for _, memKey := range memKeys { + ms.MountStoreWithDB(memKey, sdk.StoreTypeMemory, nil) + } + + if err := ms.LoadLatestVersion(); err != nil { + panic(err) + } + + ctx := sdk.NewContext(ms, tmproto.Header{ChainID: "test-chain-id"}, false, log.NewNopLogger()) + cdc, legacyAminoCdc := app.MakeCodecs() + + paramsKeeper := paramskeeper.NewKeeper( + cdc, legacyAminoCdc, keys[paramstypes.StoreKey], tKeys[paramstypes.TStoreKey], + ) + + ak := authkeeper.NewAccountKeeper( + cdc, + keys[authtypes.StoreKey], + paramsKeeper.Subspace(authtypes.ModuleName), + authtypes.ProtoBaseAccount, + app.GetMaccPerms(), + ) + + k := keeper.NewKeeper( + cdc, + legacyAminoCdc, + storeKey, + paramsKeeper.Subspace(types.DefaultParamsSpace), + ak, + nil, + nil, + nil, + nil, + ) + + return ctx, ak, k +} + +func generateRandomAppLinks(r *rand.Rand, linkNum int) []types.ApplicationLink { + accounts := simtypes.RandomAccounts(r, r.Intn(linkNum)) + var appLinks []types.ApplicationLink + for _, account := range accounts { + link := types.NewApplicationLink( + account.Address.String(), + types.NewData(simtypes.RandStringOfLength(r, 5), simtypes.RandStringOfLength(r, 6)), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData(simtypes.RandStringOfLength(r, 5), simtypes.RandStringOfLength(r, 5)), + simtypes.RandStringOfLength(r, 10), + ), + nil, + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + ) + + appLinks = append(appLinks, link) + } + + return appLinks +} + +func BenchmarkKeeper_DeleteExpiredApplicationLinks(b *testing.B) { + ctx, ak, k := setupBenchTest() + links := generateRandomAppLinks(rand.New(rand.NewSource(100)), 1) + ctx, _ = ctx.CacheContext() + + for _, link := range links { + ak.SetAccount(ctx, profilestesting.ProfileFromAddr(link.User)) + err := k.SaveApplicationLink(ctx, link) + require.NoError(b, err) + } + + b.ResetTimer() + b.Run("iterate and delete expired links", func(b *testing.B) { + for i := 0; i < b.N; i++ { + b.ReportAllocs() + profiles.BeginBlocker(ctx, k) + } + }) +} diff --git a/x/profiles/abci_test.go b/x/profiles/abci_test.go new file mode 100644 index 0000000000..19cc72d3d7 --- /dev/null +++ b/x/profiles/abci_test.go @@ -0,0 +1,140 @@ +package profiles_test + +import ( + "testing" + "time" + + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + "github.com/desmos-labs/desmos/v4/testutil/profilestesting" + "github.com/desmos-labs/desmos/v4/x/profiles" + + "github.com/desmos-labs/desmos/v4/x/profiles/keeper" + "github.com/desmos-labs/desmos/v4/x/profiles/types" + + relationshipskeeper "github.com/desmos-labs/desmos/v4/x/relationships/keeper" + relationshipstypes "github.com/desmos-labs/desmos/v4/x/relationships/types" + + "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + db "github.com/tendermint/tm-db" + + "github.com/desmos-labs/desmos/v4/app" + subspaceskeeper "github.com/desmos-labs/desmos/v4/x/subspaces/keeper" + subspacestypes "github.com/desmos-labs/desmos/v4/x/subspaces/types" +) + +func TestBeginBlocker(t *testing.T) { + // Define store keys + keys := sdk.NewMemoryStoreKeys( + paramstypes.StoreKey, authtypes.StoreKey, + relationshipstypes.StoreKey, types.StoreKey, + ) + tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) + + // Create an in-memory db + memDB := db.NewMemDB() + ms := store.NewCommitMultiStore(memDB) + for _, key := range keys { + ms.MountStoreWithDB(key, sdk.StoreTypeIAVL, memDB) + } + for _, tKey := range tKeys { + ms.MountStoreWithDB(tKey, sdk.StoreTypeTransient, memDB) + } + + err := ms.LoadLatestVersion() + require.NoError(t, err) + + ctx := sdk.NewContext(ms, tmproto.Header{ChainID: "test-chain"}, false, log.NewNopLogger()) + cdc, legacyAmino := app.MakeCodecs() + pk := paramskeeper.NewKeeper(cdc, legacyAmino, keys[paramstypes.StoreKey], tKeys[paramstypes.TStoreKey]) + sk := subspaceskeeper.NewKeeper(cdc, keys[subspacestypes.StoreKey]) + rk := relationshipskeeper.NewKeeper(cdc, keys[relationshipstypes.StoreKey], sk) + ak := authkeeper.NewAccountKeeper(cdc, keys[authtypes.StoreKey], pk.Subspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, app.GetMaccPerms()) + k := keeper.NewKeeper(cdc, legacyAmino, keys[types.StoreKey], pk.Subspace(types.DefaultParamsSpace), ak, rk, nil, nil, nil) + + testCases := []struct { + name string + setupCtx func(ctx sdk.Context) sdk.Context + store func(ctx sdk.Context) + check func(ctx sdk.Context) + expEvents sdk.Events + }{ + { + name: "expired links are deleted correctly", + setupCtx: func(ctx sdk.Context) sdk.Context { + return ctx.WithBlockTime(time.Date(2020, 1, 1, 01, 00, 00, 000, time.UTC)) + }, + store: func(ctx sdk.Context) { + address := "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773" + link := types.NewApplicationLink( + address, + types.NewData("twitter", "twitteruser"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("twitter", "calldata"), + "client_id", + ), + nil, + time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + ) + + require.NoError(t, k.SaveProfile(ctx, profilestesting.ProfileFromAddr(address))) + require.NoError(t, k.SaveApplicationLink(ctx, link)) + }, + expEvents: sdk.Events{ + sdk.NewEvent( + types.EventTypeApplicationLinkDeleted, + sdk.NewAttribute(types.AttributeKeyUser, "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"), + sdk.NewAttribute(types.AttributeKeyApplicationName, "twitter"), + sdk.NewAttribute(types.AttributeKeyApplicationUsername, "twitteruser"), + sdk.NewAttribute( + types.AttributeKeyApplicationLinkExpirationTime, + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC).Format(time.RFC3339), + ), + ), + }, + check: func(ctx sdk.Context) { + require.False(t, k.HasApplicationLink(ctx, + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + "twitter", + "twitteruser", + )) + }, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + ctx, _ := ctx.CacheContext() + if tc.setupCtx != nil { + ctx = tc.setupCtx(ctx) + } + if tc.store != nil { + tc.store(ctx) + } + + // Reset the events + ctx = ctx.WithEventManager(sdk.NewEventManager()) + + // Run the BeginBlocker + profiles.BeginBlocker(ctx, k) + + // Check the events and storage + require.Equal(t, tc.expEvents, ctx.EventManager().Events()) + if tc.check != nil { + tc.check(ctx) + } + }) + } +} diff --git a/x/profiles/client/cli/cli_app_links_test.go b/x/profiles/client/cli/cli_app_links_test.go index 9a06018fa9..672492bb98 100644 --- a/x/profiles/client/cli/cli_app_links_test.go +++ b/x/profiles/client/cli/cli_app_links_test.go @@ -45,6 +45,7 @@ func (s *IntegrationTestSuite) TestCmdQueryApplicationsLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(9999, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, @@ -81,6 +82,7 @@ func (s *IntegrationTestSuite) TestCmdQueryApplicationsLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(9999, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, diff --git a/x/profiles/client/cli/cli_test.go b/x/profiles/client/cli/cli_test.go index 23ae59824d..fb893c2305 100644 --- a/x/profiles/client/cli/cli_test.go +++ b/x/profiles/client/cli/cli_test.go @@ -134,6 +134,7 @@ func (s *IntegrationTestSuite) SetupSuite() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(9999, 1, 1, 00, 00, 00, 000, time.UTC), ), } diff --git a/x/profiles/client/utils/cli.pb.go b/x/profiles/client/utils/cli.pb.go index 07db785ce8..c0a2a81458 100644 --- a/x/profiles/client/utils/cli.pb.go +++ b/x/profiles/client/utils/cli.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/client/cli.proto +// source: desmos/profiles/v3/client/cli.proto package utils @@ -43,7 +43,7 @@ func (m *ChainLinkJSON) Reset() { *m = ChainLinkJSON{} } func (m *ChainLinkJSON) String() string { return proto.CompactTextString(m) } func (*ChainLinkJSON) ProtoMessage() {} func (*ChainLinkJSON) Descriptor() ([]byte, []int) { - return fileDescriptor_953cf0366775bd6d, []int{0} + return fileDescriptor_8dd0252be1e0ade7, []int{0} } func (m *ChainLinkJSON) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -94,18 +94,18 @@ func (m *ChainLinkJSON) GetChainConfig() types1.ChainConfig { } func init() { - proto.RegisterType((*ChainLinkJSON)(nil), "desmos.profiles.v2.client.ChainLinkJSON") + proto.RegisterType((*ChainLinkJSON)(nil), "desmos.profiles.v3.client.ChainLinkJSON") } func init() { - proto.RegisterFile("desmos/profiles/v2/client/cli.proto", fileDescriptor_953cf0366775bd6d) + proto.RegisterFile("desmos/profiles/v3/client/cli.proto", fileDescriptor_8dd0252be1e0ade7) } -var fileDescriptor_953cf0366775bd6d = []byte{ +var fileDescriptor_8dd0252be1e0ade7 = []byte{ // 384 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xbb, 0x4e, 0xf3, 0x30, 0x14, 0x80, 0x93, 0xfe, 0xfa, 0x2f, 0x4a, 0xfb, 0x33, 0x84, 0x0e, 0x6d, 0x91, 0x12, 0x08, 0x0b, - 0x12, 0xaa, 0x2d, 0x15, 0x06, 0xd4, 0xad, 0x29, 0x2c, 0x08, 0x71, 0x09, 0x1b, 0x4b, 0xe4, 0x5c, + 0x12, 0xaa, 0x2d, 0x51, 0x06, 0xd4, 0xad, 0x29, 0x2c, 0x08, 0x71, 0x09, 0x1b, 0x4b, 0xe4, 0x5c, 0x6b, 0xd5, 0x89, 0xa3, 0x38, 0xad, 0xe8, 0x5b, 0x30, 0x30, 0x30, 0xf6, 0x21, 0x78, 0x88, 0x8a, 0xa9, 0x23, 0x53, 0x85, 0xda, 0x85, 0xb9, 0x4f, 0x80, 0x62, 0x27, 0x2a, 0x42, 0x9d, 0x72, 0x9c, 0xf3, 0x9d, 0xcf, 0xe7, 0x1c, 0x59, 0x39, 0xf4, 0x7c, 0x16, 0x51, 0x06, 0x93, 0x94, 0x06, 0x98, @@ -116,17 +116,17 @@ var fileDescriptor_953cf0366775bd6d = []byte{ 0x48, 0xc5, 0xa1, 0x48, 0x1d, 0x6f, 0x69, 0x36, 0xa2, 0x9e, 0x4f, 0x98, 0xed, 0x0e, 0x10, 0x8e, 0x6d, 0x82, 0xe3, 0x61, 0x01, 0x1b, 0xcf, 0x15, 0xe5, 0x7f, 0x3f, 0xff, 0x7b, 0x85, 0xe3, 0xe1, 0xe5, 0xfd, 0xcd, 0xb5, 0x7a, 0xa7, 0xfc, 0x45, 0x9e, 0x97, 0xfa, 0x8c, 0x35, 0xe4, 0x7d, 0xf9, - 0xa8, 0xda, 0xa9, 0x03, 0xd1, 0x0c, 0x28, 0x9b, 0x01, 0xbd, 0x78, 0x62, 0x1e, 0xac, 0x17, 0xfa, - 0xce, 0x04, 0x45, 0xa4, 0x6b, 0x14, 0xb8, 0xf1, 0xf6, 0xda, 0xae, 0xf6, 0x44, 0x7c, 0x8e, 0x32, - 0x64, 0x95, 0x1e, 0xf5, 0x42, 0xf9, 0x9d, 0xa4, 0x94, 0x06, 0x8d, 0x0a, 0x17, 0x36, 0xc1, 0x96, - 0x4d, 0xdd, 0xe6, 0x80, 0x59, 0x9f, 0x2d, 0x74, 0x69, 0xbd, 0xd0, 0x6b, 0xc2, 0xcc, 0xab, 0x0c, - 0x4b, 0x54, 0xab, 0xb6, 0x52, 0x13, 0x03, 0xb8, 0x34, 0x0e, 0x70, 0xd8, 0xf8, 0xc5, 0x6d, 0xfa, - 0x36, 0x1b, 0x1f, 0xa9, 0xcf, 0x31, 0x73, 0xaf, 0x70, 0xee, 0x0a, 0xe7, 0x77, 0x85, 0x61, 0x55, - 0xdd, 0x0d, 0xd9, 0xfd, 0xf7, 0x32, 0xd5, 0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ad, 0xd9, 0x52, 0x93, + 0xe7, 0x4b, 0x4d, 0xfe, 0x58, 0x6a, 0xf2, 0xd3, 0x4a, 0x93, 0xe6, 0x2b, 0x4d, 0x7a, 0x5f, 0x69, + 0xd2, 0xc3, 0x59, 0x88, 0xb3, 0xc1, 0xc8, 0x01, 0x2e, 0x8d, 0xa0, 0xb8, 0xb8, 0x4d, 0x90, 0xc3, + 0x8a, 0x18, 0x8e, 0x4f, 0xe1, 0xe3, 0x66, 0xf3, 0xc5, 0x1b, 0x19, 0x65, 0x98, 0x30, 0xe7, 0x0f, + 0xdf, 0x5f, 0xe7, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x46, 0x97, 0xab, 0x39, 0x4d, 0x02, 0x00, 0x00, } func (this *ChainLinkJSON) Equal(that interface{}) bool { diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go index 8637d7b2ff..090022c63e 100644 --- a/x/profiles/keeper/alias_functions.go +++ b/x/profiles/keeper/alias_functions.go @@ -1,6 +1,8 @@ package keeper import ( + "bytes" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -131,6 +133,54 @@ func (k Keeper) GetApplicationLinks(ctx sdk.Context) []types.ApplicationLink { return links } +// IterateExpiringApplicationLinks iterates through all the expiring application links references. +// The key will be skipped and deleted if the application link has already been deleted. +func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index int64, link types.ApplicationLink) (stop bool)) { + store := ctx.KVStore(k.storeKey) + + iterator := sdk.KVStorePrefixIterator(store, types.ExpiringAppLinkTimePrefix) + defer iterator.Close() + + i := int64(0) + for ; iterator.Valid(); iterator.Next() { + // This iterator has the following key and value structure: + // ExpiringAppLinkTimePrefix | Expiration Time | Client ID -> Client ID + // + // This means that in order to get the expired application links we need to: + // 1. Extract the Expiration Time from the iterator key + // 2. If the Expiration Time has passed, get the application link by using the Client ID from the iterator value + + // First, we remove the prefix from the key, so we are left with the Expiration Time and Client ID + trimmedPrefixKey := bytes.TrimPrefix(iterator.Key(), types.ExpiringAppLinkTimePrefix) + + // Second, we remove the Client ID from the trimmed key, so we are left only with the Expiration Time + expiringTime, err := sdk.ParseTimeBytes(bytes.TrimSuffix(trimmedPrefixKey, iterator.Value())) + if err != nil { + panic(err) + } + + // Third, we get the Client ID from the iterator value + clientIDKey := types.ApplicationLinkClientIDKey(string(iterator.Value())) + + // Skip if application link has been deleted already + if !store.Has(clientIDKey) { + store.Delete(iterator.Key()) + continue + } + + // Check if the expiration time has passed (the application link is expired) + if ctx.BlockTime().After(expiringTime) { + applicationKey := store.Get(clientIDKey) + link := types.MustUnmarshalApplicationLink(k.cdc, store.Get(applicationKey)) + stop := fn(i, link) + if stop { + break + } + } + i++ + } +} + // -------------------------------------------------------------------------------------------------------------------- // IterateChainLinks iterates through the chain links and perform the provided function diff --git a/x/profiles/keeper/alias_functions_test.go b/x/profiles/keeper/alias_functions_test.go index 8edb34a637..7dc2b0718c 100644 --- a/x/profiles/keeper/alias_functions_test.go +++ b/x/profiles/keeper/alias_functions_test.go @@ -162,6 +162,7 @@ func (suite *KeeperTestSuite) TestKeeper_IterateUserApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), types.NewApplicationLink( address, @@ -175,6 +176,7 @@ func (suite *KeeperTestSuite) TestKeeper_IterateUserApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), types.NewApplicationLink( address, @@ -188,6 +190,7 @@ func (suite *KeeperTestSuite) TestKeeper_IterateUserApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), } @@ -224,6 +227,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), types.NewApplicationLink( address, @@ -237,6 +241,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), types.NewApplicationLink( address, @@ -250,6 +255,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), } @@ -265,6 +271,94 @@ func (suite *KeeperTestSuite) TestKeeper_GetApplicationLinks() { suite.Require().Equal(links, suite.k.GetApplicationLinks(ctx)) } +func (suite *KeeperTestSuite) TestKeeper_IterateExpiringApplicationLinks() { + testCases := []struct { + name string + setupCtx func(ctx sdk.Context) sdk.Context + store func(ctx sdk.Context) + expLinks []types.ApplicationLink + }{ + { + name: "expiring links are iterated properly", + setupCtx: func(ctx sdk.Context) sdk.Context { + return ctx.WithBlockTime(time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC)) + }, + store: func(ctx sdk.Context) { + suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47")) + + err := suite.k.SaveApplicationLink(ctx, types.NewApplicationLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + types.NewData("github", "github-user"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("github", "call_data"), + "client_id", + ), + nil, + time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + )) + suite.Require().NoError(err) + + err = suite.k.SaveApplicationLink(ctx, types.NewApplicationLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + types.NewData("reddit", "reddit-user"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("reddit", "call_data"), + "client_id2", + ), + nil, + time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + )) + suite.Require().NoError(err) + }, + expLinks: []types.ApplicationLink{ + types.NewApplicationLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + types.NewData("github", "github-user"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("github", "call_data"), + "client_id", + ), + nil, + time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + ), + }, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + ctx, _ := suite.ctx.CacheContext() + if tc.setupCtx != nil { + ctx = tc.setupCtx(ctx) + } + if tc.store != nil { + tc.store(ctx) + } + + var iteratedLinks []types.ApplicationLink + suite.k.IterateExpiringApplicationLinks(ctx, func(index int64, link types.ApplicationLink) (stop bool) { + iteratedLinks = append(iteratedLinks, link) + return false + }) + + suite.Require().Equal(tc.expLinks, iteratedLinks) + }) + } +} + // -------------------------------------------------------------------------------------------------------------------- func (suite *KeeperTestSuite) TestKeeper_GetChainLinks() { diff --git a/x/profiles/keeper/genesis_test.go b/x/profiles/keeper/genesis_test.go index 14796113fe..0b48ebb7e2 100644 --- a/x/profiles/keeper/genesis_test.go +++ b/x/profiles/keeper/genesis_test.go @@ -65,6 +65,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ) suite.k.SetParams(ctx, params) suite.k.SetPort(ctx, "port-id") @@ -93,6 +94,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), } for _, link := range applicationLinks { @@ -117,6 +119,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ), "port-id", []types.ChainLink{ @@ -138,6 +141,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), }, ), @@ -246,6 +250,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ), "profiles-port-id", []types.ChainLink{ @@ -276,6 +281,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), }, ), @@ -298,6 +304,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ) suite.Require().Equal(params, suite.k.GetParams(ctx)) @@ -334,6 +341,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), } suite.Require().Equal(applicationLinks, suite.k.GetApplicationLinks(ctx)) diff --git a/x/profiles/keeper/grpc_query_test.go b/x/profiles/keeper/grpc_query_test.go index ce8f4f34bc..6314aed5ee 100644 --- a/x/profiles/keeper/grpc_query_test.go +++ b/x/profiles/keeper/grpc_query_test.go @@ -661,6 +661,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -680,6 +681,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), )) }, @@ -706,6 +708,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, @@ -732,6 +735,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -751,6 +755,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), )) }, @@ -777,6 +782,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, @@ -803,6 +809,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -822,6 +829,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), )) }, @@ -846,6 +854,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), types.NewApplicationLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", @@ -862,6 +871,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, @@ -888,6 +898,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) suite.Require().NoError(suite.k.SaveApplicationLink( @@ -907,6 +918,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), )) }, @@ -933,6 +945,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinks() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), }, }, @@ -993,6 +1006,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkByClientID() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), )), ) }, @@ -1013,6 +1027,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkByClientID() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), }, } @@ -1067,6 +1082,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) @@ -1090,6 +1106,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) }, @@ -1131,6 +1148,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) @@ -1154,6 +1172,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) @@ -1177,6 +1196,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) }, @@ -1218,6 +1238,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) @@ -1241,6 +1262,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) @@ -1264,6 +1286,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ApplicationLinkOwners() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), )), ) }, diff --git a/x/profiles/keeper/invariants_test.go b/x/profiles/keeper/invariants_test.go index 6387591d24..b7bfe3894d 100644 --- a/x/profiles/keeper/invariants_test.go +++ b/x/profiles/keeper/invariants_test.go @@ -121,6 +121,7 @@ func (suite *KeeperTestSuite) TestInvariants() { types.AppLinkStateVerificationStarted, types.NewOracleRequest(1, 1, types.NewOracleRequestCallData("", ""), "client_id"), nil, + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), time.Now(), ) store.Set( diff --git a/x/profiles/keeper/keeper_app_links.go b/x/profiles/keeper/keeper_app_links.go index e5e469a7cd..42e4823da1 100644 --- a/x/profiles/keeper/keeper_app_links.go +++ b/x/profiles/keeper/keeper_app_links.go @@ -1,6 +1,8 @@ package keeper import ( + "time" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -26,6 +28,8 @@ func (k Keeper) SaveApplicationLink(ctx sdk.Context, link types.ApplicationLink) store.Set(userApplicationLinkKey, types.MustMarshalApplicationLink(k.cdc, link)) store.Set(types.ApplicationLinkClientIDKey(link.OracleRequest.ClientID), userApplicationLinkKey) store.Set(types.ApplicationLinkOwnerKey(link.Data.Application, link.Data.Username, link.User), []byte{0x01}) + applicationLinkExpiringTimeKey := types.ApplicationLinkExpiringTimeKey(link.ExpirationTime, link.OracleRequest.ClientID) + store.Set(applicationLinkExpiringTimeKey, []byte(link.OracleRequest.ClientID)) ctx.EventManager().EmitEvent( sdk.NewEvent( @@ -98,8 +102,19 @@ func (k Keeper) DeleteApplicationLink(ctx sdk.Context, appLink types.Application store.Delete(types.UserApplicationLinkKey(appLink.User, appLink.Data.Application, appLink.Data.Username)) store.Delete(types.ApplicationLinkClientIDKey(appLink.OracleRequest.ClientID)) store.Delete(types.ApplicationLinkOwnerKey(appLink.Data.Application, appLink.Data.Username, appLink.User)) + store.Delete(types.ApplicationLinkExpiringTimeKey(appLink.ExpirationTime, appLink.OracleRequest.ClientID)) k.AfterApplicationLinkDeleted(ctx, appLink) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeApplicationLinkDeleted, + sdk.NewAttribute(types.AttributeKeyUser, appLink.User), + sdk.NewAttribute(types.AttributeKeyApplicationName, appLink.Data.Application), + sdk.NewAttribute(types.AttributeKeyApplicationUsername, appLink.Data.Username), + sdk.NewAttribute(types.AttributeKeyApplicationLinkExpirationTime, appLink.ExpirationTime.Format(time.RFC3339)), + ), + ) } // DeleteAllUserApplicationLinks delete all the applications links associated with the given user diff --git a/x/profiles/keeper/keeper_app_links_test.go b/x/profiles/keeper/keeper_app_links_test.go index 46e0bb91cc..cb4589fa2c 100644 --- a/x/profiles/keeper/keeper_app_links_test.go +++ b/x/profiles/keeper/keeper_app_links_test.go @@ -32,6 +32,7 @@ func (suite *KeeperTestSuite) Test_SaveApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: true, }, @@ -53,6 +54,7 @@ func (suite *KeeperTestSuite) Test_SaveApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: false, check: func(ctx sdk.Context) { @@ -121,6 +123,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(address))) @@ -148,6 +151,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(address))) @@ -175,6 +179,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(address))) @@ -202,6 +207,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(address))) @@ -224,6 +230,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), }, } @@ -278,6 +285,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLinkByClientID() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(address))) @@ -300,6 +308,7 @@ func (suite *KeeperTestSuite) Test_GetApplicationLinkByClientID() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), }, } @@ -349,6 +358,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(address))) @@ -367,6 +377,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), check: func(ctx sdk.Context) { suite.Require().True(suite.k.HasApplicationLink(ctx, @@ -392,6 +403,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(address))) @@ -410,6 +422,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), check: func(ctx sdk.Context) { suite.Require().True(suite.k.HasApplicationLink(ctx, @@ -435,6 +448,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(address))) @@ -453,6 +467,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), check: func(ctx sdk.Context) { suite.Require().True(suite.k.HasApplicationLink(ctx, @@ -478,6 +493,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().NoError(suite.k.SaveProfile(ctx, profilestesting.ProfileFromAddr(address))) @@ -496,6 +512,7 @@ func (suite *KeeperTestSuite) Test_DeleteApplicationLink() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), check: func(ctx sdk.Context) { suite.Require().False(suite.k.HasApplicationLink(ctx, diff --git a/x/profiles/keeper/keeper_params_test.go b/x/profiles/keeper/keeper_params_test.go index c63c64ab0d..626741e6e1 100644 --- a/x/profiles/keeper/keeper_params_test.go +++ b/x/profiles/keeper/keeper_params_test.go @@ -19,6 +19,7 @@ func (suite *KeeperTestSuite) TestKeeper_SetParams() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ) suite.k.SetParams(suite.ctx, params) @@ -48,6 +49,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetParams() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ) suite.k.SetParams(ctx, params) }, @@ -64,6 +66,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetParams() { 200_000, sdk.NewCoin("band", sdk.NewInt(10)), ), + types.NewAppLinksParams(types.DefaultAppLinksValidityDuration), ), }, { diff --git a/x/profiles/keeper/migrations.go b/x/profiles/keeper/migrations.go index aca434200b..18a53a6594 100644 --- a/x/profiles/keeper/migrations.go +++ b/x/profiles/keeper/migrations.go @@ -3,27 +3,25 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - "github.com/gogo/protobuf/grpc" v4 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4" v5 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5" + v6 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v6" ) // DONTCOVER // Migrator is a struct for handling in-place store migrations. type Migrator struct { - keeper Keeper - ak authkeeper.AccountKeeper - queryServer grpc.Server + keeper Keeper + ak authkeeper.AccountKeeper } // NewMigrator returns a new Migrator -func NewMigrator(ak authkeeper.AccountKeeper, keeper Keeper, queryServer grpc.Server) Migrator { +func NewMigrator(ak authkeeper.AccountKeeper, keeper Keeper) Migrator { return Migrator{ - keeper: keeper, - ak: ak, - queryServer: queryServer, + keeper: keeper, + ak: ak, } } @@ -32,7 +30,12 @@ func (m Migrator) Migrate4to5(ctx sdk.Context) error { return v4.MigrateStore(ctx, m.ak, m.keeper.storeKey, m.keeper.legacyAmino, m.keeper.cdc) } -// Migrate5To6 migrates from version 5 to 6. -func (m Migrator) Migrate5To6(ctx sdk.Context) error { +// Migrate5to6 migrates from version 5 to 6. +func (m Migrator) Migrate5to6(ctx sdk.Context) error { return v5.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc, m.keeper.legacyAmino) } + +// Migrate6to7 migrates from version 6 to 7. +func (m Migrator) Migrate6to7(ctx sdk.Context) error { + return v6.MigrateStore(ctx, m.keeper.ak, m.keeper.storeKey, m.keeper.legacyAmino, m.keeper.cdc) +} diff --git a/x/profiles/keeper/relay_app_links.go b/x/profiles/keeper/relay_app_links.go index 602880a84c..09cb97066d 100644 --- a/x/profiles/keeper/relay_app_links.go +++ b/x/profiles/keeper/relay_app_links.go @@ -128,6 +128,7 @@ func (k Keeper) StartProfileConnection( ), nil, ctx.BlockTime(), + ctx.BlockTime().Add(k.GetParams(ctx).AppLinks.ValidityDuration), )) if err != nil { return err diff --git a/x/profiles/keeper/relay_app_links_test.go b/x/profiles/keeper/relay_app_links_test.go index 708b5bc7fa..a50990fa20 100644 --- a/x/profiles/keeper/relay_app_links_test.go +++ b/x/profiles/keeper/relay_app_links_test.go @@ -232,6 +232,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -255,6 +256,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewErrorResult(types.ErrRequestExpired), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -275,6 +277,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -298,6 +301,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewErrorResult(types.ErrRequestFailed), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -318,6 +322,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -348,6 +353,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -371,6 +377,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewErrorResult(types.ErrInvalidAppUsername), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -391,6 +398,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -420,6 +428,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -443,6 +452,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewErrorResult(types.ErrInvalidSignature), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -462,6 +472,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -480,6 +491,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewSuccessResult(hexValue, hexSig), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -499,6 +511,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -517,6 +530,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -536,6 +550,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewErrorResult(types.ErrInvalidSignature), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -554,6 +569,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewErrorResult(types.ErrInvalidSignature), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -573,6 +589,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewSuccessResult("value", "signature"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) err := suite.k.SaveApplicationLink(ctx, link) suite.Require().NoError(err) @@ -591,6 +608,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnRecvApplicationLinkPacketData() { ), types.NewSuccessResult("value", "signature"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, } @@ -651,6 +669,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestAcknowledgementPacket() ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr(address)) @@ -672,6 +691,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestAcknowledgementPacket() ), types.NewErrorResult("error"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, { @@ -690,6 +710,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestAcknowledgementPacket() ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr(address)) @@ -716,6 +737,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestAcknowledgementPacket() ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr(address)) @@ -737,6 +759,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestAcknowledgementPacket() ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, } @@ -792,6 +815,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestTimeoutPacket() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) suite.ak.SetAccount(ctx, profilestesting.ProfileFromAddr(address)) @@ -815,6 +839,7 @@ func (suite *KeeperTestSuite) TestKeeper_OnOracleRequestTimeoutPacket() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ) suite.Require().Equal(expected, link) }, diff --git a/x/profiles/legacy/v4/keeper.go b/x/profiles/legacy/v4/keeper.go index 1e9a733fb4..48a818d4f4 100644 --- a/x/profiles/legacy/v4/keeper.go +++ b/x/profiles/legacy/v4/keeper.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/desmos-labs/desmos/v4/x/profiles/types" + v4types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types" ) type Keeper struct { @@ -23,7 +23,7 @@ func NewKeeper(storeKey sdk.StoreKey, cdc codec.BinaryCodec) Keeper { func (k Keeper) IterateDTags(ctx sdk.Context, fn func(index int64, dTag string, value []byte) (stop bool)) { store := ctx.KVStore(k.storeKey) - dTagsStore := prefix.NewStore(store, DTagPrefix) + dTagsStore := prefix.NewStore(store, v4types.DTagPrefix) iterator := dTagsStore.Iterator(nil, nil) defer iterator.Close() @@ -35,17 +35,17 @@ func (k Keeper) IterateDTags(ctx sdk.Context, fn func(index int64, dTag string, } } -func (k Keeper) IterateDTagTransferRequests(ctx sdk.Context, fn func(index int64, request types.DTagTransferRequest) (stop bool)) { +func (k Keeper) IterateDTagTransferRequests(ctx sdk.Context, fn func(index int64, request v4types.DTagTransferRequest) (stop bool)) { store := ctx.KVStore(k.storeKey) - requestsStore := prefix.NewStore(store, DTagTransferRequestPrefix) + requestsStore := prefix.NewStore(store, v4types.DTagTransferRequestPrefix) iterator := requestsStore.Iterator(nil, nil) defer iterator.Close() var stop = false var index = int64(0) for ; iterator.Valid() && !stop; iterator.Next() { - var request types.DTagTransferRequest + var request v4types.DTagTransferRequest err := k.cdc.Unmarshal(iterator.Value(), &request) if err != nil { panic(err) @@ -55,17 +55,17 @@ func (k Keeper) IterateDTagTransferRequests(ctx sdk.Context, fn func(index int64 } } -func (k Keeper) IterateRelationships(ctx sdk.Context, fn func(index int64, relationship Relationship) (stop bool)) { +func (k Keeper) IterateRelationships(ctx sdk.Context, fn func(index int64, relationship v4types.Relationship) (stop bool)) { store := ctx.KVStore(k.storeKey) - relationshipsStore := prefix.NewStore(store, RelationshipsStorePrefix) + relationshipsStore := prefix.NewStore(store, v4types.RelationshipsStorePrefix) iterator := relationshipsStore.Iterator(nil, nil) defer iterator.Close() var stop = false var index = int64(0) for ; iterator.Valid() && !stop; iterator.Next() { - var relationship Relationship + var relationship v4types.Relationship err := k.cdc.Unmarshal(iterator.Value(), &relationship) if err != nil { panic(err) @@ -75,9 +75,9 @@ func (k Keeper) IterateRelationships(ctx sdk.Context, fn func(index int64, relat } } -func (k Keeper) GetRelationships(ctx sdk.Context) []Relationship { - var values []Relationship - k.IterateRelationships(ctx, func(_ int64, relationship Relationship) (stop bool) { +func (k Keeper) GetRelationships(ctx sdk.Context) []v4types.Relationship { + var values []v4types.Relationship + k.IterateRelationships(ctx, func(_ int64, relationship v4types.Relationship) (stop bool) { values = append(values, relationship) return false }) @@ -86,8 +86,8 @@ func (k Keeper) GetRelationships(ctx sdk.Context) []Relationship { func (k Keeper) DeleteRelationships(ctx sdk.Context) { var keys [][]byte - k.IterateRelationships(ctx, func(_ int64, relationship Relationship) (stop bool) { - keys = append(keys, RelationshipsStoreKey(relationship.Creator, relationship.SubspaceID, relationship.Recipient)) + k.IterateRelationships(ctx, func(_ int64, relationship v4types.Relationship) (stop bool) { + keys = append(keys, v4types.RelationshipsStoreKey(relationship.Creator, relationship.SubspaceID, relationship.Recipient)) return false }) @@ -97,17 +97,17 @@ func (k Keeper) DeleteRelationships(ctx sdk.Context) { } } -func (k Keeper) IterateBlocks(ctx sdk.Context, fn func(index int64, relationship UserBlock) (stop bool)) { +func (k Keeper) IterateBlocks(ctx sdk.Context, fn func(index int64, relationship v4types.UserBlock) (stop bool)) { store := ctx.KVStore(k.storeKey) - userBlocksStore := prefix.NewStore(store, UsersBlocksStorePrefix) + userBlocksStore := prefix.NewStore(store, v4types.UsersBlocksStorePrefix) iterator := userBlocksStore.Iterator(nil, nil) defer iterator.Close() var stop = false var index = int64(0) for ; iterator.Valid() && !stop; iterator.Next() { - var block UserBlock + var block v4types.UserBlock err := k.cdc.Unmarshal(iterator.Value(), &block) if err != nil { panic(err) @@ -117,9 +117,9 @@ func (k Keeper) IterateBlocks(ctx sdk.Context, fn func(index int64, relationship } } -func (k Keeper) GetBlocks(ctx sdk.Context) []UserBlock { - var values []UserBlock - k.IterateBlocks(ctx, func(_ int64, block UserBlock) (stop bool) { +func (k Keeper) GetBlocks(ctx sdk.Context) []v4types.UserBlock { + var values []v4types.UserBlock + k.IterateBlocks(ctx, func(_ int64, block v4types.UserBlock) (stop bool) { values = append(values, block) return false }) @@ -129,8 +129,8 @@ func (k Keeper) GetBlocks(ctx sdk.Context) []UserBlock { func (k Keeper) DeleteBlocks(ctx sdk.Context) { var keys [][]byte - k.IterateBlocks(ctx, func(_ int64, block UserBlock) (stop bool) { - keys = append(keys, UserBlockStoreKey(block.Blocker, block.SubspaceID, block.Blocked)) + k.IterateBlocks(ctx, func(_ int64, block v4types.UserBlock) (stop bool) { + keys = append(keys, v4types.UserBlockStoreKey(block.Blocker, block.SubspaceID, block.Blocked)) return false }) @@ -140,17 +140,17 @@ func (k Keeper) DeleteBlocks(ctx sdk.Context) { } } -func (k Keeper) IterateChainLinks(ctx sdk.Context, fn func(index int64, chainLink ChainLink) (stop bool)) { +func (k Keeper) IterateChainLinks(ctx sdk.Context, fn func(index int64, chainLink v4types.ChainLink) (stop bool)) { store := ctx.KVStore(k.storeKey) - chainLinksStore := prefix.NewStore(store, ChainLinksPrefix) + chainLinksStore := prefix.NewStore(store, v4types.ChainLinksPrefix) iterator := chainLinksStore.Iterator(nil, nil) defer iterator.Close() var stop = false var index = int64(0) for ; iterator.Valid() && !stop; iterator.Next() { - var chainLink ChainLink + var chainLink v4types.ChainLink err := k.cdc.Unmarshal(iterator.Value(), &chainLink) if err != nil { panic(err) @@ -160,17 +160,17 @@ func (k Keeper) IterateChainLinks(ctx sdk.Context, fn func(index int64, chainLin } } -func (k Keeper) IterateApplicationLinks(ctx sdk.Context, fn func(index int64, applicationLink types.ApplicationLink) (stop bool)) { +func (k Keeper) IterateApplicationLinks(ctx sdk.Context, fn func(index int64, applicationLink v4types.ApplicationLink) (stop bool)) { store := ctx.KVStore(k.storeKey) - applicationLinksStore := prefix.NewStore(store, UserApplicationLinkPrefix) + applicationLinksStore := prefix.NewStore(store, v4types.UserApplicationLinkPrefix) iterator := applicationLinksStore.Iterator(nil, nil) defer iterator.Close() var stop = false var index = int64(0) for ; iterator.Valid() && !stop; iterator.Next() { - var applicationLink types.ApplicationLink + var applicationLink v4types.ApplicationLink err := k.cdc.Unmarshal(iterator.Value(), &applicationLink) if err != nil { panic(err) @@ -183,14 +183,14 @@ func (k Keeper) IterateApplicationLinks(ctx sdk.Context, fn func(index int64, ap func (k Keeper) IterateApplicationLinkClientIDKeys(ctx sdk.Context, fn func(index int64, key []byte, value []byte) (stop bool)) { store := ctx.KVStore(k.storeKey) - clientIDsStore := prefix.NewStore(store, ApplicationLinkClientIDPrefix) + clientIDsStore := prefix.NewStore(store, v4types.ApplicationLinkClientIDPrefix) iterator := clientIDsStore.Iterator(nil, nil) defer iterator.Close() var stop = false var index = int64(0) for ; iterator.Valid() && !stop; iterator.Next() { - stop = fn(index, append(ApplicationLinkClientIDPrefix, iterator.Key()...), iterator.Value()) + stop = fn(index, append(v4types.ApplicationLinkClientIDPrefix, iterator.Key()...), iterator.Value()) index++ } } diff --git a/x/profiles/legacy/v4/store.go b/x/profiles/legacy/v4/store.go index 5f27383a4a..b2a1bdc255 100644 --- a/x/profiles/legacy/v4/store.go +++ b/x/profiles/legacy/v4/store.go @@ -13,10 +13,12 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + v4types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types" + v5types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" "github.com/desmos-labs/desmos/v4/x/profiles/types" ) -// MigrateStore performs in-place store migrations from v4 to v5 +// MigrateStore performs in-place store migrations from v4 to v5. // The migration includes: // // - migrating all the profiles to have the proper Protobuf type @@ -51,9 +53,9 @@ func MigrateStore(ctx sdk.Context, ak authkeeper.AccountKeeper, storeKey sdk.Sto } func migrateProfiles(ctx sdk.Context, ak authkeeper.AccountKeeper) error { - var profiles []*Profile + var profiles []*v4types.Profile ak.IterateAccounts(ctx, func(account authtypes.AccountI) (stop bool) { - if profile, ok := account.(*Profile); ok { + if profile, ok := account.(*v4types.Profile); ok { profiles = append(profiles, profile) } return false @@ -61,11 +63,11 @@ func migrateProfiles(ctx sdk.Context, ak authkeeper.AccountKeeper) error { for _, profile := range profiles { // Convert the profile - v2Profile, err := types.NewProfile( + v5Profile, err := v5types.NewProfile( profile.DTag, profile.Nickname, profile.Bio, - types.NewPictures(profile.Pictures.Profile, profile.Pictures.Cover), + v5types.NewPictures(profile.Pictures.Profile, profile.Pictures.Cover), profile.CreationDate, profile.GetAccount(), ) @@ -74,7 +76,7 @@ func migrateProfiles(ctx sdk.Context, ak authkeeper.AccountKeeper) error { } // Set the account - ak.SetAccount(ctx, v2Profile) + ak.SetAccount(ctx, v5Profile) } return nil @@ -90,7 +92,7 @@ func migrateDTags(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey) { store := ctx.KVStore(storeKey) for dTag, address := range dTags { // Delete the old key - store.Delete(DTagStoreKey(dTag)) + store.Delete(v4types.DTagStoreKey(dTag)) // Store the DTag using the new key store.Set(types.DTagStoreKey(dTag), address) @@ -98,8 +100,8 @@ func migrateDTags(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey) { } func migrateDTagTransferRequests(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, cdc codec.BinaryCodec) { - var requests []types.DTagTransferRequest - k.IterateDTagTransferRequests(ctx, func(index int64, request types.DTagTransferRequest) (stop bool) { + var requests []v4types.DTagTransferRequest + k.IterateDTagTransferRequests(ctx, func(index int64, request v4types.DTagTransferRequest) (stop bool) { requests = append(requests, request) return false }) @@ -107,7 +109,7 @@ func migrateDTagTransferRequests(ctx sdk.Context, k Keeper, storeKey sdk.StoreKe store := ctx.KVStore(storeKey) for i, request := range requests { // Delete the old key - store.Delete(DTagTransferRequestStoreKey(request.Sender, request.Receiver)) + store.Delete(v4types.DTagTransferRequestStoreKey(request.Sender, request.Receiver)) // Store the request using the new key store.Set( @@ -120,8 +122,8 @@ func migrateDTagTransferRequests(ctx sdk.Context, k Keeper, storeKey sdk.StoreKe func migrateApplicationLinks(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, cdc codec.BinaryCodec) { store := ctx.KVStore(storeKey) - var applicationLinks []types.ApplicationLink - k.IterateApplicationLinks(ctx, func(index int64, applicationLink types.ApplicationLink) (stop bool) { + var applicationLinks []v4types.ApplicationLink + k.IterateApplicationLinks(ctx, func(index int64, applicationLink v4types.ApplicationLink) (stop bool) { applicationLinks = append(applicationLinks, applicationLink) return false }) @@ -140,7 +142,7 @@ func migrateApplicationLinks(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, c for i, link := range applicationLinks { // Delete the old keys - store.Delete(UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username)) + store.Delete(v4types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username)) // Store the link with the new key linkKey := types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username) @@ -150,15 +152,15 @@ func migrateApplicationLinks(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, c } func migrateChainLinks(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, amino *codec.LegacyAmino, cdc codec.BinaryCodec) error { - var chainLinks []ChainLink - k.IterateChainLinks(ctx, func(index int64, chainLink ChainLink) (stop bool) { + var chainLinks []v4types.ChainLink + k.IterateChainLinks(ctx, func(index int64, chainLink v4types.ChainLink) (stop bool) { chainLinks = append(chainLinks, chainLink) return false }) store := ctx.KVStore(storeKey) for _, link := range chainLinks { - var address AddressData + var address v4types.AddressData err := cdc.UnpackAny(link.Address, &address) if err != nil { return err @@ -167,12 +169,12 @@ func migrateChainLinks(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, amino * // Convert the address data var addressData types.AddressData switch address := address.(type) { - case *Bech32Address: - addressData = types.NewBech32Address(address.Value, address.Prefix) - case *Base58Address: - addressData = types.NewBase58Address(address.Value) - case *HexAddress: - addressData = types.NewHexAddress(address.Value, address.Prefix) + case *v4types.Bech32Address: + addressData = v5types.NewBech32Address(address.Value, address.Prefix) + case *v4types.Base58Address: + addressData = v5types.NewBase58Address(address.Value) + case *v4types.HexAddress: + addressData = v5types.NewHexAddress(address.Value, address.Prefix) default: panic(fmt.Errorf("unsupported AddressData type: %T", link.Address)) } @@ -209,31 +211,28 @@ func migrateChainLinks(ctx sdk.Context, k Keeper, storeKey sdk.StoreKey, amino * } // Build the new chain link - v2Link := types.NewChainLink( + v5Link := v5types.NewChainLink( link.User, addressData, - types.NewProof( + v5types.NewProof( pubKey, - &types.SingleSignatureData{ + &v5types.SingleSignatureData{ Signature: signature, Mode: signMode, }, link.Proof.PlainText, ), - types.NewChainConfig( + v5types.NewChainConfig( link.ChainConfig.Name, ), link.CreationTime, ) // Delete the old key - store.Delete(ChainLinksStoreKey(link.User, link.ChainConfig.Name, addressData.GetValue())) + store.Delete(v4types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, addressData.GetValue())) // Store the chain link using the new key - store.Set( - types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, addressData.GetValue()), - types.MustMarshalChainLink(cdc, v2Link), - ) + store.Set(types.ChainLinksStoreKey(link.User, link.ChainConfig.Name, addressData.GetValue()), cdc.MustMarshal(&v5Link)) } return nil diff --git a/x/profiles/legacy/v4/store_test.go b/x/profiles/legacy/v4/store_test.go index b7a4bc0758..09119d51c0 100644 --- a/x/profiles/legacy/v4/store_test.go +++ b/x/profiles/legacy/v4/store_test.go @@ -5,6 +5,10 @@ import ( "testing" "time" + v4 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4" + types2 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types" + v5types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" + "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" @@ -27,8 +31,7 @@ import ( "github.com/stretchr/testify/require" "github.com/desmos-labs/desmos/v4/app" - v4 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4" - "github.com/desmos-labs/desmos/v4/x/relationships/types" + v4types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types" ) func buildContext( @@ -58,7 +61,7 @@ func TestMigrateStore(t *testing.T) { cdc, legacyAmino := app.MakeCodecs() // Build all the necessary keys - keys := sdk.NewKVStoreKeys(authtypes.StoreKey, types.StoreKey) + keys := sdk.NewKVStoreKeys(authtypes.StoreKey, profilestypes.StoreKey) tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) @@ -81,7 +84,7 @@ func TestMigrateStore(t *testing.T) { pubKey := profilestesting.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d") pubKeyAny := profilestesting.NewAny(pubKey) - addressAny := profilestesting.NewAny(&v4.Bech32Address{ + addressAny := profilestesting.NewAny(&v4types.Bech32Address{ Value: "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", Prefix: "cosmos", }) @@ -95,14 +98,14 @@ func TestMigrateStore(t *testing.T) { { name: "profiles are migrated properly", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Store a profile - profile, err := v4.NewProfile( + profile, err := types2.NewProfile( "john_doe", "John Doe", "My name if John Doe", - v4.Pictures{ + v4types.Pictures{ Profile: "", Cover: "", }, @@ -113,17 +116,17 @@ func TestMigrateStore(t *testing.T) { authKeeper.SetAccount(ctx, profile) // Store a DTag reference - kvStore.Set(v4.DTagStoreKey("john_doe"), []byte("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf")) + kvStore.Set(profilestypes.DTagStoreKey("john_doe"), []byte("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf")) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Check the profile to make sure it contains the same data - v2Profile, err := profilestypes.NewProfile( + v2Profile, err := v5types.NewProfile( "john_doe", "John Doe", "My name if John Doe", - profilestypes.NewPictures("", ""), + v5types.NewPictures("", ""), time.Date(2020, 1, 1, 0, 0, 0, 00, time.UTC), profilestesting.AccountFromAddr("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), ) @@ -133,7 +136,7 @@ func TestMigrateStore(t *testing.T) { require.NoError(t, err) account := authKeeper.GetAccount(ctx, sdkAddr) - profile, ok := account.(*profilestypes.Profile) + profile, ok := account.(*v5types.Profile) require.True(t, ok) require.Equal(t, v2Profile, profile) @@ -145,12 +148,12 @@ func TestMigrateStore(t *testing.T) { { name: "DTag transfer requests are migrated properly", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Store a DTag transfer request kvStore.Set( - v4.DTagTransferRequestStoreKey("cosmos13vsgmgs9tjktnnc6pkln7pm4jswxmeajrqc4xd", "cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), - cdc.MustMarshal(&profilestypes.DTagTransferRequest{ + profilestypes.DTagTransferRequestStoreKey("cosmos13vsgmgs9tjktnnc6pkln7pm4jswxmeajrqc4xd", "cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), + cdc.MustMarshal(&v4types.DTagTransferRequest{ DTagToTrade: "john_doe", Sender: "cosmos13vsgmgs9tjktnnc6pkln7pm4jswxmeajrqc4xd", Receiver: "cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf", @@ -158,16 +161,16 @@ func TestMigrateStore(t *testing.T) { ) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Check the migrated DTag transfer request - var stored profilestypes.DTagTransferRequest + var stored v5types.DTagTransferRequest cdc.MustUnmarshal(kvStore.Get(profilestypes.DTagTransferRequestStoreKey( "cosmos13vsgmgs9tjktnnc6pkln7pm4jswxmeajrqc4xd", "cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf", )), &stored) - require.Equal(t, profilestypes.NewDTagTransferRequest( + require.Equal(t, v5types.NewDTagTransferRequest( "john_doe", "cosmos13vsgmgs9tjktnnc6pkln7pm4jswxmeajrqc4xd", "cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf", @@ -175,22 +178,22 @@ func TestMigrateStore(t *testing.T) { }, }, { - name: "application links are stored properly", + name: "application links are migrated properly", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Store an application link - linkKey := v4.UserApplicationLinkKey("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", "twitter", "twitteruser") + linkKey := profilestypes.UserApplicationLinkKey("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", "twitter", "twitteruser") kvStore.Set( linkKey, - cdc.MustMarshal(&profilestypes.ApplicationLink{ + cdc.MustMarshal(&v5types.ApplicationLink{ User: "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", - Data: profilestypes.NewData("twitter", "twitteruser"), - State: profilestypes.ApplicationLinkStateInitialized, - OracleRequest: profilestypes.NewOracleRequest( + Data: v5types.NewData("twitter", "twitteruser"), + State: v5types.ApplicationLinkStateInitialized, + OracleRequest: v5types.NewOracleRequest( 0, 1, - profilestypes.NewOracleRequestCallData("twitter", "calldata"), + v5types.NewOracleRequestCallData("twitter", "calldata"), "client_id", ), Result: nil, @@ -199,10 +202,10 @@ func TestMigrateStore(t *testing.T) { ) // Store an application link client id - kvStore.Set(v4.ApplicationLinkClientIDKey("client_id"), linkKey) + kvStore.Set(profilestypes.ApplicationLinkClientIDKey("client_id"), linkKey) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Check the application links linkKey := profilestypes.UserApplicationLinkKey( @@ -211,16 +214,16 @@ func TestMigrateStore(t *testing.T) { "twitteruser", ) - var stored profilestypes.ApplicationLink + var stored v5types.ApplicationLink cdc.MustUnmarshal(kvStore.Get(linkKey), &stored) - require.Equal(t, profilestypes.NewApplicationLink( + require.Equal(t, v5types.NewApplicationLink( "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", - profilestypes.NewData("twitter", "twitteruser"), - profilestypes.ApplicationLinkStateInitialized, - profilestypes.NewOracleRequest( + v5types.NewData("twitter", "twitteruser"), + v5types.ApplicationLinkStateInitialized, + v5types.NewOracleRequest( 0, 1, - profilestypes.NewOracleRequestCallData("twitter", "calldata"), + v5types.NewOracleRequestCallData("twitter", "calldata"), "client_id", ), nil, @@ -234,62 +237,66 @@ func TestMigrateStore(t *testing.T) { { name: "leftover application client id keys are deleted properly", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) - kvStore.Set(v4.ApplicationLinkClientIDKey("client_id"), []byte("client_id_value")) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) + kvStore.Set(v4types.ApplicationLinkClientIDKey("client_id"), []byte("client_id_value")) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) - require.False(t, kvStore.Has(v4.ApplicationLinkClientIDKey("client_id"))) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) + require.False(t, kvStore.Has(v4types.ApplicationLinkClientIDKey("client_id"))) require.False(t, kvStore.Has(profilestypes.ApplicationLinkClientIDKey("client_id"))) }, }, { name: "chain link is migrated properly (text signature)", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Store the chain link kvStore.Set( - v4.ChainLinksStoreKey("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f"), - cdc.MustMarshal(&v4.ChainLink{ + v4types.ChainLinksStoreKey( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", + ), + cdc.MustMarshal(&v4types.ChainLink{ User: "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", Address: addressAny, - Proof: v4.Proof{ + Proof: v4types.Proof{ PubKey: pubKeyAny, Signature: "7369676E6174757265", PlainText: "74657874", }, - ChainConfig: v4.ChainConfig{Name: "cosmos"}, + ChainConfig: v4types.ChainConfig{Name: "cosmos"}, CreationTime: time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), }), ) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) signatureValue, err := hex.DecodeString("7369676E6174757265") require.NoError(t, err) - signature := profilestypes.SingleSignatureData{ + signature := v5types.SingleSignatureData{ Mode: signing.SignMode_SIGN_MODE_TEXTUAL, Signature: signatureValue, } signatureAny := profilestesting.NewAny(&signature) - var stored profilestypes.ChainLink + var stored v5types.ChainLink cdc.MustUnmarshal(kvStore.Get(profilestypes.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", )), &stored) - require.Equal(t, profilestypes.NewChainLink( + require.Equal(t, v5types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", - profilestypes.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), - profilestypes.Proof{ + v5types.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), + v5types.Proof{ PubKey: pubKeyAny, Signature: signatureAny, PlainText: "74657874", }, - profilestypes.ChainConfig{Name: "cosmos"}, + v5types.ChainConfig{Name: "cosmos"}, time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), stored) }, @@ -297,7 +304,7 @@ func TestMigrateStore(t *testing.T) { { name: "chain link is migrated properly (direct sign tx signature)", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Build the signature bz, err := cdc.Marshal(&tx.SignDoc{ @@ -311,22 +318,26 @@ func TestMigrateStore(t *testing.T) { // Store the chain link kvStore.Set( - v4.ChainLinksStoreKey("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f"), - cdc.MustMarshal(&v4.ChainLink{ + v4types.ChainLinksStoreKey( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", + ), + cdc.MustMarshal(&v4types.ChainLink{ User: "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", Address: addressAny, - Proof: v4.Proof{ + Proof: v4types.Proof{ PubKey: pubKeyAny, Signature: "7369676E6174757265", PlainText: plainTextValue, }, - ChainConfig: v4.ChainConfig{Name: "cosmos"}, + ChainConfig: v4types.ChainConfig{Name: "cosmos"}, CreationTime: time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), }), ) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) bz, err := cdc.Marshal(&tx.SignDoc{ BodyBytes: nil, @@ -340,26 +351,26 @@ func TestMigrateStore(t *testing.T) { signatureValue, err := hex.DecodeString("7369676E6174757265") require.NoError(t, err) - signatureAny := profilestesting.NewAny(&profilestypes.SingleSignatureData{ + signatureAny := profilestesting.NewAny(&v5types.SingleSignatureData{ Mode: signing.SignMode_SIGN_MODE_DIRECT, Signature: signatureValue, }) - var stored profilestypes.ChainLink + var stored v5types.ChainLink cdc.MustUnmarshal(kvStore.Get(profilestypes.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", )), &stored) - require.Equal(t, profilestypes.NewChainLink( + require.Equal(t, v5types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", - profilestypes.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), - profilestypes.Proof{ + v5types.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), + v5types.Proof{ PubKey: pubKeyAny, Signature: signatureAny, PlainText: plainTextValue, }, - profilestypes.ChainConfig{Name: "cosmos"}, + v5types.ChainConfig{Name: "cosmos"}, time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), stored) }, @@ -367,7 +378,7 @@ func TestMigrateStore(t *testing.T) { { name: "chain link is migrated properly (amino sign tx signature)", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Build the signature bz, err := legacyAmino.MarshalJSON(&legacytx.StdSignDoc{ @@ -384,22 +395,26 @@ func TestMigrateStore(t *testing.T) { // Store the chain link kvStore.Set( - v4.ChainLinksStoreKey("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f"), - cdc.MustMarshal(&v4.ChainLink{ + v4types.ChainLinksStoreKey( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", + ), + cdc.MustMarshal(&v4types.ChainLink{ User: "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", Address: addressAny, - Proof: v4.Proof{ + Proof: v4types.Proof{ PubKey: pubKeyAny, Signature: "7369676E6174757265", PlainText: plainTextValue, }, - ChainConfig: v4.ChainConfig{Name: "cosmos"}, + ChainConfig: v4types.ChainConfig{Name: "cosmos"}, CreationTime: time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), }), ) }, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) bz, err := legacyAmino.MarshalJSON(&legacytx.StdSignDoc{ AccountNumber: 1, @@ -416,27 +431,27 @@ func TestMigrateStore(t *testing.T) { signatureValue, err := hex.DecodeString("7369676E6174757265") require.NoError(t, err) - signature := profilestypes.SingleSignatureData{ + signature := v5types.SingleSignatureData{ Mode: signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, Signature: signatureValue, } signatureAny := profilestesting.NewAny(&signature) - var stored profilestypes.ChainLink + var stored v5types.ChainLink cdc.MustUnmarshal(kvStore.Get(profilestypes.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", )), &stored) - require.Equal(t, profilestypes.NewChainLink( + require.Equal(t, v5types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", - profilestypes.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), - profilestypes.Proof{ + v5types.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), + v5types.Proof{ PubKey: pubKeyAny, Signature: signatureAny, PlainText: plainTextValue, }, - profilestypes.ChainConfig{Name: "cosmos"}, + v5types.ChainConfig{Name: "cosmos"}, time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), stored) }, @@ -444,12 +459,12 @@ func TestMigrateStore(t *testing.T) { { name: "user blocks and relationships are deleted properly", store: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Store a user block kvStore.Set( - v4.UserBlockStoreKey("blocker", "", "blocked"), - cdc.MustMarshal(&v4.UserBlock{ + v4types.UserBlockStoreKey("blocker", "", "blocked"), + cdc.MustMarshal(&v4types.UserBlock{ Blocker: "blocker", Blocked: "blocked", Reason: "reason", @@ -459,16 +474,16 @@ func TestMigrateStore(t *testing.T) { // Store some relationships kvStore.Set( - v4.RelationshipsStoreKey("user", "1", "recipient"), - cdc.MustMarshal(&v4.Relationship{ + v4types.RelationshipsStoreKey("user", "1", "recipient"), + cdc.MustMarshal(&v4types.Relationship{ Creator: "user", Recipient: "recipient", SubspaceID: "1", }), ) kvStore.Set( - v4.RelationshipsStoreKey("user", "2", "recipient"), - cdc.MustMarshal(&v4.Relationship{ + v4types.RelationshipsStoreKey("user", "2", "recipient"), + cdc.MustMarshal(&v4types.Relationship{ Creator: "user", Recipient: "recipient", SubspaceID: "2", @@ -477,14 +492,14 @@ func TestMigrateStore(t *testing.T) { }, shouldErr: false, check: func(ctx sdk.Context) { - kvStore := ctx.KVStore(keys[types.StoreKey]) + kvStore := ctx.KVStore(keys[profilestypes.StoreKey]) // Make sure all blocks are deleted - require.False(t, kvStore.Has(v4.UserBlockStoreKey("blocker", "", "blocked"))) + require.False(t, kvStore.Has(v4types.UserBlockStoreKey("blocker", "", "blocked"))) // Make sure all relationships are deleted - require.False(t, kvStore.Has(v4.RelationshipsStoreKey("user", "1", "recipient"))) - require.False(t, kvStore.Has(v4.RelationshipsStoreKey("user", "1", "recipient"))) + require.False(t, kvStore.Has(v4types.RelationshipsStoreKey("user", "1", "recipient"))) + require.False(t, kvStore.Has(v4types.RelationshipsStoreKey("user", "1", "recipient"))) }, }, } @@ -497,7 +512,7 @@ func TestMigrateStore(t *testing.T) { tc.store(ctx) } - err := v4.MigrateStore(ctx, authKeeper, keys[types.StoreKey], legacyAmino, cdc) + err := v4.MigrateStore(ctx, authKeeper, keys[profilestypes.StoreKey], legacyAmino, cdc) if tc.shouldErr { require.Error(t, err) } else { diff --git a/x/profiles/legacy/v4/codec.go b/x/profiles/legacy/v4/types/codec.go similarity index 97% rename from x/profiles/legacy/v4/codec.go rename to x/profiles/legacy/v4/types/codec.go index 5f9b6860e3..9ba48f06f4 100644 --- a/x/profiles/legacy/v4/codec.go +++ b/x/profiles/legacy/v4/types/codec.go @@ -1,4 +1,4 @@ -package v4 +package types // DONTCOVER diff --git a/x/profiles/legacy/v4/keys.go b/x/profiles/legacy/v4/types/keys.go similarity index 99% rename from x/profiles/legacy/v4/keys.go rename to x/profiles/legacy/v4/types/keys.go index fd58504abb..48285ff262 100644 --- a/x/profiles/legacy/v4/keys.go +++ b/x/profiles/legacy/v4/types/keys.go @@ -1,4 +1,4 @@ -package v4 +package types // DONTCOVER diff --git a/x/profiles/legacy/v4/types/models_app_links.go b/x/profiles/legacy/v4/types/models_app_links.go new file mode 100644 index 0000000000..d06a69792b --- /dev/null +++ b/x/profiles/legacy/v4/types/models_app_links.go @@ -0,0 +1,224 @@ +package types + +// DONTCOVER + +import ( + "encoding/hex" + "fmt" + "strings" + "time" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// NewApplicationLink allows to build a new ApplicationLink instance +func NewApplicationLink( + user string, data Data, state ApplicationLinkState, oracleRequest OracleRequest, result *Result, creationTime time.Time, +) ApplicationLink { + return ApplicationLink{ + User: user, + Data: data, + State: state, + OracleRequest: oracleRequest, + Result: result, + CreationTime: creationTime, + } +} + +// Validate returns an error if the instance does not contain valid data +func (l ApplicationLink) Validate() error { + _, err := sdk.AccAddressFromBech32(l.User) + if err != nil { + return fmt.Errorf("invalid user address: %s", err) + } + + err = l.Data.Validate() + if err != nil { + return err + } + + err = l.OracleRequest.Validate() + if err != nil { + return err + } + + if l.Result != nil { + err = l.Result.Validate() + if err != nil { + return err + } + } + + if l.CreationTime.IsZero() { + return fmt.Errorf("invalid creation time: %s", l.CreationTime) + } + + return nil +} + +// IsVerificationOngoing tells whether the verification for the link is still ongoing +func (l *ApplicationLink) IsVerificationOngoing() bool { + return l.State == ApplicationLinkStateInitialized || l.State == AppLinkStateVerificationStarted +} + +// IsVerificationCompleted tells whether the verification for the link has completed or not +func (l *ApplicationLink) IsVerificationCompleted() bool { + return l.State == AppLinkStateVerificationSuccess || + l.State == AppLinkStateVerificationError || + l.State == AppLinkStateVerificationTimedOut +} + +// MustMarshalApplicationLink serializes the given application link using the provided BinaryCodec +func MustMarshalApplicationLink(cdc codec.BinaryCodec, link ApplicationLink) []byte { + return cdc.MustMarshal(&link) +} + +// MustUnmarshalApplicationLink deserializes the given byte array as an application link using +// the provided BinaryCodec +func MustUnmarshalApplicationLink(cdc codec.BinaryCodec, bz []byte) ApplicationLink { + var link ApplicationLink + cdc.MustUnmarshal(bz, &link) + return link +} + +// -------------------------------------------------------------------------------------------------------------------- + +// NewData allows to build a new Data instance +func NewData(application, username string) Data { + return Data{ + Application: application, + Username: username, + } +} + +// Validate returns an error if the instance does not contain valid data +func (d Data) Validate() error { + if len(strings.TrimSpace(d.Application)) == 0 { + return fmt.Errorf("application name cannot be empty or blank") + } + + if len(strings.TrimSpace(d.Username)) == 0 { + return fmt.Errorf("application username cannot be empty or blank") + } + + return nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// NewOracleRequest allows to build a new OracleRequest instance +func NewOracleRequest(id uint64, scriptID uint64, callData OracleRequest_CallData, clientID string) OracleRequest { + return OracleRequest{ + ID: id, + OracleScriptID: scriptID, + CallData: callData, + ClientID: clientID, + } +} + +// Validate returns an error if the instance does not contain valid data +func (o OracleRequest) Validate() error { + if o.OracleScriptID <= 0 { + return fmt.Errorf("invalid oracle script id: %d", o.OracleScriptID) + } + + err := o.CallData.Validate() + if err != nil { + return err + } + + if len(strings.TrimSpace(o.ClientID)) == 0 { + return fmt.Errorf("client id cannot be empty or blank") + } + + return nil +} + +// NewOracleRequestCallData allows to build a new OracleRequest_CallData instance +func NewOracleRequestCallData(application, callData string) OracleRequest_CallData { + return OracleRequest_CallData{ + Application: application, + CallData: callData, + } +} + +// Validate returns an error if the instance does not contain valid data +func (c OracleRequest_CallData) Validate() error { + if len(strings.TrimSpace(c.Application)) == 0 { + return fmt.Errorf("application cannot be empty or blank") + } + + if len(strings.TrimSpace(c.CallData)) == 0 { + return fmt.Errorf("call data cannot be empty or blank") + } + + if _, err := hex.DecodeString(c.CallData); err != nil { + return fmt.Errorf("invalid call data encoding: must be hex") + } + + return nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// Validate returns an error if the instance does not contain valid data +func (r *Result) Validate() error { + var err error + switch result := (r.Sum).(type) { + case *Result_Success_: + err = result.Validate() + case *Result_Failed_: + err = result.Validate() + } + return err +} + +// NewErrorResult allows to build a new Result instance representing an error +func NewErrorResult(error string) *Result { + return &Result{ + Sum: &Result_Failed_{ + Failed: &Result_Failed{ + Error: error, + }, + }, + } +} + +// Validate returns an error if the instance does not contain valid data +func (r Result_Failed_) Validate() error { + if len(strings.TrimSpace(r.Failed.Error)) == 0 { + return fmt.Errorf("error message cannot be empty or blank") + } + + return nil +} + +// NewSuccessResult allows to build a new Result instance representing a success +func NewSuccessResult(value, signature string) *Result { + return &Result{ + Sum: &Result_Success_{ + Success: &Result_Success{ + Value: value, + Signature: signature, + }, + }, + } +} + +// Validate returns an error if the instance does not contain valid data +func (r Result_Success_) Validate() error { + if len(strings.TrimSpace(r.Success.Value)) == 0 { + return fmt.Errorf("value cannot be empty or blank") + } + + if len(strings.TrimSpace(r.Success.Signature)) == 0 { + return fmt.Errorf("signature cannot be empty or blank") + } + + if _, err := hex.DecodeString(r.Success.Signature); err != nil { + return fmt.Errorf("invalid signature encoding; must be hex") + } + + return nil +} diff --git a/x/profiles/legacy/v4/types/models_app_links.pb.go b/x/profiles/legacy/v4/types/models_app_links.pb.go new file mode 100644 index 0000000000..9930977573 --- /dev/null +++ b/x/profiles/legacy/v4/types/models_app_links.pb.go @@ -0,0 +1,2293 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v1beta1/models_app_links.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// ApplicationLinkState defines if an application link is in the following +// states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT +type ApplicationLinkState int32 + +const ( + // A link has just been initialized + ApplicationLinkStateInitialized ApplicationLinkState = 0 + // A link has just started being verified + AppLinkStateVerificationStarted ApplicationLinkState = 1 + // A link has errored during the verification process + AppLinkStateVerificationError ApplicationLinkState = 2 + // A link has being verified successfully + AppLinkStateVerificationSuccess ApplicationLinkState = 3 + // A link has timed out while waiting for the verification + AppLinkStateVerificationTimedOut ApplicationLinkState = 4 +) + +var ApplicationLinkState_name = map[int32]string{ + 0: "APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED", + 1: "APPLICATION_LINK_STATE_VERIFICATION_STARTED", + 2: "APPLICATION_LINK_STATE_VERIFICATION_ERROR", + 3: "APPLICATION_LINK_STATE_VERIFICATION_SUCCESS", + 4: "APPLICATION_LINK_STATE_TIMED_OUT", +} + +var ApplicationLinkState_value = map[string]int32{ + "APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED": 0, + "APPLICATION_LINK_STATE_VERIFICATION_STARTED": 1, + "APPLICATION_LINK_STATE_VERIFICATION_ERROR": 2, + "APPLICATION_LINK_STATE_VERIFICATION_SUCCESS": 3, + "APPLICATION_LINK_STATE_TIMED_OUT": 4, +} + +func (x ApplicationLinkState) String() string { + return proto.EnumName(ApplicationLinkState_name, int32(x)) +} + +func (ApplicationLinkState) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{0} +} + +// ApplicationLink contains the data of a link to a centralized application +type ApplicationLink struct { + // User to which the link is associated + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty" yaml:"user"` + // Data contains the details of this specific link + Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data" yaml:"data"` + // State of the link + State ApplicationLinkState `protobuf:"varint,3,opt,name=state,proto3,enum=desmos.profiles.v1beta1.ApplicationLinkState" json:"state,omitempty" yaml:"state"` + // OracleRequest represents the request that has been made to the oracle + OracleRequest OracleRequest `protobuf:"bytes,4,opt,name=oracle_request,json=oracleRequest,proto3" json:"oracle_request" yaml:"oracle_request"` + // Data coming from the result of the verification. + // Only available when the state is STATE_SUCCESS + Result *Result `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty" yaml:"result"` + // CreationTime represents the time in which the link was created + CreationTime time.Time `protobuf:"bytes,6,opt,name=creation_time,json=creationTime,proto3,stdtime" json:"creation_time" yaml:"creation_time"` +} + +func (m *ApplicationLink) Reset() { *m = ApplicationLink{} } +func (m *ApplicationLink) String() string { return proto.CompactTextString(m) } +func (*ApplicationLink) ProtoMessage() {} +func (*ApplicationLink) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{0} +} +func (m *ApplicationLink) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ApplicationLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ApplicationLink.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ApplicationLink) XXX_Merge(src proto.Message) { + xxx_messageInfo_ApplicationLink.Merge(m, src) +} +func (m *ApplicationLink) XXX_Size() int { + return m.Size() +} +func (m *ApplicationLink) XXX_DiscardUnknown() { + xxx_messageInfo_ApplicationLink.DiscardUnknown(m) +} + +var xxx_messageInfo_ApplicationLink proto.InternalMessageInfo + +// Data contains the data associated to a specific user of a +// generic centralized application +type Data struct { + // The application name (eg. Twitter, GitHub, etc) + Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty" yaml:"application"` + // Username on the application (eg. Twitter tag, GitHub profile, etc) + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty" yaml:"username"` +} + +func (m *Data) Reset() { *m = Data{} } +func (m *Data) String() string { return proto.CompactTextString(m) } +func (*Data) ProtoMessage() {} +func (*Data) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{1} +} +func (m *Data) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Data.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Data) XXX_Merge(src proto.Message) { + xxx_messageInfo_Data.Merge(m, src) +} +func (m *Data) XXX_Size() int { + return m.Size() +} +func (m *Data) XXX_DiscardUnknown() { + xxx_messageInfo_Data.DiscardUnknown(m) +} + +var xxx_messageInfo_Data proto.InternalMessageInfo + +// OracleRequest represents a generic oracle request used to +// verify the ownership of a centralized application account +type OracleRequest struct { + // ID is the ID of the request + ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` + // OracleScriptID is ID of an oracle script + OracleScriptID uint64 `protobuf:"varint,2,opt,name=oracle_script_id,json=oracleScriptId,proto3" json:"oracle_script_id,omitempty" yaml:"oracle_script_id"` + // CallData contains the data used to perform the oracle request + CallData OracleRequest_CallData `protobuf:"bytes,3,opt,name=call_data,json=callData,proto3" json:"call_data" yaml:"call_data"` + // ClientID represents the ID of the client that has called the oracle script + ClientID string `protobuf:"bytes,4,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` +} + +func (m *OracleRequest) Reset() { *m = OracleRequest{} } +func (m *OracleRequest) String() string { return proto.CompactTextString(m) } +func (*OracleRequest) ProtoMessage() {} +func (*OracleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{2} +} +func (m *OracleRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleRequest.Merge(m, src) +} +func (m *OracleRequest) XXX_Size() int { + return m.Size() +} +func (m *OracleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_OracleRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleRequest proto.InternalMessageInfo + +// CallData contains the data sent to a single oracle request in order to +// verify the ownership of a centralized application by a Desmos profile +type OracleRequest_CallData struct { + // The application for which the ownership should be verified + Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty" yaml:"application"` + // The hex encoded call data that should be used to verify the application + // account ownership + CallData string `protobuf:"bytes,2,opt,name=call_data,json=callData,proto3" json:"call_data,omitempty" yaml:"call_data"` +} + +func (m *OracleRequest_CallData) Reset() { *m = OracleRequest_CallData{} } +func (m *OracleRequest_CallData) String() string { return proto.CompactTextString(m) } +func (*OracleRequest_CallData) ProtoMessage() {} +func (*OracleRequest_CallData) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{2, 0} +} +func (m *OracleRequest_CallData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleRequest_CallData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleRequest_CallData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleRequest_CallData) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleRequest_CallData.Merge(m, src) +} +func (m *OracleRequest_CallData) XXX_Size() int { + return m.Size() +} +func (m *OracleRequest_CallData) XXX_DiscardUnknown() { + xxx_messageInfo_OracleRequest_CallData.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleRequest_CallData proto.InternalMessageInfo + +func (m *OracleRequest_CallData) GetApplication() string { + if m != nil { + return m.Application + } + return "" +} + +func (m *OracleRequest_CallData) GetCallData() string { + if m != nil { + return m.CallData + } + return "" +} + +// Result represents a verification result +type Result struct { + // sum is the oneof that specifies whether this represents a success or + // failure result + // + // Types that are valid to be assigned to Sum: + // *Result_Success_ + // *Result_Failed_ + Sum isResult_Sum `protobuf_oneof:"sum"` +} + +func (m *Result) Reset() { *m = Result{} } +func (m *Result) String() string { return proto.CompactTextString(m) } +func (*Result) ProtoMessage() {} +func (*Result) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{3} +} +func (m *Result) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result.Merge(m, src) +} +func (m *Result) XXX_Size() int { + return m.Size() +} +func (m *Result) XXX_DiscardUnknown() { + xxx_messageInfo_Result.DiscardUnknown(m) +} + +var xxx_messageInfo_Result proto.InternalMessageInfo + +type isResult_Sum interface { + isResult_Sum() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type Result_Success_ struct { + Success *Result_Success `protobuf:"bytes,1,opt,name=success,proto3,oneof" json:"success,omitempty"` +} +type Result_Failed_ struct { + Failed *Result_Failed `protobuf:"bytes,2,opt,name=failed,proto3,oneof" json:"failed,omitempty"` +} + +func (*Result_Success_) isResult_Sum() {} +func (*Result_Failed_) isResult_Sum() {} + +func (m *Result) GetSum() isResult_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *Result) GetSuccess() *Result_Success { + if x, ok := m.GetSum().(*Result_Success_); ok { + return x.Success + } + return nil +} + +func (m *Result) GetFailed() *Result_Failed { + if x, ok := m.GetSum().(*Result_Failed_); ok { + return x.Failed + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Result) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Result_Success_)(nil), + (*Result_Failed_)(nil), + } +} + +// Success is the result of an application link that has been successfully +// verified +type Result_Success struct { + // Hex-encoded value that has be signed by the profile + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" yaml:"value"` + // Hex-encoded signature that has been produced by signing the value + Signature string `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" yaml:"signature"` +} + +func (m *Result_Success) Reset() { *m = Result_Success{} } +func (m *Result_Success) String() string { return proto.CompactTextString(m) } +func (*Result_Success) ProtoMessage() {} +func (*Result_Success) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{3, 0} +} +func (m *Result_Success) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result_Success) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result_Success.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result_Success) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result_Success.Merge(m, src) +} +func (m *Result_Success) XXX_Size() int { + return m.Size() +} +func (m *Result_Success) XXX_DiscardUnknown() { + xxx_messageInfo_Result_Success.DiscardUnknown(m) +} + +var xxx_messageInfo_Result_Success proto.InternalMessageInfo + +// Failed is the result of an application link that has not been verified +// successfully +type Result_Failed struct { + // Error that is associated with the failure + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty" yaml:"error"` +} + +func (m *Result_Failed) Reset() { *m = Result_Failed{} } +func (m *Result_Failed) String() string { return proto.CompactTextString(m) } +func (*Result_Failed) ProtoMessage() {} +func (*Result_Failed) Descriptor() ([]byte, []int) { + return fileDescriptor_33caa1214beac081, []int{3, 1} +} +func (m *Result_Failed) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result_Failed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result_Failed.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result_Failed) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result_Failed.Merge(m, src) +} +func (m *Result_Failed) XXX_Size() int { + return m.Size() +} +func (m *Result_Failed) XXX_DiscardUnknown() { + xxx_messageInfo_Result_Failed.DiscardUnknown(m) +} + +var xxx_messageInfo_Result_Failed proto.InternalMessageInfo + +func init() { + proto.RegisterEnum("desmos.profiles.v1beta1.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) + proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.v1beta1.ApplicationLink") + proto.RegisterType((*Data)(nil), "desmos.profiles.v1beta1.Data") + proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.v1beta1.OracleRequest") + proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.v1beta1.OracleRequest.CallData") + proto.RegisterType((*Result)(nil), "desmos.profiles.v1beta1.Result") + proto.RegisterType((*Result_Success)(nil), "desmos.profiles.v1beta1.Result.Success") + proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.v1beta1.Result.Failed") +} + +func init() { + proto.RegisterFile("desmos/profiles/v1beta1/models_app_links.proto", fileDescriptor_33caa1214beac081) +} + +var fileDescriptor_33caa1214beac081 = []byte{ + // 974 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0xc7, 0xe3, 0xc4, 0xcd, 0x36, 0xd3, 0x6d, 0x1b, 0xa6, 0x85, 0x8d, 0x2c, 0x35, 0x36, 0x2e, + 0x2a, 0x05, 0x54, 0x5b, 0x2d, 0x1c, 0x50, 0x11, 0x12, 0x71, 0xe2, 0x6a, 0xbd, 0x94, 0xb6, 0x9a, + 0x38, 0xbb, 0xd2, 0x5e, 0xac, 0x89, 0x3d, 0x09, 0xd6, 0x3a, 0x71, 0xf0, 0x8f, 0x8a, 0x82, 0xb8, + 0xaf, 0x7a, 0xda, 0x7f, 0xa0, 0xd2, 0x4a, 0xfc, 0x1d, 0x88, 0xeb, 0x5e, 0x90, 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, 0x55, 0x6e, 0x4a, 0x9d, 0xd2, 0x1e, 0x93, 0xc0, + 0xed, 0x65, 0x25, 0xda, 0x11, 0x0e, 0x22, 0xe2, 0xc0, 0x33, 0xf0, 0xd1, 0x5d, 0xa8, 0x3a, 0x42, + 0xa7, 0xa8, 0x5a, 0x14, 0xde, 0xbf, 0xbc, 0x92, 0xb6, 0x16, 0x31, 0xf5, 0x74, 0x68, 0x77, 0xee, + 0xb3, 0xd3, 0x6c, 0xea, 0xed, 0x76, 0xb5, 0x74, 0x4b, 0x9f, 0xd9, 0x8a, 0x3c, 0x02, 0xd2, 0x02, + 0xaa, 0x69, 0x7c, 0xa3, 0xb7, 0xac, 0xd3, 0x8e, 0x59, 0xe5, 0x85, 0x0f, 0x2e, 0xaf, 0x24, 0x69, + 0x11, 0x2a, 0x7d, 0x4e, 0x9d, 0xd3, 0x38, 0x12, 0xf8, 0xe7, 0x3f, 0xd7, 0x0b, 0x5a, 0xe7, 0xd5, + 0xb8, 0xce, 0xbd, 0x1e, 0xd7, 0xb9, 0x3f, 0xc7, 0x75, 0xee, 0xc5, 0x75, 0xbd, 0xf0, 0xfa, 0xba, + 0x5e, 0xf8, 0xfd, 0xba, 0x5e, 0x78, 0xfa, 0x45, 0xdf, 0x8d, 0xbe, 0x8d, 0xbb, 0x8a, 0xed, 0x0f, + 0x54, 0xb6, 0xd5, 0x7b, 0x1e, 0xee, 0x86, 0xd9, 0x59, 0x3d, 0xff, 0x4c, 0xfd, 0x7e, 0xf6, 0x1b, + 0xc0, 0x23, 0x7d, 0x6c, 0x5f, 0xa4, 0x97, 0xd1, 0xc5, 0x88, 0x84, 0xdd, 0x32, 0x7d, 0xf3, 0x3f, + 0xfd, 0x27, 0x00, 0x00, 0xff, 0xff, 0x33, 0xe4, 0x13, 0xaf, 0x2d, 0x08, 0x00, 0x00, +} + +func (this *ApplicationLink) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ApplicationLink) + if !ok { + that2, ok := that.(ApplicationLink) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.User != that1.User { + return false + } + if !this.Data.Equal(&that1.Data) { + return false + } + if this.State != that1.State { + return false + } + if !this.OracleRequest.Equal(&that1.OracleRequest) { + return false + } + if !this.Result.Equal(that1.Result) { + return false + } + if !this.CreationTime.Equal(that1.CreationTime) { + return false + } + return true +} +func (this *Data) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Data) + if !ok { + that2, ok := that.(Data) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Application != that1.Application { + return false + } + if this.Username != that1.Username { + return false + } + return true +} +func (this *OracleRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*OracleRequest) + if !ok { + that2, ok := that.(OracleRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ID != that1.ID { + return false + } + if this.OracleScriptID != that1.OracleScriptID { + return false + } + if !this.CallData.Equal(&that1.CallData) { + return false + } + if this.ClientID != that1.ClientID { + return false + } + return true +} +func (this *OracleRequest_CallData) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*OracleRequest_CallData) + if !ok { + that2, ok := that.(OracleRequest_CallData) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Application != that1.Application { + return false + } + if this.CallData != that1.CallData { + return false + } + return true +} +func (this *Result) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result) + if !ok { + that2, ok := that.(Result) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if that1.Sum == nil { + if this.Sum != nil { + return false + } + } else if this.Sum == nil { + return false + } else if !this.Sum.Equal(that1.Sum) { + return false + } + return true +} +func (this *Result_Success_) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Success_) + if !ok { + that2, ok := that.(Result_Success_) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Success.Equal(that1.Success) { + return false + } + return true +} +func (this *Result_Failed_) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Failed_) + if !ok { + that2, ok := that.(Result_Failed_) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Failed.Equal(that1.Failed) { + return false + } + return true +} +func (this *Result_Success) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Success) + if !ok { + that2, ok := that.(Result_Success) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Value != that1.Value { + return false + } + if this.Signature != that1.Signature { + return false + } + return true +} +func (this *Result_Failed) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Failed) + if !ok { + that2, ok := that.(Result_Failed) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Error != that1.Error { + return false + } + return true +} +func (m *ApplicationLink) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ApplicationLink) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ApplicationLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintModelsAppLinks(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x32 + if m.Result != nil { + { + size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + { + size, err := m.OracleRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.State != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Data) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Data) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x12 + } + if len(m.Application) > 0 { + i -= len(m.Application) + copy(dAtA[i:], m.Application) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Application))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OracleRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OracleRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ClientID) > 0 { + i -= len(m.ClientID) + copy(dAtA[i:], m.ClientID) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.ClientID))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.CallData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.OracleScriptID != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.OracleScriptID)) + i-- + dAtA[i] = 0x10 + } + if m.ID != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *OracleRequest_CallData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OracleRequest_CallData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleRequest_CallData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CallData) > 0 { + i -= len(m.CallData) + copy(dAtA[i:], m.CallData) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.CallData))) + i-- + dAtA[i] = 0x12 + } + if len(m.Application) > 0 { + i -= len(m.Application) + copy(dAtA[i:], m.Application) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Application))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Result) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Result) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Result_Success_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Success_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Success != nil { + { + size, err := m.Success.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Result_Failed_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Failed_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Failed != nil { + { + size, err := m.Failed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Result_Success) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Result_Success) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Success) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x12 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Result_Failed) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Result_Failed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Failed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsAppLinks(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsAppLinks(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ApplicationLink) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.User) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = m.Data.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + if m.State != 0 { + n += 1 + sovModelsAppLinks(uint64(m.State)) + } + l = m.OracleRequest.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + if m.Result != nil { + l = m.Result.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime) + n += 1 + l + sovModelsAppLinks(uint64(l)) + return n +} + +func (m *Data) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Application) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.Username) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *OracleRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ID != 0 { + n += 1 + sovModelsAppLinks(uint64(m.ID)) + } + if m.OracleScriptID != 0 { + n += 1 + sovModelsAppLinks(uint64(m.OracleScriptID)) + } + l = m.CallData.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + l = len(m.ClientID) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *OracleRequest_CallData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Application) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.CallData) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *Result) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *Result_Success_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success != nil { + l = m.Success.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} +func (m *Result_Failed_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Failed != nil { + l = m.Failed.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} +func (m *Result_Success) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *Result_Failed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Error) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func sovModelsAppLinks(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsAppLinks(x uint64) (n int) { + return sovModelsAppLinks(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ApplicationLink) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ApplicationLink: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ApplicationLink: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.User = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= ApplicationLinkState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OracleRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Result == nil { + m.Result = &Result{} + } + if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Data) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Data: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Data: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Application = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OracleRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OracleRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleScriptID", wireType) + } + m.OracleScriptID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OracleScriptID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CallData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleRequest_CallData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CallData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CallData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Application = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallData", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CallData = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Result: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Result: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Result_Success{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Result_Success_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Result_Failed{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Result_Failed_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result_Success) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Success: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Success: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result_Failed) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Failed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Failed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsAppLinks(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthModelsAppLinks + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsAppLinks + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsAppLinks + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsAppLinks = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsAppLinks = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsAppLinks = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v4/models_chain_links.go b/x/profiles/legacy/v4/types/models_chain_links.go similarity index 99% rename from x/profiles/legacy/v4/models_chain_links.go rename to x/profiles/legacy/v4/types/models_chain_links.go index 55eccfb5dc..6a5b10326f 100644 --- a/x/profiles/legacy/v4/models_chain_links.go +++ b/x/profiles/legacy/v4/types/models_chain_links.go @@ -1,4 +1,4 @@ -package v4 +package types // DONTCOVER diff --git a/x/profiles/legacy/v4/models_chain_links.pb.go b/x/profiles/legacy/v4/types/models_chain_links.pb.go similarity index 91% rename from x/profiles/legacy/v4/models_chain_links.pb.go rename to x/profiles/legacy/v4/types/models_chain_links.pb.go index c318b26944..64cf7b4401 100644 --- a/x/profiles/legacy/v4/models_chain_links.pb.go +++ b/x/profiles/legacy/v4/types/models_chain_links.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: desmos/profiles/v1beta1/models_chain_links.proto -package v4 +package types import ( fmt "fmt" @@ -299,47 +299,47 @@ func init() { } var fileDescriptor_1c1946212735e419 = []byte{ - // 636 bytes of a gzipped FileDescriptorProto + // 640 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0xbd, 0x6e, 0xd3, 0x40, - 0x1c, 0x8f, 0x69, 0xd3, 0x2a, 0x97, 0x04, 0xda, 0x23, 0x88, 0xd0, 0x4a, 0xbe, 0x72, 0x20, 0x54, - 0x86, 0xda, 0xf4, 0x4b, 0x42, 0x9d, 0xa8, 0xcb, 0x80, 0x00, 0x09, 0xb0, 0x3a, 0xb1, 0x44, 0x67, - 0xe7, 0xe2, 0x5a, 0xb5, 0x7d, 0x96, 0xcf, 0x8e, 0x12, 0x09, 0x89, 0x95, 0xb1, 0x23, 0x63, 0x27, - 0x9e, 0x80, 0x27, 0x60, 0xaa, 0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87, 0x66, 0x7f, 0xcb, 0x99, 0x93, 0x7b, 0xb4, 0xf9, 0x3b, - 0x00, 0x00, 0xff, 0xff, 0xa8, 0xc0, 0x54, 0x0c, 0x16, 0x05, 0x00, 0x00, + 0x1c, 0x8f, 0x69, 0xd3, 0x2a, 0x97, 0x04, 0x5a, 0x13, 0x44, 0x68, 0x25, 0x5f, 0x39, 0x10, 0x2a, + 0x43, 0x6d, 0xfa, 0x81, 0x84, 0xca, 0x42, 0x5d, 0x06, 0x04, 0x0c, 0x60, 0x95, 0x85, 0x25, 0x3a, + 0x3b, 0x17, 0xd7, 0xaa, 0xed, 0xb3, 0x7c, 0xe7, 0x2a, 0x96, 0x90, 0x58, 0x19, 0x3b, 0x32, 0x76, + 0xe2, 0x09, 0x78, 0x02, 0xa6, 0x8a, 0xa9, 0x62, 0x62, 0x32, 0xa8, 0x5d, 0x98, 0xf3, 0x04, 0xe8, + 0xee, 0xec, 0x26, 0xb4, 0x2a, 0x12, 0x13, 0xdb, 0xdd, 0xff, 0xf7, 0x71, 0xff, 0x2f, 0x1b, 0x3c, + 0xe8, 0x13, 0x16, 0x51, 0x66, 0x25, 0x29, 0x1d, 0x04, 0x21, 0x61, 0xd6, 0xfe, 0xaa, 0x4b, 0x38, + 0x5e, 0xb5, 0x22, 0xda, 0x27, 0x21, 0xeb, 0x79, 0xbb, 0x38, 0x88, 0x7b, 0x61, 0x10, 0xef, 0x31, + 0x33, 0x49, 0x29, 0xa7, 0xfa, 0x4d, 0xa5, 0x30, 0x2b, 0x85, 0x59, 0x2a, 0x16, 0x3a, 0x3e, 0xf5, + 0xa9, 0xe4, 0x58, 0xe2, 0xa4, 0xe8, 0x0b, 0xb7, 0x7c, 0x4a, 0xfd, 0x90, 0x58, 0xf2, 0xe6, 0x66, + 0x03, 0x0b, 0xc7, 0x79, 0x09, 0xc1, 0xf3, 0x10, 0x0f, 0x22, 0xc2, 0x38, 0x8e, 0x92, 0x4a, 0xeb, + 0x51, 0xf1, 0x54, 0x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01, + 0x6d, 0x1b, 0x33, 0xf2, 0xf0, 0xd1, 0x3f, 0x26, 0xf0, 0x77, 0xd7, 0x77, 0x00, 0x3c, 0x23, 0xc3, + 0xff, 0x54, 0x93, 0xfd, 0xe6, 0xe8, 0xc4, 0xd0, 0x8e, 0x4f, 0x0c, 0xed, 0xe7, 0x89, 0xa1, 0x1d, + 0x9c, 0x1a, 0xb5, 0xe3, 0x53, 0xa3, 0xf6, 0xfd, 0xd4, 0xa8, 0xbd, 0x7d, 0xec, 0x07, 0x7c, 0x37, + 0x73, 0x4d, 0x8f, 0x46, 0x96, 0xfa, 0x80, 0x56, 0x42, 0xec, 0xb2, 0xf2, 0x6c, 0xed, 0x6f, 0x58, + 0xc3, 0xf1, 0x2f, 0x2f, 0x24, 0x3e, 0xf6, 0x72, 0x11, 0xe4, 0x79, 0x42, 0x98, 0x3b, 0x23, 0xb7, + 0x69, 0xfd, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xae, 0x85, 0x42, 0x4e, 0x1c, 0x05, 0x00, 0x00, } func (this *ChainLink) Equal(that interface{}) bool { diff --git a/x/profiles/legacy/v4/types/models_dtag_requests.pb.go b/x/profiles/legacy/v4/types/models_dtag_requests.pb.go new file mode 100644 index 0000000000..6385f456e3 --- /dev/null +++ b/x/profiles/legacy/v4/types/models_dtag_requests.pb.go @@ -0,0 +1,452 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v1beta1/models_dtag_requests.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/desmos-labs/desmos/v4/x/profiles/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/regen-network/cosmos-proto" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// DTagTransferRequest represent a DTag transfer request between two users +type DTagTransferRequest struct { + // DTagToTrade contains the value of the DTag that should be transferred from + // the receiver of the request to the sender + DTagToTrade string `protobuf:"bytes,1,opt,name=dtag_to_trade,json=dtagToTrade,proto3" json:"dtag_to_trade,omitempty" yaml:"dtag_to_trade"` + // Sender represents the address of the account that sent the request + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` + // Receiver represents the receiver of the request that, if accepted, will + // give to the sender their DTag + Receiver string `protobuf:"bytes,3,opt,name=receiver,proto3" json:"receiver,omitempty" yaml:"receiver"` +} + +func (m *DTagTransferRequest) Reset() { *m = DTagTransferRequest{} } +func (m *DTagTransferRequest) String() string { return proto.CompactTextString(m) } +func (*DTagTransferRequest) ProtoMessage() {} +func (*DTagTransferRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_08f2e5360e821c5e, []int{0} +} +func (m *DTagTransferRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DTagTransferRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DTagTransferRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DTagTransferRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DTagTransferRequest.Merge(m, src) +} +func (m *DTagTransferRequest) XXX_Size() int { + return m.Size() +} +func (m *DTagTransferRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DTagTransferRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DTagTransferRequest proto.InternalMessageInfo + +func init() { + proto.RegisterType((*DTagTransferRequest)(nil), "desmos.profiles.v1beta1.DTagTransferRequest") +} + +func init() { + proto.RegisterFile("desmos/profiles/v1beta1/models_dtag_requests.proto", fileDescriptor_08f2e5360e821c5e) +} + +var fileDescriptor_08f2e5360e821c5e = []byte{ + // 371 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xb1, 0x6e, 0xdb, 0x30, + 0x10, 0x86, 0xc5, 0x16, 0x30, 0x5a, 0xb9, 0x46, 0x51, 0xd9, 0x40, 0x5d, 0x0f, 0x62, 0xa1, 0xa5, + 0x2d, 0x8a, 0x8a, 0x70, 0xdd, 0xc9, 0xdd, 0x8c, 0x6e, 0xdd, 0x04, 0x77, 0xe9, 0x22, 0x50, 0xd2, + 0x99, 0x16, 0x22, 0x89, 0x0a, 0x49, 0x1b, 0xd1, 0x1b, 0x64, 0xcc, 0x98, 0xd1, 0x8f, 0x93, 0x21, + 0x83, 0xc7, 0x4c, 0x42, 0x20, 0x2f, 0x99, 0xfd, 0x04, 0x81, 0x44, 0x29, 0x41, 0x92, 0x8d, 0x77, + 0xff, 0xf7, 0x1f, 0xef, 0x7e, 0xf3, 0x67, 0x04, 0x32, 0xe5, 0x92, 0xe4, 0x82, 0xaf, 0xe2, 0x04, + 0x24, 0xd9, 0x4e, 0x03, 0x50, 0x74, 0x4a, 0x52, 0x1e, 0x41, 0x22, 0xfd, 0x48, 0x51, 0xe6, 0x0b, + 0x38, 0xdd, 0x80, 0x54, 0xd2, 0xcd, 0x05, 0x57, 0xdc, 0xfa, 0xa8, 0x3d, 0x6e, 0xe7, 0x71, 0x5b, + 0xcf, 0x64, 0xc4, 0x38, 0xe3, 0x0d, 0x43, 0xea, 0x97, 0xc6, 0x27, 0x9f, 0x18, 0xe7, 0x2c, 0x01, + 0xd2, 0x54, 0xc1, 0x66, 0x45, 0x68, 0x56, 0xb4, 0x12, 0x7e, 0x2e, 0xa9, 0x38, 0x05, 0xa9, 0x68, + 0x9a, 0x77, 0xde, 0x90, 0xd7, 0x5f,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02, 0x8c, 0x86, 0x45, 0xdd, 0x54, 0x45, 0x0e, + 0x32, 0xe8, 0x35, 0x61, 0xcd, 0xee, 0x03, 0x00, 0x00, 0xff, 0xff, 0x40, 0x7c, 0xc1, 0x7c, 0x15, + 0x02, 0x00, 0x00, +} + +func (this *DTagTransferRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DTagTransferRequest) + if !ok { + that2, ok := that.(DTagTransferRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.DTagToTrade != that1.DTagToTrade { + return false + } + if this.Sender != that1.Sender { + return false + } + if this.Receiver != that1.Receiver { + return false + } + return true +} +func (m *DTagTransferRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DTagTransferRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DTagTransferRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintModelsDtagRequests(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x1a + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintModelsDtagRequests(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x12 + } + if len(m.DTagToTrade) > 0 { + i -= len(m.DTagToTrade) + copy(dAtA[i:], m.DTagToTrade) + i = encodeVarintModelsDtagRequests(dAtA, i, uint64(len(m.DTagToTrade))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsDtagRequests(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsDtagRequests(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *DTagTransferRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DTagToTrade) + if l > 0 { + n += 1 + l + sovModelsDtagRequests(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovModelsDtagRequests(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovModelsDtagRequests(uint64(l)) + } + return n +} + +func sovModelsDtagRequests(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsDtagRequests(x uint64) (n int) { + return sovModelsDtagRequests(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *DTagTransferRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DTagTransferRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DTagTransferRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DTagToTrade", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsDtagRequests + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DTagToTrade = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsDtagRequests + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsDtagRequests + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsDtagRequests(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsDtagRequests(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthModelsDtagRequests + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsDtagRequests + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsDtagRequests + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsDtagRequests = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsDtagRequests = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsDtagRequests = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v4/models_profile.go b/x/profiles/legacy/v4/types/models_profile.go similarity index 99% rename from x/profiles/legacy/v4/models_profile.go rename to x/profiles/legacy/v4/types/models_profile.go index 5c43aa854a..5cccc296d8 100644 --- a/x/profiles/legacy/v4/models_profile.go +++ b/x/profiles/legacy/v4/types/models_profile.go @@ -1,4 +1,4 @@ -package v4 +package types // DONTCOVER diff --git a/x/profiles/legacy/v4/models_profile.pb.go b/x/profiles/legacy/v4/types/models_profile.pb.go similarity index 86% rename from x/profiles/legacy/v4/models_profile.pb.go rename to x/profiles/legacy/v4/types/models_profile.pb.go index 62eea0b9fd..3162b9b8eb 100644 --- a/x/profiles/legacy/v4/models_profile.pb.go +++ b/x/profiles/legacy/v4/types/models_profile.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: desmos/profiles/v1beta1/models_profile.proto -package v4 +package types import ( fmt "fmt" @@ -143,38 +143,38 @@ func init() { } var fileDescriptor_a19232e029005b86 = []byte{ - // 491 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x3f, 0x6f, 0xd3, 0x40, - 0x18, 0xc6, 0x6d, 0x92, 0x36, 0xee, 0x35, 0x14, 0x74, 0x44, 0x8a, 0xc9, 0xe0, 0x0b, 0x37, 0xa0, - 0x4a, 0xb4, 0x3e, 0x15, 0xca, 0x12, 0xb1, 0xd4, 0xea, 0xc2, 0x44, 0x65, 0x55, 0x0c, 0x2c, 0xd1, - 0xd9, 0xb9, 0x1a, 0x83, 0xed, 0x8b, 0xe2, 0x4b, 0x44, 0xbe, 0x01, 0x03, 0x43, 0xc7, 0x8e, 0xf9, - 0x10, 0x7c, 0x88, 0x8a, 0xa9, 0x23, 0x93, 0x41, 0xc9, 0xc2, 0xec, 0x4f, 0x80, 0x7c, 0x7f, 0x5a, - 0x01, 0x62, 0xbb, 0xbb, 0xe7, 0xf7, 0x3e, 0xef, 0xa3, 0xc7, 0x06, 0x07, 0x13, 0x56, 0xe6, 0xbc, - 0x24, 0xd3, 0x19, 0xbf, 0x48, 0x33, 0x56, 0x92, 0x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 0xd0, 0x78, 0x49, 0x16, 0xc7, 0xd1, 0xb6, 0xac, 0xe2, 0xc5, 0xef, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xb1, 0xdb, 0x82, 0x0c, 0x08, 0x03, 0x00, 0x00, + // 493 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xb1, 0x6e, 0xd3, 0x40, + 0x1c, 0xc6, 0x6d, 0x92, 0x36, 0xee, 0x35, 0x14, 0x74, 0x44, 0x8a, 0xc9, 0xe0, 0x0b, 0x37, 0xa0, + 0x4a, 0xb4, 0x3e, 0x15, 0x98, 0x02, 0x4b, 0xad, 0x2e, 0x6c, 0x95, 0x55, 0x18, 0x58, 0xa2, 0xb3, + 0x73, 0x35, 0x06, 0xdb, 0x17, 0xd9, 0x97, 0x08, 0xbf, 0x01, 0x03, 0x43, 0xc7, 0x8e, 0x79, 0x08, + 0x1e, 0xa2, 0x62, 0xea, 0xc8, 0x64, 0x50, 0xb2, 0x30, 0xfb, 0x09, 0x90, 0x7d, 0x77, 0xad, 0x00, + 0x75, 0xbb, 0xfb, 0x7f, 0xbf, 0xff, 0x77, 0x9f, 0x3e, 0x1b, 0x1c, 0xcc, 0x58, 0x91, 0xf2, 0x82, + 0xcc, 0x73, 0x7e, 0x1e, 0x27, 0xac, 0x20, 0xcb, 0xa3, 0x80, 0x09, 0x7a, 0x44, 0x52, 0x3e, 0x63, + 0x49, 0x31, 0x55, 0x73, 0x77, 0x9e, 0x73, 0xc1, 0xe1, 0x50, 0xd2, 0xae, 0xa6, 0x5d, 0x45, 0x8f, + 0x06, 0x11, 0x8f, 0x78, 0xcb, 0x90, 0xe6, 0x24, 0xf1, 0xd1, 0xe3, 0x88, 0xf3, 0x28, 0x61, 0xa4, + 0xbd, 0x05, 0x8b, 0x73, 0x42, 0xb3, 0x52, 0x49, 0xe8, 0x5f, 0x49, 0xc4, 0x29, 0x2b,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x1b, 0x2b, 0xd7, 0x81, 0x74, 0xfd, 0x6b, 0x1d, 0x5f, 0xfc, 0x44, 0xa6, + 0xdf, 0xd7, 0xb3, 0x13, 0x2a, 0xd8, 0xc4, 0xfa, 0xb2, 0x42, 0xc6, 0xe5, 0x0a, 0x19, 0xf8, 0x23, + 0xb0, 0x74, 0x36, 0x78, 0x00, 0x7a, 0x2a, 0x78, 0xfb, 0x39, 0x76, 0x3c, 0x58, 0x57, 0x68, 0x4f, + 0x05, 0x95, 0x02, 0xf6, 0x35, 0x02, 0x9f, 0x82, 0xad, 0x90, 0x2f, 0x59, 0xae, 0xfa, 0x7f, 0x58, + 0x57, 0xa8, 0xaf, 0x9e, 0x6f, 0xc6, 0xd8, 0x97, 0xf2, 0xc4, 0xba, 0x5c, 0x21, 0xf3, 0xf7, 0x0a, + 0x99, 0xde, 0xdb, 0xab, 0xb5, 0x63, 0x5e, 0xaf, 0x1d, 0xf3, 0xd7, 0xda, 0x31, 0x2f, 0x36, 0x8e, + 0x71, 0xbd, 0x71, 0x8c, 0x1f, 0x1b, 0xc7, 0x78, 0xff, 0x2a, 0x8a, 0xc5, 0x87, 0x45, 0xe0, 0x86, + 0x3c, 0x25, 0xb2, 0xc2, 0xc3, 0x84, 0x06, 0x85, 0x3a, 0x93, 0xe5, 0x4b, 0xf2, 0xf9, 0xf6, 0x27, + 0x4f, 0x58, 0x44, 0xc3, 0xb2, 0x19, 0x8a, 0x72, 0xce, 0x8a, 0x60, 0xbb, 0x2d, 0xe4, 0xc5, 0x9f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x96, 0x94, 0x7e, 0x0e, 0x03, 0x00, 0x00, } func (this *Pictures) Equal(that interface{}) bool { diff --git a/x/profiles/legacy/v4/models_relationships.pb.go b/x/profiles/legacy/v4/types/models_relationships.pb.go similarity index 88% rename from x/profiles/legacy/v4/models_relationships.pb.go rename to x/profiles/legacy/v4/types/models_relationships.pb.go index 03a1a6778e..514af24158 100644 --- a/x/profiles/legacy/v4/models_relationships.pb.go +++ b/x/profiles/legacy/v4/types/models_relationships.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: desmos/profiles/v1beta1/models_relationships.proto -package v4 +package types import ( fmt "fmt" @@ -173,32 +173,33 @@ func init() { } var fileDescriptor_47c7d48489f1a7d0 = []byte{ - // 399 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xbf, 0xae, 0xd3, 0x30, - 0x18, 0xc5, 0x6b, 0x40, 0x17, 0x6a, 0xfe, 0x47, 0x57, 0xa2, 0xdc, 0x21, 0x06, 0x4f, 0x20, 0x41, - 0xac, 0x5b, 0xca, 0xd2, 0x31, 0x62, 0xe9, 0x84, 0x14, 0xc4, 0xc2, 0x52, 0x39, 0x89, 0x9b, 0x5a, - 0x38, 0x71, 0x64, 0xbb, 0x15, 0x7d, 0x0b, 0x46, 0xc6, 0x3e, 0x09, 0x33, 0x63, 0x47, 0xa6, 0xa8, - 0x4a, 0x17, 0xe6, 0x3c, 0x01, 0x4a, 0xec, 0xb4, 0xa8, 0xb0, 0xb1, 0x1d, 0xfb, 0xfc, 0x8e, 0x73, - 0x3e, 0xe5, 0x83, 0xe3, 0x94, 0xe9, 0x5c, 0x6a, 0x52, 0x2a, 0xb9, 0xe0, 0x82, 0x69, 0xb2, 0xbe, - 0x8e, 0x99, 0xa1, 0xd7, 0x24, 0x97, 0x29, 0x13, 0x7a, 0xae, 0x98, 0xa0, 0x86, 0xcb, 0x42, 0x2f, - 0x79, 0xa9, 0x83, 0x52, 0x49, 0x23, 0xbd, 0x27, 0x36, 0x13, 0xf4, 0x99, 0xc0, 0x65, 0xae, 0x2e, - 0x33, 0x99, 0xc9, 0x8e, 0x21, 0xad, 0xb2, 0xf8, 0xd5, 0xd3, 0x4c, 0xca, 0x4c, 0x30, 0xd2, 0x9d, - 0xe2, 0xd5, 0x82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1a, 0x31, 0x7c, 0xff, 0xa3, 0xf6, 0xc1, 0xae, 0xf6, 0xc1, - 0xbe, 0xf6, 0xc1, 0xd7, 0x83, 0x3f, 0xd8, 0x1d, 0xfc, 0xc1, 0xcf, 0x83, 0x3f, 0xf8, 0xf4, 0x36, - 0xe3, 0x66, 0xb9, 0x8a, 0x83, 0x44, 0xe6, 0xc4, 0xae, 0xd3, 0x6b, 0x41, 0x63, 0xed, 0x34, 0x59, - 0x4f, 0xc8, 0x97, 0xd3, 0x4e, 0x0a, 0x96, 0xd1, 0x64, 0x43, 0xd6, 0x93, 0xf8, 0xa2, 0xfb, 0xf7, - 0x6f, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0xc5, 0xed, 0xc5, 0x77, 0xb7, 0x02, 0x00, 0x00, + // 402 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xbf, 0x6f, 0xd4, 0x30, + 0x14, 0xc7, 0xcf, 0x80, 0x0a, 0x67, 0x7e, 0x47, 0x95, 0x38, 0x3a, 0xc4, 0xe0, 0x09, 0x24, 0x88, + 0xd5, 0xc2, 0x54, 0xb6, 0x88, 0xa5, 0x6b, 0x50, 0x17, 0x96, 0x93, 0x93, 0xbc, 0xa6, 0x16, 0x4e, + 0x1c, 0xd9, 0xbe, 0x8a, 0xfc, 0x17, 0x8c, 0x8c, 0xfd, 0x4b, 0x98, 0x19, 0x3b, 0x32, 0x45, 0x55, + 0x6e, 0x61, 0xce, 0x5f, 0x80, 0x12, 0x3b, 0x77, 0xe8, 0x60, 0xeb, 0xf6, 0xfc, 0xbe, 0x9f, 0xef, + 0xf3, 0xf7, 0x49, 0x0f, 0x1f, 0xe5, 0x60, 0x4a, 0x65, 0x58, 0xad, 0xd5, 0x99, 0x90, 0x60, 0xd8, + 0xc5, 0x61, 0x0a, 0x96, 0x1f, 0xb2, 0x52, 0xe5, 0x20, 0xcd, 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xbd, 0x17, 0x68, 0x32, 0x21, 0x5b, 0x3a, 0xf7, 0xd9, 0xff, 0xa1, 0xf3, 0x0d, 0x9d, 0x07, 0xaf, + 0xf1, 0x9e, 0x06, 0x6e, 0x54, 0xe5, 0x23, 0x3f, 0xed, 0x5b, 0xf2, 0x70, 0x5a, 0x74, 0xe8, 0xd3, + 0xc4, 0x03, 0xbb, 0x2b, 0xde, 0xb9, 0xd1, 0x8a, 0xf1, 0xe9, 0xcf, 0x2e, 0x44, 0x57, 0x5d, 0x88, + 0xae, 0xbb, 0x10, 0x7d, 0x5b, 0x87, 0xb3, 0xab, 0x75, 0x38, 0xfb, 0xb5, 0x0e, 0x67, 0x9f, 0x3f, + 0x14, 0xc2, 0x9e, 0xaf, 0xd2, 0x28, 0x53, 0x25, 0x73, 0xe7, 0xf4, 0x56, 0xf2, 0xd4, 0xf8, 0x9a, + 0x5d, 0xbc, 0x67, 0x5f, 0xb7, 0x37, 0x29, 0xa1, 0xe0, 0x59, 0x33, 0x34, 0x6d, 0x53, 0x83, 0x49, + 0xf7, 0xc6, 0x0b, 0x78, 0xf7, 0x27, 0x00, 0x00, 0xff, 0xff, 0xef, 0x73, 0x21, 0x9e, 0xbd, 0x02, + 0x00, 0x00, } func (this *Relationship) Equal(that interface{}) bool { diff --git a/x/profiles/legacy/v5/store.go b/x/profiles/legacy/v5/store.go index eac1d165f0..091a20136a 100644 --- a/x/profiles/legacy/v5/store.go +++ b/x/profiles/legacy/v5/store.go @@ -5,16 +5,17 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" + v5types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" + "github.com/desmos-labs/desmos/v4/x/profiles/types" ) -// MigrateStore performs in-place store migrations from v5 to v6 +// MigrateStore performs in-place store migrations from v5 to v6. // The migration includes: // // - add missing application links owner keys to allow reverse searches // - add missing chain links owner keys to allow reverse searches // - remove all chain links that are not valid anymore due to the new validation rules -// func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, cdc codec.BinaryCodec, legacyAmino *codec.LegacyAmino) error { store := ctx.KVStore(storeKey) @@ -38,9 +39,9 @@ func fixApplicationLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { applicationLinksStore := prefix.NewStore(store, types.ApplicationLinkPrefix) applicationLinksIterator := applicationLinksStore.Iterator(nil, nil) - var applicationLinks []types.ApplicationLink + var applicationLinks []v5types.ApplicationLink for ; applicationLinksIterator.Valid(); applicationLinksIterator.Next() { - var applicationLink types.ApplicationLink + var applicationLink v5types.ApplicationLink err := cdc.Unmarshal(applicationLinksIterator.Value(), &applicationLink) if err != nil { return err @@ -63,10 +64,10 @@ func fixChainLinks(store sdk.KVStore, cdc codec.BinaryCodec, legacyAmino *codec. chainLinkStore := prefix.NewStore(store, types.ChainLinksPrefix) chainLinksIterator := chainLinkStore.Iterator(nil, nil) - var validChainLinks []types.ChainLink - var invalidChainLinks []types.ChainLink + var validChainLinks []v5types.ChainLink + var invalidChainLinks []v5types.ChainLink for ; chainLinksIterator.Valid(); chainLinksIterator.Next() { - var chainLink types.ChainLink + var chainLink v5types.ChainLink err := cdc.Unmarshal(chainLinksIterator.Value(), &chainLink) if err != nil { return err diff --git a/x/profiles/legacy/v5/store_test.go b/x/profiles/legacy/v5/store_test.go index 75c314c6b8..91825e6c89 100644 --- a/x/profiles/legacy/v5/store_test.go +++ b/x/profiles/legacy/v5/store_test.go @@ -5,6 +5,8 @@ import ( "testing" "time" + v5types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" + v5 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5" "github.com/cosmos/cosmos-sdk/types/tx/signing" @@ -12,7 +14,7 @@ import ( "github.com/desmos-labs/desmos/v4/testutil/storetesting" "github.com/desmos-labs/desmos/v4/testutil/profilestesting" - profilestypes "github.com/desmos-labs/desmos/v4/x/profiles/types" + "github.com/desmos-labs/desmos/v4/x/profiles/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -21,7 +23,6 @@ import ( "github.com/stretchr/testify/require" "github.com/desmos-labs/desmos/v4/app" - "github.com/desmos-labs/desmos/v4/x/relationships/types" ) func TestMigrateStore(t *testing.T) { @@ -45,17 +46,17 @@ func TestMigrateStore(t *testing.T) { kvStore := ctx.KVStore(keys[types.StoreKey]) // Store an application link - linkKey := profilestypes.UserApplicationLinkKey("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", "twitter", "twitteruser") + linkKey := types.UserApplicationLinkKey("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", "twitter", "twitteruser") kvStore.Set( linkKey, - cdc.MustMarshal(&profilestypes.ApplicationLink{ + cdc.MustMarshal(&v5types.ApplicationLink{ User: "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", - Data: profilestypes.NewData("twitter", "twitteruser"), - State: profilestypes.ApplicationLinkStateInitialized, - OracleRequest: profilestypes.NewOracleRequest( + Data: v5types.NewData("twitter", "twitteruser"), + State: v5types.ApplicationLinkStateInitialized, + OracleRequest: v5types.NewOracleRequest( 0, 1, - profilestypes.NewOracleRequestCallData("twitter", "calldata"), + v5types.NewOracleRequestCallData("twitter", "calldata"), "client_id", ), Result: nil, @@ -64,13 +65,13 @@ func TestMigrateStore(t *testing.T) { ) // Store an application link client id - kvStore.Set(profilestypes.ApplicationLinkClientIDKey("client_id"), linkKey) + kvStore.Set(types.ApplicationLinkClientIDKey("client_id"), linkKey) }, check: func(ctx sdk.Context) { kvStore := ctx.KVStore(keys[types.StoreKey]) // Check the application link owner - key := profilestypes.ApplicationLinkOwnerKey( + key := types.ApplicationLinkOwnerKey( "twitter", "twitteruser", "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", @@ -85,26 +86,26 @@ func TestMigrateStore(t *testing.T) { // Store the chain link signatureValue := []byte("custom value") - signature := profilestypes.SingleSignatureData{ + signature := v5types.SingleSignatureData{ Mode: signing.SignMode_SIGN_MODE_TEXTUAL, Signature: signatureValue, } signatureAny := profilestesting.NewAny(&signature) - chainLink := profilestypes.NewChainLink( + chainLink := v5types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", - profilestypes.NewBech32Address(account.Bech32Address().GetValue(), "cosmos"), - profilestypes.Proof{ + v5types.NewBech32Address("cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos"), + v5types.Proof{ PubKey: account.PubKeyAny(), Signature: signatureAny, PlainText: hex.EncodeToString(signatureValue), }, - profilestypes.ChainConfig{Name: "cosmos"}, + v5types.ChainConfig{Name: "cosmos"}, time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ) kvStore.Set( - profilestypes.ChainLinksStoreKey( + types.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", @@ -116,15 +117,15 @@ func TestMigrateStore(t *testing.T) { kvStore := ctx.KVStore(keys[types.StoreKey]) // Make sure the chain link is deleted and the owner key is not added - require.False(t, kvStore.Has(profilestypes.ChainLinkOwnerKey( + require.False(t, kvStore.Has(types.ChainLinkOwnerKey( "cosmos", - account.Bech32Address().GetValue(), + "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", ))) - require.False(t, kvStore.Has(profilestypes.ChainLinksStoreKey( + require.False(t, kvStore.Has(types.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", - account.Bech32Address().GetValue(), + "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", ))) }, }, @@ -134,16 +135,27 @@ func TestMigrateStore(t *testing.T) { kvStore := ctx.KVStore(keys[types.StoreKey]) // Store the chain link - chainLink := account.GetBech32ChainLink( + addr, _ := sdk.Bech32ifyAddressBytes("cosmos", account.PubKey().Address()) + chainLink := v5types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + v5types.NewBech32Address(addr, "cosmos"), + v5types.NewProof( + account.PubKey(), + &v5types.SingleSignatureData{ + Mode: signing.SignMode_SIGN_MODE_TEXTUAL, + Signature: account.Sign("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47"), + }, + hex.EncodeToString([]byte("cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47")), + ), + v5types.NewChainConfig(account.ChainName()), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ) kvStore.Set( - profilestypes.ChainLinksStoreKey( + types.ChainLinksStoreKey( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", "cosmos", - "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", + account.Bech32Address().GetValue(), ), cdc.MustMarshal(&chainLink), ) @@ -151,7 +163,7 @@ func TestMigrateStore(t *testing.T) { check: func(ctx sdk.Context) { kvStore := ctx.KVStore(keys[types.StoreKey]) - key := profilestypes.ChainLinkOwnerKey( + key := types.ChainLinkOwnerKey( "cosmos", account.Bech32Address().GetValue(), "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", diff --git a/x/profiles/legacy/v5/types/codec.go b/x/profiles/legacy/v5/types/codec.go new file mode 100644 index 0000000000..51739f2da7 --- /dev/null +++ b/x/profiles/legacy/v5/types/codec.go @@ -0,0 +1,27 @@ +package types + +// DONTCOVER + +import ( + "github.com/cosmos/cosmos-sdk/codec/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" +) + +func RegisterInterfaces(registry types.InterfaceRegistry) { + registry.RegisterImplementations((*authtypes.AccountI)(nil), &Profile{}) + registry.RegisterImplementations((*exported.VestingAccount)(nil), &Profile{}) + registry.RegisterInterface( + "desmos.profiles.v2.AddressData", + (*AddressData)(nil), + &Bech32Address{}, + &Base58Address{}, + &HexAddress{}, + ) + registry.RegisterInterface( + "desmos.profiles.v2.Signature", + (*SignatureData)(nil), + &SingleSignatureData{}, + &MultiSignatureData{}, + ) +} diff --git a/x/profiles/legacy/v5/types/models_app_links.go b/x/profiles/legacy/v5/types/models_app_links.go new file mode 100644 index 0000000000..d06a69792b --- /dev/null +++ b/x/profiles/legacy/v5/types/models_app_links.go @@ -0,0 +1,224 @@ +package types + +// DONTCOVER + +import ( + "encoding/hex" + "fmt" + "strings" + "time" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// NewApplicationLink allows to build a new ApplicationLink instance +func NewApplicationLink( + user string, data Data, state ApplicationLinkState, oracleRequest OracleRequest, result *Result, creationTime time.Time, +) ApplicationLink { + return ApplicationLink{ + User: user, + Data: data, + State: state, + OracleRequest: oracleRequest, + Result: result, + CreationTime: creationTime, + } +} + +// Validate returns an error if the instance does not contain valid data +func (l ApplicationLink) Validate() error { + _, err := sdk.AccAddressFromBech32(l.User) + if err != nil { + return fmt.Errorf("invalid user address: %s", err) + } + + err = l.Data.Validate() + if err != nil { + return err + } + + err = l.OracleRequest.Validate() + if err != nil { + return err + } + + if l.Result != nil { + err = l.Result.Validate() + if err != nil { + return err + } + } + + if l.CreationTime.IsZero() { + return fmt.Errorf("invalid creation time: %s", l.CreationTime) + } + + return nil +} + +// IsVerificationOngoing tells whether the verification for the link is still ongoing +func (l *ApplicationLink) IsVerificationOngoing() bool { + return l.State == ApplicationLinkStateInitialized || l.State == AppLinkStateVerificationStarted +} + +// IsVerificationCompleted tells whether the verification for the link has completed or not +func (l *ApplicationLink) IsVerificationCompleted() bool { + return l.State == AppLinkStateVerificationSuccess || + l.State == AppLinkStateVerificationError || + l.State == AppLinkStateVerificationTimedOut +} + +// MustMarshalApplicationLink serializes the given application link using the provided BinaryCodec +func MustMarshalApplicationLink(cdc codec.BinaryCodec, link ApplicationLink) []byte { + return cdc.MustMarshal(&link) +} + +// MustUnmarshalApplicationLink deserializes the given byte array as an application link using +// the provided BinaryCodec +func MustUnmarshalApplicationLink(cdc codec.BinaryCodec, bz []byte) ApplicationLink { + var link ApplicationLink + cdc.MustUnmarshal(bz, &link) + return link +} + +// -------------------------------------------------------------------------------------------------------------------- + +// NewData allows to build a new Data instance +func NewData(application, username string) Data { + return Data{ + Application: application, + Username: username, + } +} + +// Validate returns an error if the instance does not contain valid data +func (d Data) Validate() error { + if len(strings.TrimSpace(d.Application)) == 0 { + return fmt.Errorf("application name cannot be empty or blank") + } + + if len(strings.TrimSpace(d.Username)) == 0 { + return fmt.Errorf("application username cannot be empty or blank") + } + + return nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// NewOracleRequest allows to build a new OracleRequest instance +func NewOracleRequest(id uint64, scriptID uint64, callData OracleRequest_CallData, clientID string) OracleRequest { + return OracleRequest{ + ID: id, + OracleScriptID: scriptID, + CallData: callData, + ClientID: clientID, + } +} + +// Validate returns an error if the instance does not contain valid data +func (o OracleRequest) Validate() error { + if o.OracleScriptID <= 0 { + return fmt.Errorf("invalid oracle script id: %d", o.OracleScriptID) + } + + err := o.CallData.Validate() + if err != nil { + return err + } + + if len(strings.TrimSpace(o.ClientID)) == 0 { + return fmt.Errorf("client id cannot be empty or blank") + } + + return nil +} + +// NewOracleRequestCallData allows to build a new OracleRequest_CallData instance +func NewOracleRequestCallData(application, callData string) OracleRequest_CallData { + return OracleRequest_CallData{ + Application: application, + CallData: callData, + } +} + +// Validate returns an error if the instance does not contain valid data +func (c OracleRequest_CallData) Validate() error { + if len(strings.TrimSpace(c.Application)) == 0 { + return fmt.Errorf("application cannot be empty or blank") + } + + if len(strings.TrimSpace(c.CallData)) == 0 { + return fmt.Errorf("call data cannot be empty or blank") + } + + if _, err := hex.DecodeString(c.CallData); err != nil { + return fmt.Errorf("invalid call data encoding: must be hex") + } + + return nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// Validate returns an error if the instance does not contain valid data +func (r *Result) Validate() error { + var err error + switch result := (r.Sum).(type) { + case *Result_Success_: + err = result.Validate() + case *Result_Failed_: + err = result.Validate() + } + return err +} + +// NewErrorResult allows to build a new Result instance representing an error +func NewErrorResult(error string) *Result { + return &Result{ + Sum: &Result_Failed_{ + Failed: &Result_Failed{ + Error: error, + }, + }, + } +} + +// Validate returns an error if the instance does not contain valid data +func (r Result_Failed_) Validate() error { + if len(strings.TrimSpace(r.Failed.Error)) == 0 { + return fmt.Errorf("error message cannot be empty or blank") + } + + return nil +} + +// NewSuccessResult allows to build a new Result instance representing a success +func NewSuccessResult(value, signature string) *Result { + return &Result{ + Sum: &Result_Success_{ + Success: &Result_Success{ + Value: value, + Signature: signature, + }, + }, + } +} + +// Validate returns an error if the instance does not contain valid data +func (r Result_Success_) Validate() error { + if len(strings.TrimSpace(r.Success.Value)) == 0 { + return fmt.Errorf("value cannot be empty or blank") + } + + if len(strings.TrimSpace(r.Success.Signature)) == 0 { + return fmt.Errorf("signature cannot be empty or blank") + } + + if _, err := hex.DecodeString(r.Success.Signature); err != nil { + return fmt.Errorf("invalid signature encoding; must be hex") + } + + return nil +} diff --git a/x/profiles/legacy/v5/types/models_app_links.pb.go b/x/profiles/legacy/v5/types/models_app_links.pb.go new file mode 100644 index 0000000000..c7a93788b6 --- /dev/null +++ b/x/profiles/legacy/v5/types/models_app_links.pb.go @@ -0,0 +1,2293 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v2/models_app_links.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// ApplicationLinkState defines if an application link is in the following +// states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT +type ApplicationLinkState int32 + +const ( + // A link has just been initialized + ApplicationLinkStateInitialized ApplicationLinkState = 0 + // A link has just started being verified + AppLinkStateVerificationStarted ApplicationLinkState = 1 + // A link has errored during the verification process + AppLinkStateVerificationError ApplicationLinkState = 2 + // A link has being verified successfully + AppLinkStateVerificationSuccess ApplicationLinkState = 3 + // A link has timed out while waiting for the verification + AppLinkStateVerificationTimedOut ApplicationLinkState = 4 +) + +var ApplicationLinkState_name = map[int32]string{ + 0: "APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED", + 1: "APPLICATION_LINK_STATE_VERIFICATION_STARTED", + 2: "APPLICATION_LINK_STATE_VERIFICATION_ERROR", + 3: "APPLICATION_LINK_STATE_VERIFICATION_SUCCESS", + 4: "APPLICATION_LINK_STATE_TIMED_OUT", +} + +var ApplicationLinkState_value = map[string]int32{ + "APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED": 0, + "APPLICATION_LINK_STATE_VERIFICATION_STARTED": 1, + "APPLICATION_LINK_STATE_VERIFICATION_ERROR": 2, + "APPLICATION_LINK_STATE_VERIFICATION_SUCCESS": 3, + "APPLICATION_LINK_STATE_TIMED_OUT": 4, +} + +func (x ApplicationLinkState) String() string { + return proto.EnumName(ApplicationLinkState_name, int32(x)) +} + +func (ApplicationLinkState) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{0} +} + +// ApplicationLink contains the data of a link to a centralized application +type ApplicationLink struct { + // User to which the link is associated + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty" yaml:"user"` + // Data contains the details of this specific link + Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data" yaml:"data"` + // State of the link + State ApplicationLinkState `protobuf:"varint,3,opt,name=state,proto3,enum=desmos.profiles.v2.ApplicationLinkState" json:"state,omitempty" yaml:"state"` + // OracleRequest represents the request that has been made to the oracle + OracleRequest OracleRequest `protobuf:"bytes,4,opt,name=oracle_request,json=oracleRequest,proto3" json:"oracle_request" yaml:"oracle_request"` + // Data coming from the result of the verification. + // Only available when the state is STATE_SUCCESS + Result *Result `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty" yaml:"result"` + // CreationTime represents the time in which the link was created + CreationTime time.Time `protobuf:"bytes,6,opt,name=creation_time,json=creationTime,proto3,stdtime" json:"creation_time" yaml:"creation_time"` +} + +func (m *ApplicationLink) Reset() { *m = ApplicationLink{} } +func (m *ApplicationLink) String() string { return proto.CompactTextString(m) } +func (*ApplicationLink) ProtoMessage() {} +func (*ApplicationLink) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{0} +} +func (m *ApplicationLink) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ApplicationLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ApplicationLink.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ApplicationLink) XXX_Merge(src proto.Message) { + xxx_messageInfo_ApplicationLink.Merge(m, src) +} +func (m *ApplicationLink) XXX_Size() int { + return m.Size() +} +func (m *ApplicationLink) XXX_DiscardUnknown() { + xxx_messageInfo_ApplicationLink.DiscardUnknown(m) +} + +var xxx_messageInfo_ApplicationLink proto.InternalMessageInfo + +// Data contains the data associated to a specific user of a +// generic centralized application +type Data struct { + // The application name (eg. Twitter, GitHub, etc) + Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty" yaml:"application"` + // Username on the application (eg. Twitter tag, GitHub profile, etc) + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty" yaml:"username"` +} + +func (m *Data) Reset() { *m = Data{} } +func (m *Data) String() string { return proto.CompactTextString(m) } +func (*Data) ProtoMessage() {} +func (*Data) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{1} +} +func (m *Data) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Data.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Data) XXX_Merge(src proto.Message) { + xxx_messageInfo_Data.Merge(m, src) +} +func (m *Data) XXX_Size() int { + return m.Size() +} +func (m *Data) XXX_DiscardUnknown() { + xxx_messageInfo_Data.DiscardUnknown(m) +} + +var xxx_messageInfo_Data proto.InternalMessageInfo + +// OracleRequest represents a generic oracle request used to +// verify the ownership of a centralized application account +type OracleRequest struct { + // ID is the ID of the request + ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` + // OracleScriptID is ID of an oracle script + OracleScriptID uint64 `protobuf:"varint,2,opt,name=oracle_script_id,json=oracleScriptId,proto3" json:"oracle_script_id,omitempty" yaml:"oracle_script_id"` + // CallData contains the data used to perform the oracle request + CallData OracleRequest_CallData `protobuf:"bytes,3,opt,name=call_data,json=callData,proto3" json:"call_data" yaml:"call_data"` + // ClientID represents the ID of the client that has called the oracle script + ClientID string `protobuf:"bytes,4,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` +} + +func (m *OracleRequest) Reset() { *m = OracleRequest{} } +func (m *OracleRequest) String() string { return proto.CompactTextString(m) } +func (*OracleRequest) ProtoMessage() {} +func (*OracleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{2} +} +func (m *OracleRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleRequest.Merge(m, src) +} +func (m *OracleRequest) XXX_Size() int { + return m.Size() +} +func (m *OracleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_OracleRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleRequest proto.InternalMessageInfo + +// CallData contains the data sent to a single oracle request in order to +// verify the ownership of a centralized application by a Desmos profile +type OracleRequest_CallData struct { + // The application for which the ownership should be verified + Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty" yaml:"application"` + // The hex encoded call data that should be used to verify the application + // account ownership + CallData string `protobuf:"bytes,2,opt,name=call_data,json=callData,proto3" json:"call_data,omitempty" yaml:"call_data"` +} + +func (m *OracleRequest_CallData) Reset() { *m = OracleRequest_CallData{} } +func (m *OracleRequest_CallData) String() string { return proto.CompactTextString(m) } +func (*OracleRequest_CallData) ProtoMessage() {} +func (*OracleRequest_CallData) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{2, 0} +} +func (m *OracleRequest_CallData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleRequest_CallData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleRequest_CallData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleRequest_CallData) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleRequest_CallData.Merge(m, src) +} +func (m *OracleRequest_CallData) XXX_Size() int { + return m.Size() +} +func (m *OracleRequest_CallData) XXX_DiscardUnknown() { + xxx_messageInfo_OracleRequest_CallData.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleRequest_CallData proto.InternalMessageInfo + +func (m *OracleRequest_CallData) GetApplication() string { + if m != nil { + return m.Application + } + return "" +} + +func (m *OracleRequest_CallData) GetCallData() string { + if m != nil { + return m.CallData + } + return "" +} + +// Result represents a verification result +type Result struct { + // sum is the oneof that specifies whether this represents a success or + // failure result + // + // Types that are valid to be assigned to Sum: + // *Result_Success_ + // *Result_Failed_ + Sum isResult_Sum `protobuf_oneof:"sum"` +} + +func (m *Result) Reset() { *m = Result{} } +func (m *Result) String() string { return proto.CompactTextString(m) } +func (*Result) ProtoMessage() {} +func (*Result) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{3} +} +func (m *Result) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result.Merge(m, src) +} +func (m *Result) XXX_Size() int { + return m.Size() +} +func (m *Result) XXX_DiscardUnknown() { + xxx_messageInfo_Result.DiscardUnknown(m) +} + +var xxx_messageInfo_Result proto.InternalMessageInfo + +type isResult_Sum interface { + isResult_Sum() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type Result_Success_ struct { + Success *Result_Success `protobuf:"bytes,1,opt,name=success,proto3,oneof" json:"success,omitempty"` +} +type Result_Failed_ struct { + Failed *Result_Failed `protobuf:"bytes,2,opt,name=failed,proto3,oneof" json:"failed,omitempty"` +} + +func (*Result_Success_) isResult_Sum() {} +func (*Result_Failed_) isResult_Sum() {} + +func (m *Result) GetSum() isResult_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *Result) GetSuccess() *Result_Success { + if x, ok := m.GetSum().(*Result_Success_); ok { + return x.Success + } + return nil +} + +func (m *Result) GetFailed() *Result_Failed { + if x, ok := m.GetSum().(*Result_Failed_); ok { + return x.Failed + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Result) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Result_Success_)(nil), + (*Result_Failed_)(nil), + } +} + +// Success is the result of an application link that has been successfully +// verified +type Result_Success struct { + // Hex-encoded value that has be signed by the profile + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" yaml:"value"` + // Hex-encoded signature that has been produced by signing the value + Signature string `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" yaml:"signature"` +} + +func (m *Result_Success) Reset() { *m = Result_Success{} } +func (m *Result_Success) String() string { return proto.CompactTextString(m) } +func (*Result_Success) ProtoMessage() {} +func (*Result_Success) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{3, 0} +} +func (m *Result_Success) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result_Success) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result_Success.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result_Success) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result_Success.Merge(m, src) +} +func (m *Result_Success) XXX_Size() int { + return m.Size() +} +func (m *Result_Success) XXX_DiscardUnknown() { + xxx_messageInfo_Result_Success.DiscardUnknown(m) +} + +var xxx_messageInfo_Result_Success proto.InternalMessageInfo + +// Failed is the result of an application link that has not been verified +// successfully +type Result_Failed struct { + // Error that is associated with the failure + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty" yaml:"error"` +} + +func (m *Result_Failed) Reset() { *m = Result_Failed{} } +func (m *Result_Failed) String() string { return proto.CompactTextString(m) } +func (*Result_Failed) ProtoMessage() {} +func (*Result_Failed) Descriptor() ([]byte, []int) { + return fileDescriptor_c4a613de86d4edc0, []int{3, 1} +} +func (m *Result_Failed) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result_Failed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result_Failed.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result_Failed) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result_Failed.Merge(m, src) +} +func (m *Result_Failed) XXX_Size() int { + return m.Size() +} +func (m *Result_Failed) XXX_DiscardUnknown() { + xxx_messageInfo_Result_Failed.DiscardUnknown(m) +} + +var xxx_messageInfo_Result_Failed proto.InternalMessageInfo + +func init() { + proto.RegisterEnum("desmos.profiles.v2.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) + proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.v2.ApplicationLink") + proto.RegisterType((*Data)(nil), "desmos.profiles.v2.Data") + proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.v2.OracleRequest") + proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.v2.OracleRequest.CallData") + proto.RegisterType((*Result)(nil), "desmos.profiles.v2.Result") + proto.RegisterType((*Result_Success)(nil), "desmos.profiles.v2.Result.Success") + proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.v2.Result.Failed") +} + +func init() { + proto.RegisterFile("desmos/profiles/v2/models_app_links.proto", fileDescriptor_c4a613de86d4edc0) +} + +var fileDescriptor_c4a613de86d4edc0 = []byte{ + // 969 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4d, 0x6f, 0xdb, 0x46, + 0x14, 0x14, 0x25, 0x5a, 0xb1, 0xd6, 0xb1, 0xad, 0xae, 0xdd, 0x56, 0x20, 0x10, 0x91, 0xa6, 0x8b, + 0xc2, 0x49, 0x11, 0x12, 0x55, 0x5b, 0xa0, 0x70, 0xd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, 0xfe, 0x8b, 0xff, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x97, 0x5a, 0x38, 0x00, 0x00, 0x08, 0x00, 0x00, +} + +func (this *ApplicationLink) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ApplicationLink) + if !ok { + that2, ok := that.(ApplicationLink) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.User != that1.User { + return false + } + if !this.Data.Equal(&that1.Data) { + return false + } + if this.State != that1.State { + return false + } + if !this.OracleRequest.Equal(&that1.OracleRequest) { + return false + } + if !this.Result.Equal(that1.Result) { + return false + } + if !this.CreationTime.Equal(that1.CreationTime) { + return false + } + return true +} +func (this *Data) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Data) + if !ok { + that2, ok := that.(Data) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Application != that1.Application { + return false + } + if this.Username != that1.Username { + return false + } + return true +} +func (this *OracleRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*OracleRequest) + if !ok { + that2, ok := that.(OracleRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ID != that1.ID { + return false + } + if this.OracleScriptID != that1.OracleScriptID { + return false + } + if !this.CallData.Equal(&that1.CallData) { + return false + } + if this.ClientID != that1.ClientID { + return false + } + return true +} +func (this *OracleRequest_CallData) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*OracleRequest_CallData) + if !ok { + that2, ok := that.(OracleRequest_CallData) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Application != that1.Application { + return false + } + if this.CallData != that1.CallData { + return false + } + return true +} +func (this *Result) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result) + if !ok { + that2, ok := that.(Result) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if that1.Sum == nil { + if this.Sum != nil { + return false + } + } else if this.Sum == nil { + return false + } else if !this.Sum.Equal(that1.Sum) { + return false + } + return true +} +func (this *Result_Success_) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Success_) + if !ok { + that2, ok := that.(Result_Success_) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Success.Equal(that1.Success) { + return false + } + return true +} +func (this *Result_Failed_) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Failed_) + if !ok { + that2, ok := that.(Result_Failed_) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Failed.Equal(that1.Failed) { + return false + } + return true +} +func (this *Result_Success) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Success) + if !ok { + that2, ok := that.(Result_Success) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Value != that1.Value { + return false + } + if this.Signature != that1.Signature { + return false + } + return true +} +func (this *Result_Failed) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result_Failed) + if !ok { + that2, ok := that.(Result_Failed) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Error != that1.Error { + return false + } + return true +} +func (m *ApplicationLink) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ApplicationLink) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ApplicationLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintModelsAppLinks(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x32 + if m.Result != nil { + { + size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + { + size, err := m.OracleRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.State != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Data) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Data) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x12 + } + if len(m.Application) > 0 { + i -= len(m.Application) + copy(dAtA[i:], m.Application) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Application))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OracleRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OracleRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ClientID) > 0 { + i -= len(m.ClientID) + copy(dAtA[i:], m.ClientID) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.ClientID))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.CallData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.OracleScriptID != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.OracleScriptID)) + i-- + dAtA[i] = 0x10 + } + if m.ID != 0 { + i = encodeVarintModelsAppLinks(dAtA, i, uint64(m.ID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *OracleRequest_CallData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OracleRequest_CallData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleRequest_CallData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CallData) > 0 { + i -= len(m.CallData) + copy(dAtA[i:], m.CallData) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.CallData))) + i-- + dAtA[i] = 0x12 + } + if len(m.Application) > 0 { + i -= len(m.Application) + copy(dAtA[i:], m.Application) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Application))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Result) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Result) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Result_Success_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Success_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Success != nil { + { + size, err := m.Success.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Result_Failed_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Failed_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Failed != nil { + { + size, err := m.Failed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsAppLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Result_Success) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Result_Success) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Success) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x12 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Result_Failed) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Result_Failed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result_Failed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintModelsAppLinks(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsAppLinks(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsAppLinks(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ApplicationLink) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.User) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = m.Data.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + if m.State != 0 { + n += 1 + sovModelsAppLinks(uint64(m.State)) + } + l = m.OracleRequest.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + if m.Result != nil { + l = m.Result.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime) + n += 1 + l + sovModelsAppLinks(uint64(l)) + return n +} + +func (m *Data) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Application) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.Username) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *OracleRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ID != 0 { + n += 1 + sovModelsAppLinks(uint64(m.ID)) + } + if m.OracleScriptID != 0 { + n += 1 + sovModelsAppLinks(uint64(m.OracleScriptID)) + } + l = m.CallData.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + l = len(m.ClientID) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *OracleRequest_CallData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Application) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.CallData) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *Result) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *Result_Success_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success != nil { + l = m.Success.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} +func (m *Result_Failed_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Failed != nil { + l = m.Failed.Size() + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} +func (m *Result_Success) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func (m *Result_Failed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Error) + if l > 0 { + n += 1 + l + sovModelsAppLinks(uint64(l)) + } + return n +} + +func sovModelsAppLinks(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsAppLinks(x uint64) (n int) { + return sovModelsAppLinks(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ApplicationLink) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ApplicationLink: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ApplicationLink: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.User = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= ApplicationLinkState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OracleRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Result == nil { + m.Result = &Result{} + } + if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Data) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Data: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Data: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Application = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OracleRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OracleRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OracleScriptID", wireType) + } + m.OracleScriptID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OracleScriptID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CallData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleRequest_CallData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CallData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CallData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Application = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CallData", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CallData = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Result: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Result: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Result_Success{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Result_Success_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Result_Failed{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Result_Failed_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result_Success) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Success: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Success: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result_Failed) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Failed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Failed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsAppLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsAppLinks(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthModelsAppLinks + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsAppLinks + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsAppLinks + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsAppLinks = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsAppLinks = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsAppLinks = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v5/types/models_chain_links.go b/x/profiles/legacy/v5/types/models_chain_links.go new file mode 100644 index 0000000000..1b140c59c7 --- /dev/null +++ b/x/profiles/legacy/v5/types/models_chain_links.go @@ -0,0 +1,563 @@ +package types + +// DONTCOVER + +import ( + "bytes" + "encoding/hex" + "fmt" + "strings" + "time" + + "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" + + "github.com/cosmos/cosmos-sdk/types/bech32" + "github.com/cosmos/cosmos-sdk/types/tx" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/tendermint/tendermint/crypto/tmhash" + + "github.com/btcsuite/btcd/btcec" + "github.com/ethereum/go-ethereum/crypto" + "github.com/gogo/protobuf/proto" + "github.com/mr-tron/base58" + + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/crypto/types/multisig" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// NewChainConfig allows to build a new ChainConfig instance +func NewChainConfig(name string) ChainConfig { + return ChainConfig{ + Name: name, + } +} + +// Validate checks the validity of the ChainConfig +func (c ChainConfig) Validate() error { + if strings.TrimSpace(c.Name) == "" { + return fmt.Errorf("chain name cannot be empty or blank") + } + if c.Name != strings.ToLower(c.Name) { + return fmt.Errorf("chain name must be lowercase") + } + return nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// NewProof is a constructor function for Proof +// nolint:interfacer +func NewProof(pubKey cryptotypes.PubKey, signature SignatureData, plainText string) Proof { + pubKeyAny, err := codectypes.NewAnyWithValue(pubKey) + if err != nil { + panic("failed to pack public key to any type") + } + + signatureAny, err := codectypes.NewAnyWithValue(signature) + if err != nil { + panic("failed to pack signature data to any type") + } + + return Proof{ + PubKey: pubKeyAny, + Signature: signatureAny, + PlainText: plainText, + } +} + +// Validate checks the validity of the Proof +func (p Proof) Validate() error { + if p.PubKey == nil { + return fmt.Errorf("public key field cannot be nil") + } + + if p.Signature == nil { + return fmt.Errorf("signature field cannot be nil") + } + + if strings.TrimSpace(p.PlainText) == "" { + return fmt.Errorf("plain text cannot be empty or blank") + } + + _, err := hex.DecodeString(p.PlainText) + if err != nil { + return fmt.Errorf("invalid hex-encoded plain text") + } + + return nil +} + +// Verify verifies the signature using the given plain text and public key. +// It returns and error if something is invalid. +func (p Proof) Verify(cdc codec.BinaryCodec, legacyAmino *codec.LegacyAmino, owner string, address AddressData) error { + value, err := hex.DecodeString(p.PlainText) + if err != nil { + return fmt.Errorf("error while decoding proof text: %s", err) + } + + // Make sure the signed value is valid, if it's a transaction + isValidTextSig := IsValidTextSig(value, owner) + isValidDirectTxSig := IsValidDirectTxSig(value, owner, cdc) + isValidAminoTxSig := IsValidAminoTxSig(value, owner, legacyAmino) + + if !isValidTextSig && !isValidDirectTxSig && !isValidAminoTxSig { + return fmt.Errorf("proof signed value must either be the user address or a transaction containing it as the memo") + } + + var sigData SignatureData + err = cdc.UnpackAny(p.Signature, &sigData) + if err != nil { + return fmt.Errorf("failed to unpack the signature") + } + + // Convert the signature data to the Cosmos type + cosmosSigData, err := SignatureDataToCosmosSignatureData(cdc, sigData) + if err != nil { + return err + } + + // Verify the signature + var pubkey cryptotypes.PubKey + switch sigData := cosmosSigData.(type) { + case *signing.SingleSignatureData: + err = cdc.UnpackAny(p.PubKey, &pubkey) + if err != nil { + return fmt.Errorf("failed to unpack the public key") + } + if !pubkey.VerifySignature(value, sigData.Signature) { + return fmt.Errorf("failed to verify the signature") + } + + case *signing.MultiSignatureData: + var multiPubkey multisig.PubKey + err = cdc.UnpackAny(p.PubKey, &multiPubkey) + if err != nil { + return fmt.Errorf("failed to unpack the public key") + } + err = multiPubkey.VerifyMultisignature( + func(mode signing.SignMode) ([]byte, error) { + return value, nil + }, + sigData, + ) + if err != nil { + return err + } + pubkey = multiPubkey + } + + // Verify the public key + valid, err := address.VerifyPubKey(pubkey) + if err != nil { + return err + } + if !valid { + return fmt.Errorf("invalid address and public key combination provided") + } + + return nil +} + +// IsValidTextSig tells whether the given value has been generated using SIGN_MODE_TEXTUAL +// and signing the given expected value +func IsValidTextSig(value []byte, expectedValue string) bool { + return string(value) == expectedValue +} + +// IsValidDirectTxSig tells whether the given value has been generated using SIGN_MODE_DIRECT and signing +// a transaction that contains a memo field equals to the given expected value +func IsValidDirectTxSig(value []byte, expectedMemo string, cdc codec.BinaryCodec) bool { + // Unmarshal the SignDoc + var signDoc tx.SignDoc + err := cdc.Unmarshal(value, &signDoc) + if err != nil { + return false + } + + // Check to make sure the value was a SignDoc. If that's not the case, the two arrays will not match + if !bytes.Equal(value, cdc.MustMarshal(&signDoc)) { + return false + } + + // Get the TxBody + var txBody tx.TxBody + err = cdc.Unmarshal(signDoc.BodyBytes, &txBody) + if err != nil { + return false + } + + // Check memo + return txBody.Memo == expectedMemo +} + +// IsValidAminoTxSig tells whether the given value has been generated using SIGN_MODE_AMINO_JSON and signing +// a transaction that contains a memo field equals to the given expected value +func IsValidAminoTxSig(value []byte, expectedMemo string, cdc *codec.LegacyAmino) bool { + // Unmarshal the StdSignDoc + var signDoc legacytx.StdSignDoc + err := cdc.UnmarshalJSON(value, &signDoc) + if err != nil { + return false + } + + // Check the memo field + return signDoc.Memo == expectedMemo +} + +// UnpackInterfaces implements codectypes.UnpackInterfacesMessage +func (p *Proof) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + var pubKey cryptotypes.PubKey + err := unpacker.UnpackAny(p.PubKey, &pubKey) + if err != nil { + return err + } + + var signatureData SignatureData + return unpacker.UnpackAny(p.Signature, &signatureData) +} + +// -------------------------------------------------------------------------------------------------------------------- + +// SignatureData represents a generic single- or multi- signature data +type SignatureData interface { + proto.Message + + isSignatureData() +} + +// SignatureDataToCosmosSignatureData allows to convert the given SignatureData to a Cosmos SignatureData instance +// unpacking the proto.Any instance using the given unpacker. +func SignatureDataToCosmosSignatureData(unpacker codectypes.AnyUnpacker, s SignatureData) (signing.SignatureData, error) { + switch data := s.(type) { + case *SingleSignatureData: + return &signing.SingleSignatureData{ + Signature: data.Signature, + SignMode: data.Mode, + }, nil + + case *MultiSignatureData: + sigs, err := unpackSignatures(unpacker, data.Signatures) + if err != nil { + return nil, err + } + + return &signing.MultiSignatureData{ + BitArray: data.BitArray, + Signatures: sigs, + }, nil + } + + return nil, fmt.Errorf("signature type not supported: %T", s) +} + +// SignatureDataFromCosmosSignatureData allows to create a SignatureData instance from the given Cosmos SignatureData +func SignatureDataFromCosmosSignatureData(data signing.SignatureData) (SignatureData, error) { + switch data := data.(type) { + case *signing.SingleSignatureData: + return &SingleSignatureData{ + Mode: data.SignMode, + Signature: data.Signature, + }, nil + + case *signing.MultiSignatureData: + sigAnys := make([]*codectypes.Any, len(data.Signatures)) + for i, data := range data.Signatures { + sigData, err := SignatureDataFromCosmosSignatureData(data) + if err != nil { + return nil, err + } + sigAny, err := codectypes.NewAnyWithValue(sigData) + if err != nil { + return nil, err + } + sigAnys[i] = sigAny + } + return &MultiSignatureData{ + BitArray: data.BitArray, + Signatures: sigAnys, + }, nil + default: + return nil, fmt.Errorf("unexpected case %+v", data) + } +} + +// unpackSignatures unpacks the given signatures using the provided unpacker +func unpackSignatures(unpacker codectypes.AnyUnpacker, sigs []*codectypes.Any) ([]signing.SignatureData, error) { + var signatures = make([]signing.SignatureData, len(sigs)) + for i, sig := range sigs { + var signatureData SignatureData + if err := unpacker.UnpackAny(sig, &signatureData); err != nil { + return nil, err + } + + cosmosSigData, err := SignatureDataToCosmosSignatureData(unpacker, signatureData) + if err != nil { + return nil, err + } + signatures[i] = cosmosSigData + } + + return signatures, nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +var _ SignatureData = &SingleSignatureData{} + +// isSignatureData implements SignatureData +func (s *SingleSignatureData) isSignatureData() {} + +// -------------------------------------------------------------------------------------------------------------------- + +var _ SignatureData = &MultiSignatureData{} + +// isSignatureData implements SignatureData +func (s *MultiSignatureData) isSignatureData() {} + +// UnpackInterfaces implements codectypes.UnpackInterfacesMessage +func (s *MultiSignatureData) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + for _, signature := range s.Signatures { + var signatureData SignatureData + err := unpacker.UnpackAny(signature, &signatureData) + if err != nil { + return err + } + } + + return nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// AddressData is an interface representing a generic external chain address +type AddressData interface { + proto.Message + + // Validate checks the validity of the AddressData + Validate() error + + // GetValue returns the address value + GetValue() string + + // VerifyPubKey verifies that the given public key is associated with this address data + VerifyPubKey(key cryptotypes.PubKey) (bool, error) +} + +// -------------------------------------------------------------------------------------------------------------------- + +var _ AddressData = &Bech32Address{} + +// NewBech32Address returns a new Bech32Address instance +func NewBech32Address(value, prefix string) *Bech32Address { + return &Bech32Address{Value: value, Prefix: prefix} +} + +// Validate implements AddressData +func (b Bech32Address) Validate() error { + if strings.TrimSpace(b.Value) == "" { + return fmt.Errorf("value cannot be empty or blank") + } + + if strings.TrimSpace(b.Prefix) == "" { + return fmt.Errorf("prefix cannot be empty or blank") + } + + _, err := sdk.GetFromBech32(b.Value, b.Prefix) + if err != nil { + return fmt.Errorf("invalid Bech32 value or wrong prefix") + } + + return nil +} + +// GetValue implements AddressData +func (b Bech32Address) GetValue() string { + return b.Value +} + +// VerifyPubKey implements AddressData +func (b Bech32Address) VerifyPubKey(key cryptotypes.PubKey) (bool, error) { + _, bz, err := bech32.DecodeAndConvert(b.Value) + if err != nil { + return false, err + } + return bytes.Equal(bz, key.Address().Bytes()), nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +var _ AddressData = &Base58Address{} + +// NewBase58Address returns a new Base58Address instance +func NewBase58Address(value string) *Base58Address { + return &Base58Address{Value: value} +} + +// Validate implements AddressData +func (b Base58Address) Validate() error { + if strings.TrimSpace(b.Value) == "" { + return fmt.Errorf("address cannot be empty or blank") + } + + if _, err := base58.Decode(b.Value); err != nil { + return fmt.Errorf("invalid Base58 address") + } + + return nil +} + +// GetValue implements AddressData +func (b Base58Address) GetValue() string { + return b.Value +} + +// VerifyPubKey implements AddressData +func (b Base58Address) VerifyPubKey(key cryptotypes.PubKey) (bool, error) { + bz, err := base58.Decode(b.Value) + return bytes.Equal(tmhash.SumTruncated(bz), key.Address().Bytes()), err +} + +// -------------------------------------------------------------------------------------------------------------------- + +var _ AddressData = &HexAddress{} + +// NewHexAddress returns a new HexAddress instance +func NewHexAddress(value, prefix string) *HexAddress { + return &HexAddress{Value: value, Prefix: prefix} +} + +// Validate implements AddressData +func (h HexAddress) Validate() error { + if strings.TrimSpace(h.Value) == "" { + return fmt.Errorf("value cannot be empty or blank") + } + + if len(h.Value) <= len(h.Prefix) { + return fmt.Errorf("address cannot be smaller than prefix") + } + + prefix, addrWithoutPrefix := h.Value[:len(h.Prefix)], h.Value[len(h.Prefix):] + if prefix != h.Prefix { + return fmt.Errorf("prefix does not match") + } + + if _, err := hex.DecodeString(addrWithoutPrefix); err != nil { + return fmt.Errorf("invalid hex address") + } + return nil +} + +// GetValue implements AddressData +func (h HexAddress) GetValue() string { + return h.Value +} + +// VerifyPubKey implements AddressData +func (h HexAddress) VerifyPubKey(key cryptotypes.PubKey) (bool, error) { + addr := h.Value[len(h.Prefix):] + bz, err := hex.DecodeString(addr) + if err != nil { + return false, err + } + pubKey, err := btcec.ParsePubKey(key.Bytes(), btcec.S256()) + if err != nil { + return false, err + } + uncompressedPubKey := pubKey.SerializeUncompressed() + return bytes.Equal(crypto.Keccak256(uncompressedPubKey[1:])[12:], bz), err +} + +// -------------------------------------------------------------------------------------------------------------------- + +// UnpackAddressData deserializes the given any type value as an address data using the provided unpacker +func UnpackAddressData(unpacker codectypes.AnyUnpacker, addressAny *codectypes.Any) (AddressData, error) { + var address AddressData + if err := unpacker.UnpackAny(addressAny, &address); err != nil { + return nil, err + } + return address, nil +} + +// -------------------------------------------------------------------------------------------------------------------- + +// NewChainLink returns a new ChainLink instance +// nolint:interfacer +func NewChainLink(user string, address AddressData, proof Proof, chainConfig ChainConfig, creationTime time.Time) ChainLink { + addressAny, err := codectypes.NewAnyWithValue(address) + if err != nil { + panic("failed to pack address data to any type") + } + return ChainLink{ + User: user, + Address: addressAny, + Proof: proof, + ChainConfig: chainConfig, + CreationTime: creationTime, + } +} + +// GetAddressData returns the AddressData associated with this chain link +func (link ChainLink) GetAddressData() AddressData { + return link.Address.GetCachedValue().(AddressData) +} + +// Validate checks the validity of the ChainLink +func (link ChainLink) Validate() error { + if _, err := sdk.AccAddressFromBech32(link.User); err != nil { + return fmt.Errorf("invalid creator address: %s", link.User) + } + + if link.Address == nil { + return fmt.Errorf("address cannot be nil") + } + + err := link.Proof.Validate() + if err != nil { + return err + } + + err = link.ChainConfig.Validate() + if err != nil { + return err + } + + if link.CreationTime.IsZero() { + return fmt.Errorf("creation time cannot be zero") + } + + return nil +} + +// UnpackInterfaces implements codectypes.UnpackInterfacesMessage +func (link *ChainLink) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + if link.Address != nil { + var address AddressData + err := unpacker.UnpackAny(link.Address, &address) + if err != nil { + return err + } + } + + err := link.Proof.UnpackInterfaces(unpacker) + if err != nil { + return err + } + + return nil +} + +// MustMarshalChainLink serializes the given chain link using the provided BinaryCodec +func MustMarshalChainLink(cdc codec.BinaryCodec, link ChainLink) []byte { + return cdc.MustMarshal(&link) +} + +// MustUnmarshalChainLink deserializes the given byte array as a chain link using +// the provided BinaryCodec +func MustUnmarshalChainLink(codec codec.BinaryCodec, bz []byte) ChainLink { + var link ChainLink + codec.MustUnmarshal(bz, &link) + return link +} diff --git a/x/profiles/legacy/v5/types/models_chain_links.pb.go b/x/profiles/legacy/v5/types/models_chain_links.pb.go new file mode 100644 index 0000000000..21362ed668 --- /dev/null +++ b/x/profiles/legacy/v5/types/models_chain_links.pb.go @@ -0,0 +1,2237 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v2/models_chain_links.proto + +package types + +import ( + bytes "bytes" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + types1 "github.com/cosmos/cosmos-sdk/crypto/types" + signing "github.com/cosmos/cosmos-sdk/types/tx/signing" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/regen-network/cosmos-proto" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// ChainLink contains the data representing either an inter- or cross- chain +// link +type ChainLink struct { + // User defines the destination profile address to link + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty" yaml:"user"` + // Address contains the data of the external chain address to be connected + // with the Desmos profile + Address *types.Any `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` + // Proof contains the ownership proof of the external chain address + Proof Proof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof" yaml:"proof"` + // ChainConfig contains the configuration of the external chain + ChainConfig ChainConfig `protobuf:"bytes,4,opt,name=chain_config,json=chainConfig,proto3" json:"chain_config" yaml:"chain_config"` + // CreationTime represents the time in which the link has been created + CreationTime time.Time `protobuf:"bytes,5,opt,name=creation_time,json=creationTime,proto3,stdtime" json:"creation_time" yaml:"creation_time"` +} + +func (m *ChainLink) Reset() { *m = ChainLink{} } +func (m *ChainLink) String() string { return proto.CompactTextString(m) } +func (*ChainLink) ProtoMessage() {} +func (*ChainLink) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{0} +} +func (m *ChainLink) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChainLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChainLink.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ChainLink) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainLink.Merge(m, src) +} +func (m *ChainLink) XXX_Size() int { + return m.Size() +} +func (m *ChainLink) XXX_DiscardUnknown() { + xxx_messageInfo_ChainLink.DiscardUnknown(m) +} + +var xxx_messageInfo_ChainLink proto.InternalMessageInfo + +// ChainConfig contains the data of the chain with which the link is made. +type ChainConfig struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` +} + +func (m *ChainConfig) Reset() { *m = ChainConfig{} } +func (m *ChainConfig) String() string { return proto.CompactTextString(m) } +func (*ChainConfig) ProtoMessage() {} +func (*ChainConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{1} +} +func (m *ChainConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChainConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChainConfig.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ChainConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainConfig.Merge(m, src) +} +func (m *ChainConfig) XXX_Size() int { + return m.Size() +} +func (m *ChainConfig) XXX_DiscardUnknown() { + xxx_messageInfo_ChainConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_ChainConfig proto.InternalMessageInfo + +// Proof contains all the data used to verify a signature when linking an +// account to a profile +type Proof struct { + // PubKey represents the public key associated with the address for which to + // prove the ownership + PubKey *types.Any `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty" yaml:"pub_key"` + // Signature represents the hex-encoded signature of the PlainText value + Signature *types.Any `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" yaml:"signature"` + // PlainText represents the hex-encoded value signed in order to produce the + // Signature + PlainText string `protobuf:"bytes,3,opt,name=plain_text,json=plainText,proto3" json:"plain_text,omitempty" yaml:"plain_text"` +} + +func (m *Proof) Reset() { *m = Proof{} } +func (m *Proof) String() string { return proto.CompactTextString(m) } +func (*Proof) ProtoMessage() {} +func (*Proof) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{2} +} +func (m *Proof) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Proof.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Proof) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proof.Merge(m, src) +} +func (m *Proof) XXX_Size() int { + return m.Size() +} +func (m *Proof) XXX_DiscardUnknown() { + xxx_messageInfo_Proof.DiscardUnknown(m) +} + +var xxx_messageInfo_Proof proto.InternalMessageInfo + +// Bech32Address represents a Bech32-encoded address +type Bech32Address struct { + // Value represents the Bech-32 encoded address value + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" yaml:"value"` + // Prefix represents the HRP of the Bech32 address + Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty" yaml:"prefix"` +} + +func (m *Bech32Address) Reset() { *m = Bech32Address{} } +func (m *Bech32Address) String() string { return proto.CompactTextString(m) } +func (*Bech32Address) ProtoMessage() {} +func (*Bech32Address) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{3} +} +func (m *Bech32Address) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Bech32Address) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Bech32Address.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Bech32Address) XXX_Merge(src proto.Message) { + xxx_messageInfo_Bech32Address.Merge(m, src) +} +func (m *Bech32Address) XXX_Size() int { + return m.Size() +} +func (m *Bech32Address) XXX_DiscardUnknown() { + xxx_messageInfo_Bech32Address.DiscardUnknown(m) +} + +var xxx_messageInfo_Bech32Address proto.InternalMessageInfo + +// Base58Address represents a Base58-encoded address +type Base58Address struct { + // Value contains the Base58-encoded address + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" yaml:"value"` +} + +func (m *Base58Address) Reset() { *m = Base58Address{} } +func (m *Base58Address) String() string { return proto.CompactTextString(m) } +func (*Base58Address) ProtoMessage() {} +func (*Base58Address) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{4} +} +func (m *Base58Address) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Base58Address) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Base58Address.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Base58Address) XXX_Merge(src proto.Message) { + xxx_messageInfo_Base58Address.Merge(m, src) +} +func (m *Base58Address) XXX_Size() int { + return m.Size() +} +func (m *Base58Address) XXX_DiscardUnknown() { + xxx_messageInfo_Base58Address.DiscardUnknown(m) +} + +var xxx_messageInfo_Base58Address proto.InternalMessageInfo + +// HexAddress represents an Hex-encoded address +// NOTE: Currently it only supports keccak256-uncompressed addresses +type HexAddress struct { + // Value represents the hex address value + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" yaml:"value"` + // Prefix represents the optional prefix used during address encoding (e.g. + // 0x) + Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty" yaml:"prefix"` +} + +func (m *HexAddress) Reset() { *m = HexAddress{} } +func (m *HexAddress) String() string { return proto.CompactTextString(m) } +func (*HexAddress) ProtoMessage() {} +func (*HexAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{5} +} +func (m *HexAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HexAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HexAddress.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HexAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_HexAddress.Merge(m, src) +} +func (m *HexAddress) XXX_Size() int { + return m.Size() +} +func (m *HexAddress) XXX_DiscardUnknown() { + xxx_messageInfo_HexAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_HexAddress proto.InternalMessageInfo + +// SingleSignatureData is the signature data for a single signer +type SingleSignatureData struct { + // Mode is the signing mode of the single signer + Mode signing.SignMode `protobuf:"varint,1,opt,name=mode,proto3,enum=cosmos.tx.signing.v1beta1.SignMode" json:"mode,omitempty"` + // Signature is the raw signature bytes + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *SingleSignatureData) Reset() { *m = SingleSignatureData{} } +func (m *SingleSignatureData) String() string { return proto.CompactTextString(m) } +func (*SingleSignatureData) ProtoMessage() {} +func (*SingleSignatureData) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{6} +} +func (m *SingleSignatureData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SingleSignatureData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SingleSignatureData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SingleSignatureData) XXX_Merge(src proto.Message) { + xxx_messageInfo_SingleSignatureData.Merge(m, src) +} +func (m *SingleSignatureData) XXX_Size() int { + return m.Size() +} +func (m *SingleSignatureData) XXX_DiscardUnknown() { + xxx_messageInfo_SingleSignatureData.DiscardUnknown(m) +} + +var xxx_messageInfo_SingleSignatureData proto.InternalMessageInfo + +// MultiSignatureData is the signature data for a multisig public key +type MultiSignatureData struct { + // Bitarray specifies which keys within the multisig are signing + BitArray *types1.CompactBitArray `protobuf:"bytes,1,opt,name=bit_array,json=bitArray,proto3" json:"bit_array,omitempty"` + // Signatures is the signatures of the multi-signature + Signatures []*types.Any `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` +} + +func (m *MultiSignatureData) Reset() { *m = MultiSignatureData{} } +func (m *MultiSignatureData) String() string { return proto.CompactTextString(m) } +func (*MultiSignatureData) ProtoMessage() {} +func (*MultiSignatureData) Descriptor() ([]byte, []int) { + return fileDescriptor_1deb25c5b4df9624, []int{7} +} +func (m *MultiSignatureData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MultiSignatureData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MultiSignatureData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MultiSignatureData) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiSignatureData.Merge(m, src) +} +func (m *MultiSignatureData) XXX_Size() int { + return m.Size() +} +func (m *MultiSignatureData) XXX_DiscardUnknown() { + xxx_messageInfo_MultiSignatureData.DiscardUnknown(m) +} + +var xxx_messageInfo_MultiSignatureData proto.InternalMessageInfo + +func init() { + proto.RegisterType((*ChainLink)(nil), "desmos.profiles.v2.ChainLink") + proto.RegisterType((*ChainConfig)(nil), "desmos.profiles.v2.ChainConfig") + proto.RegisterType((*Proof)(nil), "desmos.profiles.v2.Proof") + proto.RegisterType((*Bech32Address)(nil), "desmos.profiles.v2.Bech32Address") + proto.RegisterType((*Base58Address)(nil), "desmos.profiles.v2.Base58Address") + proto.RegisterType((*HexAddress)(nil), "desmos.profiles.v2.HexAddress") + proto.RegisterType((*SingleSignatureData)(nil), "desmos.profiles.v2.SingleSignatureData") + proto.RegisterType((*MultiSignatureData)(nil), "desmos.profiles.v2.MultiSignatureData") +} + +func init() { + proto.RegisterFile("desmos/profiles/v2/models_chain_links.proto", fileDescriptor_1deb25c5b4df9624) +} + +var fileDescriptor_1deb25c5b4df9624 = []byte{ + // 803 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0x8e, 0x69, 0xd3, 0x25, 0x93, 0x64, 0xd9, 0x9d, 0x0d, 0x52, 0xda, 0x45, 0x71, 0xf1, 0x4a, + 0xb0, 0x08, 0xd5, 0xa3, 0xcd, 0x6e, 0x05, 0x0a, 0x17, 0xe2, 0x82, 0x54, 0x89, 0x56, 0x02, 0xb7, + 0x5c, 0xb8, 0x44, 0x63, 0x67, 0xe2, 0x8e, 0x6a, 0x7b, 0x2c, 0x7b, 0x1c, 0xc5, 0x12, 0x12, 0x47, + 0x38, 0xf6, 0xc8, 0x81, 0x43, 0xff, 0x07, 0xf8, 0x23, 0x2a, 0x4e, 0x15, 0xa7, 0x9e, 0x02, 0x6a, + 0x2f, 0x9c, 0xf3, 0x17, 0xa0, 0xf9, 0xe1, 0x24, 0x4d, 0x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, 0xdb, 0x89, 0x4f, 0xec, 0x72, 0xff, 0xe8, + 0x0d, 0x63, 0x0b, 0xde, 0x21, 0x1b, 0x12, 0x57, 0x12, 0xe0, 0x7b, 0xab, 0x33, 0xd3, 0x58, 0x9a, + 0x83, 0xde, 0xa6, 0xf0, 0xa2, 0x7d, 0x34, 0x6f, 0xdd, 0x68, 0xfd, 0x6a, 0x00, 0x78, 0x28, 0xb6, + 0xd5, 0x6d, 0x23, 0x07, 0xa0, 0xe6, 0x51, 0x3e, 0xc0, 0x69, 0x8a, 0xcb, 0x41, 0x46, 0xa5, 0x1b, + 0xb5, 0xf4, 0xec, 0xf9, 0x8e, 0x2b, 0x2d, 0xed, 0xb1, 0x28, 0xc1, 0x3e, 0x77, 0x28, 0xef, 0x0b, + 0x9a, 0xfb, 0xb6, 0xa7, 0xbf, 0xc4, 0x1c, 0xce, 0xcd, 0x88, 0x7d, 0xb6, 0x76, 0xdf, 0x48, 0xbb, + 0x4b, 0xb8, 0x07, 0x5c, 0x3b, 0xdf, 0x5e, 0x5c, 0x77, 0x8c, 0xcb, 0xeb, 0x8e, 0xf1, 0xd7, 0x75, + 0xc7, 0x38, 0xbb, 0xe9, 0x54, 0x2e, 0x6f, 0x3a, 0x95, 0xab, 0x9b, 0x4e, 0xe5, 0xbb, 0xcf, 0x02, + 0xca, 0x4f, 0x72, 0xcf, 0xf6, 0x59, 0x84, 0xd4, 0x46, 0xda, 0x09, 0xb1, 0x97, 0xe9, 0x6f, 0x34, + 0x7e, 0x83, 0x26, 0x8b, 0x9f, 0x51, 0x48, 0x02, 0xec, 0x17, 0x68, 0xbc, 0x8b, 0x78, 0x91, 0x90, + 0xcc, 0xdb, 0x90, 0x5e, 0x5e, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0x97, 0x38, 0x95, 0xbe, 0xb6, + 0x06, 0x00, 0x00, +} + +func (this *ChainLink) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ChainLink) + if !ok { + that2, ok := that.(ChainLink) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.User != that1.User { + return false + } + if !this.Address.Equal(that1.Address) { + return false + } + if !this.Proof.Equal(&that1.Proof) { + return false + } + if !this.ChainConfig.Equal(&that1.ChainConfig) { + return false + } + if !this.CreationTime.Equal(that1.CreationTime) { + return false + } + return true +} +func (this *ChainConfig) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ChainConfig) + if !ok { + that2, ok := that.(ChainConfig) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + return true +} +func (this *Proof) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Proof) + if !ok { + that2, ok := that.(Proof) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.PubKey.Equal(that1.PubKey) { + return false + } + if !this.Signature.Equal(that1.Signature) { + return false + } + if this.PlainText != that1.PlainText { + return false + } + return true +} +func (this *Bech32Address) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Bech32Address) + if !ok { + that2, ok := that.(Bech32Address) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Value != that1.Value { + return false + } + if this.Prefix != that1.Prefix { + return false + } + return true +} +func (this *Base58Address) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Base58Address) + if !ok { + that2, ok := that.(Base58Address) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Value != that1.Value { + return false + } + return true +} +func (this *HexAddress) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*HexAddress) + if !ok { + that2, ok := that.(HexAddress) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Value != that1.Value { + return false + } + if this.Prefix != that1.Prefix { + return false + } + return true +} +func (this *SingleSignatureData) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SingleSignatureData) + if !ok { + that2, ok := that.(SingleSignatureData) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Mode != that1.Mode { + return false + } + if !bytes.Equal(this.Signature, that1.Signature) { + return false + } + return true +} +func (this *MultiSignatureData) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MultiSignatureData) + if !ok { + that2, ok := that.(MultiSignatureData) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.BitArray.Equal(that1.BitArray) { + return false + } + if len(this.Signatures) != len(that1.Signatures) { + return false + } + for i := range this.Signatures { + if !this.Signatures[i].Equal(that1.Signatures[i]) { + return false + } + } + return true +} +func (m *ChainLink) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ChainLink) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChainLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintModelsChainLinks(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x2a + { + size, err := m.ChainConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Address != nil { + { + size, err := m.Address.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ChainConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ChainConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChainConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Proof) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Proof) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PlainText) > 0 { + i -= len(m.PlainText) + copy(dAtA[i:], m.PlainText) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.PlainText))) + i-- + dAtA[i] = 0x1a + } + if m.Signature != nil { + { + size, err := m.Signature.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Bech32Address) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Bech32Address) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Bech32Address) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Prefix) > 0 { + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Prefix))) + i-- + dAtA[i] = 0x12 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Base58Address) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Base58Address) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Base58Address) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HexAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HexAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HexAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Prefix) > 0 { + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Prefix))) + i-- + dAtA[i] = 0x12 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SingleSignatureData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SingleSignatureData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SingleSignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintModelsChainLinks(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x12 + } + if m.Mode != 0 { + i = encodeVarintModelsChainLinks(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MultiSignatureData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MultiSignatureData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MultiSignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signatures) > 0 { + for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Signatures[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.BitArray != nil { + { + size, err := m.BitArray.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsChainLinks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsChainLinks(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsChainLinks(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ChainLink) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.User) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + if m.Address != nil { + l = m.Address.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + l = m.Proof.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + l = m.ChainConfig.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime) + n += 1 + l + sovModelsChainLinks(uint64(l)) + return n +} + +func (m *ChainConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + return n +} + +func (m *Proof) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + if m.Signature != nil { + l = m.Signature.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + l = len(m.PlainText) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + return n +} + +func (m *Bech32Address) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + l = len(m.Prefix) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + return n +} + +func (m *Base58Address) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + return n +} + +func (m *HexAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + l = len(m.Prefix) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + return n +} + +func (m *SingleSignatureData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Mode != 0 { + n += 1 + sovModelsChainLinks(uint64(m.Mode)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + return n +} + +func (m *MultiSignatureData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BitArray != nil { + l = m.BitArray.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + if len(m.Signatures) > 0 { + for _, e := range m.Signatures { + l = e.Size() + n += 1 + l + sovModelsChainLinks(uint64(l)) + } + } + return n +} + +func sovModelsChainLinks(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsChainLinks(x uint64) (n int) { + return sovModelsChainLinks(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ChainLink) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChainLink: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChainLink: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.User = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Address == nil { + m.Address = &types.Any{} + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ChainConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChainConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChainConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChainConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Proof) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Proof: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Proof: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PubKey == nil { + m.PubKey = &types.Any{} + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Signature == nil { + m.Signature = &types.Any{} + } + if err := m.Signature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PlainText", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PlainText = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Bech32Address) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Bech32Address: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Bech32Address: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Base58Address) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Base58Address: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Base58Address: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HexAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HexAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HexAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SingleSignatureData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SingleSignatureData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SingleSignatureData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + m.Mode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Mode |= signing.SignMode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MultiSignatureData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MultiSignatureData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MultiSignatureData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BitArray", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BitArray == nil { + m.BitArray = &types1.CompactBitArray{} + } + if err := m.BitArray.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsChainLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsChainLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signatures = append(m.Signatures, &types.Any{}) + if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsChainLinks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsChainLinks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsChainLinks(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsChainLinks + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthModelsChainLinks + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsChainLinks + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsChainLinks + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsChainLinks = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsChainLinks = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsChainLinks = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v5/types/models_dtag_requests.go b/x/profiles/legacy/v5/types/models_dtag_requests.go new file mode 100644 index 0000000000..c481c46a14 --- /dev/null +++ b/x/profiles/legacy/v5/types/models_dtag_requests.go @@ -0,0 +1,51 @@ +package types + +// DONTCOVER + +import ( + "fmt" + "strings" + + "github.com/cosmos/cosmos-sdk/codec" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func NewDTagTransferRequest(dTagToTrade string, sender, receiver string) DTagTransferRequest { + return DTagTransferRequest{ + DTagToTrade: dTagToTrade, + Receiver: receiver, + Sender: sender, + } +} + +// Validate checks the request validity +func (request DTagTransferRequest) Validate() error { + _, err := sdk.AccAddressFromBech32(request.Sender) + if err != nil { + return fmt.Errorf("invalid DTag transfer request sender address: %s", request.Sender) + } + + _, err = sdk.AccAddressFromBech32(request.Receiver) + if err != nil { + return fmt.Errorf("invalid receiver address: %s", request.Receiver) + } + + if request.Receiver == request.Sender { + return fmt.Errorf("the sender and receiver must be different") + } + + if strings.TrimSpace(request.DTagToTrade) == "" { + return fmt.Errorf("invalid DTag to trade: %s", request.DTagToTrade) + } + + return nil +} + +// MustUnmarshalDTagTransferRequest unmarshalls the given byte array as a DTagTransferRequest +// using the provided marshaller +func MustUnmarshalDTagTransferRequest(cdc codec.BinaryCodec, bz []byte) DTagTransferRequest { + var request DTagTransferRequest + cdc.MustUnmarshal(bz, &request) + return request +} diff --git a/x/profiles/legacy/v5/types/models_dtag_requests.pb.go b/x/profiles/legacy/v5/types/models_dtag_requests.pb.go new file mode 100644 index 0000000000..fbf96f5bca --- /dev/null +++ b/x/profiles/legacy/v5/types/models_dtag_requests.pb.go @@ -0,0 +1,449 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v2/models_dtag_requests.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/regen-network/cosmos-proto" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// DTagTransferRequest represent a DTag transfer request between two users +type DTagTransferRequest struct { + // DTagToTrade contains the value of the DTag that should be transferred from + // the receiver of the request to the sender + DTagToTrade string `protobuf:"bytes,1,opt,name=dtag_to_trade,json=dtagToTrade,proto3" json:"dtag_to_trade,omitempty" yaml:"dtag_to_trade"` + // Sender represents the address of the account that sent the request + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` + // Receiver represents the receiver of the request that, if accepted, will + // give to the sender their DTag + Receiver string `protobuf:"bytes,3,opt,name=receiver,proto3" json:"receiver,omitempty" yaml:"receiver"` +} + +func (m *DTagTransferRequest) Reset() { *m = DTagTransferRequest{} } +func (m *DTagTransferRequest) String() string { return proto.CompactTextString(m) } +func (*DTagTransferRequest) ProtoMessage() {} +func (*DTagTransferRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_3722cfac854d7654, []int{0} +} +func (m *DTagTransferRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DTagTransferRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DTagTransferRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DTagTransferRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DTagTransferRequest.Merge(m, src) +} +func (m *DTagTransferRequest) XXX_Size() int { + return m.Size() +} +func (m *DTagTransferRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DTagTransferRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DTagTransferRequest proto.InternalMessageInfo + +func init() { + proto.RegisterType((*DTagTransferRequest)(nil), "desmos.profiles.v2.DTagTransferRequest") +} + +func init() { + proto.RegisterFile("desmos/profiles/v2/models_dtag_requests.proto", fileDescriptor_3722cfac854d7654) +} + +var fileDescriptor_3722cfac854d7654 = []byte{ + // 349 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x91, 0xb1, 0x4e, 0xe3, 0x40, + 0x10, 0x40, 0xbd, 0x77, 0x52, 0x74, 0xe7, 0x5c, 0x74, 0x3a, 0x27, 0x45, 0x2e, 0x85, 0x17, 0xb9, + 0x01, 0x8a, 0x78, 0xa5, 0x00, 0x4d, 0xe8, 0x22, 0x3a, 0x3a, 0x2b, 0x34, 0x34, 0xd6, 0xda, 0x9e, + 0x2c, 0x96, 0xec, 0xac, 0xd9, 0xdd, 0x58, 0xf8, 0x0f, 0x28, 0x29, 0x29, 0xf3, 0x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, 0xbf, 0x04, 0x84, 0x10, 0xe7, 0x20, 0x86, 0x3f, 0x1b, 0xb9, 0xbf, 0x2b, + 0xf1, 0x5f, 0x2d, 0xef, 0x89, 0xe3, 0x7d, 0x48, 0xd3, 0x3f, 0xf7, 0x6b, 0x6c, 0x3c, 0xae, 0x31, + 0x7a, 0x5b, 0x63, 0x34, 0xbb, 0x7a, 0xaa, 0x6c, 0xb4, 0xa9, 0x6c, 0xf4, 0x5a, 0xd9, 0xe8, 0x61, + 0x6b, 0x1b, 0x9b, 0xad, 0x6d, 0xbc, 0x6c, 0x6d, 0xe3, 0xfa, 0x9c, 0xc5, 0xea, 0x66, 0x15, 0xb8, + 0x21, 0x4f, 0x89, 0x3e, 0xfa, 0x38, 0xa1, 0x81, 0x6c, 0x63, 0x92, 0x9f, 0x92, 0xbb, 0xcf, 0x4f, + 0x4b, 0x80, 0xd1, 0xb0, 0x20, 0xf9, 0x19, 0x51, 0x45, 0x06, 0x32, 0xe8, 0x34, 0xc7, 0x3a, 0x79, + 0x0f, 0x00, 0x00, 0xff, 0xff, 0xc6, 0x16, 0xdc, 0xe8, 0xde, 0x01, 0x00, 0x00, +} + +func (this *DTagTransferRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DTagTransferRequest) + if !ok { + that2, ok := that.(DTagTransferRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.DTagToTrade != that1.DTagToTrade { + return false + } + if this.Sender != that1.Sender { + return false + } + if this.Receiver != that1.Receiver { + return false + } + return true +} +func (m *DTagTransferRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DTagTransferRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DTagTransferRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintModelsDtagRequests(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x1a + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintModelsDtagRequests(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x12 + } + if len(m.DTagToTrade) > 0 { + i -= len(m.DTagToTrade) + copy(dAtA[i:], m.DTagToTrade) + i = encodeVarintModelsDtagRequests(dAtA, i, uint64(len(m.DTagToTrade))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsDtagRequests(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsDtagRequests(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *DTagTransferRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DTagToTrade) + if l > 0 { + n += 1 + l + sovModelsDtagRequests(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovModelsDtagRequests(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovModelsDtagRequests(uint64(l)) + } + return n +} + +func sovModelsDtagRequests(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsDtagRequests(x uint64) (n int) { + return sovModelsDtagRequests(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *DTagTransferRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DTagTransferRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DTagTransferRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DTagToTrade", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsDtagRequests + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DTagToTrade = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsDtagRequests + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsDtagRequests + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsDtagRequests(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsDtagRequests + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsDtagRequests(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsDtagRequests + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthModelsDtagRequests + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsDtagRequests + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsDtagRequests + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsDtagRequests = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsDtagRequests = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsDtagRequests = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v5/types/models_params.pb.go b/x/profiles/legacy/v5/types/models_params.pb.go new file mode 100644 index 0000000000..31efb7de5a --- /dev/null +++ b/x/profiles/legacy/v5/types/models_params.pb.go @@ -0,0 +1,1450 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v2/models_params.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params contains the parameters for the profiles module +type Params struct { + Nickname NicknameParams `protobuf:"bytes,1,opt,name=nickname,proto3" json:"nickname" yaml:"nickname"` + DTag DTagParams `protobuf:"bytes,2,opt,name=dtag,proto3" json:"dtag" yaml:"dtag"` + Bio BioParams `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio" yaml:"bio"` + Oracle OracleParams `protobuf:"bytes,4,opt,name=oracle,proto3" json:"oracle" yaml:"oracle"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_1b093f5fee9c9f7d, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +// NicknameParams defines the parameters related to the profiles nicknames +type NicknameParams struct { + MinLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=min_length,json=minLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_length" yaml:"min_length"` + MaxLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=max_length,json=maxLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_length" yaml:"max_length"` +} + +func (m *NicknameParams) Reset() { *m = NicknameParams{} } +func (m *NicknameParams) String() string { return proto.CompactTextString(m) } +func (*NicknameParams) ProtoMessage() {} +func (*NicknameParams) Descriptor() ([]byte, []int) { + return fileDescriptor_1b093f5fee9c9f7d, []int{1} +} +func (m *NicknameParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NicknameParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NicknameParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NicknameParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_NicknameParams.Merge(m, src) +} +func (m *NicknameParams) XXX_Size() int { + return m.Size() +} +func (m *NicknameParams) XXX_DiscardUnknown() { + xxx_messageInfo_NicknameParams.DiscardUnknown(m) +} + +var xxx_messageInfo_NicknameParams proto.InternalMessageInfo + +// DTagParams defines the parameters related to profile DTags +type DTagParams struct { + RegEx string `protobuf:"bytes,1,opt,name=reg_ex,json=regEx,proto3" json:"reg_ex,omitempty" yaml:"reg_ex"` + MinLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=min_length,json=minLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_length" yaml:"min_length"` + MaxLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=max_length,json=maxLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_length" yaml:"max_length"` +} + +func (m *DTagParams) Reset() { *m = DTagParams{} } +func (m *DTagParams) String() string { return proto.CompactTextString(m) } +func (*DTagParams) ProtoMessage() {} +func (*DTagParams) Descriptor() ([]byte, []int) { + return fileDescriptor_1b093f5fee9c9f7d, []int{2} +} +func (m *DTagParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DTagParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DTagParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DTagParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_DTagParams.Merge(m, src) +} +func (m *DTagParams) XXX_Size() int { + return m.Size() +} +func (m *DTagParams) XXX_DiscardUnknown() { + xxx_messageInfo_DTagParams.DiscardUnknown(m) +} + +var xxx_messageInfo_DTagParams proto.InternalMessageInfo + +// BioParams defines the parameters related to profile biography +type BioParams struct { + MaxLength github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=max_length,json=maxLength,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_length" yaml:"max_length"` +} + +func (m *BioParams) Reset() { *m = BioParams{} } +func (m *BioParams) String() string { return proto.CompactTextString(m) } +func (*BioParams) ProtoMessage() {} +func (*BioParams) Descriptor() ([]byte, []int) { + return fileDescriptor_1b093f5fee9c9f7d, []int{3} +} +func (m *BioParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BioParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BioParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BioParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_BioParams.Merge(m, src) +} +func (m *BioParams) XXX_Size() int { + return m.Size() +} +func (m *BioParams) XXX_DiscardUnknown() { + xxx_messageInfo_BioParams.DiscardUnknown(m) +} + +var xxx_messageInfo_BioParams proto.InternalMessageInfo + +// OracleParams defines the parameters related to the oracle +// that will be used to verify the ownership of a centralized +// application account by a Desmos profile +type OracleParams struct { + // ScriptID represents the ID of the oracle script to be called to verify the + // data + ScriptID uint64 `protobuf:"varint,1,opt,name=script_id,json=scriptId,proto3" json:"script_id,omitempty" yaml:"script_id"` + // AskCount represents the number of oracles to which ask to verify the data + AskCount uint64 `protobuf:"varint,2,opt,name=ask_count,json=askCount,proto3" json:"ask_count,omitempty" yaml:"ask_count"` + // MinCount represents the minimum count of oracles that should complete the + // verification successfully + MinCount uint64 `protobuf:"varint,3,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty" yaml:"min_count"` + // PrepareGas represents the amount of gas to be used during the preparation + // stage of the oracle script + PrepareGas uint64 `protobuf:"varint,4,opt,name=prepare_gas,json=prepareGas,proto3" json:"prepare_gas,omitempty" yaml:"prepare_gas"` + // ExecuteGas represents the amount of gas to be used during the execution of + // the oracle script + ExecuteGas uint64 `protobuf:"varint,5,opt,name=execute_gas,json=executeGas,proto3" json:"execute_gas,omitempty" yaml:"execute_gas"` + // FeeAmount represents the amount of fees to be payed in order to execute the + // oracle script + FeeAmount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=fee_amount,json=feeAmount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"fee_amount" yaml:"fee_amount"` +} + +func (m *OracleParams) Reset() { *m = OracleParams{} } +func (m *OracleParams) String() string { return proto.CompactTextString(m) } +func (*OracleParams) ProtoMessage() {} +func (*OracleParams) Descriptor() ([]byte, []int) { + return fileDescriptor_1b093f5fee9c9f7d, []int{4} +} +func (m *OracleParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleParams.Merge(m, src) +} +func (m *OracleParams) XXX_Size() int { + return m.Size() +} +func (m *OracleParams) XXX_DiscardUnknown() { + xxx_messageInfo_OracleParams.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleParams proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "desmos.profiles.v2.Params") + proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.v2.NicknameParams") + proto.RegisterType((*DTagParams)(nil), "desmos.profiles.v2.DTagParams") + proto.RegisterType((*BioParams)(nil), "desmos.profiles.v2.BioParams") + proto.RegisterType((*OracleParams)(nil), "desmos.profiles.v2.OracleParams") +} + +func init() { + proto.RegisterFile("desmos/profiles/v2/models_params.proto", fileDescriptor_1b093f5fee9c9f7d) +} + +var fileDescriptor_1b093f5fee9c9f7d = []byte{ + // 705 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xd3, 0x4c, + 0x14, 0xc7, 0x73, 0x71, 0xa3, 0x78, 0xd2, 0xef, 0x83, 0x5a, 0x05, 0x42, 0x11, 0x76, 0x34, 0x8b, + 0x2a, 0x9b, 0xda, 0x6a, 0x00, 0x21, 0x15, 0xb1, 0xc0, 0x69, 0x85, 0x2a, 0x01, 0xad, 0x0c, 0x08, + 0x89, 0x8d, 0x35, 0x76, 0xa6, 0xae, 0x15, 0xdb, 0x63, 0x79, 0x9c, 0x28, 0x5d, 0xb1, 0x65, 0xc9, + 0x13, 0x20, 0xd6, 0x88, 0x07, 0xe9, 0x0a, 0x75, 0x89, 0x58, 0x18, 0x94, 0xbe, 0x41, 0x9e, 0x00, + 0xcd, 0x25, 0x97, 0x96, 0x4a, 0x14, 0x10, 0xab, 0x1c, 0xcf, 0x39, 0xff, 0xdf, 0x99, 0x39, 0x7f, + 0x7b, 0x02, 0xd6, 0x7b, 0x98, 0xc6, 0x84, 0x5a, 0x69, 0x46, 0x0e, 0xc2, 0x08, 0x53, 0x6b, 0xd8, + 0xb1, 0x62, 0xd2, 0xc3, 0x11, 0x75, 0x53, 0x94, 0xa1, 0x98, 0x9a, 0x69, 0x46, 0x72, 0xa2, 0x69, + 0xa2, 0xce, 0x9c, 0xd6, 0x99, 0xc3, 0xce, 0xda, 0x6a, 0x40, 0x02, 0xc2, 0xd3, 0x16, 0x8b, 0x44, + 0xe5, 0x9a, 0xee, 0x13, 0x4e, 0xf4, 0x10, 0xc5, 0xd6, 0x70, 0xd3, 0xc3, 0x39, 0xda, 0xb4, 0x7c, + 0x12, 0x26, 0x22, 0x0f, 0x3f, 0x57, 0x40, 0x6d, 0x9f, 0xa3, 0xb5, 0x57, 0xa0, 0x9e, 0x84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 0xd1, 0x75, 0x4e, 0x82, 0x8e, 0x1a, 0x87, 0xc9, 0x13, 0x1e, + 0xf3, 0x1e, 0x68, 0x34, 0xed, 0x51, 0xf9, 0xcb, 0x1e, 0x33, 0x12, 0xeb, 0x81, 0x46, 0xa2, 0x87, + 0x3c, 0xe0, 0xfb, 0x0a, 0x00, 0x73, 0xbb, 0xb4, 0x36, 0xa8, 0x65, 0x38, 0x70, 0xf1, 0x88, 0x1f, + 0x4c, 0xb5, 0x57, 0xe6, 0x03, 0x12, 0xeb, 0xd0, 0x59, 0xca, 0x70, 0xb0, 0x33, 0xd2, 0xc8, 0x99, + 0x31, 0x88, 0x2d, 0xee, 0xff, 0xde, 0x16, 0xc7, 0x85, 0xa1, 0x3e, 0x9d, 0x9e, 0xf9, 0x97, 0x33, + 0x21, 0x67, 0x66, 0x52, 0xfd, 0xe3, 0x86, 0xd3, 0x01, 0x5c, 0x72, 0x40, 0x03, 0xa0, 0xce, 0x5e, + 0xbf, 0x73, 0xbe, 0x54, 0xff, 0xa1, 0x2f, 0x9f, 0xaa, 0x60, 0x79, 0xf1, 0x75, 0xd5, 0x1e, 0x02, + 0x95, 0xfa, 0x59, 0x98, 0xe6, 0x6e, 0xd8, 0xe3, 0xe6, 0x28, 0x76, 0x6b, 0x5c, 0x18, 0xf5, 0xe7, + 0x7c, 0x71, 0x77, 0x7b, 0x52, 0x18, 0x57, 0x05, 0x77, 0x56, 0x06, 0x9d, 0xba, 0x88, 0x77, 0x7b, + 0xda, 0x26, 0x50, 0x11, 0xed, 0xbb, 0x3e, 0x19, 0x24, 0x39, 0x77, 0x4b, 0xb1, 0x57, 0xe7, 0x92, + 0x59, 0x0a, 0x3a, 0x75, 0x44, 0xfb, 0x5d, 0x16, 0x32, 0x09, 0xb3, 0x42, 0x48, 0xaa, 0xe7, 0x25, + 0xb3, 0x14, 0x74, 0xea, 0x71, 0x98, 0x08, 0xc9, 0x7d, 0xd0, 0x48, 0x33, 0x9c, 0xa2, 0x0c, 0xbb, + 0x01, 0xa2, 0xfc, 0x53, 0x54, 0xec, 0xeb, 0x93, 0xc2, 0xd0, 0x84, 0x68, 0x21, 0x09, 0x1d, 0x20, + 0x9f, 0x1e, 0x23, 0xca, 0x84, 0x78, 0x84, 0xfd, 0x41, 0x2e, 0x84, 0x4b, 0xe7, 0x85, 0x0b, 0x49, + 0xe8, 0x00, 0xf9, 0xc4, 0x84, 0x6f, 0x00, 0x38, 0xc0, 0xd8, 0x45, 0x31, 0xdf, 0x65, 0xad, 0x55, + 0x6d, 0x37, 0x3a, 0x37, 0x4d, 0x31, 0x78, 0x93, 0x5d, 0x93, 0xa6, 0xbc, 0x26, 0xcd, 0x2e, 0x09, + 0x13, 0x7b, 0x47, 0x7e, 0xf4, 0xd2, 0x82, 0xb9, 0x14, 0x7e, 0xfc, 0x66, 0xb4, 0x2f, 0xe1, 0x20, + 0xa3, 0x50, 0x47, 0x3d, 0xc0, 0xf8, 0x11, 0xd7, 0x09, 0xbb, 0xec, 0x97, 0xc7, 0x63, 0xbd, 0x7c, + 0x32, 0xd6, 0xcb, 0xdf, 0xc7, 0x7a, 0xf9, 0xdd, 0xa9, 0x5e, 0x3a, 0x39, 0xd5, 0x4b, 0x5f, 0x4e, + 0xf5, 0xd2, 0xeb, 0x07, 0x0b, 0x50, 0x71, 0x25, 0x6d, 0x44, 0xc8, 0xa3, 0x32, 0xb6, 0x86, 0x77, + 0xad, 0xd1, 0xfc, 0x0f, 0x22, 0xc2, 0x01, 0xf2, 0x8f, 0xac, 0xe1, 0x3d, 0xd1, 0xcd, 0xab, 0xf1, + 0x6b, 0xfd, 0xce, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xeb, 0x0c, 0x25, 0x06, 0x4a, 0x06, 0x00, + 0x00, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Oracle.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Bio.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.DTag.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Nickname.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NicknameParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NicknameParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NicknameParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MaxLength.Size() + i -= size + if _, err := m.MaxLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.MinLength.Size() + i -= size + if _, err := m.MinLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DTagParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DTagParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DTagParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MaxLength.Size() + i -= size + if _, err := m.MaxLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.MinLength.Size() + i -= size + if _, err := m.MinLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.RegEx) > 0 { + i -= len(m.RegEx) + copy(dAtA[i:], m.RegEx) + i = encodeVarintModelsParams(dAtA, i, uint64(len(m.RegEx))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BioParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BioParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BioParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MaxLength.Size() + i -= size + if _, err := m.MaxLength.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} + +func (m *OracleParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OracleParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OracleParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FeeAmount) > 0 { + for iNdEx := len(m.FeeAmount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FeeAmount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.ExecuteGas != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.ExecuteGas)) + i-- + dAtA[i] = 0x28 + } + if m.PrepareGas != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.PrepareGas)) + i-- + dAtA[i] = 0x20 + } + if m.MinCount != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.MinCount)) + i-- + dAtA[i] = 0x18 + } + if m.AskCount != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.AskCount)) + i-- + dAtA[i] = 0x10 + } + if m.ScriptID != 0 { + i = encodeVarintModelsParams(dAtA, i, uint64(m.ScriptID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsParams(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Nickname.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.DTag.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.Bio.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.Oracle.Size() + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + +func (m *NicknameParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MinLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.MaxLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + +func (m *DTagParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RegEx) + if l > 0 { + n += 1 + l + sovModelsParams(uint64(l)) + } + l = m.MinLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + l = m.MaxLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + +func (m *BioParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MaxLength.Size() + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + +func (m *OracleParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ScriptID != 0 { + n += 1 + sovModelsParams(uint64(m.ScriptID)) + } + if m.AskCount != 0 { + n += 1 + sovModelsParams(uint64(m.AskCount)) + } + if m.MinCount != 0 { + n += 1 + sovModelsParams(uint64(m.MinCount)) + } + if m.PrepareGas != 0 { + n += 1 + sovModelsParams(uint64(m.PrepareGas)) + } + if m.ExecuteGas != 0 { + n += 1 + sovModelsParams(uint64(m.ExecuteGas)) + } + if len(m.FeeAmount) > 0 { + for _, e := range m.FeeAmount { + l = e.Size() + n += 1 + l + sovModelsParams(uint64(l)) + } + } + return n +} + +func sovModelsParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsParams(x uint64) (n int) { + return sovModelsParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nickname", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Nickname.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DTag", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DTag.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bio", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Bio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Oracle", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Oracle.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NicknameParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NicknameParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NicknameParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DTagParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DTagParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DTagParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegEx", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RegEx = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BioParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BioParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BioParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxLength", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxLength.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OracleParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OracleParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OracleParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ScriptID", wireType) + } + m.ScriptID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ScriptID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AskCount", wireType) + } + m.AskCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AskCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) + } + m.MinCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PrepareGas", wireType) + } + m.PrepareGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PrepareGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecuteGas", wireType) + } + m.ExecuteGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExecuteGas |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeAmount = append(m.FeeAmount, types.Coin{}) + if err := m.FeeAmount[len(m.FeeAmount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthModelsParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v5/types/models_profile.go b/x/profiles/legacy/v5/types/models_profile.go new file mode 100644 index 0000000000..a97b8821e7 --- /dev/null +++ b/x/profiles/legacy/v5/types/models_profile.go @@ -0,0 +1,353 @@ +package types + +// DONTCOVER + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/desmos-labs/desmos/v4/x/commons" + + "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/ghodss/yaml" + "github.com/gogo/protobuf/proto" +) + +var ( + _ authtypes.AccountI = (*Profile)(nil) + _ exported.VestingAccount = (*Profile)(nil) +) + +// NewProfile builds a new profile having the given DTag, creator and creation date +func NewProfile(dTag string, nickname, bio string, pictures Pictures, creationDate time.Time, account authtypes.AccountI) (*Profile, error) { + // Make sure myAccount is a proto.Message, e.g. a BaseAccount etc. + protoAccount, ok := account.(proto.Message) + if !ok { + return nil, fmt.Errorf("the given account cannot be serialized using Protobuf") + } + + myAccountAny, err := codectypes.NewAnyWithValue(protoAccount) + if err != nil { + return nil, err + } + + return &Profile{ + DTag: dTag, + Nickname: nickname, + Bio: bio, + Pictures: pictures, + CreationDate: creationDate, + Account: myAccountAny, + }, nil +} + +// NewProfileFromAccount allows to build a new Profile instance from a provided DTag, and account and a creation time +func NewProfileFromAccount(dTag string, account authtypes.AccountI, creationTime time.Time) (*Profile, error) { + return NewProfile( + dTag, + "", + "", + NewPictures("", ""), + creationTime, + account, + ) +} + +// GetAccount returns the underlying account as an authtypes.AccountI instance +func (p *Profile) GetAccount() authtypes.AccountI { + return p.Account.GetCachedValue().(authtypes.AccountI) +} + +// getVestingAccount returns the underlying account as an exported.VestingAccount instance +func (p *Profile) getVestingAccount() exported.VestingAccount { + acc, ok := p.Account.GetCachedValue().(exported.VestingAccount) + if !ok { + return nil + } + return acc +} + +// setAccount sets the given account as the underlying account instance. +// This should be called after updating anything about the account (eg. after calling SetSequence). +func (p *Profile) setAccount(account authtypes.AccountI) error { + accAny, err := codectypes.NewAnyWithValue(account) + if err != nil { + return err + } + + p.Account = accAny + return nil +} + +// GetAddress implements authtypes.AccountI +func (p *Profile) GetAddress() sdk.AccAddress { + return p.GetAccount().GetAddress() +} + +// SetAddress implements authtypes.AccountI +func (p *Profile) SetAddress(addr sdk.AccAddress) error { + acc := p.GetAccount() + err := acc.SetAddress(addr) + if err != nil { + return err + } + + return p.setAccount(acc) +} + +// GetPubKey implements authtypes.AccountI +func (p *Profile) GetPubKey() cryptotypes.PubKey { + return p.GetAccount().GetPubKey() +} + +// SetPubKey implements authtypes.AccountI +func (p *Profile) SetPubKey(pubKey cryptotypes.PubKey) error { + acc := p.GetAccount() + err := acc.SetPubKey(pubKey) + if err != nil { + return err + } + + return p.setAccount(acc) +} + +// GetAccountNumber implements authtypes.AccountI +func (p *Profile) GetAccountNumber() uint64 { + return p.GetAccount().GetAccountNumber() +} + +// SetAccountNumber implements authtypes.AccountI +func (p *Profile) SetAccountNumber(accountNumber uint64) error { + acc := p.GetAccount() + err := acc.SetAccountNumber(accountNumber) + if err != nil { + return err + } + + return p.setAccount(acc) +} + +// GetSequence implements authtypes.AccountI +func (p *Profile) GetSequence() uint64 { + return p.GetAccount().GetSequence() +} + +// SetSequence implements authtypes.AccountI +func (p *Profile) SetSequence(sequence uint64) error { + acc := p.GetAccount() + err := acc.SetSequence(sequence) + if err != nil { + return err + } + + return p.setAccount(acc) +} + +// LockedCoins implements exported.VestingAccount +func (p *Profile) LockedCoins(blockTime time.Time) sdk.Coins { + acc := p.getVestingAccount() + if acc == nil { + return sdk.NewCoins() + } + return acc.LockedCoins(blockTime) +} + +// TrackDelegation implements exported.VestingAccount +func (p *Profile) TrackDelegation(blockTime time.Time, balance, amount sdk.Coins) { + acc := p.getVestingAccount() + if acc == nil { + return + } + + acc.TrackDelegation(blockTime, balance, amount) + err := p.setAccount(acc) + if err != nil { + panic(err) + } +} + +// TrackUndelegation implements exported.VestingAccount +func (p *Profile) TrackUndelegation(amount sdk.Coins) { + acc := p.getVestingAccount() + if acc == nil { + return + } + + acc.TrackUndelegation(amount) + err := p.setAccount(acc) + if err != nil { + panic(err) + } +} + +// GetVestedCoins implements exported.VestingAccount +func (p *Profile) GetVestedCoins(blockTime time.Time) sdk.Coins { + acc := p.getVestingAccount() + if acc == nil { + return sdk.NewCoins() + } + return acc.GetVestedCoins(blockTime) +} + +// GetVestingCoins implements exported.VestingAccount +func (p *Profile) GetVestingCoins(blockTime time.Time) sdk.Coins { + acc := p.getVestingAccount() + if acc == nil { + return sdk.NewCoins() + } + return acc.GetVestingCoins(blockTime) +} + +// GetStartTime implements exported.VestingAccount +func (p *Profile) GetStartTime() int64 { + acc := p.getVestingAccount() + if acc == nil { + return -1 + } + return acc.GetStartTime() +} + +// GetEndTime implements exported.VestingAccount +func (p *Profile) GetEndTime() int64 { + acc := p.getVestingAccount() + if acc == nil { + return -1 + } + return acc.GetEndTime() +} + +// GetOriginalVesting implements exported.VestingAccount +func (p *Profile) GetOriginalVesting() sdk.Coins { + acc := p.getVestingAccount() + if acc == nil { + return sdk.NewCoins() + } + return acc.GetOriginalVesting() +} + +// GetDelegatedFree implements exported.VestingAccount +func (p *Profile) GetDelegatedFree() sdk.Coins { + acc := p.getVestingAccount() + if acc == nil { + return sdk.NewCoins() + } + return acc.GetDelegatedFree() +} + +// GetDelegatedVesting implements exported.VestingAccount +func (p *Profile) GetDelegatedVesting() sdk.Coins { + acc := p.getVestingAccount() + if acc == nil { + return sdk.NewCoins() + } + return acc.GetDelegatedVesting() +} + +// UnpackInterfaces implements codectypes.UnpackInterfacesMessage +func (p *Profile) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + if p.Account != nil { + var account authtypes.AccountI + err := unpacker.UnpackAny(p.Account, &account) + if err != nil { + return err + } + } + + return nil +} + +// ------------------------------------------------------------------------------------------------------------------- + +type profilePretty struct { + Address sdk.AccAddress `json:"address" yaml:"address"` + PubKey string `json:"public_key" yaml:"public_key"` + AccountNumber uint64 `json:"account_number" yaml:"account_number"` + Sequence uint64 `json:"sequence" yaml:"sequence"` + DTag string `json:"dtag" yaml:"dtag"` + Nickname string `json:"nickname" yaml:"nickname"` + Bio string `json:"bio" yaml:"bio"` + Pictures Pictures `json:"pictures" yaml:"pictures"` + CreationDate time.Time `json:"creation_date" yaml:"creation_date"` +} + +// String implements authtypes.AccountI implements stringer +func (p *Profile) String() string { + out, _ := p.MarshalYAML() + return out.(string) +} + +// MarshalYAML returns the YAML representation of a Profile. +func (p *Profile) MarshalYAML() (interface{}, error) { + bs, err := yaml.Marshal(profilePretty{ + Address: p.GetAddress(), + PubKey: p.GetPubKey().String(), + AccountNumber: p.GetAccountNumber(), + Sequence: p.GetSequence(), + DTag: p.DTag, + Nickname: p.Nickname, + Bio: p.Bio, + Pictures: p.Pictures, + CreationDate: p.CreationDate, + }) + + if err != nil { + return nil, err + } + + return string(bs), nil +} + +// MarshalJSON returns the JSON representation of a Profile. +func (p *Profile) MarshalJSON() ([]byte, error) { + var pubKey = "" + if p.GetPubKey() != nil { + pubKey = p.GetPubKey().String() + } + + return json.Marshal(profilePretty{ + Address: p.GetAddress(), + PubKey: pubKey, + AccountNumber: p.GetAccountNumber(), + Sequence: p.GetSequence(), + DTag: p.DTag, + Nickname: p.Nickname, + Bio: p.Bio, + Pictures: p.Pictures, + CreationDate: p.CreationDate, + }) +} + +// ------------------------------------------------------------------------------------------------------------------- + +// NewPictures is a constructor function for Pictures +func NewPictures(profile, cover string) Pictures { + return Pictures{ + Profile: profile, + Cover: cover, + } +} + +// Validate check the validity of the Pictures +func (pic Pictures) Validate() error { + if pic.Profile != "" { + valid := commons.IsURIValid(pic.Profile) + if !valid { + return fmt.Errorf("invalid profile picture uri provided") + } + } + + if pic.Cover != "" { + valid := commons.IsURIValid(pic.Cover) + if !valid { + return fmt.Errorf("invalid profile cover uri provided") + } + } + + return nil +} diff --git a/x/profiles/legacy/v5/types/models_profile.pb.go b/x/profiles/legacy/v5/types/models_profile.pb.go new file mode 100644 index 0000000000..75ac2c885d --- /dev/null +++ b/x/profiles/legacy/v5/types/models_profile.pb.go @@ -0,0 +1,826 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/v2/models_profile.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/regen-network/cosmos-proto" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Profile represents a generic first on Desmos, containing the information of a +// single user +type Profile struct { + // Account represents the base Cosmos account associated with this profile + Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + // DTag represents the unique tag of this profile + DTag string `protobuf:"bytes,2,opt,name=dtag,proto3" json:"dtag,omitempty" yaml:"dtag"` + // Nickname contains the custom human readable name of the profile + Nickname string `protobuf:"bytes,3,opt,name=nickname,proto3" json:"nickname,omitempty" yaml:"nickname"` + // Bio contains the biography of the profile + Bio string `protobuf:"bytes,4,opt,name=bio,proto3" json:"bio,omitempty" yaml:"bio"` + // Pictures contains the data about the pictures associated with he profile + Pictures Pictures `protobuf:"bytes,5,opt,name=pictures,proto3" json:"pictures" yaml:"pictures"` + // CreationTime represents the time in which the profile has been created + CreationDate time.Time `protobuf:"bytes,6,opt,name=creation_date,json=creationDate,proto3,stdtime" json:"creation_date" yaml:"creation_date"` +} + +func (m *Profile) Reset() { *m = Profile{} } +func (*Profile) ProtoMessage() {} +func (*Profile) Descriptor() ([]byte, []int) { + return fileDescriptor_089dd63594c4b06b, []int{0} +} +func (m *Profile) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Profile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Profile.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Profile) XXX_Merge(src proto.Message) { + xxx_messageInfo_Profile.Merge(m, src) +} +func (m *Profile) XXX_Size() int { + return m.Size() +} +func (m *Profile) XXX_DiscardUnknown() { + xxx_messageInfo_Profile.DiscardUnknown(m) +} + +var xxx_messageInfo_Profile proto.InternalMessageInfo + +// Pictures contains the data of a user profile's related pictures +type Pictures struct { + // Profile contains the URL to the profile picture + Profile string `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty" yaml:"profile"` + // Cover contains the URL to the cover picture + Cover string `protobuf:"bytes,2,opt,name=cover,proto3" json:"cover,omitempty" yaml:"cover"` +} + +func (m *Pictures) Reset() { *m = Pictures{} } +func (m *Pictures) String() string { return proto.CompactTextString(m) } +func (*Pictures) ProtoMessage() {} +func (*Pictures) Descriptor() ([]byte, []int) { + return fileDescriptor_089dd63594c4b06b, []int{1} +} +func (m *Pictures) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Pictures) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Pictures.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Pictures) XXX_Merge(src proto.Message) { + xxx_messageInfo_Pictures.Merge(m, src) +} +func (m *Pictures) XXX_Size() int { + return m.Size() +} +func (m *Pictures) XXX_DiscardUnknown() { + xxx_messageInfo_Pictures.DiscardUnknown(m) +} + +var xxx_messageInfo_Pictures proto.InternalMessageInfo + +func (m *Pictures) GetProfile() string { + if m != nil { + return m.Profile + } + return "" +} + +func (m *Pictures) GetCover() string { + if m != nil { + return m.Cover + } + return "" +} + +func init() { + proto.RegisterType((*Profile)(nil), "desmos.profiles.v2.Profile") + proto.RegisterType((*Pictures)(nil), "desmos.profiles.v2.Pictures") +} + +func init() { + proto.RegisterFile("desmos/profiles/v2/models_profile.proto", fileDescriptor_089dd63594c4b06b) +} + +var fileDescriptor_089dd63594c4b06b = []byte{ + // 489 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0xb1, 0x6e, 0xd3, 0x40, + 0x1c, 0xc6, 0x6d, 0x92, 0x36, 0xee, 0x35, 0x14, 0x74, 0x44, 0xaa, 0x89, 0x90, 0x2f, 0xba, 0x01, + 0x2a, 0x41, 0x7d, 0x52, 0x80, 0x25, 0xb0, 0xd4, 0xea, 0xc2, 0x56, 0xac, 0xb2, 0xb0, 0x44, 0x67, + 0xe7, 0x6a, 0x0c, 0xb6, 0xcf, 0xb2, 0x2f, 0x16, 0x7e, 0x02, 0x18, 0x3b, 0x76, 0xcc, 0x43, 0xf0, + 0x10, 0x15, 0x53, 0x47, 0x26, 0x83, 0x92, 0x85, 0xd9, 0x4f, 0x80, 0xec, 0xf3, 0xb5, 0xa2, 0xdd, + 0xee, 0xee, 0xfb, 0x7d, 0xdf, 0xff, 0xaf, 0xcf, 0x06, 0xcf, 0x16, 0x2c, 0x8f, 0x79, 0x4e, 0xd2, + 0x8c, 0x9f, 0x85, 0x11, 0xcb, 0x49, 0x31, 0x25, 0x31, 0x5f, 0xb0, 0x28, 0x9f, 0x77, 0x4f, 0x76, + 0x9a, 0x71, 0xc1, 0x21,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 0xb1, 0x85, 0xe1, 0x0d, 0xff, 0x02, 0x00, 0x00, +} + +func (this *Pictures) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Pictures) + if !ok { + that2, ok := that.(Pictures) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Profile != that1.Profile { + return false + } + if this.Cover != that1.Cover { + return false + } + return true +} +func (m *Profile) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Profile) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Profile) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationDate):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintModelsProfile(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x32 + { + size, err := m.Pictures.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsProfile(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.Bio) > 0 { + i -= len(m.Bio) + copy(dAtA[i:], m.Bio) + i = encodeVarintModelsProfile(dAtA, i, uint64(len(m.Bio))) + i-- + dAtA[i] = 0x22 + } + if len(m.Nickname) > 0 { + i -= len(m.Nickname) + copy(dAtA[i:], m.Nickname) + i = encodeVarintModelsProfile(dAtA, i, uint64(len(m.Nickname))) + i-- + dAtA[i] = 0x1a + } + if len(m.DTag) > 0 { + i -= len(m.DTag) + copy(dAtA[i:], m.DTag) + i = encodeVarintModelsProfile(dAtA, i, uint64(len(m.DTag))) + i-- + dAtA[i] = 0x12 + } + if m.Account != nil { + { + size, err := m.Account.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsProfile(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Pictures) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Pictures) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Pictures) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cover) > 0 { + i -= len(m.Cover) + copy(dAtA[i:], m.Cover) + i = encodeVarintModelsProfile(dAtA, i, uint64(len(m.Cover))) + i-- + dAtA[i] = 0x12 + } + if len(m.Profile) > 0 { + i -= len(m.Profile) + copy(dAtA[i:], m.Profile) + i = encodeVarintModelsProfile(dAtA, i, uint64(len(m.Profile))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModelsProfile(dAtA []byte, offset int, v uint64) int { + offset -= sovModelsProfile(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Profile) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Account != nil { + l = m.Account.Size() + n += 1 + l + sovModelsProfile(uint64(l)) + } + l = len(m.DTag) + if l > 0 { + n += 1 + l + sovModelsProfile(uint64(l)) + } + l = len(m.Nickname) + if l > 0 { + n += 1 + l + sovModelsProfile(uint64(l)) + } + l = len(m.Bio) + if l > 0 { + n += 1 + l + sovModelsProfile(uint64(l)) + } + l = m.Pictures.Size() + n += 1 + l + sovModelsProfile(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationDate) + n += 1 + l + sovModelsProfile(uint64(l)) + return n +} + +func (m *Pictures) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Profile) + if l > 0 { + n += 1 + l + sovModelsProfile(uint64(l)) + } + l = len(m.Cover) + if l > 0 { + n += 1 + l + sovModelsProfile(uint64(l)) + } + return n +} + +func sovModelsProfile(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModelsProfile(x uint64) (n int) { + return sovModelsProfile(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Profile) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Profile: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Profile: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Account == nil { + m.Account = &types.Any{} + } + if err := m.Account.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DTag", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DTag = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nickname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nickname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bio", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bio = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pictures", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Pictures.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreationDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsProfile(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsProfile + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Pictures) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Pictures: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Pictures: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Profile", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Profile = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cover", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModelsProfile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModelsProfile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cover = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsProfile(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsProfile + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModelsProfile(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowModelsProfile + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthModelsProfile + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModelsProfile + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModelsProfile + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModelsProfile = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModelsProfile = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModelsProfile = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/profiles/legacy/v6/store.go b/x/profiles/legacy/v6/store.go new file mode 100644 index 0000000000..9020d276bb --- /dev/null +++ b/x/profiles/legacy/v6/store.go @@ -0,0 +1,266 @@ +package v6 + +import ( + "fmt" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + + v5types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" + + "github.com/cosmos/cosmos-sdk/store/prefix" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + "github.com/desmos-labs/desmos/v4/x/profiles/types" +) + +// MigrateStore performs in-place store migrations from v6 to v7. +// The migration includes: +// +// - migrating all the profiles to have the proper Protobuf type +// - add the expiration date to all application links +func MigrateStore(ctx sdk.Context, ak authkeeper.AccountKeeper, storeKey sdk.StoreKey, amino *codec.LegacyAmino, cdc codec.BinaryCodec) error { + store := ctx.KVStore(storeKey) + + // Migrate the profiles + err := migrateProfiles(ctx, ak) + if err != nil { + return err + } + + // Migrate all the application links + err = migrateApplicationLinks(store, cdc) + if err != nil { + return err + } + + // Migrate all the chain links + err = migrateChainLinks(store, cdc) + if err != nil { + return err + } + + return nil +} + +// migrateProfiles migrates the profiles from v5 to v7 to properly update the Protobuf name. +// The migration from v5 to v6 is skipped because the two types are identical (from v5 to v6 no changes were made). +func migrateProfiles(ctx sdk.Context, ak authkeeper.AccountKeeper) error { + var profiles []*v5types.Profile + ak.IterateAccounts(ctx, func(account authtypes.AccountI) (stop bool) { + if profile, ok := account.(*v5types.Profile); ok { + profiles = append(profiles, profile) + } + return false + }) + + for _, profile := range profiles { + // Convert the profile + v7Profile, err := types.NewProfile( + profile.DTag, + profile.Nickname, + profile.Bio, + types.NewPictures(profile.Pictures.Profile, profile.Pictures.Cover), + profile.CreationDate, + profile.GetAccount(), + ) + if err != nil { + return err + } + + // Set the account + ak.SetAccount(ctx, v7Profile) + } + + return nil +} + +// migrateApplicationLinks migrates the application links from v5 to v7 adding the expiration date properly. +// The migration from v5 to v6 is skipped because the two types are identical (from v5 to v6 no changes were made). +func migrateApplicationLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { + appLinksStore := prefix.NewStore(store, types.ApplicationLinkPrefix) + iterator := appLinksStore.Iterator(nil, nil) + + var applicationLinks []v5types.ApplicationLink + for ; iterator.Valid(); iterator.Next() { + var applicationLink v5types.ApplicationLink + err := cdc.Unmarshal(iterator.Value(), &applicationLink) + if err != nil { + return err + } + applicationLinks = append(applicationLinks, applicationLink) + } + + for _, v5Link := range applicationLinks { + // Migrate the link + v7Link := types.NewApplicationLink( + v5Link.User, + convertApplicationLinkData(v5Link.Data), + convertApplicationLinkState(v5Link.State), + convertApplicationLinkOracleRequest(v5Link.OracleRequest), + convertApplicationLinkResult(v5Link.Result), + v5Link.CreationTime, + v5Link.CreationTime.Add(types.DefaultAppLinksValidityDuration), + ) + + // Store the application link + userApplicationLinkKey := types.UserApplicationLinkKey(v7Link.User, v7Link.Data.Application, v7Link.Data.Username) + store.Set(userApplicationLinkKey, cdc.MustMarshal(&v7Link)) + + // Store the expiration time + applicationLinkExpiringTimeKey := types.ApplicationLinkExpiringTimeKey(v7Link.ExpirationTime, v7Link.OracleRequest.ClientID) + store.Set(applicationLinkExpiringTimeKey, []byte(v7Link.OracleRequest.ClientID)) + } + + return nil +} + +func convertApplicationLinkData(v5Data v5types.Data) types.Data { + return types.NewData(v5Data.Application, v5Data.Username) +} + +func convertApplicationLinkState(v5State v5types.ApplicationLinkState) types.ApplicationLinkState { + switch v5State { + case v5types.ApplicationLinkStateInitialized: + return types.ApplicationLinkStateInitialized + case v5types.AppLinkStateVerificationStarted: + return types.AppLinkStateVerificationStarted + case v5types.AppLinkStateVerificationError: + return types.AppLinkStateVerificationError + case v5types.AppLinkStateVerificationSuccess: + return types.AppLinkStateVerificationSuccess + case v5types.AppLinkStateVerificationTimedOut: + return types.AppLinkStateVerificationTimedOut + default: + panic(fmt.Errorf("invalid application link state: %s", v5State)) + } +} + +func convertApplicationLinkOracleRequest(v5Request v5types.OracleRequest) types.OracleRequest { + return types.NewOracleRequest( + v5Request.ID, + v5Request.OracleScriptID, + types.NewOracleRequestCallData(v5Request.CallData.Application, v5Request.CallData.CallData), + v5Request.ClientID, + ) +} + +func convertApplicationLinkResult(v5Result *v5types.Result) *types.Result { + if v5Result == nil { + return nil + } + + switch result := v5Result.Sum.(type) { + case *v5types.Result_Success_: + return types.NewSuccessResult(result.Success.Value, result.Success.Signature) + + case *v5types.Result_Failed_: + return types.NewErrorResult(result.Failed.Error) + + default: + panic(fmt.Errorf("invalid result type: %T", v5Result.Sum)) + } +} + +// migrateChainLinks migrates the chain links from v5 to v7 by changing the various Protobuf interface types. +// The migration from v5 to v6 is skipped because the two types are identical (from v5 to v6 no changes were made). +func migrateChainLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { + appLinksStore := prefix.NewStore(store, types.ChainLinksPrefix) + iterator := appLinksStore.Iterator(nil, nil) + + var applicationLinks []v5types.ChainLink + for ; iterator.Valid(); iterator.Next() { + var applicationLink v5types.ChainLink + err := cdc.Unmarshal(iterator.Value(), &applicationLink) + if err != nil { + return err + } + applicationLinks = append(applicationLinks, applicationLink) + } + + for _, v5Link := range applicationLinks { + // Migrate the link + v7Link := types.NewChainLink( + v5Link.User, + convertChainLinkAddressData(v5Link.GetAddressData()), + convertChainLinkProof(v5Link.Proof, cdc), + types.NewChainConfig(v5Link.ChainConfig.Name), + v5Link.CreationTime, + ) + + // Store the chain link + userApplicationLinkKey := types.ChainLinksStoreKey(v7Link.User, v7Link.ChainConfig.Name, v7Link.GetAddressData().GetValue()) + store.Set(userApplicationLinkKey, cdc.MustMarshal(&v7Link)) + } + + return nil +} + +func convertChainLinkAddressData(v5Signature v5types.AddressData) types.AddressData { + switch address := v5Signature.(type) { + case *v5types.Bech32Address: + return types.NewBech32Address(address.Value, address.Prefix) + case *v5types.Base58Address: + return types.NewBase58Address(address.Value) + case *v5types.HexAddress: + return types.NewHexAddress(address.Value, address.Prefix) + default: + panic(fmt.Errorf("invalid signature type: %T", v5Signature)) + } +} + +func convertChainLinkProof(v5Proof v5types.Proof, cdc codec.BinaryCodec) types.Proof { + var pubKey cryptotypes.PubKey + err := cdc.UnpackAny(v5Proof.PubKey, &pubKey) + if err != nil { + panic(err) + } + + var v6Signature types.SignatureData + v6SignatureAny := convertChainLinkSignatureData(v5Proof.Signature, cdc) + err = cdc.UnpackAny(v6SignatureAny, &v6Signature) + if err != nil { + panic(err) + } + + return types.NewProof(pubKey, v6Signature, v5Proof.PlainText) + +} + +func convertChainLinkSignatureData(data *codectypes.Any, cdc codec.BinaryCodec) *codectypes.Any { + var v5Signature v5types.SignatureData + err := cdc.UnpackAny(data, &v5Signature) + if err != nil { + panic(err) + } + + var signatureAny *codectypes.Any + switch signature := v5Signature.(type) { + case *v5types.SingleSignatureData: + v6Signature := &types.SingleSignatureData{Signature: signature.Signature, Mode: signature.Mode} + signatureAny, err = codectypes.NewAnyWithValue(v6Signature) + if err != nil { + panic(err) + } + + case *v5types.MultiSignatureData: + sigsAnys := make([]*codectypes.Any, len(signature.Signatures)) + for i, signature := range signature.Signatures { + sigsAnys[i] = convertChainLinkSignatureData(signature, cdc) + } + + v6Signature := &types.MultiSignatureData{BitArray: signature.BitArray, Signatures: sigsAnys} + signatureAny, err = codectypes.NewAnyWithValue(v6Signature) + if err != nil { + panic(err) + } + + } + + return signatureAny + +} diff --git a/x/profiles/legacy/v6/store_test.go b/x/profiles/legacy/v6/store_test.go new file mode 100644 index 0000000000..740b3d49ee --- /dev/null +++ b/x/profiles/legacy/v6/store_test.go @@ -0,0 +1,252 @@ +package v6_test + +import ( + "encoding/hex" + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + + v5types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" + v6 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v6" + + "github.com/desmos-labs/desmos/v4/testutil/profilestesting" + + "github.com/cosmos/cosmos-sdk/store" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + dbm "github.com/tendermint/tm-db" + + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/stretchr/testify/require" + + "github.com/desmos-labs/desmos/v4/app" + "github.com/desmos-labs/desmos/v4/x/profiles/types" +) + +func buildContext( + keys map[string]*sdk.KVStoreKey, tKeys map[string]*sdk.TransientStoreKey, memKeys map[string]*sdk.MemoryStoreKey, +) sdk.Context { + db := dbm.NewMemDB() + cms := store.NewCommitMultiStore(db) + for _, key := range keys { + cms.MountStoreWithDB(key, sdk.StoreTypeIAVL, db) + } + for _, tKey := range tKeys { + cms.MountStoreWithDB(tKey, sdk.StoreTypeTransient, db) + } + for _, memKey := range memKeys { + cms.MountStoreWithDB(memKey, sdk.StoreTypeMemory, nil) + } + + err := cms.LoadLatestVersion() + if err != nil { + panic(err) + } + + return sdk.NewContext(cms, tmproto.Header{}, false, log.NewNopLogger()) +} + +func TestMigrateStore(t *testing.T) { + cdc, legacyAmino := app.MakeCodecs() + + // Build all the necessary keys + keys := sdk.NewKVStoreKeys(authtypes.StoreKey, types.StoreKey) + tKeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + + // Build the x/auth keeper + paramsKeeper := paramskeeper.NewKeeper( + cdc, + legacyAmino, + keys[paramstypes.StoreKey], + tKeys[paramstypes.TStoreKey], + ) + authKeeper := authkeeper.NewAccountKeeper( + cdc, + keys[authtypes.StoreKey], + paramsKeeper.Subspace(authtypes.ModuleName), + authtypes.ProtoBaseAccount, + app.GetMaccPerms(), + ) + + pubKey := secp256k1.GenPrivKey().PubKey() + testCases := []struct { + name string + store func(ctx sdk.Context) + shouldErr bool + check func(ctx sdk.Context) + }{ + { + name: "profiles are migrated properly", + store: func(ctx sdk.Context) { + // Store a profile + profile, err := v5types.NewProfile( + "john_doe", + "John Doe", + "My name if John Doe", + v5types.Pictures{ + Profile: "", + Cover: "", + }, + time.Date(2020, 1, 1, 0, 0, 0, 00, time.UTC), + profilestesting.AccountFromAddr("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), + ) + require.NoError(t, err) + authKeeper.SetAccount(ctx, profile) + }, + check: func(ctx sdk.Context) { + // Check the profile to make sure it contains the same data + v7Profile, err := types.NewProfile( + "john_doe", + "John Doe", + "My name if John Doe", + types.NewPictures("", ""), + time.Date(2020, 1, 1, 0, 0, 0, 00, time.UTC), + profilestesting.AccountFromAddr("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf"), + ) + require.NoError(t, err) + + sdkAddr, err := sdk.AccAddressFromBech32("cosmos1nejmx335u222dj6lg7qjqrufchkpazu8e0semf") + require.NoError(t, err) + + account := authKeeper.GetAccount(ctx, sdkAddr) + profile, ok := account.(*types.Profile) + require.True(t, ok) + require.Equal(t, v7Profile, profile) + }, + }, + { + name: "application links are migrated properly", + store: func(ctx sdk.Context) { + kvStore := ctx.KVStore(keys[types.StoreKey]) + + // Store an application link + link := v5types.NewApplicationLink( + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + v5types.NewData("twitter", "twitteruser"), + v5types.ApplicationLinkStateInitialized, + v5types.NewOracleRequest( + 0, + 1, + v5types.NewOracleRequestCallData("twitter", "calldata"), + "client_id", + ), + nil, + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), + ) + kvStore.Set(types.UserApplicationLinkKey("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", "twitter", "twitteruser"), cdc.MustMarshal(&link)) + }, + check: func(ctx sdk.Context) { + kvStore := ctx.KVStore(keys[types.StoreKey]) + + // Check the application links + linkKey := types.UserApplicationLinkKey( + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + "twitter", + "twitteruser", + ) + + var stored types.ApplicationLink + cdc.MustUnmarshal(kvStore.Get(linkKey), &stored) + require.Equal(t, types.NewApplicationLink( + "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", + types.NewData("twitter", "twitteruser"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData("twitter", "calldata"), + "client_id", + ), + nil, + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + ), stored) + + // Check the application link expiration time + require.Equal(t, []byte("client_id"), kvStore.Get(types.ApplicationLinkExpiringTimeKey( + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + "client_id", + ))) + }, + }, + { + name: "chain links are migrated properly", + store: func(ctx sdk.Context) { + kvStore := ctx.KVStore(keys[types.StoreKey]) + + sig, err := hex.DecodeString("1234") + require.NoError(t, err) + + chainLink := v5types.NewChainLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + v5types.NewBech32Address("cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", "cosmos"), + v5types.NewProof( + pubKey, + &v5types.SingleSignatureData{ + Mode: signing.SignMode_SIGN_MODE_DIRECT, + Signature: sig, + }, + "plain_text", + ), + v5types.NewChainConfig("cosmos"), + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + ) + kvStore.Set( + types.ChainLinksStoreKey( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + "cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", + ), + cdc.MustMarshal(&chainLink), + ) + }, + shouldErr: false, + check: func(ctx sdk.Context) { + kvStore := ctx.KVStore(keys[types.StoreKey]) + + var stored types.ChainLink + cdc.MustUnmarshal(kvStore.Get(types.ChainLinksStoreKey( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + "cosmos", + "cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", + )), &stored) + require.Equal(t, types.NewChainLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + types.NewBech32Address("cosmos1ftkjv8njvkekk00ehwdfl5sst8zgdpenjfm4hs", "cosmos"), + types.NewProof(pubKey, profilestesting.SingleSignatureProtoFromHex("1234"), "plain_text"), + types.NewChainConfig("cosmos"), + time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), + ), stored) + }, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + ctx := buildContext(keys, tKeys, memKeys) + if tc.store != nil { + tc.store(ctx) + } + + err := v6.MigrateStore(ctx, authKeeper, keys[types.StoreKey], legacyAmino, cdc) + if tc.shouldErr { + require.Error(t, err) + } else { + require.NoError(t, err) + if tc.check != nil { + tc.check(ctx) + } + } + }) + } +} diff --git a/x/profiles/module.go b/x/profiles/module.go index 2aa3890f8c..7863f07182 100644 --- a/x/profiles/module.go +++ b/x/profiles/module.go @@ -6,6 +6,9 @@ import ( "fmt" "math/rand" + v4 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types" + v5 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v5/types" + feeskeeper "github.com/desmos-labs/desmos/v4/x/fees/keeper" "github.com/cosmos/cosmos-sdk/client" @@ -24,13 +27,12 @@ import ( "github.com/desmos-labs/desmos/v4/x/profiles/client/cli" "github.com/desmos-labs/desmos/v4/x/profiles/keeper" - v4 "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4" "github.com/desmos-labs/desmos/v4/x/profiles/simulation" "github.com/desmos-labs/desmos/v4/x/profiles/types" ) const ( - consensusVersion = 6 + consensusVersion = 7 ) // type check to ensure the interface is properly implemented @@ -91,6 +93,7 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { // RegisterInterfaces registers interfaces and implementations of the profiles module. func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { v4.RegisterInterfaces(registry) + v5.RegisterInterfaces(registry) types.RegisterInterfaces(registry) } @@ -110,12 +113,16 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - m := keeper.NewMigrator(am.ak, am.keeper, cfg.QueryServer()) + m := keeper.NewMigrator(am.ak, am.keeper) err := cfg.RegisterMigration(types.ModuleName, 4, m.Migrate4to5) if err != nil { panic(err) } - err = cfg.RegisterMigration(types.ModuleName, 5, m.Migrate5To6) + err = cfg.RegisterMigration(types.ModuleName, 5, m.Migrate5to6) + if err != nil { + panic(err) + } + err = cfg.RegisterMigration(types.ModuleName, 6, m.Migrate6to7) if err != nil { panic(err) } @@ -182,7 +189,8 @@ func (AppModule) ConsensusVersion() uint64 { } // BeginBlock returns the begin blocker for the profiles module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { + BeginBlocker(ctx, am.keeper) } // EndBlock returns the end blocker for the profiles module. It returns no validator diff --git a/x/profiles/simulation/decoder.go b/x/profiles/simulation/decoder.go index dd4e4b8125..fbf6cd616e 100644 --- a/x/profiles/simulation/decoder.go +++ b/x/profiles/simulation/decoder.go @@ -31,13 +31,20 @@ func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string { var chainLinkA, chainLinkB types.ChainLink cdc.MustUnmarshal(kvA.Value, &chainLinkA) cdc.MustUnmarshal(kvB.Value, &chainLinkB) - return fmt.Sprintf("Chain link A: %s\nChain link B: %s\n", chainLinkA, chainLinkB) + return fmt.Sprintf("ChainLinkA: %s\nChainLinkB: %s\n", chainLinkA, chainLinkB) case bytes.HasPrefix(kvA.Key, types.ApplicationLinkPrefix): var applicationLinkA, applicationLinkB types.ApplicationLink cdc.MustUnmarshal(kvA.Value, &applicationLinkA) cdc.MustUnmarshal(kvB.Value, &applicationLinkB) - return fmt.Sprintf("Application link A: %s\nApplication link B: %s\n", &applicationLinkA, &applicationLinkB) + return fmt.Sprintf("ApplicationLinkA: %s\nApplicationLinkB: %s\n", &applicationLinkA, &applicationLinkB) + + case bytes.HasPrefix(kvA.Key, types.ExpiringAppLinkTimePrefix): + var clientIDA, clientIDB string + clientIDA = string(kvA.Value) + clientIDB = string(kvB.Value) + return fmt.Sprintf("ExpiringClientIDA: %s\nExpiringClientIDB: %s\n", + clientIDA, clientIDB) default: panic(fmt.Sprintf("unexpected %s key %X (%s)", types.ModuleName, kvA.Key, kvA.Key)) diff --git a/x/profiles/simulation/decoder_test.go b/x/profiles/simulation/decoder_test.go index 001d50d000..b285abab20 100644 --- a/x/profiles/simulation/decoder_test.go +++ b/x/profiles/simulation/decoder_test.go @@ -43,6 +43,7 @@ func TestDecodeStore(t *testing.T) { types.OracleRequest{}, nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ) kvPairs := kv.Pairs{Pairs: []kv.Pair{ @@ -73,6 +74,13 @@ func TestDecodeStore(t *testing.T) { ), Value: cdc.MustMarshal(&applicationLink), }, + { + Key: types.ApplicationLinkExpiringTimeKey( + time.Date(2022, 1, 1, 0, 0, 00, 000, time.UTC), + "client_id", + ), + Value: []byte("client_id"), + }, { Key: []byte("invalid"), Value: []byte("value"), @@ -85,8 +93,9 @@ func TestDecodeStore(t *testing.T) { }{ {"DTags", fmt.Sprintf("DTagAddressA: %s\nDTagAddressB: %s\n", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns")}, {"DTag transfer request", fmt.Sprintf("RequestA: %s\nRequestB: %s\n", request, request)}, - {"Chain link", fmt.Sprintf("Chain link A: %s\nChain link B: %s\n", chainLink, chainLink)}, - {"Application link", fmt.Sprintf("Application link A: %s\nApplication link B: %s\n", &applicationLink, &applicationLink)}, + {"Chain link", fmt.Sprintf("ChainLinkA: %s\nChainLinkB: %s\n", chainLink, chainLink)}, + {"Application link", fmt.Sprintf("ApplicationLinkA: %s\nApplicationLinkB: %s\n", &applicationLink, &applicationLink)}, + {"Expiring Application link", fmt.Sprintf("ExpiringClientIDA: %s\nExpiringClientIDB: %s\n", "client_id", "client_id")}, {"other", ""}, } diff --git a/x/profiles/simulation/genesis.go b/x/profiles/simulation/genesis.go index 1163df8b7d..f8b2a2f364 100644 --- a/x/profiles/simulation/genesis.go +++ b/x/profiles/simulation/genesis.go @@ -56,6 +56,7 @@ func RandomizedGenState(simsState *module.SimulationState) { RandomDTagParams(simsState.Rand), RandomBioParams(simsState.Rand), RandomOracleParams(simsState.Rand), + RandomAppLinksParams(simsState.Rand), ), types.IBCPortID, randomChainLinks(profiles, simsState), diff --git a/x/profiles/simulation/params.go b/x/profiles/simulation/params.go index 82c07b0ec6..27b5a6f850 100644 --- a/x/profiles/simulation/params.go +++ b/x/profiles/simulation/params.go @@ -49,5 +49,11 @@ func ParamChanges(r *rand.Rand) []simtypes.ParamChange { ) }, ), + simulation.NewSimParamChange(types.ModuleName, string(types.AppLinksParamsKey), + func(r *rand.Rand) string { + params := RandomAppLinksParams(r) + return fmt.Sprintf(`{"validity_duration":"%d"}`, params.ValidityDuration) + }, + ), } } diff --git a/x/profiles/simulation/utils.go b/x/profiles/simulation/utils.go index 5144ec83ea..f9e00c42bc 100644 --- a/x/profiles/simulation/utils.go +++ b/x/profiles/simulation/utils.go @@ -178,3 +178,9 @@ func RandomOracleParams(r *rand.Rand) types.OracleParams { simtypes.RandSubsetCoins(r, feeCoins)..., ) } + +// RandomAppLinksParams return a random appLinks param +func RandomAppLinksParams(r *rand.Rand) types.AppLinksParams { + randomDuration := time.Duration(simtypes.RandIntBetween(r, 60*60*24*14, 60*60*24*7*4*6)) * time.Second + return types.NewAppLinksParams(randomDuration) +} diff --git a/x/profiles/types/codec.go b/x/profiles/types/codec.go index 0db463c013..3833d1566a 100644 --- a/x/profiles/types/codec.go +++ b/x/profiles/types/codec.go @@ -40,14 +40,14 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations((*exported.VestingAccount)(nil), &Profile{}) registry.RegisterImplementations((*authtypes.GenesisAccount)(nil), &Profile{}) registry.RegisterInterface( - "desmos.profiles.v2.AddressData", + "desmos.profiles.v3.AddressData", (*AddressData)(nil), &Bech32Address{}, &Base58Address{}, &HexAddress{}, ) registry.RegisterInterface( - "desmos.profiles.v2.Signature", + "desmos.profiles.v3.Signature", (*SignatureData)(nil), &SingleSignatureData{}, &MultiSignatureData{}, diff --git a/x/profiles/types/events.go b/x/profiles/types/events.go index 3c77c25d0b..07867b4bbe 100644 --- a/x/profiles/types/events.go +++ b/x/profiles/types/events.go @@ -18,28 +18,30 @@ const ( EventTypeApplicationLinkDeleted = "unlink_application" EventTypesApplicationLinkSaved = "application_link_saved" - AttributeKeyProfileDTag = "profile_dtag" - AttributeKeyProfileCreator = "profile_creator" - AttributeKeyProfileCreationTime = "profile_creation_time" - AttributeKeyRequestReceiver = "request_receiver" - AttributeKeyRequestSender = "request_sender" - AttributeKeyDTagToTrade = "dtag_to_trade" - AttributeKeyNewDTag = "new_dtag" - AttributeKeyChainLinkSourceAddress = "chain_link_account_target" - AttributeKeyChainLinkDestinationAddress = "chain_link_account_owner" - AttributeKeyChainLinkSourceChainName = "chain_link_source_chain_name" - AttributeKeyChainLinkCreationTime = "chain_link_creation_time" - AttributeKeyAckSuccess = "success" - AttributeKeyUser = "user" - AttributeKeyApplicationName = "application_name" - AttributeKeyApplicationUsername = "application_username" - AttributeKeyApplicationLinkCreationTime = "application_link_creation_time" - AttributeKeyOracleID = "oracle_id" - AttributeKeyClientID = "client_id" - AttributeKeyRequestID = "request_id" - AttributeKeyResolveStatus = "resolve_status" - AttributeKeyAck = "acknowledgement" - AttributeKeyAckError = "error" + AttributeKeyProfileDTag = "profile_dtag" + AttributeKeyProfileCreator = "profile_creator" + AttributeKeyProfileCreationTime = "profile_creation_time" + AttributeKeyRequestReceiver = "request_receiver" + AttributeKeyRequestSender = "request_sender" + AttributeKeyDTagToTrade = "dtag_to_trade" + AttributeKeyNewDTag = "new_dtag" + AttributeKeyChainLinkSourceAddress = "chain_link_account_target" + AttributeKeyChainLinkDestinationAddress = "chain_link_account_owner" + AttributeKeyChainLinkSourceChainName = "chain_link_source_chain_name" + AttributeKeyChainLinkCreationTime = "chain_link_creation_time" + AttributeKeyApplicationLinkExpirationTime = "application_link_expiration_time" + AttributeKeyAckSuccess = "success" + AttributeKeyUser = "user" + AttributeKeyApplicationName = "application_name" + AttributeKeyApplicationUsername = "application_username" + AttributeKeyApplicationLinkCreationTime = "application_link_creation_time" + AttributeKeyOracleID = "oracle_id" + AttributeKeyClientID = "client_id" + AttributeKeyRequestID = "request_id" + AttributeKeyRequestKey = "request_key" + AttributeKeyResolveStatus = "resolve_status" + AttributeKeyAck = "acknowledgement" + AttributeKeyAckError = "error" AttributeValueCategory = ModuleName ) diff --git a/x/profiles/types/genesis.pb.go b/x/profiles/types/genesis.pb.go index c576b9f79b..3bc417f368 100644 --- a/x/profiles/types/genesis.pb.go +++ b/x/profiles/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/genesis.proto +// source: desmos/profiles/v3/genesis.proto package types @@ -26,17 +26,17 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the profiles module's genesis state. type GenesisState struct { DTagTransferRequests []DTagTransferRequest `protobuf:"bytes,1,rep,name=dtag_transfer_requests,json=dtagTransferRequests,proto3" json:"dtag_transfer_requests" yaml:"dtag_transfer_requests"` - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params" yaml:"params"` - IBCPortID string `protobuf:"bytes,3,opt,name=ibc_port_id,json=ibcPortId,proto3" json:"ibc_port_id,omitempty" yaml:"ibc_port_id"` - ChainLinks []ChainLink `protobuf:"bytes,4,rep,name=chain_links,json=chainLinks,proto3" json:"chain_links" yaml:"chain_links"` - ApplicationLinks []ApplicationLink `protobuf:"bytes,5,rep,name=application_links,json=applicationLinks,proto3" json:"application_links" yaml:"application_links"` + ChainLinks []ChainLink `protobuf:"bytes,2,rep,name=chain_links,json=chainLinks,proto3" json:"chain_links" yaml:"chain_links"` + ApplicationLinks []ApplicationLink `protobuf:"bytes,3,rep,name=application_links,json=applicationLinks,proto3" json:"application_links" yaml:"application_links"` + IBCPortID string `protobuf:"bytes,4,opt,name=ibc_port_id,json=ibcPortId,proto3" json:"ibc_port_id,omitempty" yaml:"ibc_port_id"` + Params Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params" yaml:"params"` } func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_be71125223ae0fd1, []int{0} + return fileDescriptor_bd22d098f73f0a1c, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -66,42 +66,42 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo func init() { - proto.RegisterType((*GenesisState)(nil), "desmos.profiles.v2.GenesisState") + proto.RegisterType((*GenesisState)(nil), "desmos.profiles.v3.GenesisState") } -func init() { proto.RegisterFile("desmos/profiles/v2/genesis.proto", fileDescriptor_be71125223ae0fd1) } +func init() { proto.RegisterFile("desmos/profiles/v3/genesis.proto", fileDescriptor_bd22d098f73f0a1c) } -var fileDescriptor_be71125223ae0fd1 = []byte{ - // 463 bytes of a gzipped FileDescriptorProto +var fileDescriptor_bd22d098f73f0a1c = []byte{ + // 462 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xcf, 0x6a, 0xd4, 0x40, 0x1c, 0xc7, 0x13, 0xbb, 0x16, 0x36, 0xab, 0xa0, 0x61, 0x95, 0x10, 0x68, 0x12, 0x52, 0xb0, 0x2b, - 0xd2, 0x04, 0x57, 0x4f, 0x05, 0x0f, 0x66, 0x0b, 0xb2, 0xe8, 0xa1, 0xc4, 0x9e, 0x7a, 0x09, 0x93, - 0x64, 0x9a, 0x0e, 0x4d, 0x32, 0xe3, 0xcc, 0x74, 0xb1, 0x6f, 0xe0, 0x51, 0xf0, 0xea, 0xc1, 0xc7, - 0xe9, 0xb1, 0x47, 0x4f, 0x41, 0xb2, 0x6f, 0xb0, 0x4f, 0x20, 0x9b, 0x99, 0xd8, 0xe8, 0x66, 0xbd, - 0x85, 0xfc, 0x3e, 0xdf, 0x3f, 0x7c, 0x19, 0xcd, 0x49, 0x21, 0x2b, 0x30, 0xf3, 0x09, 0xc5, 0xe7, - 0x28, 0x87, 0xcc, 0x5f, 0x4c, 0xfd, 0x0c, 0x96, 0x90, 0x21, 0xe6, 0x11, 0x8a, 0x39, 0xd6, 0x75, - 0x41, 0x78, 0x2d, 0xe1, 0x2d, 0xa6, 0xe6, 0x38, 0xc3, 0x19, 0x6e, 0xce, 0xfe, 0xfa, 0x4b, 0x90, - 0xe6, 0xb3, 0x1e, 0xaf, 0x02, 0xa7, 0x30, 0x67, 0x11, 0x01, 0x14, 0x14, 0xd2, 0xd1, 0x3c, 0xf8, - 0x0f, 0x27, 0x7e, 0x49, 0xf0, 0x70, 0x3b, 0x98, 0x72, 0x90, 0x45, 0x14, 0x7e, 0xba, 0x82, 0x8c, - 0xb7, 0xbe, 0x2f, 0xb6, 0xe3, 0xc9, 0x05, 0x40, 0x65, 0x94, 0xa3, 0xf2, 0xb2, 0x85, 0x9f, 0x6f, - 0x87, 0x01, 0x21, 0x5d, 0xd4, 0xfd, 0x36, 0xd0, 0x1e, 0xbc, 0x13, 0x9b, 0x7c, 0xe4, 0x80, 0x43, - 0xfd, 0xbb, 0xaa, 0x3d, 0x6d, 0x0a, 0x70, 0x0a, 0x4a, 0x76, 0x0e, 0xe9, 0x9f, 0x26, 0x86, 0xea, - 0xec, 0x4c, 0x46, 0xd3, 0x03, 0x6f, 0x73, 0x34, 0xef, 0xf8, 0x14, 0x64, 0xa7, 0x52, 0x10, 0x0a, - 0x3e, 0x78, 0x73, 0x53, 0xd9, 0x4a, 0x5d, 0xd9, 0xe3, 0x9e, 0x23, 0x5b, 0x55, 0xf6, 0xde, 0x35, - 0x28, 0xf2, 0x23, 0xb7, 0x3f, 0xcc, 0x0d, 0xc7, 0xeb, 0xc3, 0xbf, 0x32, 0x7d, 0xae, 0xed, 0x8a, - 0xbd, 0x8d, 0x7b, 0x8e, 0x3a, 0x19, 0x4d, 0xcd, 0xbe, 0x36, 0x27, 0x0d, 0x11, 0x3c, 0x59, 0x17, - 0x58, 0x55, 0xf6, 0x43, 0x11, 0x24, 0x74, 0x6e, 0x28, 0x0d, 0xf4, 0x99, 0x36, 0x42, 0x71, 0x12, - 0x11, 0x4c, 0x79, 0x84, 0x52, 0x63, 0xc7, 0x51, 0x27, 0xc3, 0x60, 0xbf, 0xae, 0xec, 0xe1, 0x3c, - 0x98, 0x9d, 0x60, 0xca, 0xe7, 0xc7, 0xab, 0xca, 0xd6, 0x85, 0xb8, 0x43, 0xba, 0xe1, 0x10, 0xc5, - 0x49, 0x03, 0xa4, 0xfa, 0x99, 0x36, 0xea, 0xec, 0x6f, 0x0c, 0x9a, 0x89, 0xf6, 0xfa, 0x4a, 0xcd, - 0xd6, 0xd8, 0x07, 0x54, 0x5e, 0x06, 0xa6, 0xec, 0x25, 0xad, 0x3b, 0x7a, 0x37, 0xd4, 0x92, 0x16, - 0x63, 0x3a, 0xd5, 0x1e, 0x03, 0x42, 0x72, 0x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x4a, 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, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -124,6 +124,23 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.IBCPortID) > 0 { + i -= len(m.IBCPortID) + copy(dAtA[i:], m.IBCPortID) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.IBCPortID))) + i-- + dAtA[i] = 0x22 + } if len(m.ApplicationLinks) > 0 { for iNdEx := len(m.ApplicationLinks) - 1; iNdEx >= 0; iNdEx-- { { @@ -135,7 +152,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x1a } } if len(m.ChainLinks) > 0 { @@ -149,26 +166,9 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 - } - } - if len(m.IBCPortID) > 0 { - i -= len(m.IBCPortID) - copy(dAtA[i:], m.IBCPortID) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.IBCPortID))) - i-- - dAtA[i] = 0x1a - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + dAtA[i] = 0x12 } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x12 if len(m.DTagTransferRequests) > 0 { for iNdEx := len(m.DTagTransferRequests) - 1; iNdEx >= 0; iNdEx-- { { @@ -209,12 +209,6 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = len(m.IBCPortID) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } if len(m.ChainLinks) > 0 { for _, e := range m.ChainLinks { l = e.Size() @@ -227,6 +221,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + l = len(m.IBCPortID) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } @@ -301,7 +301,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainLinks", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -328,15 +328,16 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ChainLinks = append(m.ChainLinks, ChainLink{}) + if err := m.ChainLinks[len(m.ChainLinks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IBCPortID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ApplicationLinks", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -346,29 +347,31 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenesis } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - m.IBCPortID = string(dAtA[iNdEx:postIndex]) + m.ApplicationLinks = append(m.ApplicationLinks, ApplicationLink{}) + if err := m.ApplicationLinks[len(m.ApplicationLinks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainLinks", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IBCPortID", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -378,29 +381,27 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenesis } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainLinks = append(m.ChainLinks, ChainLink{}) - if err := m.ChainLinks[len(m.ChainLinks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.IBCPortID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApplicationLinks", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -427,8 +428,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ApplicationLinks = append(m.ApplicationLinks, ApplicationLink{}) - if err := m.ApplicationLinks[len(m.ApplicationLinks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/profiles/types/genesis_test.go b/x/profiles/types/genesis_test.go index 3e4b8324a3..3b28fc50f8 100644 --- a/x/profiles/types/genesis_test.go +++ b/x/profiles/types/genesis_test.go @@ -32,6 +32,7 @@ func TestValidateGenesis(t *testing.T) { types.DefaultDTagParams(), types.DefaultBioParams(), types.DefaultOracleParams(), + types.DefaultAppLinksParams(), ), types.IBCPortID, nil, @@ -102,6 +103,7 @@ func TestValidateGenesis(t *testing.T) { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), }, ), @@ -170,6 +172,7 @@ func TestValidateGenesis(t *testing.T) { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), ), }, ), diff --git a/x/profiles/types/keys.go b/x/profiles/types/keys.go index 31b284162f..59e6f22afe 100644 --- a/x/profiles/types/keys.go +++ b/x/profiles/types/keys.go @@ -3,6 +3,9 @@ package types import ( "bytes" "strings" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // DONTCOVER @@ -41,8 +44,9 @@ var ( ApplicationLinkPrefix = []byte{0x13} ApplicationLinkClientIDPrefix = []byte{0x14} - ChainLinkChainPrefix = []byte{0x15} - ApplicationLinkAppPrefix = []byte{0x16} + ChainLinkChainPrefix = []byte{0x15} + ApplicationLinkAppPrefix = []byte{0x16} + ExpiringAppLinkTimePrefix = []byte{0x17} ) // DTagStoreKey turns a DTag into the key used to store the address associated with it into the store @@ -146,3 +150,15 @@ func GetApplicationLinkOwnerData(key []byte) (application, username, owner strin values := bytes.Split(cleanedKey, Separator) return string(values[0]), string(values[1]), string(values[2]) } + +// ApplicationLinkExpiringTimePrefix returns the store prefix used to identify the +// expiration time for application links +func ApplicationLinkExpiringTimePrefix(expirationTime time.Time) []byte { + return append(ExpiringAppLinkTimePrefix, sdk.FormatTimeBytes(expirationTime)...) +} + +// ApplicationLinkExpiringTimeKey returns the key used to store the expirationTime +// of the application link associated with the given clientID +func ApplicationLinkExpiringTimeKey(expirationTime time.Time, clientID string) []byte { + return append(ApplicationLinkExpiringTimePrefix(expirationTime), []byte(clientID)...) +} diff --git a/x/profiles/types/models_app_links.go b/x/profiles/types/models_app_links.go index b9f0994d61..711a64d799 100644 --- a/x/profiles/types/models_app_links.go +++ b/x/profiles/types/models_app_links.go @@ -12,15 +12,16 @@ import ( // NewApplicationLink allows to build a new ApplicationLink instance func NewApplicationLink( - user string, data Data, state ApplicationLinkState, oracleRequest OracleRequest, result *Result, creationTime time.Time, + user string, data Data, state ApplicationLinkState, oracleRequest OracleRequest, result *Result, creationTime time.Time, expirationTime time.Time, ) ApplicationLink { return ApplicationLink{ - User: user, - Data: data, - State: state, - OracleRequest: oracleRequest, - Result: result, - CreationTime: creationTime, + User: user, + Data: data, + State: state, + OracleRequest: oracleRequest, + Result: result, + CreationTime: creationTime, + ExpirationTime: expirationTime, } } @@ -52,6 +53,14 @@ func (l ApplicationLink) Validate() error { return fmt.Errorf("invalid creation time: %s", l.CreationTime) } + if l.ExpirationTime.IsZero() { + return fmt.Errorf("invalid expiration time: %s", l.ExpirationTime) + } + + if l.ExpirationTime.Before(l.CreationTime) { + return fmt.Errorf("expiration time: %s cannot be before creation time: %s", l.ExpirationTime, l.CreationTime) + } + return nil } diff --git a/x/profiles/types/models_app_links.pb.go b/x/profiles/types/models_app_links.pb.go index 957c3be460..b844e6b796 100644 --- a/x/profiles/types/models_app_links.pb.go +++ b/x/profiles/types/models_app_links.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/models_app_links.proto +// source: desmos/profiles/v3/models_app_links.proto package types @@ -65,7 +65,7 @@ func (x ApplicationLinkState) String() string { } func (ApplicationLinkState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{0} + return fileDescriptor_e02d86ea3253bfd9, []int{0} } // ApplicationLink contains the data of a link to a centralized application @@ -75,7 +75,7 @@ type ApplicationLink struct { // Data contains the details of this specific link Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data" yaml:"data"` // State of the link - State ApplicationLinkState `protobuf:"varint,3,opt,name=state,proto3,enum=desmos.profiles.v2.ApplicationLinkState" json:"state,omitempty" yaml:"state"` + State ApplicationLinkState `protobuf:"varint,3,opt,name=state,proto3,enum=desmos.profiles.v3.ApplicationLinkState" json:"state,omitempty" yaml:"state"` // OracleRequest represents the request that has been made to the oracle OracleRequest OracleRequest `protobuf:"bytes,4,opt,name=oracle_request,json=oracleRequest,proto3" json:"oracle_request" yaml:"oracle_request"` // Data coming from the result of the verification. @@ -83,13 +83,15 @@ type ApplicationLink struct { Result *Result `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty" yaml:"result"` // CreationTime represents the time in which the link was created CreationTime time.Time `protobuf:"bytes,6,opt,name=creation_time,json=creationTime,proto3,stdtime" json:"creation_time" yaml:"creation_time"` + // ExpirationTime represents the time in which the link will expire + ExpirationTime time.Time `protobuf:"bytes,7,opt,name=expiration_time,json=expirationTime,proto3,stdtime" json:"expiration_time" yaml:"expiration_time"` } func (m *ApplicationLink) Reset() { *m = ApplicationLink{} } func (m *ApplicationLink) String() string { return proto.CompactTextString(m) } func (*ApplicationLink) ProtoMessage() {} func (*ApplicationLink) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{0} + return fileDescriptor_e02d86ea3253bfd9, []int{0} } func (m *ApplicationLink) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -131,7 +133,7 @@ func (m *Data) Reset() { *m = Data{} } func (m *Data) String() string { return proto.CompactTextString(m) } func (*Data) ProtoMessage() {} func (*Data) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{1} + return fileDescriptor_e02d86ea3253bfd9, []int{1} } func (m *Data) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -177,7 +179,7 @@ func (m *OracleRequest) Reset() { *m = OracleRequest{} } func (m *OracleRequest) String() string { return proto.CompactTextString(m) } func (*OracleRequest) ProtoMessage() {} func (*OracleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{2} + return fileDescriptor_e02d86ea3253bfd9, []int{2} } func (m *OracleRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -220,7 +222,7 @@ func (m *OracleRequest_CallData) Reset() { *m = OracleRequest_CallData{} func (m *OracleRequest_CallData) String() string { return proto.CompactTextString(m) } func (*OracleRequest_CallData) ProtoMessage() {} func (*OracleRequest_CallData) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{2, 0} + return fileDescriptor_e02d86ea3253bfd9, []int{2, 0} } func (m *OracleRequest_CallData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -278,7 +280,7 @@ func (m *Result) Reset() { *m = Result{} } func (m *Result) String() string { return proto.CompactTextString(m) } func (*Result) ProtoMessage() {} func (*Result) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{3} + return fileDescriptor_e02d86ea3253bfd9, []int{3} } func (m *Result) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -366,7 +368,7 @@ func (m *Result_Success) Reset() { *m = Result_Success{} } func (m *Result_Success) String() string { return proto.CompactTextString(m) } func (*Result_Success) ProtoMessage() {} func (*Result_Success) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{3, 0} + return fileDescriptor_e02d86ea3253bfd9, []int{3, 0} } func (m *Result_Success) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -406,7 +408,7 @@ func (m *Result_Failed) Reset() { *m = Result_Failed{} } func (m *Result_Failed) String() string { return proto.CompactTextString(m) } func (*Result_Failed) ProtoMessage() {} func (*Result_Failed) Descriptor() ([]byte, []int) { - return fileDescriptor_c4a613de86d4edc0, []int{3, 1} + return fileDescriptor_e02d86ea3253bfd9, []int{3, 1} } func (m *Result_Failed) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -436,83 +438,84 @@ func (m *Result_Failed) XXX_DiscardUnknown() { var xxx_messageInfo_Result_Failed proto.InternalMessageInfo func init() { - proto.RegisterEnum("desmos.profiles.v2.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) - proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.v2.ApplicationLink") - proto.RegisterType((*Data)(nil), "desmos.profiles.v2.Data") - proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.v2.OracleRequest") - proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.v2.OracleRequest.CallData") - proto.RegisterType((*Result)(nil), "desmos.profiles.v2.Result") - proto.RegisterType((*Result_Success)(nil), "desmos.profiles.v2.Result.Success") - proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.v2.Result.Failed") + proto.RegisterEnum("desmos.profiles.v3.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) + proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.v3.ApplicationLink") + proto.RegisterType((*Data)(nil), "desmos.profiles.v3.Data") + proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.v3.OracleRequest") + proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.v3.OracleRequest.CallData") + proto.RegisterType((*Result)(nil), "desmos.profiles.v3.Result") + proto.RegisterType((*Result_Success)(nil), "desmos.profiles.v3.Result.Success") + proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.v3.Result.Failed") } func init() { - proto.RegisterFile("desmos/profiles/v2/models_app_links.proto", fileDescriptor_c4a613de86d4edc0) -} - -var fileDescriptor_c4a613de86d4edc0 = []byte{ - // 961 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6e, 0xdb, 0x46, - 0x17, 0x15, 0x25, 0x5a, 0x91, 0xc6, 0xb1, 0xad, 0x6f, 0xec, 0xaf, 0x15, 0x08, 0x44, 0xa4, 0xe9, - 0xa2, 0x70, 0x52, 0x84, 0x44, 0xd4, 0x2e, 0x0a, 0x17, 0x2d, 0x20, 0x4a, 0x34, 0xc2, 0xc6, 0xb5, - 0x84, 0x11, 0x9d, 0x00, 0xd9, 0x10, 0x63, 0x72, 0xac, 0x12, 0xa1, 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 0x7e, 0x9d, 0x88, 0x85, 0xb9, 0x44, 0xca, 0x91, 0x11, 0xa5, 0xc2, 0x1e, 0x58, 0x0b, 0x23, - 0x1c, 0x91, 0x7a, 0x49, 0xe2, 0xf6, 0x37, 0x9b, 0xfb, 0xcb, 0x34, 0xfe, 0xe5, 0xad, 0x9f, 0xe2, - 0xb5, 0xda, 0x34, 0x11, 0x6f, 0x33, 0x3d, 0x2a, 0x20, 0x23, 0x26, 0x04, 0x07, 0x60, 0xd3, 0x0f, - 0xb0, 0xed, 0x11, 0x2b, 0x20, 0x3f, 0xc4, 0x24, 0x8c, 0xea, 0x3c, 0xb5, 0xb7, 0xbb, 0x4c, 0xba, - 0x4b, 0x91, 0x88, 0x01, 0xb5, 0x3b, 0x99, 0xcf, 0xff, 0x33, 0xdd, 0xeb, 0x32, 0x32, 0xda, 0xf0, - 0x17, 0xd1, 0x50, 0x07, 0xe5, 0x80, 0x84, 0xb1, 0x17, 0xd5, 0xd7, 0x68, 0x03, 0x61, 0x59, 0x03, - 0x44, 0x11, 0xda, 0xff, 0xa6, 0x89, 0xb8, 0xc1, 0x54, 0x19, 0x47, 0x46, 0x19, 0x19, 0x62, 0xb0, - 0x61, 0x07, 0x84, 0xde, 0xce, 0x4a, 0x93, 0xa9, 0x97, 0x33, 0x35, 0x16, 0x9b, 0x92, 0xc7, 0xa6, - 0x98, 0x79, 0x6c, 0x9a, 0x94, 0xf9, 0xdc, 0x61, 0x8a, 0xd7, 0xe8, 0xf2, 0xcb, 0xbf, 0x44, 0x0e, - 0xdd, 0xce, 0xcf, 0x52, 0xd2, 0x41, 0xe5, 0xc5, 0x2b, 0xb1, 0xf0, 0xf6, 0x95, 0xc8, 0xc9, 0x3f, - 0x03, 0x3e, 0x4d, 0x04, 0x7e, 0x09, 0xd6, 0xf1, 0x7c, 0xaa, 0x59, 0xca, 0x1f, 0x4d, 0x13, 0x11, - 0x32, 0xc9, 0x85, 0xa2, 0x8c, 0x16, 0xa1, 0x50, 0x05, 0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 0xe3, 0x30, 0x3f, 0xef, 0x9b, 0x2d, 0x64, 0xea, 0x9d, - 0x1a, 0x37, 0x53, 0x9d, 0xa9, 0x3d, 0x26, 0x81, 0x7b, 0x96, 0xb5, 0xe8, 0x47, 0x38, 0x88, 0x88, - 0x03, 0x7b, 0xe0, 0xee, 0x87, 0xa8, 0xea, 0x08, 0x75, 0x51, 0xad, 0x28, 0xec, 0x5e, 0x5c, 0x4a, - 0x77, 0x56, 0x69, 0xea, 0xe9, 0xd0, 0x3e, 0xd8, 0xe7, 0x49, 0xbb, 0xad, 0xf7, 0xfb, 0xb5, 0xd2, - 0x7b, 0x7c, 0x66, 0x2b, 0xf2, 0x2d, 0x90, 0x56, 0xa8, 0x9a, 0xc6, 0x77, 0x7a, 0xc7, 0xea, 0x9e, - 0x98, 0x35, 0x5e, 0xf8, 0xe4, 0xe2, 0x52, 0x92, 0x56, 0x49, 0xa5, 0xef, 0xa7, 0xd3, 0x8d, 0x23, - 0x81, 0x7f, 0xf1, 0x6b, 0xa3, 0xa0, 0x3d, 0x7a, 0x3d, 0x69, 0x70, 0x6f, 0x26, 0x0d, 0xee, 0xef, - 0x49, 0x83, 0x7b, 0x79, 0xd5, 0x28, 0xbc, 0xb9, 0x6a, 0x14, 0xfe, 0xbc, 0x6a, 0x14, 0x9e, 0x3e, - 0x18, 0xb8, 0xd1, 0xf7, 0xf1, 0xa9, 0x62, 0xfb, 0x43, 0x95, 0x2d, 0xf4, 0x7d, 0x0f, 0x9f, 0x86, - 0xd9, 0xb7, 0x7a, 0xfe, 0x85, 0xfa, 0xe3, 0xfc, 0x6f, 0x3d, 0x7a, 0x3e, 0x26, 0xe1, 0x69, 0x99, - 0x3e, 0xed, 0x9f, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x98, 0xb6, 0x49, 0xf6, 0x07, 0x00, - 0x00, + proto.RegisterFile("desmos/profiles/v3/models_app_links.proto", fileDescriptor_e02d86ea3253bfd9) +} + +var fileDescriptor_e02d86ea3253bfd9 = []byte{ + // 989 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x4f, 0xdc, 0x46, + 0x18, 0xde, 0x0f, 0xb3, 0xb0, 0x43, 0x80, 0xed, 0x40, 0xd3, 0x95, 0xa5, 0xac, 0x8d, 0xa9, 0x2a, + 0x92, 0x2a, 0xb6, 0x02, 0x3d, 0x54, 0x54, 0xad, 0xb4, 0xde, 0x35, 0x8a, 0x1b, 0x0a, 0x68, 0xd6, + 0x24, 0x52, 0x2e, 0xd6, 0x60, 0x0f, 0xdb, 0x51, 0xbc, 0x6b, 0xd7, 0x1f, 0x28, 0x69, 0xd5, 0x7b, + 0xc4, 0x29, 0x7f, 0x00, 0x29, 0x52, 0xff, 0x44, 0x6f, 0x3d, 0xf4, 0x92, 0x63, 0x7a, 0xeb, 0xc9, + 0xad, 0x96, 0x4b, 0xcf, 0xfb, 0x0b, 0x2a, 0xcf, 0xd8, 0xec, 0x12, 0x20, 0x44, 0xca, 0xcd, 0x3b, + 0xef, 0xf3, 0xf1, 0xce, 0x3c, 0xef, 0x8c, 0x16, 0xdc, 0x75, 0x49, 0x34, 0xf0, 0x23, 0x2d, 0x08, + 0xfd, 0x23, 0xea, 0x91, 0x48, 0x3b, 0xde, 0xd4, 0x06, 0xbe, 0x4b, 0xbc, 0xc8, 0xc6, 0x41, 0x60, + 0x7b, 0x74, 0xf8, 0x2c, 0x52, 0x83, 0xd0, 0x8f, 0x7d, 0x08, 0x39, 0x54, 0x2d, 0xa0, 0xea, 0xf1, + 0xa6, 0xb8, 0xd2, 0xf7, 0xfb, 0x3e, 0x2b, 0x6b, 0xd9, 0x17, 0x47, 0x8a, 0x52, 0xdf, 0xf7, 0xfb, + 0x1e, 0xd1, 0xd8, 0xaf, 0xc3, 0xe4, 0x48, 0x8b, 0xe9, 0x80, 0x44, 0x31, 0x1e, 0x04, 0x1c, 0x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 0xbd, 0x24, 0x16, 0x85, 0x97, 0xbf, 0xb5, + 0x4a, 0xfa, 0xa3, 0x37, 0xa3, 0x56, 0xf9, 0xed, 0xa8, 0x55, 0xfe, 0x77, 0xd4, 0x2a, 0xbf, 0x3a, + 0x6b, 0x95, 0xde, 0x9e, 0xb5, 0x4a, 0x7f, 0x9f, 0xb5, 0x4a, 0x4f, 0x1f, 0xf4, 0x69, 0xfc, 0x63, + 0x72, 0xa8, 0x3a, 0xfe, 0x40, 0xe3, 0x03, 0x7d, 0xdf, 0xc3, 0x87, 0x51, 0xfe, 0xad, 0x1d, 0x7f, + 0xa5, 0x3d, 0x9f, 0xfc, 0x7f, 0x88, 0x5f, 0x04, 0x24, 0x3a, 0xac, 0xb1, 0xe7, 0x7d, 0xf3, 0xff, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x89, 0xbe, 0x63, 0x5f, 0x08, 0x00, 0x00, } func (this *ApplicationLink) Equal(that interface{}) bool { @@ -552,6 +555,9 @@ func (this *ApplicationLink) Equal(that interface{}) bool { if !this.CreationTime.Equal(that1.CreationTime) { return false } + if !this.ExpirationTime.Equal(that1.ExpirationTime) { + return false + } return true } func (this *Data) Equal(that interface{}) bool { @@ -790,13 +796,21 @@ func (m *ApplicationLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpirationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime):]) if err1 != nil { return 0, err1 } i -= n1 i = encodeVarintModelsAppLinks(dAtA, i, uint64(n1)) i-- + dAtA[i] = 0x3a + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreationTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintModelsAppLinks(dAtA, i, uint64(n2)) + i-- dAtA[i] = 0x32 if m.Result != nil { { @@ -1144,6 +1158,8 @@ func (m *ApplicationLink) Size() (n int) { } l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreationTime) n += 1 + l + sovModelsAppLinks(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpirationTime) + n += 1 + l + sovModelsAppLinks(uint64(l)) return n } @@ -1489,6 +1505,39 @@ func (m *ApplicationLink) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsAppLinks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsAppLinks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsAppLinks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExpirationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipModelsAppLinks(dAtA[iNdEx:]) diff --git a/x/profiles/types/models_app_links_test.go b/x/profiles/types/models_app_links_test.go index 3b2b0c58cd..5836368713 100644 --- a/x/profiles/types/models_app_links_test.go +++ b/x/profiles/types/models_app_links_test.go @@ -32,6 +32,7 @@ func TestApplicationLink_Validate(t *testing.T) { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: true, }, @@ -52,6 +53,7 @@ func TestApplicationLink_Validate(t *testing.T) { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: true, }, @@ -72,6 +74,7 @@ func TestApplicationLink_Validate(t *testing.T) { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: true, }, @@ -92,6 +95,7 @@ func TestApplicationLink_Validate(t *testing.T) { ), nil, time.Time{}, + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: true, }, @@ -112,6 +116,7 @@ func TestApplicationLink_Validate(t *testing.T) { ), types.NewErrorResult(""), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: true, }, @@ -132,6 +137,49 @@ func TestApplicationLink_Validate(t *testing.T) { ), types.NewSuccessResult("value", "signature"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + ), + shouldErr: true, + }, + { + name: "invalid expiration time returns error", + link: types.NewApplicationLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + types.NewData("twitter", "twitteruser"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData( + "twitter", + "7B22757365726E616D65223A22526963636172646F4D222C22676973745F6964223A223732306530303732333930613930316262383065353966643630643766646564227D", + ), + "client_id", + ), + nil, + time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Time{}, + ), + shouldErr: true, + }, + { + name: "expiration time before creation time returns error", + link: types.NewApplicationLink( + "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", + types.NewData("twitter", "twitteruser"), + types.ApplicationLinkStateInitialized, + types.NewOracleRequest( + 0, + 1, + types.NewOracleRequestCallData( + "twitter", + "7B22757365726E616D65223A22526963636172646F4D222C22676973745F6964223A223732306530303732333930613930316262383065353966643630643766646564227D", + ), + "client_id", + ), + nil, + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: true, }, @@ -152,6 +200,7 @@ func TestApplicationLink_Validate(t *testing.T) { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2022, 1, 1, 00, 00, 00, 000, time.UTC), ), shouldErr: false, }, diff --git a/x/profiles/types/models_chain_links.pb.go b/x/profiles/types/models_chain_links.pb.go index 6f7bb4e608..0ff5906b89 100644 --- a/x/profiles/types/models_chain_links.pb.go +++ b/x/profiles/types/models_chain_links.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/models_chain_links.proto +// source: desmos/profiles/v3/models_chain_links.proto package types @@ -52,7 +52,7 @@ func (m *ChainLink) Reset() { *m = ChainLink{} } func (m *ChainLink) String() string { return proto.CompactTextString(m) } func (*ChainLink) ProtoMessage() {} func (*ChainLink) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{0} + return fileDescriptor_29bee920e792da29, []int{0} } func (m *ChainLink) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -90,7 +90,7 @@ func (m *ChainConfig) Reset() { *m = ChainConfig{} } func (m *ChainConfig) String() string { return proto.CompactTextString(m) } func (*ChainConfig) ProtoMessage() {} func (*ChainConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{1} + return fileDescriptor_29bee920e792da29, []int{1} } func (m *ChainConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -136,7 +136,7 @@ func (m *Proof) Reset() { *m = Proof{} } func (m *Proof) String() string { return proto.CompactTextString(m) } func (*Proof) ProtoMessage() {} func (*Proof) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{2} + return fileDescriptor_29bee920e792da29, []int{2} } func (m *Proof) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -177,7 +177,7 @@ func (m *Bech32Address) Reset() { *m = Bech32Address{} } func (m *Bech32Address) String() string { return proto.CompactTextString(m) } func (*Bech32Address) ProtoMessage() {} func (*Bech32Address) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{3} + return fileDescriptor_29bee920e792da29, []int{3} } func (m *Bech32Address) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -216,7 +216,7 @@ func (m *Base58Address) Reset() { *m = Base58Address{} } func (m *Base58Address) String() string { return proto.CompactTextString(m) } func (*Base58Address) ProtoMessage() {} func (*Base58Address) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{4} + return fileDescriptor_29bee920e792da29, []int{4} } func (m *Base58Address) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -259,7 +259,7 @@ func (m *HexAddress) Reset() { *m = HexAddress{} } func (m *HexAddress) String() string { return proto.CompactTextString(m) } func (*HexAddress) ProtoMessage() {} func (*HexAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{5} + return fileDescriptor_29bee920e792da29, []int{5} } func (m *HexAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -300,7 +300,7 @@ func (m *SingleSignatureData) Reset() { *m = SingleSignatureData{} } func (m *SingleSignatureData) String() string { return proto.CompactTextString(m) } func (*SingleSignatureData) ProtoMessage() {} func (*SingleSignatureData) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{6} + return fileDescriptor_29bee920e792da29, []int{6} } func (m *SingleSignatureData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -341,7 +341,7 @@ func (m *MultiSignatureData) Reset() { *m = MultiSignatureData{} } func (m *MultiSignatureData) String() string { return proto.CompactTextString(m) } func (*MultiSignatureData) ProtoMessage() {} func (*MultiSignatureData) Descriptor() ([]byte, []int) { - return fileDescriptor_1deb25c5b4df9624, []int{7} + return fileDescriptor_29bee920e792da29, []int{7} } func (m *MultiSignatureData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -371,25 +371,25 @@ func (m *MultiSignatureData) XXX_DiscardUnknown() { var xxx_messageInfo_MultiSignatureData proto.InternalMessageInfo func init() { - proto.RegisterType((*ChainLink)(nil), "desmos.profiles.v2.ChainLink") - proto.RegisterType((*ChainConfig)(nil), "desmos.profiles.v2.ChainConfig") - proto.RegisterType((*Proof)(nil), "desmos.profiles.v2.Proof") - proto.RegisterType((*Bech32Address)(nil), "desmos.profiles.v2.Bech32Address") - proto.RegisterType((*Base58Address)(nil), "desmos.profiles.v2.Base58Address") - proto.RegisterType((*HexAddress)(nil), "desmos.profiles.v2.HexAddress") - proto.RegisterType((*SingleSignatureData)(nil), "desmos.profiles.v2.SingleSignatureData") - proto.RegisterType((*MultiSignatureData)(nil), "desmos.profiles.v2.MultiSignatureData") + proto.RegisterType((*ChainLink)(nil), "desmos.profiles.v3.ChainLink") + proto.RegisterType((*ChainConfig)(nil), "desmos.profiles.v3.ChainConfig") + proto.RegisterType((*Proof)(nil), "desmos.profiles.v3.Proof") + proto.RegisterType((*Bech32Address)(nil), "desmos.profiles.v3.Bech32Address") + proto.RegisterType((*Base58Address)(nil), "desmos.profiles.v3.Base58Address") + proto.RegisterType((*HexAddress)(nil), "desmos.profiles.v3.HexAddress") + proto.RegisterType((*SingleSignatureData)(nil), "desmos.profiles.v3.SingleSignatureData") + proto.RegisterType((*MultiSignatureData)(nil), "desmos.profiles.v3.MultiSignatureData") } func init() { - proto.RegisterFile("desmos/profiles/v2/models_chain_links.proto", fileDescriptor_1deb25c5b4df9624) + proto.RegisterFile("desmos/profiles/v3/models_chain_links.proto", fileDescriptor_29bee920e792da29) } -var fileDescriptor_1deb25c5b4df9624 = []byte{ +var fileDescriptor_29bee920e792da29 = []byte{ // 793 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x4d, 0x4f, 0xeb, 0x46, 0x14, 0x8d, 0x0b, 0x81, 0x66, 0x92, 0x50, 0x18, 0x52, 0x29, 0x40, 0x15, 0x53, 0x23, 0xb5, 0x54, - 0x15, 0xb6, 0x08, 0x54, 0xad, 0xb2, 0x6a, 0x4c, 0x2b, 0x21, 0x01, 0x52, 0x6b, 0x58, 0x75, 0x13, + 0x15, 0xb6, 0x20, 0x54, 0xad, 0xb2, 0x6a, 0x4c, 0x2b, 0x21, 0x01, 0x52, 0x6b, 0x58, 0x75, 0x13, 0x8d, 0x9d, 0x89, 0x19, 0x61, 0x7b, 0x2c, 0x7b, 0x1c, 0x25, 0x52, 0xa5, 0x2e, 0xdb, 0x25, 0xcb, 0x2e, 0xba, 0xe0, 0x3f, 0xb4, 0x3f, 0x02, 0x75, 0x85, 0xba, 0x62, 0x95, 0x56, 0xb0, 0xe9, 0x3a, 0xbf, 0xe0, 0x69, 0x3e, 0x9c, 0x84, 0xf0, 0x40, 0x7a, 0xab, 0xb7, 0xf3, 0xdc, 0x7b, 0xce, 0x99, @@ -404,39 +404,39 @@ var fileDescriptor_1deb25c5b4df9624 = []byte{ 0xf8, 0x63, 0x01, 0x94, 0x8e, 0x78, 0xb9, 0xa7, 0x24, 0xba, 0x82, 0x3b, 0x60, 0x31, 0x4b, 0x71, 0x52, 0xd7, 0xb6, 0xb5, 0xdd, 0x92, 0xfd, 0xd1, 0x78, 0xa4, 0x97, 0x87, 0x28, 0x0c, 0x5a, 0x06, 0x8f, 0x1a, 0x8e, 0x48, 0xc2, 0x1f, 0xc1, 0x32, 0xea, 0x76, 0x13, 0x9c, 0xa6, 0xf5, 0x0f, 0xb6, - 0xb5, 0xdd, 0x72, 0xb3, 0x66, 0xca, 0xc2, 0xcc, 0xbc, 0x30, 0xb3, 0x1d, 0x0d, 0xed, 0x4f, 0xc7, - 0x23, 0x7d, 0x45, 0xb2, 0x15, 0xdc, 0xf8, 0xfb, 0xaf, 0xbd, 0x72, 0x5b, 0x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4, 0xd2, 0x33, + 0x27, 0x3b, 0x2e, 0xb7, 0x74, 0x44, 0xc3, 0x18, 0x79, 0xcc, 0x26, 0xac, 0xcd, 0x69, 0xce, 0x87, + 0xae, 0xfa, 0xe2, 0x73, 0x38, 0x31, 0xc3, 0xf7, 0xd9, 0xc2, 0x4b, 0x23, 0xed, 0xcc, 0xe0, 0x5e, + 0x71, 0x6d, 0x9f, 0xdc, 0x3e, 0x34, 0xb4, 0xbb, 0x87, 0x86, 0xf6, 0xdf, 0x43, 0x43, 0xbb, 0x7e, + 0x6c, 0x14, 0xee, 0x1e, 0x1b, 0x85, 0xfb, 0xc7, 0x46, 0xe1, 0xa7, 0x7d, 0x9f, 0xb0, 0xcb, 0xcc, + 0x35, 0x3d, 0x1a, 0x5a, 0x72, 0x23, 0xed, 0x05, 0xc8, 0x4d, 0xd5, 0xb7, 0xd5, 0x3f, 0xb4, 0x06, + 0xd3, 0x9f, 0x11, 0x1b, 0xc6, 0x38, 0x75, 0x97, 0x84, 0x83, 0xe6, 0x9b, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x32, 0xbc, 0x6e, 0x9d, 0xac, 0x06, 0x00, 0x00, } func (this *ChainLink) Equal(that interface{}) bool { diff --git a/x/profiles/types/models_dtag_requests.pb.go b/x/profiles/types/models_dtag_requests.pb.go index 646a367ef9..be2fb6c01b 100644 --- a/x/profiles/types/models_dtag_requests.pb.go +++ b/x/profiles/types/models_dtag_requests.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/models_dtag_requests.proto +// source: desmos/profiles/v3/models_dtag_requests.proto package types @@ -42,7 +42,7 @@ func (m *DTagTransferRequest) Reset() { *m = DTagTransferRequest{} } func (m *DTagTransferRequest) String() string { return proto.CompactTextString(m) } func (*DTagTransferRequest) ProtoMessage() {} func (*DTagTransferRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3722cfac854d7654, []int{0} + return fileDescriptor_3ee5a4443f48e795, []int{0} } func (m *DTagTransferRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -72,38 +72,37 @@ func (m *DTagTransferRequest) XXX_DiscardUnknown() { var xxx_messageInfo_DTagTransferRequest proto.InternalMessageInfo func init() { - proto.RegisterType((*DTagTransferRequest)(nil), "desmos.profiles.v2.DTagTransferRequest") + proto.RegisterType((*DTagTransferRequest)(nil), "desmos.profiles.v3.DTagTransferRequest") } func init() { - proto.RegisterFile("desmos/profiles/v2/models_dtag_requests.proto", fileDescriptor_3722cfac854d7654) + proto.RegisterFile("desmos/profiles/v3/models_dtag_requests.proto", fileDescriptor_3ee5a4443f48e795) } -var fileDescriptor_3722cfac854d7654 = []byte{ - // 355 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xb1, 0x4e, 0xe3, 0x40, - 0x10, 0x86, 0xbd, 0x77, 0x52, 0x74, 0xe7, 0x5c, 0x74, 0xc2, 0x49, 0x11, 0x52, 0x78, 0x91, 0x1b, - 0x40, 0x28, 0x5e, 0x11, 0xa8, 0x52, 0x46, 0x74, 0xe9, 0xac, 0x54, 0x34, 0xd6, 0xda, 0x9e, 0x38, - 0x16, 0xb6, 0xd7, 0xec, 0x6e, 0x2c, 0xf2, 0x06, 0x94, 0x94, 0x94, 0x79, 0x1c, 0x0a, 0x8a, 0x94, - 0x54, 0x16, 0x72, 0x1a, 0xea, 0x3c, 0x01, 0xb2, 0xd7, 0x01, 0x81, 0x44, 0x37, 0xff, 0xfc, 0xdf, - 0xcc, 0xee, 0xfc, 0xfa, 0x30, 0x00, 0x91, 0x30, 0x41, 0x32, 0xce, 0xe6, 0x51, 0x0c, 0x82, 0xe4, - 0x23, 0x92, 0xb0, 0x00, 0x62, 0xe1, 0x06, 0x92, 0x86, 0x2e, 0x87, 0xdb, 0x25, 0x08, 0x29, 0xec, - 0x8c, 0x33, 0xc9, 0x0c, 0x43, 0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x4b, 0x13, 0x3d, 0x6c, 0x4d, 0x6d, - 0xb3, 0x35, 0xb5, 0x97, 0xad, 0xa9, 0x5d, 0x9f, 0x87, 0x91, 0x5c, 0x2c, 0x3d, 0xdb, 0x67, 0x09, - 0x51, 0x01, 0x0d, 0x63, 0xea, 0x89, 0xa6, 0x26, 0xf9, 0x25, 0xb9, 0xfb, 0x4c, 0x4c, 0xae, 0x32, - 0x10, 0x5e, 0xab, 0x8e, 0xe8, 0xe2, 0x3d, 0x00, 0x00, 0xff, 0xff, 0x25, 0xaf, 0x47, 0x40, 0x01, - 0x02, 0x00, 0x00, +var fileDescriptor_3ee5a4443f48e795 = []byte{ + // 339 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x91, 0x31, 0x4f, 0xeb, 0x30, + 0x10, 0x80, 0xe3, 0xf7, 0xa4, 0xea, 0xbd, 0x94, 0x0a, 0x91, 0x76, 0x28, 0x1d, 0x62, 0x94, 0x05, + 0x18, 0x1a, 0x0b, 0x95, 0xa9, 0x63, 0xc5, 0xd6, 0x2d, 0xea, 0xc4, 0x12, 0x39, 0xcd, 0xd5, 0x44, + 0x4a, 0xea, 0x60, 0xbb, 0x11, 0xfd, 0x07, 0x8c, 0x8c, 0x8c, 0xfd, 0x39, 0x0c, 0x0c, 0x1d, 0x99, + 0x22, 0x94, 0x2e, 0xcc, 0xfd, 0x05, 0x28, 0x76, 0x0a, 0x82, 0xed, 0xee, 0xbe, 0xef, 0xce, 0xa7, + 0xb3, 0x3d, 0x8c, 0x41, 0x66, 0x5c, 0x92, 0x5c, 0xf0, 0x45, 0x92, 0x82, 0x24, 0xc5, 0x88, 0x64, + 0x3c, 0x86, 0x54, 0x86, 0xb1, 0xa2, 0x2c, 0x14, 0x70, 0xbf, 0x02, 0xa9, 0xa4, 0x9f, 0x0b, 0xae, + 0xb8, 0xe3, 0x18, 0xdd, 0x3f, 0xe8, 0x7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 0xf9, 0x73, 0x9e, 0x11, + 0x73, 0xf4, 0x61, 0x4a, 0x23, 0xd9, 0xc4, 0xa4, 0xb8, 0x26, 0x0f, 0xdf, 0x9f, 0xa6, 0xd6, 0x39, + 0xc8, 0xa8, 0xa5, 0x4f, 0x34, 0xfa, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x3c, 0xf2, 0x28, 0x40, 0xd4, + 0x01, 0x00, 0x00, } func (this *DTagTransferRequest) Equal(that interface{}) bool { diff --git a/x/profiles/types/models_packets.pb.go b/x/profiles/types/models_packets.pb.go index 5c777a7b39..4515d41f91 100644 --- a/x/profiles/types/models_packets.pb.go +++ b/x/profiles/types/models_packets.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/models_packets.proto +// source: desmos/profiles/v3/models_packets.proto package types @@ -46,7 +46,7 @@ func (m *LinkChainAccountPacketData) Reset() { *m = LinkChainAccountPack func (m *LinkChainAccountPacketData) String() string { return proto.CompactTextString(m) } func (*LinkChainAccountPacketData) ProtoMessage() {} func (*LinkChainAccountPacketData) Descriptor() ([]byte, []int) { - return fileDescriptor_7b1a8c7a3fceacd2, []int{0} + return fileDescriptor_ecd3778626d03f03, []int{0} } func (m *LinkChainAccountPacketData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -86,7 +86,7 @@ func (m *LinkChainAccountPacketAck) Reset() { *m = LinkChainAccountPacke func (m *LinkChainAccountPacketAck) String() string { return proto.CompactTextString(m) } func (*LinkChainAccountPacketAck) ProtoMessage() {} func (*LinkChainAccountPacketAck) Descriptor() ([]byte, []int) { - return fileDescriptor_7b1a8c7a3fceacd2, []int{1} + return fileDescriptor_ecd3778626d03f03, []int{1} } func (m *LinkChainAccountPacketAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -116,19 +116,19 @@ func (m *LinkChainAccountPacketAck) XXX_DiscardUnknown() { var xxx_messageInfo_LinkChainAccountPacketAck proto.InternalMessageInfo func init() { - proto.RegisterType((*LinkChainAccountPacketData)(nil), "desmos.profiles.v2.LinkChainAccountPacketData") - proto.RegisterType((*LinkChainAccountPacketAck)(nil), "desmos.profiles.v2.LinkChainAccountPacketAck") + proto.RegisterType((*LinkChainAccountPacketData)(nil), "desmos.profiles.v3.LinkChainAccountPacketData") + proto.RegisterType((*LinkChainAccountPacketAck)(nil), "desmos.profiles.v3.LinkChainAccountPacketAck") } func init() { - proto.RegisterFile("desmos/profiles/v2/models_packets.proto", fileDescriptor_7b1a8c7a3fceacd2) + proto.RegisterFile("desmos/profiles/v3/models_packets.proto", fileDescriptor_ecd3778626d03f03) } -var fileDescriptor_7b1a8c7a3fceacd2 = []byte{ +var fileDescriptor_ecd3778626d03f03 = []byte{ // 462 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x41, 0x8e, 0xd3, 0x30, 0x14, 0x4d, 0xa0, 0x20, 0x4d, 0x0a, 0x88, 0x49, 0x07, 0xa9, 0x2d, 0x52, 0x52, 0x45, 0x42, 0x54, - 0x42, 0x63, 0x8b, 0xc2, 0x6a, 0x76, 0xcd, 0xb0, 0x40, 0x02, 0x89, 0x51, 0x77, 0xb0, 0xa9, 0x5c, + 0x42, 0x63, 0x0b, 0xca, 0x6a, 0x76, 0xcd, 0xb0, 0x40, 0x02, 0x89, 0x51, 0x77, 0xb0, 0xa9, 0x5c, 0xc7, 0x4d, 0xad, 0xa6, 0xfe, 0x51, 0xec, 0x56, 0xf4, 0x06, 0x2c, 0x59, 0x70, 0x00, 0x0e, 0xc1, 0x21, 0x46, 0xac, 0x66, 0xc9, 0xaa, 0x42, 0xed, 0x0d, 0xe6, 0x04, 0x28, 0xb6, 0xcb, 0xa4, 0xb4, 0x68, 0x76, 0xfe, 0xff, 0xbd, 0xf7, 0xdf, 0xcf, 0xcb, 0xf7, 0x9e, 0x27, 0x4c, 0xce, 0x40, 0xe2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x96, 0x39, 0x93, 0xa3, 0xfb, 0xfa, 0xdc, 0x7a, + 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x12, 0xb2, 0x30, 0x23, 0x6c, 0x03, 0x00, 0x00, } func (m *LinkChainAccountPacketData) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/models_params.go b/x/profiles/types/models_params.go index 28926b9923..d4c8633769 100644 --- a/x/profiles/types/models_params.go +++ b/x/profiles/types/models_params.go @@ -3,6 +3,7 @@ package types import ( "fmt" "strings" + "time" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -11,17 +12,19 @@ import ( const ( // DefaultParamsSpace represents the default paramspace for the Params keeper - DefaultParamsSpace = ModuleName + DefaultParamsSpace = ModuleName + FourteenDaysCorrectionFactor = time.Hour * 24 * 14 // This value is the equivalent of 14 days in minutes ) // Default profile paramsModule var ( - DefaultMinNicknameLength = sdk.NewInt(2) - DefaultMaxNicknameLength = sdk.NewInt(1000) // Longest name on earth count 954 chars - DefaultRegEx = `^[A-Za-z0-9_]+$` - DefaultMinDTagLength = sdk.NewInt(3) - DefaultMaxDTagLength = sdk.NewInt(30) - DefaultMaxBioLength = sdk.NewInt(1000) + DefaultMinNicknameLength = sdk.NewInt(2) + DefaultMaxNicknameLength = sdk.NewInt(1000) // Longest name on earth count 954 chars + DefaultRegEx = `^[A-Za-z0-9_]+$` + DefaultMinDTagLength = sdk.NewInt(3) + DefaultMaxDTagLength = sdk.NewInt(30) + DefaultMaxBioLength = sdk.NewInt(1000) + DefaultAppLinksValidityDuration = time.Hour * 24 * 365 // 1 year ) // Parameters store keys @@ -30,6 +33,7 @@ var ( DTagParamsKey = []byte("DTagParams") BioParamsKey = []byte("MaxBioLen") OracleParamsKey = []byte("OracleParams") + AppLinksParamsKey = []byte("AppLinksParams") ) // ___________________________________________________________________________________________________________________ @@ -41,12 +45,13 @@ func ParamKeyTable() paramstypes.KeyTable { } // NewParams creates a new ProfileParams obj -func NewParams(nickname NicknameParams, dTag DTagParams, bio BioParams, oracle OracleParams) Params { +func NewParams(nickname NicknameParams, dTag DTagParams, bio BioParams, oracle OracleParams, appLinks AppLinksParams) Params { return Params{ Nickname: nickname, DTag: dTag, Bio: bio, Oracle: oracle, + AppLinks: appLinks, } } @@ -57,6 +62,7 @@ func DefaultParams() Params { DTag: DefaultDTagParams(), Bio: DefaultBioParams(), Oracle: DefaultOracleParams(), + AppLinks: DefaultAppLinksParams(), } } @@ -68,6 +74,7 @@ func (params *Params) ParamSetPairs() paramstypes.ParamSetPairs { paramstypes.NewParamSetPair(DTagParamsKey, ¶ms.DTag, ValidateDTagParams), paramstypes.NewParamSetPair(BioParamsKey, ¶ms.Bio, ValidateBioParams), paramstypes.NewParamSetPair(OracleParamsKey, ¶ms.Oracle, ValidateOracleParams), + paramstypes.NewParamSetPair(AppLinksParamsKey, ¶ms.AppLinks, ValidateAppLinksParams), } } @@ -85,7 +92,11 @@ func (params Params) Validate() error { return err } - return ValidateOracleParams(params.Oracle) + if err := ValidateOracleParams(params.Oracle); err != nil { + return err + } + + return ValidateAppLinksParams(params.AppLinks) } // ___________________________________________________________________________________________________________________ @@ -257,3 +268,28 @@ func ValidateOracleParams(i interface{}) error { return nil } + +// ___________________________________________________________________________________________________________________ + +func NewAppLinksParams(validityDuration time.Duration) AppLinksParams { + return AppLinksParams{ + ValidityDuration: validityDuration, + } +} + +func DefaultAppLinksParams() AppLinksParams { + return NewAppLinksParams(DefaultAppLinksValidityDuration) +} + +func ValidateAppLinksParams(i interface{}) error { + params, isAppLinksParams := i.(AppLinksParams) + if !isAppLinksParams { + return fmt.Errorf("invalid parameters type: %s", i) + } + + if params.ValidityDuration < FourteenDaysCorrectionFactor { + return fmt.Errorf("validity duration must be not less than 14 days: %s", params.ValidityDuration) + } + + return nil +} diff --git a/x/profiles/types/models_params.pb.go b/x/profiles/types/models_params.pb.go index dba5e08833..d0aa11e0a2 100644 --- a/x/profiles/types/models_params.pb.go +++ b/x/profiles/types/models_params.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/models_params.proto +// source: desmos/profiles/v3/models_params.proto package types @@ -9,15 +9,19 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -31,13 +35,14 @@ type Params struct { DTag DTagParams `protobuf:"bytes,2,opt,name=dtag,proto3" json:"dtag" yaml:"dtag"` Bio BioParams `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio" yaml:"bio"` Oracle OracleParams `protobuf:"bytes,4,opt,name=oracle,proto3" json:"oracle" yaml:"oracle"` + AppLinks AppLinksParams `protobuf:"bytes,5,opt,name=app_links,json=appLinks,proto3" json:"app_links" yaml:"app_links"` } func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_1b093f5fee9c9f7d, []int{0} + return fileDescriptor_924c89959f3aa975, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -76,7 +81,7 @@ func (m *NicknameParams) Reset() { *m = NicknameParams{} } func (m *NicknameParams) String() string { return proto.CompactTextString(m) } func (*NicknameParams) ProtoMessage() {} func (*NicknameParams) Descriptor() ([]byte, []int) { - return fileDescriptor_1b093f5fee9c9f7d, []int{1} + return fileDescriptor_924c89959f3aa975, []int{1} } func (m *NicknameParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -116,7 +121,7 @@ func (m *DTagParams) Reset() { *m = DTagParams{} } func (m *DTagParams) String() string { return proto.CompactTextString(m) } func (*DTagParams) ProtoMessage() {} func (*DTagParams) Descriptor() ([]byte, []int) { - return fileDescriptor_1b093f5fee9c9f7d, []int{2} + return fileDescriptor_924c89959f3aa975, []int{2} } func (m *DTagParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -154,7 +159,7 @@ func (m *BioParams) Reset() { *m = BioParams{} } func (m *BioParams) String() string { return proto.CompactTextString(m) } func (*BioParams) ProtoMessage() {} func (*BioParams) Descriptor() ([]byte, []int) { - return fileDescriptor_1b093f5fee9c9f7d, []int{3} + return fileDescriptor_924c89959f3aa975, []int{3} } func (m *BioParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -210,7 +215,7 @@ func (m *OracleParams) Reset() { *m = OracleParams{} } func (m *OracleParams) String() string { return proto.CompactTextString(m) } func (*OracleParams) ProtoMessage() {} func (*OracleParams) Descriptor() ([]byte, []int) { - return fileDescriptor_1b093f5fee9c9f7d, []int{4} + return fileDescriptor_924c89959f3aa975, []int{4} } func (m *OracleParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -239,64 +244,111 @@ func (m *OracleParams) XXX_DiscardUnknown() { var xxx_messageInfo_OracleParams proto.InternalMessageInfo +// AppLinksParams define the parameters related to the app links +type AppLinksParams struct { + // Default validity duration before an application link expires + ValidityDuration time.Duration `protobuf:"bytes,1,opt,name=validity_duration,json=validityDuration,proto3,stdduration" json:"validity_duration" yaml:"validity_duration"` +} + +func (m *AppLinksParams) Reset() { *m = AppLinksParams{} } +func (m *AppLinksParams) String() string { return proto.CompactTextString(m) } +func (*AppLinksParams) ProtoMessage() {} +func (*AppLinksParams) Descriptor() ([]byte, []int) { + return fileDescriptor_924c89959f3aa975, []int{5} +} +func (m *AppLinksParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AppLinksParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AppLinksParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AppLinksParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_AppLinksParams.Merge(m, src) +} +func (m *AppLinksParams) XXX_Size() int { + return m.Size() +} +func (m *AppLinksParams) XXX_DiscardUnknown() { + xxx_messageInfo_AppLinksParams.DiscardUnknown(m) +} + +var xxx_messageInfo_AppLinksParams proto.InternalMessageInfo + func init() { - proto.RegisterType((*Params)(nil), "desmos.profiles.v2.Params") - proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.v2.NicknameParams") - proto.RegisterType((*DTagParams)(nil), "desmos.profiles.v2.DTagParams") - proto.RegisterType((*BioParams)(nil), "desmos.profiles.v2.BioParams") - proto.RegisterType((*OracleParams)(nil), "desmos.profiles.v2.OracleParams") + proto.RegisterType((*Params)(nil), "desmos.profiles.v3.Params") + proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.v3.NicknameParams") + proto.RegisterType((*DTagParams)(nil), "desmos.profiles.v3.DTagParams") + proto.RegisterType((*BioParams)(nil), "desmos.profiles.v3.BioParams") + proto.RegisterType((*OracleParams)(nil), "desmos.profiles.v3.OracleParams") + proto.RegisterType((*AppLinksParams)(nil), "desmos.profiles.v3.AppLinksParams") } func init() { - proto.RegisterFile("desmos/profiles/v2/models_params.proto", fileDescriptor_1b093f5fee9c9f7d) + proto.RegisterFile("desmos/profiles/v3/models_params.proto", fileDescriptor_924c89959f3aa975) } -var fileDescriptor_1b093f5fee9c9f7d = []byte{ - // 697 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcb, 0x6e, 0xd3, 0x4c, - 0x14, 0xc7, 0x93, 0xd8, 0x8d, 0xe2, 0x49, 0xbf, 0x0f, 0x6a, 0x15, 0x08, 0x45, 0xd8, 0xd1, 0x2c, - 0xaa, 0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, 0xdf, 0x00, 0x70, 0x88, 0xb1, 0x87, 0x62, 0xbe, 0xcb, 0x6a, 0x53, - 0x69, 0xd5, 0x3b, 0xb7, 0x2d, 0x31, 0x78, 0x8b, 0x5d, 0x93, 0x96, 0xbc, 0x26, 0xad, 0x2e, 0x89, - 0x12, 0x67, 0x57, 0x7e, 0xf4, 0xd2, 0x82, 0x85, 0x14, 0x7e, 0xfc, 0x66, 0xb6, 0xae, 0xe0, 0x20, - 0xa3, 0x50, 0x57, 0x3b, 0xc4, 0xf8, 0x11, 0xd7, 0x09, 0xbb, 0x9c, 0x27, 0x27, 0x13, 0xa3, 0x7c, - 0x3a, 0x31, 0xca, 0xdf, 0x27, 0x46, 0xf9, 0xdd, 0x99, 0x51, 0x3a, 0x3d, 0x33, 0x4a, 0x5f, 0xce, - 0x8c, 0xd2, 0xeb, 0xf6, 0x12, 0x54, 0x5c, 0x49, 0x5b, 0x03, 0xe4, 0x53, 0x19, 0xdb, 0xa3, 0xfb, - 0xf6, 0x78, 0xf1, 0x07, 0xc1, 0x7b, 0xf8, 0x55, 0x7e, 0x99, 0xdf, 0xfb, 0x11, 0x00, 0x00, 0xff, - 0xff, 0xfb, 0x86, 0xa5, 0xb7, 0x40, 0x06, 0x00, 0x00, +var fileDescriptor_924c89959f3aa975 = []byte{ + // 804 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0xc7, 0xe3, 0x3a, 0x8d, 0xe2, 0xc9, 0xb2, 0x6c, 0xad, 0x05, 0xb2, 0x8b, 0xb0, 0xa3, 0x11, + 0x5a, 0xe5, 0xb2, 0xb6, 0xb2, 0x45, 0x42, 0x5a, 0x89, 0xc3, 0x3a, 0x5d, 0xa1, 0x8a, 0x85, 0xae, + 0x0c, 0x12, 0x82, 0x8b, 0x35, 0xb6, 0x27, 0xee, 0x28, 0xb6, 0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0xec, 0x0e, 0xff, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x27, 0x48, 0xa2, 0xab, + 0x42, 0x07, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -319,6 +371,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.AppLinks.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModelsParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a { size, err := m.Oracle.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -550,6 +612,37 @@ func (m *OracleParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *AppLinksParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AppLinksParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AppLinksParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ValidityDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidityDuration):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintModelsParams(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintModelsParams(dAtA []byte, offset int, v uint64) int { offset -= sovModelsParams(v) base := offset @@ -575,6 +668,8 @@ func (m *Params) Size() (n int) { n += 1 + l + sovModelsParams(uint64(l)) l = m.Oracle.Size() n += 1 + l + sovModelsParams(uint64(l)) + l = m.AppLinks.Size() + n += 1 + l + sovModelsParams(uint64(l)) return n } @@ -649,6 +744,17 @@ func (m *OracleParams) Size() (n int) { return n } +func (m *AppLinksParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidityDuration) + n += 1 + l + sovModelsParams(uint64(l)) + return n +} + func sovModelsParams(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -816,6 +922,39 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppLinks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AppLinks.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipModelsParams(dAtA[iNdEx:]) @@ -1363,6 +1502,89 @@ func (m *OracleParams) Unmarshal(dAtA []byte) error { } return nil } +func (m *AppLinksParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AppLinksParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AppLinksParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidityDuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelsParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModelsParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModelsParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.ValidityDuration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModelsParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModelsParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipModelsParams(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/profiles/types/models_params_test.go b/x/profiles/types/models_params_test.go index 9baeda38f1..d59ba594b6 100644 --- a/x/profiles/types/models_params_test.go +++ b/x/profiles/types/models_params_test.go @@ -2,6 +2,7 @@ package types_test import ( "testing" + "time" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -22,6 +23,7 @@ func TestValidateParams(t *testing.T) { types.DefaultDTagParams(), types.DefaultBioParams(), types.DefaultOracleParams(), + types.DefaultAppLinksParams(), ), shouldErr: true, }, @@ -32,6 +34,7 @@ func TestValidateParams(t *testing.T) { types.NewDTagParams("regEx", sdk.NewInt(3), sdk.NewInt(-30)), types.DefaultBioParams(), types.DefaultOracleParams(), + types.DefaultAppLinksParams(), ), shouldErr: true, }, @@ -42,6 +45,7 @@ func TestValidateParams(t *testing.T) { types.DefaultDTagParams(), types.NewBioParams(sdk.NewInt(-1000)), types.DefaultOracleParams(), + types.DefaultAppLinksParams(), ), shouldErr: true, }, @@ -58,7 +62,19 @@ func TestValidateParams(t *testing.T) { 0, 0, sdk.NewCoins()..., - )), + ), + types.DefaultAppLinksParams()), + shouldErr: true, + }, + { + name: "invalid app links params return error", + params: types.NewParams( + types.DefaultNicknameParams(), + types.DefaultDTagParams(), + types.DefaultBioParams(), + types.DefaultOracleParams(), + types.NewAppLinksParams(time.Duration(0)), + ), shouldErr: true, }, { @@ -68,6 +84,7 @@ func TestValidateParams(t *testing.T) { types.DefaultDTagParams(), types.DefaultBioParams(), types.DefaultOracleParams(), + types.DefaultAppLinksParams(), ), shouldErr: false, }, @@ -197,6 +214,7 @@ func TestValidateBioParams(t *testing.T) { }) } } + func TestValidateOracleParams(t *testing.T) { testCases := []struct { name string @@ -290,3 +308,35 @@ func TestValidateOracleParams(t *testing.T) { }) } } + +func TestValidateAppLinksParams(t *testing.T) { + testCases := []struct { + name string + params types.AppLinksParams + shouldErr bool + }{ + { + name: "time duration zero returns error", + params: types.NewAppLinksParams(time.Duration(0)), + shouldErr: true, + }, + { + name: "valid params return no error", + params: types.DefaultAppLinksParams(), + shouldErr: false, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + err := types.ValidateAppLinksParams(tc.params) + + if tc.shouldErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/profiles/types/models_profile.pb.go b/x/profiles/types/models_profile.pb.go index f75eecf8f7..9dec791f16 100644 --- a/x/profiles/types/models_profile.pb.go +++ b/x/profiles/types/models_profile.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/models_profile.proto +// source: desmos/profiles/v3/models_profile.proto package types @@ -49,7 +49,7 @@ type Profile struct { func (m *Profile) Reset() { *m = Profile{} } func (*Profile) ProtoMessage() {} func (*Profile) Descriptor() ([]byte, []int) { - return fileDescriptor_089dd63594c4b06b, []int{0} + return fileDescriptor_0064ca3ec5b2e1f8, []int{0} } func (m *Profile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -90,7 +90,7 @@ func (m *Pictures) Reset() { *m = Pictures{} } func (m *Pictures) String() string { return proto.CompactTextString(m) } func (*Pictures) ProtoMessage() {} func (*Pictures) Descriptor() ([]byte, []int) { - return fileDescriptor_089dd63594c4b06b, []int{1} + return fileDescriptor_0064ca3ec5b2e1f8, []int{1} } func (m *Pictures) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -134,48 +134,47 @@ func (m *Pictures) GetCover() string { } func init() { - proto.RegisterType((*Profile)(nil), "desmos.profiles.v2.Profile") - proto.RegisterType((*Pictures)(nil), "desmos.profiles.v2.Pictures") + proto.RegisterType((*Profile)(nil), "desmos.profiles.v3.Profile") + proto.RegisterType((*Pictures)(nil), "desmos.profiles.v3.Pictures") } func init() { - proto.RegisterFile("desmos/profiles/v2/models_profile.proto", fileDescriptor_089dd63594c4b06b) + proto.RegisterFile("desmos/profiles/v3/models_profile.proto", fileDescriptor_0064ca3ec5b2e1f8) } -var fileDescriptor_089dd63594c4b06b = []byte{ - // 497 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0x6d, 0x9a, 0x36, 0xee, 0x35, 0x14, 0x74, 0x44, 0xaa, 0x89, 0x90, 0x2f, 0xba, 0x01, - 0x2a, 0x95, 0xfa, 0x44, 0x60, 0x8a, 0x58, 0x6a, 0x75, 0x41, 0x2c, 0xc5, 0xea, 0xc4, 0x12, 0x9d, - 0x9d, 0xab, 0x7b, 0xd4, 0xf6, 0x45, 0xf1, 0x25, 0x22, 0x9f, 0x00, 0xc6, 0x8e, 0x1d, 0xf3, 0x21, - 0xf8, 0x10, 0x15, 0x53, 0x47, 0x26, 0x83, 0x92, 0x85, 0xd9, 0x9f, 0x00, 0xd9, 0x77, 0xd7, 0x0a, - 0x2a, 0x36, 0xdf, 0xfb, 0xff, 0xde, 0xff, 0xfd, 0xf5, 0x9e, 0xc1, 0x8b, 0x31, 0x2b, 0x32, 0x51, - 0x90, 0xc9, 0x54, 0x9c, 0xf1, 0x94, 0x15, 0x64, 0x3e, 0x20, 0x99, 0x18, 0xb3, 0xb4, 0x18, 0xe9, - 0x92, 0x3f, 0x99, 0x0a, 0x29, 0x20, 0x54, 0xa0, 0x6f, 0x40, 0x7f, 0x3e, 0xe8, 0x75, 0x13, 0x91, - 0x88, 0x46, 0x26, 0xf5, 0x97, 0x22, 0x7b, 0x4f, 0x13, 0x21, 0x92, 0x94, 0x91, 0xe6, 0x15, 0xcd, - 0xce, 0x08, 0xcd, 0x17, 0x5a, 0x42, 0xff, 0x4a, 0x92, 0x67, 0xac, 0x90, 0x34, 0x9b, 0x98, 0xde, - 0x58, 0xd4, 0x53, 0x46, 0xca, 0x54, 0x3d, 0xb4, 0x74, 0xf0, 0xff, 0xa4, 0xf1, 0x39, 0xe5, 0xf9, - 0x28, 0xe5, 0xf9, 0x85, 0x86, 0xf1, 0x97, 0x0d, 0xd0, 0x3e, 0x51, 0x20, 0x7c, 0x0b, 0xda, 0x34, - 0x8e, 0xc5, 0x2c, 0x97, 0xae, 0xdd, 0xb7, 0xf7, 0x77, 0x06, 0x5d, 0x5f, 0xc5, 0xf0, 0x4d, 0x0c, - 0xff, 0x28, 0x5f, 0x04, 0x9d, 0xef, 0xdf, 0x0e, 0x9d, 0x23, 0x05, 0xbe, 0x0b, 0x4d, 0x0b, 0x3c, - 0x00, 0xad, 0xb1, 0xa4, 0x89, 0xfb, 0xa0, 0x6f, 0xef, 0x6f, 0x07, 0x7b, 0xab, 0x12, 0xb5, 0x8e, - 0x4f, 0x69, 0x52, 0x95, 0x68, 0x67, 0x41, 0xb3, 0x74, 0x88, 0x6b, 0x15, 0x87, 0x0d, 0x04, 0x09, - 0x70, 0x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, 0xb3, 0x6e, 0xd6, 0x9e, 0xf5, 0x63, 0xed, - 0x59, 0x1f, 0x5f, 0x25, 0x5c, 0x9e, 0xcf, 0x22, 0x3f, 0x16, 0x19, 0x51, 0xdb, 0x3b, 0x4c, 0x69, - 0x54, 0xe8, 0x6f, 0x32, 0x7f, 0x43, 0x3e, 0xdf, 0xfd, 0x58, 0x72, 0x31, 0x61, 0x45, 0xb4, 0xd5, - 0xac, 0xe1, 0xf5, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xe4, 0xad, 0x2b, 0x22, 0x03, 0x00, - 0x00, +var fileDescriptor_0064ca3ec5b2e1f8 = []byte{ + // 482 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0xb1, 0x6e, 0xd3, 0x40, + 0x1c, 0xc6, 0x6d, 0x92, 0x36, 0xee, 0x35, 0x14, 0x74, 0x44, 0xaa, 0x89, 0x90, 0x2f, 0xba, 0x01, + 0x2a, 0x41, 0x7d, 0x82, 0x30, 0x45, 0x2c, 0xb5, 0xba, 0x20, 0x96, 0x62, 0x75, 0x62, 0x89, 0xce, + 0xce, 0xd5, 0x18, 0x6c, 0x9f, 0x65, 0x5f, 0x22, 0xf2, 0x04, 0x30, 0x76, 0xec, 0x98, 0x87, 0xe0, + 0x21, 0x2a, 0xa6, 0x8e, 0x4c, 0x06, 0x25, 0x0b, 0xb3, 0x9f, 0x00, 0xd9, 0x77, 0xd7, 0x0a, 0xb2, + 0xdd, 0xdd, 0xf7, 0xfb, 0xbe, 0xff, 0x5f, 0x9f, 0x0d, 0x9e, 0xcd, 0x58, 0x99, 0xf2, 0x92, 0xe4, + 0x05, 0xbf, 0x88, 0x13, 0x56, 0x92, 0xc5, 0x98, 0xa4, 0x7c, 0xc6, 0x92, 0x72, 0xaa, 0x9e, 0xdc, + 0xbc, 0xe0, 0x82, 0x43, 0x28, 0x41, 0x57, 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pictures) Equal(that interface{}) bool { diff --git a/x/profiles/types/msg_server.pb.go b/x/profiles/types/msg_server.pb.go index 3a5de974ab..9d1f30e42d 100644 --- a/x/profiles/types/msg_server.pb.go +++ b/x/profiles/types/msg_server.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/msg_server.proto +// source: desmos/profiles/v3/msg_server.proto package types @@ -29,41 +29,41 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { - proto.RegisterFile("desmos/profiles/v2/msg_server.proto", fileDescriptor_c2fd53889ce3d02c) + proto.RegisterFile("desmos/profiles/v3/msg_server.proto", fileDescriptor_869194438e2ecf0d) } -var fileDescriptor_c2fd53889ce3d02c = []byte{ +var fileDescriptor_869194438e2ecf0d = []byte{ // 477 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xcf, 0x6e, 0xd3, 0x30, 0x1c, 0xc7, 0x5b, 0x21, 0x21, 0x61, 0x84, 0x00, 0xc3, 0x65, 0x3e, 0xe4, 0xc0, 0xbf, 0x31, 0x60, - 0xf1, 0x56, 0x38, 0x70, 0x2d, 0xdb, 0x0d, 0x26, 0xa1, 0x32, 0x2e, 0x48, 0xa8, 0x72, 0xdd, 0x5f, - 0xbd, 0x68, 0xae, 0x6d, 0x62, 0x27, 0x62, 0x4f, 0xc0, 0x95, 0x07, 0xe0, 0x81, 0x38, 0xee, 0xc8, - 0x11, 0xb5, 0x2f, 0x82, 0x12, 0xb7, 0x21, 0xed, 0xe2, 0x2e, 0xbd, 0xd9, 0xf9, 0x7d, 0xbe, 0x7f, + 0xf1, 0xb6, 0x72, 0xe0, 0x5a, 0xb6, 0x1b, 0x4c, 0x42, 0x65, 0x5c, 0x90, 0x50, 0xe5, 0xba, 0xbf, + 0x7a, 0xd1, 0x5c, 0xdb, 0xc4, 0x4e, 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d, 0xdc, 0xa5, 0x01, 0x3b, 0xba, 0x59, 0x3e, 0x79, 0xbd, 0xbf, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x12, 0xeb, 0x12, 0x96, 0x79, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -117,7 +117,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) SaveProfile(ctx context.Context, in *MsgSaveProfile, opts ...grpc.CallOption) (*MsgSaveProfileResponse, error) { out := new(MsgSaveProfileResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/SaveProfile", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/SaveProfile", in, out, opts...) if err != nil { return nil, err } @@ -126,7 +126,7 @@ func (c *msgClient) SaveProfile(ctx context.Context, in *MsgSaveProfile, opts .. func (c *msgClient) DeleteProfile(ctx context.Context, in *MsgDeleteProfile, opts ...grpc.CallOption) (*MsgDeleteProfileResponse, error) { out := new(MsgDeleteProfileResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/DeleteProfile", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/DeleteProfile", in, out, opts...) if err != nil { return nil, err } @@ -135,7 +135,7 @@ func (c *msgClient) DeleteProfile(ctx context.Context, in *MsgDeleteProfile, opt func (c *msgClient) RequestDTagTransfer(ctx context.Context, in *MsgRequestDTagTransfer, opts ...grpc.CallOption) (*MsgRequestDTagTransferResponse, error) { out := new(MsgRequestDTagTransferResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/RequestDTagTransfer", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/RequestDTagTransfer", in, out, opts...) if err != nil { return nil, err } @@ -144,7 +144,7 @@ func (c *msgClient) RequestDTagTransfer(ctx context.Context, in *MsgRequestDTagT func (c *msgClient) CancelDTagTransferRequest(ctx context.Context, in *MsgCancelDTagTransferRequest, opts ...grpc.CallOption) (*MsgCancelDTagTransferRequestResponse, error) { out := new(MsgCancelDTagTransferRequestResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/CancelDTagTransferRequest", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/CancelDTagTransferRequest", in, out, opts...) if err != nil { return nil, err } @@ -153,7 +153,7 @@ func (c *msgClient) CancelDTagTransferRequest(ctx context.Context, in *MsgCancel func (c *msgClient) AcceptDTagTransferRequest(ctx context.Context, in *MsgAcceptDTagTransferRequest, opts ...grpc.CallOption) (*MsgAcceptDTagTransferRequestResponse, error) { out := new(MsgAcceptDTagTransferRequestResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/AcceptDTagTransferRequest", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/AcceptDTagTransferRequest", in, out, opts...) if err != nil { return nil, err } @@ -162,7 +162,7 @@ func (c *msgClient) AcceptDTagTransferRequest(ctx context.Context, in *MsgAccept func (c *msgClient) RefuseDTagTransferRequest(ctx context.Context, in *MsgRefuseDTagTransferRequest, opts ...grpc.CallOption) (*MsgRefuseDTagTransferRequestResponse, error) { out := new(MsgRefuseDTagTransferRequestResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/RefuseDTagTransferRequest", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/RefuseDTagTransferRequest", in, out, opts...) if err != nil { return nil, err } @@ -171,7 +171,7 @@ func (c *msgClient) RefuseDTagTransferRequest(ctx context.Context, in *MsgRefuse func (c *msgClient) LinkChainAccount(ctx context.Context, in *MsgLinkChainAccount, opts ...grpc.CallOption) (*MsgLinkChainAccountResponse, error) { out := new(MsgLinkChainAccountResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/LinkChainAccount", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/LinkChainAccount", in, out, opts...) if err != nil { return nil, err } @@ -180,7 +180,7 @@ func (c *msgClient) LinkChainAccount(ctx context.Context, in *MsgLinkChainAccoun func (c *msgClient) UnlinkChainAccount(ctx context.Context, in *MsgUnlinkChainAccount, opts ...grpc.CallOption) (*MsgUnlinkChainAccountResponse, error) { out := new(MsgUnlinkChainAccountResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/UnlinkChainAccount", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/UnlinkChainAccount", in, out, opts...) if err != nil { return nil, err } @@ -189,7 +189,7 @@ func (c *msgClient) UnlinkChainAccount(ctx context.Context, in *MsgUnlinkChainAc func (c *msgClient) LinkApplication(ctx context.Context, in *MsgLinkApplication, opts ...grpc.CallOption) (*MsgLinkApplicationResponse, error) { out := new(MsgLinkApplicationResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/LinkApplication", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/LinkApplication", in, out, opts...) if err != nil { return nil, err } @@ -198,7 +198,7 @@ func (c *msgClient) LinkApplication(ctx context.Context, in *MsgLinkApplication, func (c *msgClient) UnlinkApplication(ctx context.Context, in *MsgUnlinkApplication, opts ...grpc.CallOption) (*MsgUnlinkApplicationResponse, error) { out := new(MsgUnlinkApplicationResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Msg/UnlinkApplication", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Msg/UnlinkApplication", in, out, opts...) if err != nil { return nil, err } @@ -285,7 +285,7 @@ func _Msg_SaveProfile_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/SaveProfile", + FullMethod: "/desmos.profiles.v3.Msg/SaveProfile", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).SaveProfile(ctx, req.(*MsgSaveProfile)) @@ -303,7 +303,7 @@ func _Msg_DeleteProfile_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/DeleteProfile", + FullMethod: "/desmos.profiles.v3.Msg/DeleteProfile", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).DeleteProfile(ctx, req.(*MsgDeleteProfile)) @@ -321,7 +321,7 @@ func _Msg_RequestDTagTransfer_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/RequestDTagTransfer", + FullMethod: "/desmos.profiles.v3.Msg/RequestDTagTransfer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).RequestDTagTransfer(ctx, req.(*MsgRequestDTagTransfer)) @@ -339,7 +339,7 @@ func _Msg_CancelDTagTransferRequest_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/CancelDTagTransferRequest", + FullMethod: "/desmos.profiles.v3.Msg/CancelDTagTransferRequest", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).CancelDTagTransferRequest(ctx, req.(*MsgCancelDTagTransferRequest)) @@ -357,7 +357,7 @@ func _Msg_AcceptDTagTransferRequest_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/AcceptDTagTransferRequest", + FullMethod: "/desmos.profiles.v3.Msg/AcceptDTagTransferRequest", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).AcceptDTagTransferRequest(ctx, req.(*MsgAcceptDTagTransferRequest)) @@ -375,7 +375,7 @@ func _Msg_RefuseDTagTransferRequest_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/RefuseDTagTransferRequest", + FullMethod: "/desmos.profiles.v3.Msg/RefuseDTagTransferRequest", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).RefuseDTagTransferRequest(ctx, req.(*MsgRefuseDTagTransferRequest)) @@ -393,7 +393,7 @@ func _Msg_LinkChainAccount_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/LinkChainAccount", + FullMethod: "/desmos.profiles.v3.Msg/LinkChainAccount", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).LinkChainAccount(ctx, req.(*MsgLinkChainAccount)) @@ -411,7 +411,7 @@ func _Msg_UnlinkChainAccount_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/UnlinkChainAccount", + FullMethod: "/desmos.profiles.v3.Msg/UnlinkChainAccount", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).UnlinkChainAccount(ctx, req.(*MsgUnlinkChainAccount)) @@ -429,7 +429,7 @@ func _Msg_LinkApplication_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/LinkApplication", + FullMethod: "/desmos.profiles.v3.Msg/LinkApplication", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).LinkApplication(ctx, req.(*MsgLinkApplication)) @@ -447,7 +447,7 @@ func _Msg_UnlinkApplication_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Msg/UnlinkApplication", + FullMethod: "/desmos.profiles.v3.Msg/UnlinkApplication", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).UnlinkApplication(ctx, req.(*MsgUnlinkApplication)) @@ -456,7 +456,7 @@ func _Msg_UnlinkApplication_Handler(srv interface{}, ctx context.Context, dec fu } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "desmos.profiles.v2.Msg", + ServiceName: "desmos.profiles.v3.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -501,5 +501,5 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "desmos/profiles/v2/msg_server.proto", + Metadata: "desmos/profiles/v3/msg_server.proto", } diff --git a/x/profiles/types/msgs_app_links.pb.go b/x/profiles/types/msgs_app_links.pb.go index 9e590db667..1aaf759a0d 100644 --- a/x/profiles/types/msgs_app_links.pb.go +++ b/x/profiles/types/msgs_app_links.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/msgs_app_links.proto +// source: desmos/profiles/v3/msgs_app_links.proto package types @@ -50,7 +50,7 @@ func (m *MsgLinkApplication) Reset() { *m = MsgLinkApplication{} } func (m *MsgLinkApplication) String() string { return proto.CompactTextString(m) } func (*MsgLinkApplication) ProtoMessage() {} func (*MsgLinkApplication) Descriptor() ([]byte, []int) { - return fileDescriptor_72bc9ee36626b76e, []int{0} + return fileDescriptor_29dfbdba444598ee, []int{0} } func (m *MsgLinkApplication) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -88,7 +88,7 @@ func (m *MsgLinkApplicationResponse) Reset() { *m = MsgLinkApplicationRe func (m *MsgLinkApplicationResponse) String() string { return proto.CompactTextString(m) } func (*MsgLinkApplicationResponse) ProtoMessage() {} func (*MsgLinkApplicationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_72bc9ee36626b76e, []int{1} + return fileDescriptor_29dfbdba444598ee, []int{1} } func (m *MsgLinkApplicationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -133,7 +133,7 @@ func (m *MsgUnlinkApplication) Reset() { *m = MsgUnlinkApplication{} } func (m *MsgUnlinkApplication) String() string { return proto.CompactTextString(m) } func (*MsgUnlinkApplication) ProtoMessage() {} func (*MsgUnlinkApplication) Descriptor() ([]byte, []int) { - return fileDescriptor_72bc9ee36626b76e, []int{2} + return fileDescriptor_29dfbdba444598ee, []int{2} } func (m *MsgUnlinkApplication) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -171,7 +171,7 @@ func (m *MsgUnlinkApplicationResponse) Reset() { *m = MsgUnlinkApplicati func (m *MsgUnlinkApplicationResponse) String() string { return proto.CompactTextString(m) } func (*MsgUnlinkApplicationResponse) ProtoMessage() {} func (*MsgUnlinkApplicationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_72bc9ee36626b76e, []int{3} + return fileDescriptor_29dfbdba444598ee, []int{3} } func (m *MsgUnlinkApplicationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -201,21 +201,21 @@ func (m *MsgUnlinkApplicationResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnlinkApplicationResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgLinkApplication)(nil), "desmos.profiles.v2.MsgLinkApplication") - proto.RegisterType((*MsgLinkApplicationResponse)(nil), "desmos.profiles.v2.MsgLinkApplicationResponse") - proto.RegisterType((*MsgUnlinkApplication)(nil), "desmos.profiles.v2.MsgUnlinkApplication") - proto.RegisterType((*MsgUnlinkApplicationResponse)(nil), "desmos.profiles.v2.MsgUnlinkApplicationResponse") + proto.RegisterType((*MsgLinkApplication)(nil), "desmos.profiles.v3.MsgLinkApplication") + proto.RegisterType((*MsgLinkApplicationResponse)(nil), "desmos.profiles.v3.MsgLinkApplicationResponse") + proto.RegisterType((*MsgUnlinkApplication)(nil), "desmos.profiles.v3.MsgUnlinkApplication") + proto.RegisterType((*MsgUnlinkApplicationResponse)(nil), "desmos.profiles.v3.MsgUnlinkApplicationResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/msgs_app_links.proto", fileDescriptor_72bc9ee36626b76e) + proto.RegisterFile("desmos/profiles/v3/msgs_app_links.proto", fileDescriptor_29dfbdba444598ee) } -var fileDescriptor_72bc9ee36626b76e = []byte{ +var fileDescriptor_29dfbdba444598ee = []byte{ // 559 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0x4f, 0x6f, 0xd3, 0x30, 0x1c, 0x4d, 0xd8, 0x18, 0xad, 0xa7, 0x8e, 0x2d, 0x14, 0x14, 0xaa, 0x92, 0x54, 0xbe, 0xd0, 0x1d, - 0x48, 0xd4, 0x82, 0x04, 0xda, 0x09, 0x02, 0x07, 0x10, 0x4c, 0xa0, 0x08, 0x2e, 0x5c, 0x8a, 0x9b, + 0x48, 0x54, 0x8a, 0x04, 0xda, 0x09, 0x02, 0x07, 0x10, 0x4c, 0xa0, 0x08, 0x2e, 0x5c, 0x8a, 0x9b, 0x9a, 0xd4, 0x5a, 0x62, 0x47, 0xb1, 0x5b, 0xb1, 0x6f, 0xc0, 0x91, 0x8f, 0xb0, 0x4f, 0xc1, 0x67, 0xd8, 0x71, 0x47, 0x4e, 0x11, 0x6a, 0x2f, 0x9c, 0x23, 0x71, 0x47, 0xb1, 0xdd, 0x7f, 0x74, 0xa7, 0x3c, 0xbf, 0xdf, 0x7b, 0xb6, 0x7f, 0xbf, 0x3c, 0x83, 0x87, 0x23, 0xcc, 0x53, 0xc6, 0xfd, 0x2c, @@ -226,28 +226,28 @@ var fileDescriptor_72bc9ee36626b76e = []byte{ 0x02, 0xf8, 0x77, 0x07, 0x58, 0xa7, 0x3c, 0x7e, 0x47, 0xe8, 0xd9, 0x8b, 0x2c, 0x4b, 0x48, 0x84, 0x04, 0x61, 0xd4, 0x3a, 0x06, 0x7b, 0x1c, 0xd3, 0x11, 0xce, 0x6d, 0xb3, 0x63, 0x76, 0xeb, 0xc1, 0x51, 0x59, 0xb8, 0x8d, 0x73, 0x94, 0x26, 0x27, 0x50, 0xf1, 0x30, 0xd4, 0x02, 0xeb, 0x3d, 0xa8, - 0x57, 0xf7, 0x18, 0x8c, 0x90, 0x40, 0xf6, 0x8d, 0x8e, 0xd9, 0xdd, 0xef, 0xdb, 0xde, 0x76, 0x2f, - 0xde, 0x2b, 0x24, 0x50, 0x60, 0x5f, 0x16, 0xae, 0x51, 0x16, 0xee, 0xa1, 0xda, 0x6b, 0x69, 0x84, - 0x61, 0xad, 0xc2, 0x95, 0xc6, 0xea, 0x81, 0x7a, 0x84, 0x92, 0x44, 0x6d, 0xb8, 0x23, 0x8f, 0x6f, - 0xae, 0x2c, 0xcb, 0x12, 0x0c, 0x6b, 0x15, 0x96, 0x96, 0xa7, 0x60, 0x9f, 0xb3, 0x49, 0x1e, 0xe1, - 0x41, 0xc6, 0x72, 0x61, 0xef, 0x4a, 0xd3, 0xbd, 0xb2, 0x70, 0x2d, 0x7d, 0xe7, 0x55, 0x11, 0x86, - 0x40, 0xad, 0x3e, 0xb0, 0x5c, 0x58, 0xcf, 0xc1, 0x81, 0xae, 0x45, 0x63, 0x44, 0x29, 0x4e, 0xec, - 0x9b, 0xd2, 0x7b, 0xbf, 0x2c, 0xdc, 0xbb, 0x1b, 0x5e, 0x5d, 0x87, 0x61, 0x43, 0x11, 0x2f, 0xd5, - 0xda, 0xfa, 0x02, 0x0e, 0x04, 0x49, 0x31, 0x9b, 0x88, 0xc1, 0x18, 0x93, 0x78, 0x2c, 0xec, 0x3d, - 0x39, 0x83, 0x96, 0x47, 0x86, 0x91, 0x57, 0x8d, 0xde, 0xd3, 0x03, 0x9f, 0xf6, 0xbc, 0xd7, 0x52, - 0x11, 0x3c, 0xd0, 0x53, 0xd0, 0x27, 0x6c, 0xfa, 0x61, 0xd8, 0xd0, 0x84, 0x52, 0x5b, 0x6f, 0xc0, - 0xd1, 0x42, 0x51, 0x7d, 0xb9, 0x40, 0x69, 0x66, 0xdf, 0xea, 0x98, 0xdd, 0xdd, 0xa0, 0x5d, 0x16, - 0xae, 0xbd, 0xb9, 0xc9, 0x52, 0x02, 0xc3, 0x43, 0xcd, 0x7d, 0x5c, 0x50, 0x27, 0xb5, 0xef, 0x17, - 0xae,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0x19, 0xa3, 0x1c, + 0xc3, 0x9f, 0x26, 0x68, 0x9e, 0xf2, 0xf8, 0x13, 0x4d, 0xfe, 0xcb, 0xc5, 0x33, 0xb0, 0x8f, 0x56, + 0x4b, 0x1d, 0x8e, 0xb5, 0x41, 0xaf, 0x15, 0x61, 0xb8, 0x2e, 0xb5, 0x7c, 0x50, 0x9b, 0x70, 0x9c, + 0x53, 0x94, 0x62, 0x99, 0x92, 0x7a, 0x70, 0xa7, 0x2c, 0xdc, 0xdb, 0xca, 0xb6, 0xa8, 0xc0, 0x70, + 0x29, 0x92, 0x11, 0x24, 0x31, 0xc5, 0xb9, 0xce, 0xc0, 0x7a, 0x04, 0x25, 0x5f, 0x45, 0x50, 0x82, + 0xb5, 0xb6, 0x1c, 0xd0, 0xbe, 0xee, 0xde, 0x8b, 0xc6, 0x82, 0xb7, 0x97, 0x33, 0xc7, 0xbc, 0x9a, + 0x39, 0xe6, 0xef, 0x99, 0x63, 0xfe, 0x98, 0x3b, 0xc6, 0xd5, 0xdc, 0x31, 0x7e, 0xcd, 0x1d, 0xe3, + 0x73, 0x2f, 0x26, 0x62, 0x3c, 0x19, 0x7a, 0x11, 0x4b, 0x7d, 0x95, 0xde, 0x47, 0x09, 0x1a, 0x72, + 0x8d, 0xfd, 0xe9, 0x13, 0xff, 0xdb, 0xea, 0x19, 0x8a, 0xf3, 0x0c, 0xf3, 0xe1, 0x9e, 0x7c, 0x42, + 0xfd, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xeb, 0xb6, 0x1b, 0xcb, 0xe3, 0x03, 0x00, 0x00, } func (m *MsgLinkApplication) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/msgs_chain_links.pb.go b/x/profiles/types/msgs_chain_links.pb.go index a5f56eadcc..d13b8469bf 100644 --- a/x/profiles/types/msgs_chain_links.pb.go +++ b/x/profiles/types/msgs_chain_links.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/msgs_chain_links.proto +// source: desmos/profiles/v3/msgs_chain_links.proto package types @@ -43,7 +43,7 @@ func (m *MsgLinkChainAccount) Reset() { *m = MsgLinkChainAccount{} } func (m *MsgLinkChainAccount) String() string { return proto.CompactTextString(m) } func (*MsgLinkChainAccount) ProtoMessage() {} func (*MsgLinkChainAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_d28c3718ad31f8ee, []int{0} + return fileDescriptor_52cd1f5b825f2f4e, []int{0} } func (m *MsgLinkChainAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -108,7 +108,7 @@ func (m *MsgLinkChainAccountResponse) Reset() { *m = MsgLinkChainAccount func (m *MsgLinkChainAccountResponse) String() string { return proto.CompactTextString(m) } func (*MsgLinkChainAccountResponse) ProtoMessage() {} func (*MsgLinkChainAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d28c3718ad31f8ee, []int{1} + return fileDescriptor_52cd1f5b825f2f4e, []int{1} } func (m *MsgLinkChainAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -153,7 +153,7 @@ func (m *MsgUnlinkChainAccount) Reset() { *m = MsgUnlinkChainAccount{} } func (m *MsgUnlinkChainAccount) String() string { return proto.CompactTextString(m) } func (*MsgUnlinkChainAccount) ProtoMessage() {} func (*MsgUnlinkChainAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_d28c3718ad31f8ee, []int{2} + return fileDescriptor_52cd1f5b825f2f4e, []int{2} } func (m *MsgUnlinkChainAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -211,7 +211,7 @@ func (m *MsgUnlinkChainAccountResponse) Reset() { *m = MsgUnlinkChainAcc func (m *MsgUnlinkChainAccountResponse) String() string { return proto.CompactTextString(m) } func (*MsgUnlinkChainAccountResponse) ProtoMessage() {} func (*MsgUnlinkChainAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d28c3718ad31f8ee, []int{3} + return fileDescriptor_52cd1f5b825f2f4e, []int{3} } func (m *MsgUnlinkChainAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -241,21 +241,21 @@ func (m *MsgUnlinkChainAccountResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnlinkChainAccountResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgLinkChainAccount)(nil), "desmos.profiles.v2.MsgLinkChainAccount") - proto.RegisterType((*MsgLinkChainAccountResponse)(nil), "desmos.profiles.v2.MsgLinkChainAccountResponse") - proto.RegisterType((*MsgUnlinkChainAccount)(nil), "desmos.profiles.v2.MsgUnlinkChainAccount") - proto.RegisterType((*MsgUnlinkChainAccountResponse)(nil), "desmos.profiles.v2.MsgUnlinkChainAccountResponse") + proto.RegisterType((*MsgLinkChainAccount)(nil), "desmos.profiles.v3.MsgLinkChainAccount") + proto.RegisterType((*MsgLinkChainAccountResponse)(nil), "desmos.profiles.v3.MsgLinkChainAccountResponse") + proto.RegisterType((*MsgUnlinkChainAccount)(nil), "desmos.profiles.v3.MsgUnlinkChainAccount") + proto.RegisterType((*MsgUnlinkChainAccountResponse)(nil), "desmos.profiles.v3.MsgUnlinkChainAccountResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/msgs_chain_links.proto", fileDescriptor_d28c3718ad31f8ee) + proto.RegisterFile("desmos/profiles/v3/msgs_chain_links.proto", fileDescriptor_52cd1f5b825f2f4e) } -var fileDescriptor_d28c3718ad31f8ee = []byte{ +var fileDescriptor_52cd1f5b825f2f4e = []byte{ // 486 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xc1, 0x6a, 0xdb, 0x40, 0x10, 0xb5, 0xd2, 0x26, 0xe0, 0x75, 0x02, 0x8d, 0x12, 0x83, 0xe3, 0x10, 0x29, 0xec, 0xa1, 0x38, - 0x94, 0x68, 0xa9, 0x9b, 0x53, 0x6f, 0x56, 0x7a, 0x6b, 0x52, 0x8a, 0xa0, 0x97, 0x5e, 0xcc, 0x7a, + 0x94, 0x68, 0x69, 0x9d, 0x53, 0x6f, 0x56, 0x7a, 0x6b, 0x52, 0x8a, 0xa0, 0x97, 0x5e, 0xcc, 0x7a, 0xbd, 0xde, 0x88, 0x48, 0x3b, 0x42, 0x2b, 0xbb, 0xf5, 0x5f, 0xf4, 0x13, 0xfa, 0x11, 0xfd, 0x88, 0xd0, 0x53, 0x8e, 0x85, 0x82, 0x28, 0xf6, 0x1f, 0xe8, 0x0b, 0x8a, 0x76, 0x25, 0x5c, 0x37, 0xba, 0xcd, 0xcc, 0x7b, 0xf3, 0xe6, 0xcd, 0xec, 0xa2, 0x8b, 0x29, 0x57, 0x31, 0x28, 0x92, 0xa4, 0x30, @@ -265,25 +265,25 @@ var fileDescriptor_d28c3718ad31f8ee = []byte{ 0x67, 0x84, 0xca, 0x65, 0x0d, 0x31, 0x28, 0x45, 0xc6, 0xa6, 0xc7, 0x24, 0x15, 0xf4, 0xaa, 0xc9, 0x0a, 0x4c, 0x79, 0xd4, 0x60, 0x06, 0xff, 0xde, 0x41, 0x47, 0xb7, 0x4a, 0xdc, 0x84, 0xf2, 0xfe, 0xba, 0x04, 0x47, 0x8c, 0xc1, 0x5c, 0x66, 0x36, 0x43, 0x07, 0x86, 0x4c, 0xa7, 0xd3, 0x94, 0x2b, - 0xd5, 0xb3, 0xce, 0xad, 0x41, 0x67, 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, 0x3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06, 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, } func (m *MsgLinkChainAccount) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/msgs_dtag_requests.pb.go b/x/profiles/types/msgs_dtag_requests.pb.go index 79d33ce0c8..7db8ae77b2 100644 --- a/x/profiles/types/msgs_dtag_requests.pb.go +++ b/x/profiles/types/msgs_dtag_requests.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/msgs_dtag_requests.proto +// source: desmos/profiles/v3/msgs_dtag_requests.proto package types @@ -40,7 +40,7 @@ func (m *MsgRequestDTagTransfer) Reset() { *m = MsgRequestDTagTransfer{} func (m *MsgRequestDTagTransfer) String() string { return proto.CompactTextString(m) } func (*MsgRequestDTagTransfer) ProtoMessage() {} func (*MsgRequestDTagTransfer) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{0} + return fileDescriptor_00569a18db7c139d, []int{0} } func (m *MsgRequestDTagTransfer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -78,7 +78,7 @@ func (m *MsgRequestDTagTransferResponse) Reset() { *m = MsgRequestDTagTr func (m *MsgRequestDTagTransferResponse) String() string { return proto.CompactTextString(m) } func (*MsgRequestDTagTransferResponse) ProtoMessage() {} func (*MsgRequestDTagTransferResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{1} + return fileDescriptor_00569a18db7c139d, []int{1} } func (m *MsgRequestDTagTransferResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -120,7 +120,7 @@ func (m *MsgCancelDTagTransferRequest) Reset() { *m = MsgCancelDTagTrans func (m *MsgCancelDTagTransferRequest) String() string { return proto.CompactTextString(m) } func (*MsgCancelDTagTransferRequest) ProtoMessage() {} func (*MsgCancelDTagTransferRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{2} + return fileDescriptor_00569a18db7c139d, []int{2} } func (m *MsgCancelDTagTransferRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -158,7 +158,7 @@ func (m *MsgCancelDTagTransferRequestResponse) Reset() { *m = MsgCancelD func (m *MsgCancelDTagTransferRequestResponse) String() string { return proto.CompactTextString(m) } func (*MsgCancelDTagTransferRequestResponse) ProtoMessage() {} func (*MsgCancelDTagTransferRequestResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{3} + return fileDescriptor_00569a18db7c139d, []int{3} } func (m *MsgCancelDTagTransferRequestResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -203,7 +203,7 @@ func (m *MsgAcceptDTagTransferRequest) Reset() { *m = MsgAcceptDTagTrans func (m *MsgAcceptDTagTransferRequest) String() string { return proto.CompactTextString(m) } func (*MsgAcceptDTagTransferRequest) ProtoMessage() {} func (*MsgAcceptDTagTransferRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{4} + return fileDescriptor_00569a18db7c139d, []int{4} } func (m *MsgAcceptDTagTransferRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -241,7 +241,7 @@ func (m *MsgAcceptDTagTransferRequestResponse) Reset() { *m = MsgAcceptD func (m *MsgAcceptDTagTransferRequestResponse) String() string { return proto.CompactTextString(m) } func (*MsgAcceptDTagTransferRequestResponse) ProtoMessage() {} func (*MsgAcceptDTagTransferRequestResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{5} + return fileDescriptor_00569a18db7c139d, []int{5} } func (m *MsgAcceptDTagTransferRequestResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -283,7 +283,7 @@ func (m *MsgRefuseDTagTransferRequest) Reset() { *m = MsgRefuseDTagTrans func (m *MsgRefuseDTagTransferRequest) String() string { return proto.CompactTextString(m) } func (*MsgRefuseDTagTransferRequest) ProtoMessage() {} func (*MsgRefuseDTagTransferRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{6} + return fileDescriptor_00569a18db7c139d, []int{6} } func (m *MsgRefuseDTagTransferRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -321,7 +321,7 @@ func (m *MsgRefuseDTagTransferRequestResponse) Reset() { *m = MsgRefuseD func (m *MsgRefuseDTagTransferRequestResponse) String() string { return proto.CompactTextString(m) } func (*MsgRefuseDTagTransferRequestResponse) ProtoMessage() {} func (*MsgRefuseDTagTransferRequestResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_530fdfdb77008b0a, []int{7} + return fileDescriptor_00569a18db7c139d, []int{7} } func (m *MsgRefuseDTagTransferRequestResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -351,49 +351,49 @@ func (m *MsgRefuseDTagTransferRequestResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRefuseDTagTransferRequestResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgRequestDTagTransfer)(nil), "desmos.profiles.v2.MsgRequestDTagTransfer") - proto.RegisterType((*MsgRequestDTagTransferResponse)(nil), "desmos.profiles.v2.MsgRequestDTagTransferResponse") - proto.RegisterType((*MsgCancelDTagTransferRequest)(nil), "desmos.profiles.v2.MsgCancelDTagTransferRequest") - proto.RegisterType((*MsgCancelDTagTransferRequestResponse)(nil), "desmos.profiles.v2.MsgCancelDTagTransferRequestResponse") - proto.RegisterType((*MsgAcceptDTagTransferRequest)(nil), "desmos.profiles.v2.MsgAcceptDTagTransferRequest") - proto.RegisterType((*MsgAcceptDTagTransferRequestResponse)(nil), "desmos.profiles.v2.MsgAcceptDTagTransferRequestResponse") - proto.RegisterType((*MsgRefuseDTagTransferRequest)(nil), "desmos.profiles.v2.MsgRefuseDTagTransferRequest") - proto.RegisterType((*MsgRefuseDTagTransferRequestResponse)(nil), "desmos.profiles.v2.MsgRefuseDTagTransferRequestResponse") + proto.RegisterType((*MsgRequestDTagTransfer)(nil), "desmos.profiles.v3.MsgRequestDTagTransfer") + proto.RegisterType((*MsgRequestDTagTransferResponse)(nil), "desmos.profiles.v3.MsgRequestDTagTransferResponse") + proto.RegisterType((*MsgCancelDTagTransferRequest)(nil), "desmos.profiles.v3.MsgCancelDTagTransferRequest") + proto.RegisterType((*MsgCancelDTagTransferRequestResponse)(nil), "desmos.profiles.v3.MsgCancelDTagTransferRequestResponse") + proto.RegisterType((*MsgAcceptDTagTransferRequest)(nil), "desmos.profiles.v3.MsgAcceptDTagTransferRequest") + proto.RegisterType((*MsgAcceptDTagTransferRequestResponse)(nil), "desmos.profiles.v3.MsgAcceptDTagTransferRequestResponse") + proto.RegisterType((*MsgRefuseDTagTransferRequest)(nil), "desmos.profiles.v3.MsgRefuseDTagTransferRequest") + proto.RegisterType((*MsgRefuseDTagTransferRequestResponse)(nil), "desmos.profiles.v3.MsgRefuseDTagTransferRequestResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/msgs_dtag_requests.proto", fileDescriptor_530fdfdb77008b0a) + proto.RegisterFile("desmos/profiles/v3/msgs_dtag_requests.proto", fileDescriptor_00569a18db7c139d) } -var fileDescriptor_530fdfdb77008b0a = []byte{ +var fileDescriptor_00569a18db7c139d = []byte{ // 429 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x93, 0xbf, 0x6f, 0xd3, 0x40, 0x14, 0xc7, 0xed, 0x22, 0xb5, 0xe1, 0x24, 0x84, 0x30, 0x08, 0x95, 0x0a, 0x9d, 0x2b, 0x0b, 0xf1, - 0x43, 0xa8, 0x3e, 0x51, 0x58, 0xe8, 0x46, 0xe9, 0x86, 0xca, 0x60, 0x75, 0x62, 0x89, 0xce, 0xf6, - 0xf3, 0x11, 0xc9, 0xf6, 0x99, 0x7b, 0xb6, 0x43, 0x16, 0x26, 0x06, 0x46, 0xfe, 0x84, 0xfe, 0x27, - 0xac, 0x8c, 0x19, 0x99, 0x22, 0xe4, 0x2c, 0xcc, 0xf9, 0x0b, 0x90, 0x7d, 0x76, 0xa2, 0x80, 0x83, - 0x08, 0x03, 0xdb, 0xdd, 0xfb, 0x7e, 0x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, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xa6, 0xff, 0x0a, 0xd4, 0x24, 0x04, 0x00, 0x00, } func (m *MsgRequestDTagTransfer) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/msgs_profile.pb.go b/x/profiles/types/msgs_profile.pb.go index e1d3d61237..30e9a26124 100644 --- a/x/profiles/types/msgs_profile.pb.go +++ b/x/profiles/types/msgs_profile.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/msgs_profile.proto +// source: desmos/profiles/v3/msgs_profile.proto package types @@ -39,7 +39,7 @@ func (m *MsgSaveProfile) Reset() { *m = MsgSaveProfile{} } func (m *MsgSaveProfile) String() string { return proto.CompactTextString(m) } func (*MsgSaveProfile) ProtoMessage() {} func (*MsgSaveProfile) Descriptor() ([]byte, []int) { - return fileDescriptor_e19057696b6ec51e, []int{0} + return fileDescriptor_5ea75cf4ca5bb3a3, []int{0} } func (m *MsgSaveProfile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -76,7 +76,7 @@ func (m *MsgSaveProfileResponse) Reset() { *m = MsgSaveProfileResponse{} func (m *MsgSaveProfileResponse) String() string { return proto.CompactTextString(m) } func (*MsgSaveProfileResponse) ProtoMessage() {} func (*MsgSaveProfileResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e19057696b6ec51e, []int{1} + return fileDescriptor_5ea75cf4ca5bb3a3, []int{1} } func (m *MsgSaveProfileResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -114,7 +114,7 @@ func (m *MsgDeleteProfile) Reset() { *m = MsgDeleteProfile{} } func (m *MsgDeleteProfile) String() string { return proto.CompactTextString(m) } func (*MsgDeleteProfile) ProtoMessage() {} func (*MsgDeleteProfile) Descriptor() ([]byte, []int) { - return fileDescriptor_e19057696b6ec51e, []int{2} + return fileDescriptor_5ea75cf4ca5bb3a3, []int{2} } func (m *MsgDeleteProfile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -151,7 +151,7 @@ func (m *MsgDeleteProfileResponse) Reset() { *m = MsgDeleteProfileRespon func (m *MsgDeleteProfileResponse) String() string { return proto.CompactTextString(m) } func (*MsgDeleteProfileResponse) ProtoMessage() {} func (*MsgDeleteProfileResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e19057696b6ec51e, []int{3} + return fileDescriptor_5ea75cf4ca5bb3a3, []int{3} } func (m *MsgDeleteProfileResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -181,46 +181,46 @@ func (m *MsgDeleteProfileResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDeleteProfileResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgSaveProfile)(nil), "desmos.profiles.v2.MsgSaveProfile") - proto.RegisterType((*MsgSaveProfileResponse)(nil), "desmos.profiles.v2.MsgSaveProfileResponse") - proto.RegisterType((*MsgDeleteProfile)(nil), "desmos.profiles.v2.MsgDeleteProfile") - proto.RegisterType((*MsgDeleteProfileResponse)(nil), "desmos.profiles.v2.MsgDeleteProfileResponse") + proto.RegisterType((*MsgSaveProfile)(nil), "desmos.profiles.v3.MsgSaveProfile") + proto.RegisterType((*MsgSaveProfileResponse)(nil), "desmos.profiles.v3.MsgSaveProfileResponse") + proto.RegisterType((*MsgDeleteProfile)(nil), "desmos.profiles.v3.MsgDeleteProfile") + proto.RegisterType((*MsgDeleteProfileResponse)(nil), "desmos.profiles.v3.MsgDeleteProfileResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/msgs_profile.proto", fileDescriptor_e19057696b6ec51e) + proto.RegisterFile("desmos/profiles/v3/msgs_profile.proto", fileDescriptor_5ea75cf4ca5bb3a3) } -var fileDescriptor_e19057696b6ec51e = []byte{ +var fileDescriptor_5ea75cf4ca5bb3a3 = []byte{ // 444 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0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xaf, 0xbf, 0x2e, 0x42, 0xf7, 0x72, 0x11, 0xba, 0x3f, - 0x16, 0xa1, 0xfb, 0x65, 0x19, 0x3a, 0x97, 0xcb, 0xd0, 0xf9, 0xbe, 0x0c, 0x9d, 0x77, 0x4f, 0x65, - 0xaa, 0xdf, 0xcf, 0xe2, 0x51, 0x82, 0x39, 0xb7, 0x47, 0x72, 0x90, 0x89, 0x58, 0x75, 0x6f, 0x5e, - 0x3d, 0xe7, 0x9f, 0x7e, 0x5f, 0x8d, 0x9e, 0x17, 0xa0, 0xe2, 0x2d, 0x73, 0x24, 0xcf, 0x7e, 0x05, - 0x00, 0x00, 0xff, 0xff, 0x14, 0xc6, 0x2e, 0xcf, 0x05, 0x03, 0x00, 0x00, + 0x24, 0xc8, 0xad, 0xd0, 0x51, 0x45, 0xa2, 0x09, 0xa9, 0x40, 0x91, 0x22, 0x43, 0x45, 0x73, 0xb2, + 0x7d, 0x93, 0xc5, 0xc2, 0xbe, 0x31, 0xde, 0x3d, 0x8b, 0x7b, 0x03, 0x4a, 0x1e, 0x21, 0x8f, 0x43, + 0x41, 0x91, 0x92, 0xca, 0x42, 0xbe, 0x86, 0xda, 0x4f, 0x80, 0xbc, 0x6b, 0x1f, 0xdc, 0x09, 0x8a, + 0x74, 0x3b, 0xf3, 0x7f, 0xff, 0x3f, 0xa3, 0xd5, 0x90, 0x47, 0x53, 0x90, 0x19, 0x4a, 0x9e, 0x17, + 0x78, 0x91, 0xa4, 0x20, 0x79, 0x39, 0xe6, 0x99, 0x14, 0x72, 0xd2, 0x35, 0x46, 0x79, 0x81, 0x0a, + 0x1d, 0xc7, 0x60, 0xa3, 0x1e, 0x1b, 0x95, 0x63, 0x6f, 0x5f, 0xa0, 0x40, 0x2d, 0xf3, 0xf6, 0x65, + 0x48, 0xef, 0xa1, 0x40, 0x14, 0x29, 0x70, 0x5d, 0x45, 0xf3, 0x0b, 0x1e, 0xce, 0x16, 0xbd, 0x14, + 0x63, 0x1b, 0x32, 0x31,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, 0x78, 0xf7, 0xcb, 0x25, + 0xb5, 0x7e, 0x5d, 0x52, 0x8b, 0xb9, 0xe4, 0x60, 0xfd, 0x37, 0x03, 0x90, 0x39, 0xce, 0x24, 0xb0, + 0xd7, 0xe4, 0xde, 0x99, 0x14, 0xa7, 0x90, 0x82, 0x5a, 0xfd, 0xf4, 0x5f, 0x53, 0xec, 0xeb, 0x4c, + 0xf1, 0x88, 0xbb, 0x99, 0xd5, 0xcf, 0x39, 0x79, 0xf3, 0xad, 0xf6, 0xed, 0xab, 0xda, 0xb7, 0x7f, + 0xd6, 0xbe, 0xfd, 0x75, 0xe9, 0x5b, 0x57, 0x4b, 0xdf, 0xfa, 0xb1, 0xf4, 0xad, 0xf7, 0xcf, 0x45, + 0xa2, 0x3e, 0xcc, 0xa3, 0x51, 0x8c, 0x19, 0x37, 0x47, 0x72, 0x94, 0x86, 0x91, 0xec, 0xde, 0xbc, + 0x7c, 0xc1, 0x3f, 0xff, 0xb9, 0x1a, 0xb5, 0xc8, 0x41, 0x46, 0x3b, 0xfa, 0x48, 0xc6, 0xbf, 0x03, + 0x00, 0x00, 0xff, 0xff, 0xb8, 0x1c, 0x11, 0xc5, 0x05, 0x03, 0x00, 0x00, } func (m *MsgSaveProfile) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/query.pb.go b/x/profiles/types/query.pb.go index 9f6fe43a6e..61b7cd8af3 100644 --- a/x/profiles/types/query.pb.go +++ b/x/profiles/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/query.proto +// source: desmos/profiles/v3/query.proto package types @@ -30,13 +30,13 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -func init() { proto.RegisterFile("desmos/profiles/v2/query.proto", fileDescriptor_fba4df0d7bde4d7c) } +func init() { proto.RegisterFile("desmos/profiles/v3/query.proto", fileDescriptor_bcbdebc2a1cf2f2b) } -var fileDescriptor_fba4df0d7bde4d7c = []byte{ +var fileDescriptor_bcbdebc2a1cf2f2b = []byte{ // 613 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x3d, 0x6f, 0xd3, 0x40, 0x18, 0xc7, 0x6b, 0x24, 0x8a, 0x74, 0x0b, 0xe8, 0x04, 0x43, 0xa2, 0xe0, 0x8a, 0x42, 0x5e, 0x94, - 0x26, 0x3e, 0x92, 0x02, 0x52, 0x11, 0x0c, 0xb4, 0x5d, 0x2a, 0x90, 0x28, 0xa8, 0x13, 0x4b, 0x74, + 0x26, 0x3e, 0xd2, 0x00, 0x52, 0x11, 0x0c, 0xb4, 0x5d, 0x2a, 0x90, 0x28, 0xa8, 0x13, 0x4b, 0x74, 0x76, 0x2e, 0xee, 0x09, 0xe7, 0xee, 0xea, 0x73, 0x02, 0x51, 0x95, 0x85, 0x8d, 0x05, 0x21, 0xb1, 0x33, 0xf1, 0x11, 0xf8, 0x08, 0x0c, 0x2c, 0x88, 0x4a, 0x2c, 0x8c, 0x28, 0xe1, 0x83, 0x20, 0xdf, 0x4b, 0xa3, 0x86, 0x38, 0x49, 0xbb, 0xd9, 0xbe, 0xdf, 0xff, 0x9e, 0xdf, 0x73, 0x7e, 0x74, 0xc0, @@ -49,30 +49,30 @@ var fileDescriptor_fba4df0d7bde4d7c = []byte{ 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, - 0x6d, 0x7e, 0x03, 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, 0x9a, 0x5a, 0x7d, 0x7a, 0xd9, 0x65, 0xa7, 0x51, 0x2b, 0xda, 0x38, 0x47, 0xc2, + 0x98, 0x16, 0x95, 0xe9, 0x1a, 0xbc, 0x39, 0xcb, 0x14, 0x0b, 0x61, 0xce, 0xf1, 0x87, 0x03, 0x72, + 0x53, 0x7b, 0x6c, 0x0f, 0x76, 0x22, 0x4a, 0x58, 0xb2, 0xb7, 0x0b, 0xb7, 0x96, 0xad, 0x3b, 0xc9, + 0x58, 0xe5, 0x87, 0x17, 0x89, 0x1a, 0xf7, 0x2d, 0xe5, 0xde, 0x84, 0x8d, 0xb9, 0xee, 0x28, 0x50, + 0x39, 0x89, 0x8e, 0xf5, 0x43, 0x8b, 0xb6, 0x87, 0xf0, 0xab, 0x03, 0x6e, 0x4c, 0x15, 0x30, 0xd3, + 0x71, 0x7f, 0x59, 0xa1, 0xb3, 0x33, 0xf2, 0xe0, 0xbc, 0x31, 0xd3, 0x43, 0x4d, 0xf5, 0x50, 0x82, + 0x77, 0xe6, 0xf7, 0x60, 0xe6, 0x64, 0x08, 0x56, 0xf7, 0xd5, 0xa5, 0x0b, 0x4b, 0xd9, 0x57, 0x92, + 0x02, 0xac, 0x57, 0x79, 0x21, 0x67, 0x44, 0xd6, 0x95, 0x48, 0x01, 0xe6, 0x67, 0xde, 0x5c, 0x8a, + 0xdd, 0x7e, 0xfa, 0x7d, 0xe4, 0x3a, 0x27, 0x23, 0xd7, 0xf9, 0x33, 0x72, 0x9d, 0x8f, 0x63, 0x77, + 0xe5, 0x64, 0xec, 0xae, 0xfc, 0x1e, 0xbb, 0x2b, 0xaf, 0x1a, 0x21, 0x4d, 0x0e, 0x7b, 0xbe, 0x17, + 0xf0, 0xae, 0xc9, 0xd7, 0x23, 0xec, 0x4b, 0xbb, 0x57, 0xff, 0x1e, 0x7a, 0x3b, 0xd9, 0x30, 0x19, + 0x08, 0x22, 0xfd, 0x55, 0x75, 0x35, 0x37, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xef, 0x67, 0x18, + 0xbe, 0x39, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -123,7 +123,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Profile(ctx context.Context, in *QueryProfileRequest, opts ...grpc.CallOption) (*QueryProfileResponse, error) { out := new(QueryProfileResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/Profile", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/Profile", in, out, opts...) if err != nil { return nil, err } @@ -132,7 +132,7 @@ func (c *queryClient) Profile(ctx context.Context, in *QueryProfileRequest, opts func (c *queryClient) IncomingDTagTransferRequests(ctx context.Context, in *QueryIncomingDTagTransferRequestsRequest, opts ...grpc.CallOption) (*QueryIncomingDTagTransferRequestsResponse, error) { out := new(QueryIncomingDTagTransferRequestsResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/IncomingDTagTransferRequests", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/IncomingDTagTransferRequests", in, out, opts...) if err != nil { return nil, err } @@ -141,7 +141,7 @@ func (c *queryClient) IncomingDTagTransferRequests(ctx context.Context, in *Quer func (c *queryClient) ChainLinks(ctx context.Context, in *QueryChainLinksRequest, opts ...grpc.CallOption) (*QueryChainLinksResponse, error) { out := new(QueryChainLinksResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/ChainLinks", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/ChainLinks", in, out, opts...) if err != nil { return nil, err } @@ -150,7 +150,7 @@ func (c *queryClient) ChainLinks(ctx context.Context, in *QueryChainLinksRequest func (c *queryClient) ChainLinkOwners(ctx context.Context, in *QueryChainLinkOwnersRequest, opts ...grpc.CallOption) (*QueryChainLinkOwnersResponse, error) { out := new(QueryChainLinkOwnersResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/ChainLinkOwners", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/ChainLinkOwners", in, out, opts...) if err != nil { return nil, err } @@ -159,7 +159,7 @@ func (c *queryClient) ChainLinkOwners(ctx context.Context, in *QueryChainLinkOwn func (c *queryClient) ApplicationLinks(ctx context.Context, in *QueryApplicationLinksRequest, opts ...grpc.CallOption) (*QueryApplicationLinksResponse, error) { out := new(QueryApplicationLinksResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/ApplicationLinks", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/ApplicationLinks", in, out, opts...) if err != nil { return nil, err } @@ -168,7 +168,7 @@ func (c *queryClient) ApplicationLinks(ctx context.Context, in *QueryApplication func (c *queryClient) ApplicationLinkByClientID(ctx context.Context, in *QueryApplicationLinkByClientIDRequest, opts ...grpc.CallOption) (*QueryApplicationLinkByClientIDResponse, error) { out := new(QueryApplicationLinkByClientIDResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/ApplicationLinkByClientID", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/ApplicationLinkByClientID", in, out, opts...) if err != nil { return nil, err } @@ -177,7 +177,7 @@ func (c *queryClient) ApplicationLinkByClientID(ctx context.Context, in *QueryAp func (c *queryClient) ApplicationLinkOwners(ctx context.Context, in *QueryApplicationLinkOwnersRequest, opts ...grpc.CallOption) (*QueryApplicationLinkOwnersResponse, error) { out := new(QueryApplicationLinkOwnersResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/ApplicationLinkOwners", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/ApplicationLinkOwners", in, out, opts...) if err != nil { return nil, err } @@ -186,7 +186,7 @@ func (c *queryClient) ApplicationLinkOwners(ctx context.Context, in *QueryApplic func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/desmos.profiles.v2.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/desmos.profiles.v3.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -264,7 +264,7 @@ func _Query_Profile_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/Profile", + FullMethod: "/desmos.profiles.v3.Query/Profile", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Profile(ctx, req.(*QueryProfileRequest)) @@ -282,7 +282,7 @@ func _Query_IncomingDTagTransferRequests_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/IncomingDTagTransferRequests", + FullMethod: "/desmos.profiles.v3.Query/IncomingDTagTransferRequests", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).IncomingDTagTransferRequests(ctx, req.(*QueryIncomingDTagTransferRequestsRequest)) @@ -300,7 +300,7 @@ func _Query_ChainLinks_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/ChainLinks", + FullMethod: "/desmos.profiles.v3.Query/ChainLinks", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ChainLinks(ctx, req.(*QueryChainLinksRequest)) @@ -318,7 +318,7 @@ func _Query_ChainLinkOwners_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/ChainLinkOwners", + FullMethod: "/desmos.profiles.v3.Query/ChainLinkOwners", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ChainLinkOwners(ctx, req.(*QueryChainLinkOwnersRequest)) @@ -336,7 +336,7 @@ func _Query_ApplicationLinks_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/ApplicationLinks", + FullMethod: "/desmos.profiles.v3.Query/ApplicationLinks", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ApplicationLinks(ctx, req.(*QueryApplicationLinksRequest)) @@ -354,7 +354,7 @@ func _Query_ApplicationLinkByClientID_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/ApplicationLinkByClientID", + FullMethod: "/desmos.profiles.v3.Query/ApplicationLinkByClientID", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ApplicationLinkByClientID(ctx, req.(*QueryApplicationLinkByClientIDRequest)) @@ -372,7 +372,7 @@ func _Query_ApplicationLinkOwners_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/ApplicationLinkOwners", + FullMethod: "/desmos.profiles.v3.Query/ApplicationLinkOwners", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ApplicationLinkOwners(ctx, req.(*QueryApplicationLinkOwnersRequest)) @@ -390,7 +390,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/desmos.profiles.v2.Query/Params", + FullMethod: "/desmos.profiles.v3.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -399,7 +399,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "desmos.profiles.v2.Query", + ServiceName: "desmos.profiles.v3.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -436,5 +436,5 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "desmos/profiles/v2/query.proto", + Metadata: "desmos/profiles/v3/query.proto", } diff --git a/x/profiles/types/query.pb.gw.go b/x/profiles/types/query.pb.gw.go index 5ec0613d09..5fc0d2acad 100644 --- a/x/profiles/types/query.pb.gw.go +++ b/x/profiles/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: desmos/profiles/v2/query.proto +// source: desmos/profiles/v3/query.proto /* Package types is a reverse proxy. @@ -708,21 +708,21 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Profile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 1, 0, 4, 1, 5, 3}, []string{"desmos", "profiles", "v2", "user"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Profile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 1, 0, 4, 1, 5, 3}, []string{"desmos", "profiles", "v3", "user"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_IncomingDTagTransferRequests_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v2", "dtag-transfer-requests"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_IncomingDTagTransferRequests_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v3", "dtag-transfer-requests"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ChainLinks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v2", "chain-links"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_ChainLinks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v3", "chain-links"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ChainLinkOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"desmos", "profiles", "v2", "chain-links", "owners"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_ChainLinkOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"desmos", "profiles", "v3", "chain-links", "owners"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ApplicationLinks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v2", "app-links"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_ApplicationLinks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v3", "app-links"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ApplicationLinkByClientID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"desmos", "profiles", "v2", "app-links", "clients", "client_id"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_ApplicationLinkByClientID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"desmos", "profiles", "v3", "app-links", "clients", "client_id"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ApplicationLinkOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"desmos", "profiles", "v2", "app-links", "owners"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_ApplicationLinkOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"desmos", "profiles", "v3", "app-links", "owners"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v2", "params"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"desmos", "profiles", "v3", "params"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( diff --git a/x/profiles/types/query_app_links.pb.go b/x/profiles/types/query_app_links.pb.go index fff4848105..22106d1fb7 100644 --- a/x/profiles/types/query_app_links.pb.go +++ b/x/profiles/types/query_app_links.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/query_app_links.proto +// source: desmos/profiles/v3/query_app_links.proto package types @@ -47,7 +47,7 @@ func (m *QueryApplicationLinksRequest) Reset() { *m = QueryApplicationLi func (m *QueryApplicationLinksRequest) String() string { return proto.CompactTextString(m) } func (*QueryApplicationLinksRequest) ProtoMessage() {} func (*QueryApplicationLinksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{0} + return fileDescriptor_b3b6ad0478f8a288, []int{0} } func (m *QueryApplicationLinksRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -116,7 +116,7 @@ func (m *QueryApplicationLinksResponse) Reset() { *m = QueryApplicationL func (m *QueryApplicationLinksResponse) String() string { return proto.CompactTextString(m) } func (*QueryApplicationLinksResponse) ProtoMessage() {} func (*QueryApplicationLinksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{1} + return fileDescriptor_b3b6ad0478f8a288, []int{1} } func (m *QueryApplicationLinksResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -170,7 +170,7 @@ func (m *QueryApplicationLinkByClientIDRequest) Reset() { *m = QueryAppl func (m *QueryApplicationLinkByClientIDRequest) String() string { return proto.CompactTextString(m) } func (*QueryApplicationLinkByClientIDRequest) ProtoMessage() {} func (*QueryApplicationLinkByClientIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{2} + return fileDescriptor_b3b6ad0478f8a288, []int{2} } func (m *QueryApplicationLinkByClientIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -218,7 +218,7 @@ func (m *QueryApplicationLinkByClientIDResponse) Reset() { func (m *QueryApplicationLinkByClientIDResponse) String() string { return proto.CompactTextString(m) } func (*QueryApplicationLinkByClientIDResponse) ProtoMessage() {} func (*QueryApplicationLinkByClientIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{3} + return fileDescriptor_b3b6ad0478f8a288, []int{3} } func (m *QueryApplicationLinkByClientIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -271,7 +271,7 @@ func (m *QueryApplicationLinkOwnersRequest) Reset() { *m = QueryApplicat func (m *QueryApplicationLinkOwnersRequest) String() string { return proto.CompactTextString(m) } func (*QueryApplicationLinkOwnersRequest) ProtoMessage() {} func (*QueryApplicationLinkOwnersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{4} + return fileDescriptor_b3b6ad0478f8a288, []int{4} } func (m *QueryApplicationLinkOwnersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -334,7 +334,7 @@ func (m *QueryApplicationLinkOwnersResponse) Reset() { *m = QueryApplica func (m *QueryApplicationLinkOwnersResponse) String() string { return proto.CompactTextString(m) } func (*QueryApplicationLinkOwnersResponse) ProtoMessage() {} func (*QueryApplicationLinkOwnersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{5} + return fileDescriptor_b3b6ad0478f8a288, []int{5} } func (m *QueryApplicationLinkOwnersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -393,7 +393,7 @@ func (m *QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails) String( } func (*QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails) ProtoMessage() {} func (*QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails) Descriptor() ([]byte, []int) { - return fileDescriptor_df55d222350c3dbf, []int{5, 0} + return fileDescriptor_b3b6ad0478f8a288, []int{5, 0} } func (m *QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -444,54 +444,54 @@ func (m *QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails) GetUser } func init() { - proto.RegisterType((*QueryApplicationLinksRequest)(nil), "desmos.profiles.v2.QueryApplicationLinksRequest") - proto.RegisterType((*QueryApplicationLinksResponse)(nil), "desmos.profiles.v2.QueryApplicationLinksResponse") - proto.RegisterType((*QueryApplicationLinkByClientIDRequest)(nil), "desmos.profiles.v2.QueryApplicationLinkByClientIDRequest") - proto.RegisterType((*QueryApplicationLinkByClientIDResponse)(nil), "desmos.profiles.v2.QueryApplicationLinkByClientIDResponse") - proto.RegisterType((*QueryApplicationLinkOwnersRequest)(nil), "desmos.profiles.v2.QueryApplicationLinkOwnersRequest") - proto.RegisterType((*QueryApplicationLinkOwnersResponse)(nil), "desmos.profiles.v2.QueryApplicationLinkOwnersResponse") - proto.RegisterType((*QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails)(nil), "desmos.profiles.v2.QueryApplicationLinkOwnersResponse.ApplicationLinkOwnerDetails") + proto.RegisterType((*QueryApplicationLinksRequest)(nil), "desmos.profiles.v3.QueryApplicationLinksRequest") + proto.RegisterType((*QueryApplicationLinksResponse)(nil), "desmos.profiles.v3.QueryApplicationLinksResponse") + proto.RegisterType((*QueryApplicationLinkByClientIDRequest)(nil), "desmos.profiles.v3.QueryApplicationLinkByClientIDRequest") + proto.RegisterType((*QueryApplicationLinkByClientIDResponse)(nil), "desmos.profiles.v3.QueryApplicationLinkByClientIDResponse") + proto.RegisterType((*QueryApplicationLinkOwnersRequest)(nil), "desmos.profiles.v3.QueryApplicationLinkOwnersRequest") + proto.RegisterType((*QueryApplicationLinkOwnersResponse)(nil), "desmos.profiles.v3.QueryApplicationLinkOwnersResponse") + proto.RegisterType((*QueryApplicationLinkOwnersResponse_ApplicationLinkOwnerDetails)(nil), "desmos.profiles.v3.QueryApplicationLinkOwnersResponse.ApplicationLinkOwnerDetails") } func init() { - proto.RegisterFile("desmos/profiles/v2/query_app_links.proto", fileDescriptor_df55d222350c3dbf) + proto.RegisterFile("desmos/profiles/v3/query_app_links.proto", fileDescriptor_b3b6ad0478f8a288) } -var fileDescriptor_df55d222350c3dbf = []byte{ - // 521 bytes of a gzipped FileDescriptorProto +var fileDescriptor_b3b6ad0478f8a288 = []byte{ + // 522 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xc1, 0x6e, 0x13, 0x31, - 0x10, 0x8d, 0x93, 0x50, 0xb5, 0xce, 0xcd, 0xe2, 0x90, 0x6e, 0xcb, 0x12, 0x82, 0x28, 0x01, 0x09, - 0x5b, 0x09, 0x5c, 0x11, 0x22, 0x44, 0xa0, 0x0a, 0x24, 0x60, 0x8f, 0x5c, 0x22, 0x6f, 0xe2, 0x2e, - 0x16, 0x1b, 0xdb, 0x5d, 0x7b, 0x03, 0xf9, 0x0b, 0x7e, 0x83, 0x3f, 0xe0, 0x13, 0x7a, 0xcc, 0x91, - 0x13, 0x42, 0xc9, 0x8f, 0xa0, 0xb5, 0xdd, 0xa6, 0x0d, 0x4b, 0x22, 0x50, 0x6f, 0x9e, 0x79, 0x6f, - 0x66, 0xde, 0xbc, 0x4c, 0x16, 0x76, 0xc6, 0x4c, 0x4f, 0xa4, 0x26, 0x2a, 0x93, 0x27, 0x3c, 0x65, - 0x9a, 0x4c, 0x7b, 0xe4, 0x34, 0x67, 0xd9, 0x6c, 0x48, 0x95, 0x1a, 0xa6, 0x5c, 0x7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x0c, 0x2b, 0x1f, 0xba, 0x09, 0x37, 0x1f, 0xf3, - 0x18, 0x8f, 0xe4, 0x84, 0x38, 0xff, 0x1e, 0xa5, 0x34, 0xd6, 0xfe, 0x4d, 0xa6, 0x4f, 0xc8, 0x97, - 0xd5, 0xc7, 0xcb, 0xcc, 0x14, 0xd3, 0xf1, 0x8e, 0xfd, 0xd0, 0x3c, 0xfe, 0x1d, 0x00, 0x00, 0xff, - 0xff, 0x35, 0x2f, 0xb5, 0xb4, 0x69, 0x05, 0x00, 0x00, + 0x10, 0x8d, 0x93, 0x50, 0xb5, 0xce, 0x6d, 0xc5, 0x61, 0xbb, 0x2d, 0x4b, 0x08, 0xa2, 0x04, 0x24, + 0x6c, 0xa5, 0xe1, 0x8a, 0x10, 0x21, 0x02, 0x55, 0x20, 0x01, 0x7b, 0xe4, 0x12, 0x79, 0x13, 0x77, + 0xb1, 0xd8, 0xd8, 0xee, 0xda, 0x1b, 0xc8, 0x5f, 0xf0, 0x1b, 0xfc, 0x01, 0x9f, 0xd0, 0x63, 0x8e, + 0x9c, 0x10, 0x4a, 0x7e, 0x04, 0xad, 0xed, 0x36, 0x6d, 0x58, 0x12, 0x51, 0xe5, 0xe6, 0x99, 0xf7, + 0x66, 0xe6, 0xcd, 0xcb, 0x64, 0x61, 0x7b, 0x44, 0xd5, 0x58, 0x28, 0x2c, 0x33, 0x71, 0xca, 0x52, + 0xaa, 0xf0, 0xa4, 0x8b, 0xcf, 0x72, 0x9a, 0x4d, 0x07, 0x44, 0xca, 0x41, 0xca, 0xf8, 0x67, 0x85, + 0x64, 0x26, 0xb4, 0xf0, 0x3c, 0xcb, 0x44, 0x17, 0x4c, 0x34, 0xe9, 0x06, 0xb7, 0x13, 0x91, 0x08, + 0x03, 0xe3, 0xe2, 0x65, 0x99, 0xc1, 0x61, 0x22, 0x44, 0x92, 0x52, 0x4c, 0x24, 0xc3, 0x84, 0x73, + 0xa1, 0x89, 0x66, 0x82, 0xbb, 0x3e, 0xc1, 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xd6, 0xf6, 0x1c, 0x69, 0x05, 0x00, 0x00, } func (m *QueryApplicationLinksRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/query_chain_links.pb.go b/x/profiles/types/query_chain_links.pb.go index 740fed69a5..13e853c2b9 100644 --- a/x/profiles/types/query_chain_links.pb.go +++ b/x/profiles/types/query_chain_links.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/query_chain_links.proto +// source: desmos/profiles/v3/query_chain_links.proto package types @@ -48,7 +48,7 @@ func (m *QueryChainLinksRequest) Reset() { *m = QueryChainLinksRequest{} func (m *QueryChainLinksRequest) String() string { return proto.CompactTextString(m) } func (*QueryChainLinksRequest) ProtoMessage() {} func (*QueryChainLinksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f3f86dba4268625b, []int{0} + return fileDescriptor_17ef8689aa5884e9, []int{0} } func (m *QueryChainLinksRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -117,7 +117,7 @@ func (m *QueryChainLinksResponse) Reset() { *m = QueryChainLinksResponse func (m *QueryChainLinksResponse) String() string { return proto.CompactTextString(m) } func (*QueryChainLinksResponse) ProtoMessage() {} func (*QueryChainLinksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f3f86dba4268625b, []int{1} + return fileDescriptor_17ef8689aa5884e9, []int{1} } func (m *QueryChainLinksResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -177,7 +177,7 @@ func (m *QueryChainLinkOwnersRequest) Reset() { *m = QueryChainLinkOwner func (m *QueryChainLinkOwnersRequest) String() string { return proto.CompactTextString(m) } func (*QueryChainLinkOwnersRequest) ProtoMessage() {} func (*QueryChainLinkOwnersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f3f86dba4268625b, []int{2} + return fileDescriptor_17ef8689aa5884e9, []int{2} } func (m *QueryChainLinkOwnersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -240,7 +240,7 @@ func (m *QueryChainLinkOwnersResponse) Reset() { *m = QueryChainLinkOwne func (m *QueryChainLinkOwnersResponse) String() string { return proto.CompactTextString(m) } func (*QueryChainLinkOwnersResponse) ProtoMessage() {} func (*QueryChainLinkOwnersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f3f86dba4268625b, []int{3} + return fileDescriptor_17ef8689aa5884e9, []int{3} } func (m *QueryChainLinkOwnersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -298,7 +298,7 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) String() string { } func (*QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) ProtoMessage() {} func (*QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) Descriptor() ([]byte, []int) { - return fileDescriptor_f3f86dba4268625b, []int{3, 0} + return fileDescriptor_17ef8689aa5884e9, []int{3, 0} } func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -349,49 +349,49 @@ func (m *QueryChainLinkOwnersResponse_ChainLinkOwnerDetails) GetTarget() string } func init() { - proto.RegisterType((*QueryChainLinksRequest)(nil), "desmos.profiles.v2.QueryChainLinksRequest") - proto.RegisterType((*QueryChainLinksResponse)(nil), "desmos.profiles.v2.QueryChainLinksResponse") - proto.RegisterType((*QueryChainLinkOwnersRequest)(nil), "desmos.profiles.v2.QueryChainLinkOwnersRequest") - proto.RegisterType((*QueryChainLinkOwnersResponse)(nil), "desmos.profiles.v2.QueryChainLinkOwnersResponse") - proto.RegisterType((*QueryChainLinkOwnersResponse_ChainLinkOwnerDetails)(nil), "desmos.profiles.v2.QueryChainLinkOwnersResponse.ChainLinkOwnerDetails") + proto.RegisterType((*QueryChainLinksRequest)(nil), "desmos.profiles.v3.QueryChainLinksRequest") + proto.RegisterType((*QueryChainLinksResponse)(nil), "desmos.profiles.v3.QueryChainLinksResponse") + proto.RegisterType((*QueryChainLinkOwnersRequest)(nil), "desmos.profiles.v3.QueryChainLinkOwnersRequest") + proto.RegisterType((*QueryChainLinkOwnersResponse)(nil), "desmos.profiles.v3.QueryChainLinkOwnersResponse") + proto.RegisterType((*QueryChainLinkOwnersResponse_ChainLinkOwnerDetails)(nil), "desmos.profiles.v3.QueryChainLinkOwnersResponse.ChainLinkOwnerDetails") } func init() { - proto.RegisterFile("desmos/profiles/v2/query_chain_links.proto", fileDescriptor_f3f86dba4268625b) + proto.RegisterFile("desmos/profiles/v3/query_chain_links.proto", fileDescriptor_17ef8689aa5884e9) } -var fileDescriptor_f3f86dba4268625b = []byte{ +var fileDescriptor_17ef8689aa5884e9 = []byte{ // 476 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0x4f, 0x6f, 0xd3, 0x30, 0x18, 0x87, 0xeb, 0xb6, 0x54, 0x9a, 0x77, 0xb3, 0x60, 0x64, 0x61, 0x0b, 0xd5, 0x0e, 0x50, 0x0d, - 0x61, 0xab, 0x85, 0x0b, 0xd7, 0x81, 0xc6, 0x01, 0xc4, 0x9f, 0x1e, 0xb9, 0x54, 0x4e, 0xfb, 0x2e, - 0xb3, 0x48, 0xec, 0x2c, 0x76, 0x0a, 0xfd, 0x16, 0x7c, 0x00, 0xf8, 0x04, 0x9c, 0xf8, 0x16, 0x3b, - 0xee, 0xc8, 0x09, 0xa1, 0xf6, 0x8b, 0xa0, 0xd8, 0x66, 0x23, 0x6a, 0x18, 0x12, 0xea, 0xcd, 0xaf, - 0xdf, 0xd7, 0xfe, 0x3d, 0x7d, 0x1a, 0xe3, 0xc3, 0x19, 0xe8, 0x4c, 0x69, 0x96, 0x17, 0xea, 0x44, - 0xa4, 0xa0, 0xd9, 0x7c, 0xc4, 0xce, 0x4a, 0x28, 0x16, 0x93, 0xe9, 0x29, 0x17, 0x72, 0x92, 0x0a, - 0xf9, 0x5e, 0xd3, 0xbc, 0x50, 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+ 0xe3, 0x3b, 0x8d, 0x79, 0x37, 0xf8, 0xe9, 0x1e, 0xbe, 0x3c, 0x5b, 0x46, 0xe8, 0x7c, 0x19, 0xa1, + 0x5f, 0xcb, 0x08, 0x7d, 0x5e, 0x45, 0xad, 0xf3, 0x55, 0xd4, 0xfa, 0xb1, 0x8a, 0x5a, 0xef, 0x87, + 0x89, 0x30, 0x27, 0x65, 0x4c, 0xa7, 0x2a, 0x63, 0x4e, 0xd3, 0xe3, 0x94, 0xc7, 0xda, 0xaf, 0xd9, + 0xfc, 0x09, 0xfb, 0x74, 0xf9, 0x94, 0xcd, 0x22, 0x07, 0x1d, 0xf7, 0xec, 0xa3, 0x1b, 0xfd, 0x0e, + 0x00, 0x00, 0xff, 0xff, 0x34, 0x00, 0x65, 0xf3, 0x79, 0x04, 0x00, 0x00, } func (m *QueryChainLinksRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/query_dtag_requests.pb.go b/x/profiles/types/query_dtag_requests.pb.go index 3db5f2ea36..97d1ea3c26 100644 --- a/x/profiles/types/query_dtag_requests.pb.go +++ b/x/profiles/types/query_dtag_requests.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/query_dtag_requests.proto +// source: desmos/profiles/v3/query_dtag_requests.proto package types @@ -43,7 +43,7 @@ func (m *QueryIncomingDTagTransferRequestsRequest) Reset() { func (m *QueryIncomingDTagTransferRequestsRequest) String() string { return proto.CompactTextString(m) } func (*QueryIncomingDTagTransferRequestsRequest) ProtoMessage() {} func (*QueryIncomingDTagTransferRequestsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1695790c33fec123, []int{0} + return fileDescriptor_ba6e00c149c010bd, []int{0} } func (m *QueryIncomingDTagTransferRequestsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -90,7 +90,7 @@ func (m *QueryIncomingDTagTransferRequestsResponse) String() string { } func (*QueryIncomingDTagTransferRequestsResponse) ProtoMessage() {} func (*QueryIncomingDTagTransferRequestsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1695790c33fec123, []int{1} + return fileDescriptor_ba6e00c149c010bd, []int{1} } func (m *QueryIncomingDTagTransferRequestsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -134,41 +134,41 @@ func (m *QueryIncomingDTagTransferRequestsResponse) GetPagination() *query.PageR } func init() { - proto.RegisterType((*QueryIncomingDTagTransferRequestsRequest)(nil), "desmos.profiles.v2.QueryIncomingDTagTransferRequestsRequest") - proto.RegisterType((*QueryIncomingDTagTransferRequestsResponse)(nil), "desmos.profiles.v2.QueryIncomingDTagTransferRequestsResponse") + proto.RegisterType((*QueryIncomingDTagTransferRequestsRequest)(nil), "desmos.profiles.v3.QueryIncomingDTagTransferRequestsRequest") + proto.RegisterType((*QueryIncomingDTagTransferRequestsResponse)(nil), "desmos.profiles.v3.QueryIncomingDTagTransferRequestsResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/query_dtag_requests.proto", fileDescriptor_1695790c33fec123) + proto.RegisterFile("desmos/profiles/v3/query_dtag_requests.proto", fileDescriptor_ba6e00c149c010bd) } -var fileDescriptor_1695790c33fec123 = []byte{ - // 395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xb1, 0xce, 0xd3, 0x30, - 0x14, 0x85, 0x63, 0x40, 0xe8, 0x27, 0xff, 0x16, 0x31, 0xb4, 0x11, 0x4a, 0xab, 0x0e, 0x34, 0x20, - 0x6a, 0xab, 0x81, 0x89, 0xb1, 0x42, 0xa0, 0x8a, 0x05, 0xa2, 0x4e, 0x2c, 0x95, 0x93, 0xde, 0x9a, +var fileDescriptor_ba6e00c149c010bd = []byte{ + // 396 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xb1, 0xae, 0xd3, 0x30, + 0x18, 0x85, 0x63, 0x40, 0xe8, 0x92, 0xbb, 0x45, 0x0c, 0x6d, 0x84, 0xd2, 0xaa, 0x03, 0x0d, 0x88, + 0xda, 0x6a, 0xcb, 0xc4, 0x58, 0x21, 0x50, 0xc5, 0x02, 0x51, 0x27, 0x96, 0xca, 0x49, 0xff, 0x9a, 0x48, 0x89, 0x9d, 0xda, 0x4e, 0x44, 0xdf, 0x80, 0x91, 0x91, 0xb1, 0x6f, 0xc2, 0xda, 0xb1, 0x23, - 0x13, 0x42, 0xed, 0xc2, 0x63, 0xa0, 0xc4, 0xa6, 0xad, 0x44, 0x24, 0x98, 0xe2, 0x9b, 0x73, 0x7c, - 0xf2, 0x1d, 0xdd, 0xb8, 0xcf, 0x56, 0xa0, 0x0a, 0xa1, 0x48, 0x29, 0xc5, 0x3a, 0xcb, 0x41, 0x91, - 0x3a, 0x22, 0x9b, 0x0a, 0xe4, 0x76, 0xb9, 0xd2, 0x94, 0x2d, 0x25, 0x6c, 0x2a, 0x50, 0x5a, 0xe1, - 0x52, 0x0a, 0x2d, 0x3c, 0xcf, 0xb8, 0xf1, 0x1f, 0x37, 0xae, 0x23, 0xff, 0x21, 0x13, 0x4c, 0xb4, - 0x32, 0x69, 0x4e, 0xc6, 0xe9, 0x3f, 0x62, 0x42, 0xb0, 0x1c, 0x08, 0x2d, 0x33, 0x42, 0x39, 0x17, - 0x9a, 0xea, 0x4c, 0x70, 0x9b, 0xe3, 0xf7, 0xad, 0xda, 0x4e, 0x49, 0xb5, 0x26, 0x94, 0x6f, 0xad, - 0x34, 0xe9, 0x00, 0x2a, 0xc4, 0x0a, 0x72, 0xd5, 0x45, 0xe4, 0xf7, 0x53, 0xd1, 0xd8, 0x97, 0x06, - 0xc0, 0x0c, 0x56, 0x7a, 0x6a, 0x26, 0x92, 0x50, 0x05, 0xa6, 0x13, 0xa9, 0xa7, 0x09, 0x68, 0x3a, - 0x25, 0x25, 0x65, 0x19, 0x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bb, 0xb0, 0xe7, 0xbf, 0x03, 0x00, - 0x00, 0xff, 0xff, 0x6c, 0x46, 0x82, 0xd5, 0xb9, 0x02, 0x00, 0x00, + 0x13, 0x42, 0xed, 0xc2, 0x63, 0xa0, 0xc4, 0xa6, 0xad, 0x44, 0x24, 0xee, 0x14, 0xff, 0x39, 0xc7, + 0x27, 0xdf, 0xd1, 0x1f, 0xf7, 0xc5, 0x0a, 0x54, 0x2e, 0x14, 0x29, 0xa4, 0x58, 0xa7, 0x19, 0x28, + 0x52, 0x4d, 0xc9, 0xa6, 0x04, 0xb9, 0x5d, 0xae, 0x34, 0x65, 0x4b, 0x09, 0x9b, 0x12, 0x94, 0x56, + 0xb8, 0x90, 0x42, 0x0b, 0xcf, 0x33, 0x6e, 0xfc, 0xd7, 0x8d, 0xab, 0xa9, 0xff, 0x98, 0x09, 0x26, + 0x1a, 0x99, 0xd4, 0x27, 0xe3, 0xf4, 0x9f, 0x30, 0x21, 0x58, 0x06, 0x84, 0x16, 0x29, 0xa1, 0x9c, + 0x0b, 0x4d, 0x75, 0x2a, 0xb8, 0xcd, 0xf1, 0xbb, 0x56, 0x6d, 0xa6, 0xb8, 0x5c, 0x13, 0xca, 0xb7, + 0x56, 0x1a, 0xb5, 0x00, 0xe5, 0x62, 0x05, 0x99, 0x6a, 0x23, 0xf2, 0xbb, 0x89, 0xa8, 0xed, 0x4b, + 0x03, 0x60, 0x06, 0x2b, 0x3d, 0x37, 0x13, 0x89, 0xa9, 0x02, 0xd3, 0x89, 0x54, 0xe3, 0x18, 0x34, + 0x1d, 0x93, 0x82, 0xb2, 0x94, 0x37, 0x44, 0xc6, 0x3b, 0xf8, 0x86, 0xdc, 0xf0, 0x43, 0x6d, 0x99, + 0xf3, 0x44, 0xe4, 0x29, 0x67, 0xaf, 0x17, 0x94, 0x2d, 0x24, 0xe5, 0x6a, 0x0d, 0x32, 0xb2, 0x9f, + 0xb4, 0x4f, 0xcf, 0x77, 0x6f, 0x24, 0x24, 0x90, 0x56, 0x20, 0x3b, 0xa8, 0x8f, 0xc2, 0x47, 0xd1, + 0x79, 0xf6, 0xde, 0xb8, 0xee, 0x25, 0xbc, 0x73, 0xaf, 0x8f, 0xc2, 0xdb, 0xc9, 0x53, 0x6c, 0xb9, + 0x6a, 0x12, 0xdc, 0x90, 0x60, 0x4b, 0x82, 0xdf, 0x53, 0x06, 0x36, 0x37, 0xba, 0xba, 0xf9, 0xea, + 0xe6, 0xcb, 0xae, 0xe7, 0xfc, 0xde, 0xf5, 0x9c, 0xc1, 0x77, 0xe4, 0x3e, 0xbb, 0x03, 0x9a, 0x2a, + 0x04, 0x57, 0xe0, 0xcd, 0x6b, 0x36, 0xf3, 0xae, 0x83, 0xfa, 0xf7, 0xc3, 0xdb, 0xc9, 0x10, 0xff, + 0xbb, 0x34, 0xdc, 0x92, 0x31, 0x7b, 0xb0, 0xff, 0xd9, 0x73, 0xa2, 0xf3, 0x75, 0xef, 0x6d, 0x4b, + 0x95, 0xe1, 0x7f, 0xab, 0x18, 0x8e, 0xeb, 0x2e, 0xb3, 0x77, 0xfb, 0x63, 0x80, 0x0e, 0xc7, 0x00, + 0xfd, 0x3a, 0x06, 0xe8, 0xeb, 0x29, 0x70, 0x0e, 0xa7, 0xc0, 0xf9, 0x71, 0x0a, 0x9c, 0x8f, 0x63, + 0x96, 0xea, 0x4f, 0x65, 0x8c, 0x13, 0x91, 0x13, 0x43, 0x39, 0xca, 0x68, 0xac, 0xec, 0x99, 0x54, + 0x2f, 0xc9, 0xe7, 0xcb, 0x8f, 0xa0, 0xb7, 0x05, 0xa8, 0xf8, 0x61, 0xb3, 0xb0, 0xe9, 0x9f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xb6, 0xcd, 0x12, 0xd1, 0xb9, 0x02, 0x00, 0x00, } func (m *QueryIncomingDTagTransferRequestsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/query_params.pb.go b/x/profiles/types/query_params.pb.go index 627a659f57..8083507a39 100644 --- a/x/profiles/types/query_params.pb.go +++ b/x/profiles/types/query_params.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/query_params.proto +// source: desmos/profiles/v3/query_params.proto package types @@ -35,7 +35,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3cc715515401743a, []int{0} + return fileDescriptor_9afa8e27b0a00e24, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -73,7 +73,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3cc715515401743a, []int{1} + return fileDescriptor_9afa8e27b0a00e24, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -110,19 +110,19 @@ func (m *QueryParamsResponse) GetParams() Params { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "desmos.profiles.v2.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "desmos.profiles.v2.QueryParamsResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "desmos.profiles.v3.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "desmos.profiles.v3.QueryParamsResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/query_params.proto", fileDescriptor_3cc715515401743a) + proto.RegisterFile("desmos/profiles/v3/query_params.proto", fileDescriptor_9afa8e27b0a00e24) } -var fileDescriptor_3cc715515401743a = []byte{ +var fileDescriptor_9afa8e27b0a00e24 = []byte{ // 294 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xb1, 0x4e, 0xf3, 0x30, 0x14, 0x85, 0x13, 0xe9, 0x57, 0x87, 0xfc, 0x5b, 0xe8, 0x40, 0x23, 0x64, 0x50, 0x25, 0x10, 0x42, - 0xc2, 0x57, 0x0d, 0x0c, 0xcc, 0x5d, 0x19, 0x80, 0x8e, 0x2c, 0x95, 0xdd, 0xba, 0x26, 0x52, 0xe2, + 0xc2, 0x57, 0x25, 0x0c, 0xcc, 0x5d, 0x19, 0x80, 0x8e, 0x2c, 0x95, 0xdd, 0xba, 0x26, 0x52, 0xe2, 0xeb, 0xc6, 0x4e, 0x44, 0xde, 0x82, 0xc7, 0xea, 0xd8, 0x91, 0x09, 0xa1, 0xe4, 0x45, 0x50, 0x62, 0x23, 0x54, 0xc1, 0x76, 0x8f, 0xcf, 0xe7, 0xe3, 0xe3, 0x1b, 0x9d, 0xaf, 0x85, 0x29, 0xd0, 0x80, 0x2e, 0x71, 0x93, 0xe5, 0xc2, 0x40, 0x9d, 0xc2, 0xb6, 0x12, 0x65, 0xb3, 0xd4, 0xac, 0x64, 0x85, @@ -133,12 +133,12 @@ var fileDescriptor_3cc715515401743a = []byte{ 0x09, 0x6f, 0x5d, 0x39, 0x05, 0x9c, 0x19, 0xe1, 0x7e, 0x01, 0xf5, 0x8c, 0x0b, 0xcb, 0x66, 0xa0, 0x99, 0xcc, 0xd4, 0x50, 0xc5, 0xb1, 0xd3, 0x71, 0x14, 0x3f, 0xf5, 0xc4, 0xe3, 0x90, 0xbd, 0x10, 0xdb, 0x4a, 0x18, 0x3b, 0x7d, 0x88, 0x8e, 0x0e, 0x4e, 0x8d, 0x46, 0x65, 0x44, 0x7c, 0x17, 0x8d, - 0x5c, 0x87, 0xe3, 0xf0, 0x2c, 0xbc, 0xfc, 0x9f, 0x26, 0xf4, 0xf7, 0x3e, 0xa8, 0xbb, 0x33, 0xff, - 0xb7, 0xfb, 0x38, 0x0d, 0x16, 0x9e, 0x9f, 0xdf, 0xef, 0x5a, 0x12, 0xee, 0x5b, 0x12, 0x7e, 0xb6, - 0x24, 0x7c, 0xeb, 0x48, 0xb0, 0xef, 0x48, 0xf0, 0xde, 0x91, 0xe0, 0x79, 0x26, 0x33, 0xfb, 0x52, - 0x71, 0xba, 0xc2, 0x02, 0x5c, 0xda, 0x75, 0xce, 0xb8, 0xf1, 0x33, 0xd4, 0xb7, 0xf0, 0xfa, 0xb3, - 0x0b, 0xdb, 0x68, 0x61, 0xf8, 0x68, 0xa8, 0x7e, 0xf3, 0x15, 0x00, 0x00, 0xff, 0xff, 0x95, 0x9c, - 0x44, 0x9d, 0xb5, 0x01, 0x00, 0x00, + 0x5c, 0x87, 0xe3, 0xf0, 0x2c, 0xbc, 0xfc, 0x7f, 0x93, 0xd0, 0xdf, 0xfb, 0xa0, 0xee, 0xce, 0xfc, + 0xdf, 0xee, 0xe3, 0x34, 0x58, 0x78, 0x7e, 0x7e, 0xbf, 0x6b, 0x49, 0xb8, 0x6f, 0x49, 0xf8, 0xd9, + 0x92, 0xf0, 0xad, 0x23, 0xc1, 0xbe, 0x23, 0xc1, 0x7b, 0x47, 0x82, 0xe7, 0x99, 0xcc, 0xec, 0x4b, + 0xc5, 0xe9, 0x0a, 0x0b, 0x70, 0x69, 0xd7, 0x39, 0xe3, 0xc6, 0xcf, 0x50, 0xdf, 0xc2, 0xeb, 0xcf, + 0x2e, 0x6c, 0xa3, 0x85, 0xe1, 0xa3, 0xa1, 0x7a, 0xfa, 0x15, 0x00, 0x00, 0xff, 0xff, 0xc4, 0x40, + 0x1c, 0xd7, 0xb5, 0x01, 0x00, 0x00, } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/types/query_profile.pb.go b/x/profiles/types/query_profile.pb.go index 5d473491e4..2708aa289c 100644 --- a/x/profiles/types/query_profile.pb.go +++ b/x/profiles/types/query_profile.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: desmos/profiles/v2/query_profile.proto +// source: desmos/profiles/v3/query_profile.proto package types @@ -37,7 +37,7 @@ func (m *QueryProfileRequest) Reset() { *m = QueryProfileRequest{} } func (m *QueryProfileRequest) String() string { return proto.CompactTextString(m) } func (*QueryProfileRequest) ProtoMessage() {} func (*QueryProfileRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_705b9d777999c138, []int{0} + return fileDescriptor_7c0e029b5401ec84, []int{0} } func (m *QueryProfileRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -75,7 +75,7 @@ func (m *QueryProfileResponse) Reset() { *m = QueryProfileResponse{} } func (m *QueryProfileResponse) String() string { return proto.CompactTextString(m) } func (*QueryProfileResponse) ProtoMessage() {} func (*QueryProfileResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_705b9d777999c138, []int{1} + return fileDescriptor_7c0e029b5401ec84, []int{1} } func (m *QueryProfileResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -112,36 +112,36 @@ func (m *QueryProfileResponse) GetProfile() *types.Any { } func init() { - proto.RegisterType((*QueryProfileRequest)(nil), "desmos.profiles.v2.QueryProfileRequest") - proto.RegisterType((*QueryProfileResponse)(nil), "desmos.profiles.v2.QueryProfileResponse") + proto.RegisterType((*QueryProfileRequest)(nil), "desmos.profiles.v3.QueryProfileRequest") + proto.RegisterType((*QueryProfileResponse)(nil), "desmos.profiles.v3.QueryProfileResponse") } func init() { - proto.RegisterFile("desmos/profiles/v2/query_profile.proto", fileDescriptor_705b9d777999c138) + proto.RegisterFile("desmos/profiles/v3/query_profile.proto", fileDescriptor_7c0e029b5401ec84) } -var fileDescriptor_705b9d777999c138 = []byte{ - // 319 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x51, 0xb1, 0x4e, 0xf3, 0x30, - 0x18, 0x4c, 0xa4, 0x5f, 0x3f, 0x25, 0x30, 0x85, 0x0e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xdb, - 0xc1, 0xf7, 0xb2, 0x1d, 0x74, 0xee, 0xa3, 0xe6, 0x5f, 0x93, 0x92, 0x28, 0x14, 0x8b, 0xaf, 0xa2, - 0x1d, 0xdf, 0xd8, 0x1a, 0xf7, 0xfa, 0x4d, 0xe2, 0x0a, 0x90, 0xba, 0x00, 0x19, 0x8a, 0x6a, 0xb4, - 0xff, 0xf1, 0xd6, 0x6d, 0x0c, 0xb3, 0x0c, 0x8d, 0xd0, 0xd7, 0xe3, 0xda, 0x32, 0xba, 0x79, 0x5f, - 0x27, 0xe1, 0x6a, 0x9d, 0x84, 0x5f, 0xeb, 0x24, 0x7c, 0xdd, 0x24, 0xc1, 0x6a, 0x93, 0x04, 0x9f, - 0x9b, 0x24, 0x78, 0xe8, 0xf1, 0x5c, 0x3f, 0x99, 0x94, 0x64, 0x38, 0x07, 0xf7, 0xb2, 0xdd, 0x19, - 0x4d, 0x95, 0x9f, 0xa1, 0xbc, 0x80, 0xe7, 0xdf, 0x2f, 0xd1, 0x95, 0x64, 0x2a, 0xfd, 0x6f, 0x13, - 0x07, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x43, 0xf4, 0x50, 0x8e, 0xb2, 0x01, 0x00, 0x00, +var fileDescriptor_7c0e029b5401ec84 = []byte{ + // 317 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x51, 0xb1, 0x4e, 0xc3, 0x30, + 0x14, 0x4c, 0x24, 0x04, 0x25, 0x30, 0x85, 0x0e, 0x50, 0xa1, 0x14, 0x75, 0x40, 0x08, 0xa9, 0x7e, + 0x2a, 0x61, 0x42, 0x2c, 0xed, 0x86, 0x58, 0xa0, 0x62, 0x62, 0xa9, 0x9c, 0xe0, 0x86, 0x48, 0xad, + 0x9f, 0x1b, 0xdb, 0x11, 0xf9, 0x03, 0x46, 0x3e, 0xa1, 0x1f, 0xc1, 0x47, 0x20, 0xa6, 0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, 0x53, 0xd4, 0x5c, 0xdd, 0x8c, 0x1b, 0xcb, 0xe8, 0xf6, 0x63, 0x1d, 0xf9, + 0xab, 0x75, 0xe4, 0x7f, 0xaf, 0x23, 0xff, 0x6d, 0x13, 0x79, 0xab, 0x4d, 0xe4, 0x7d, 0x6d, 0x22, + 0xef, 0x71, 0x90, 0xe5, 0xea, 0x59, 0x27, 0x24, 0xc5, 0x39, 0xd8, 0x97, 0xed, 0xcf, 0x68, 0x22, + 0xdd, 0x0c, 0xe5, 0x25, 0xbc, 0xfc, 0x7d, 0x89, 0xaa, 0x04, 0x93, 0xc9, 0xb6, 0x49, 0x8c, 0x7f, + 0x03, 0x00, 0x00, 0xff, 0xff, 0x01, 0x0a, 0x39, 0x3f, 0xb2, 0x01, 0x00, 0x00, } func (m *QueryProfileRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/profiles/wasm/querier_test.go b/x/profiles/wasm/querier_test.go index cceacc0f31..dbd5f80039 100644 --- a/x/profiles/wasm/querier_test.go +++ b/x/profiles/wasm/querier_test.go @@ -170,6 +170,7 @@ func (suite *TestSuite) TestProfilesWasmQuerier_QueryCustom() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), )), ) }, @@ -191,6 +192,7 @@ func (suite *TestSuite) TestProfilesWasmQuerier_QueryCustom() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), ), }, Pagination: &query.PageResponse{NextKey: nil, Total: 1}}, @@ -220,6 +222,7 @@ func (suite *TestSuite) TestProfilesWasmQuerier_QueryCustom() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), )), ) }, @@ -240,6 +243,7 @@ func (suite *TestSuite) TestProfilesWasmQuerier_QueryCustom() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), )}, ), }, @@ -271,6 +275,7 @@ func (suite *TestSuite) TestProfilesWasmQuerier_QueryCustom() { ), nil, time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), + time.Date(2020, 3, 1, 00, 00, 00, 000, time.UTC), )), ) }, diff --git a/x/relationships/legacy/v1/store_test.go b/x/relationships/legacy/v1/store_test.go index 918ab88d6b..ff90602a43 100644 --- a/x/relationships/legacy/v1/store_test.go +++ b/x/relationships/legacy/v1/store_test.go @@ -3,6 +3,8 @@ package v1_test import ( "testing" + v4types "github.com/desmos-labs/desmos/v4/x/profiles/legacy/v4/types" + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -27,27 +29,27 @@ func TestMigrateStore(t *testing.T) { store: func(ctx sdk.Context) { store := ctx.KVStore(storeKey) - blockBz := cdc.MustMarshal(&profilesv4.UserBlock{ + blockBz := cdc.MustMarshal(&v4types.UserBlock{ Blocker: "blocker", Blocked: "blocked", Reason: "reason", SubspaceID: "", }) - store.Set(profilesv4.UserBlockStoreKey("blocker", "", "blocked"), blockBz) + store.Set(v4types.UserBlockStoreKey("blocker", "", "blocked"), blockBz) - relBz := cdc.MustMarshal(&profilesv4.Relationship{ + relBz := cdc.MustMarshal(&v4types.Relationship{ Creator: "user", Recipient: "recipient", SubspaceID: "", }) - store.Set(profilesv4.RelationshipsStoreKey("user", "", "recipient"), relBz) + store.Set(v4types.RelationshipsStoreKey("user", "", "recipient"), relBz) - relBz = cdc.MustMarshal(&profilesv4.Relationship{ + relBz = cdc.MustMarshal(&v4types.Relationship{ Creator: "user", Recipient: "recipient", SubspaceID: "2", }) - store.Set(profilesv4.RelationshipsStoreKey("user", "2", "recipient"), relBz) + store.Set(v4types.RelationshipsStoreKey("user", "2", "recipient"), relBz) }, shouldErr: false, check: func(ctx sdk.Context) {