diff --git a/.github/workflows/on-chain-upgrade.yml b/.github/workflows/on-chain-upgrade.yml index 8c3b4a4d63..1ad9d906f4 100644 --- a/.github/workflows/on-chain-upgrade.yml +++ b/.github/workflows/on-chain-upgrade.yml @@ -22,9 +22,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 env: - GENESIS_DESMOS_VERSION: "v0.17.2" - GENESIS_URL: "https://raw.githubusercontent.com/desmos-labs/morpheus/master/morpheus-apollo-2/genesis.json" - UPGRADE_NAME: "desmos-v0.17.4-upgrade" + GENESIS_DESMOS_VERSION: "v1.0.4" + GENESIS_URL: "https://raw.githubusercontent.com/RiccardoM/desmos-states/master/morpheus-apollo-22003141.json" + UPGRADE_NAME: "v2.0.0" steps: - name: Checkout 🛎️ uses: actions/checkout@v2 @@ -34,17 +34,8 @@ jobs: with: go-version: 1.15 - - name: Compute diff 📜 - uses: technote-space/get-diff-action@v5.0.1 - with: - PATTERNS: | - **/**.go - go.mod - go.sum - - name: Install Desmos 🔧 run: make clean install - if: env.GIT_DIFF - name: Start testnet ⛓ run: | @@ -52,9 +43,7 @@ jobs: GENESIS_VERSION="$GENESIS_DESMOS_VERSION" \ GENESIS_URL="$GENESIS_URL" \ UPGRADE_NAME="$UPGRADE_NAME" - if: env.GIT_DIFF - name: Submit upgrade ✅ run: | - ./contrib/upgrade_testnet/submit_upgrade_proposal.sh 4 $UPGRADE_NAME 50 - if: env.GIT_DIFF \ No newline at end of file + ./contrib/upgrade_testnet/submit_upgrade_proposal.sh 4 $UPGRADE_NAME 50 \ No newline at end of file diff --git a/app/app.go b/app/app.go index 781017dfa7..4b62a255d5 100644 --- a/app/app.go +++ b/app/app.go @@ -98,6 +98,8 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" @@ -324,6 +326,7 @@ func NewDesmosApp( app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper) app.upgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp) + app.registerUpgradeHandlers() // register the staking hooks // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks @@ -369,7 +372,7 @@ func NewDesmosApp( &app.IBCKeeper.PortKeeper, scopedProfilesKeeper, ) - profilesModule := profiles.NewAppModule(appCodec, app.ProfileKeeper, app.AccountKeeper, app.BankKeeper) + profilesModule := profiles.NewAppModule(appCodec, legacyAmino, app.ProfileKeeper, app.AccountKeeper, app.BankKeeper) // Create static IBC router, add transfer route, then set and seal it ibcRouter := porttypes.NewRouter() @@ -500,7 +503,7 @@ func NewDesmosApp( // Custom modules //fees.NewAppModule(app.FeesKeeper, app.AccountKeeper), //posts.NewAppModule(app.appCodec, app.postsKeeper, app.AccountKeeper, app.BankKeeper), - profiles.NewAppModule(app.appCodec, app.ProfileKeeper, app.AccountKeeper, app.BankKeeper), + profiles.NewAppModule(app.appCodec, legacyAmino, app.ProfileKeeper, app.AccountKeeper, app.BankKeeper), //subspaces.NewAppModule(app.appCodec, app.SubspaceKeeper, app.AccountKeeper, app.BankKeeper), ) @@ -686,6 +689,49 @@ func (app *DesmosApp) RegisterTendermintService(clientCtx client.Context) { tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry) } +func (app *DesmosApp) registerUpgradeHandlers() { + app.upgradeKeeper.SetUpgradeHandler("v2.0.0", func(ctx sdk.Context, plan upgradetypes.Plan, _ module.VersionMap) (module.VersionMap, error) { + // 1st-time running in-store migrations, using 1 as fromVersion to + // avoid running InitGenesis. + fromVM := map[string]uint64{ + authtypes.ModuleName: 1, + banktypes.ModuleName: 1, + capabilitytypes.ModuleName: 1, + crisistypes.ModuleName: 1, + distrtypes.ModuleName: 1, + evidencetypes.ModuleName: 1, + govtypes.ModuleName: 1, + minttypes.ModuleName: 1, + paramstypes.ModuleName: 1, + slashingtypes.ModuleName: 1, + stakingtypes.ModuleName: 1, + upgradetypes.ModuleName: 1, + vestingtypes.ModuleName: 1, + ibchost.ModuleName: 1, + genutiltypes.ModuleName: 1, + ibctransfertypes.ModuleName: 1, + + profilestypes.ModuleName: 1, + } + + return app.mm.RunMigrations(ctx, app.configurator, fromVM) + }) + + upgradeInfo, err := app.upgradeKeeper.ReadUpgradeInfoFromDisk() + if err != nil { + panic(err) + } + + if upgradeInfo.Name == "v2.0.0" && !app.upgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + storeUpgrades := storetypes.StoreUpgrades{ + Added: []string{authz.ModuleName, feegrant.ModuleName}, + } + + // configure store loader that checks if version == upgradeHeight and applies store upgrades + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) + } +} + // RegisterSwaggerAPI registers swagger route with API Server func RegisterSwaggerAPI(ctx client.Context, rtr *mux.Router) { statikFS, err := fs.New() diff --git a/contrib/upgrade_testnet/docker-compose.yml b/contrib/upgrade_testnet/docker-compose.yml index e8e323fa0d..f820e4d0a1 100644 --- a/contrib/upgrade_testnet/docker-compose.yml +++ b/contrib/upgrade_testnet/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: desmosnode0: container_name: desmosnode0 - image: "desmoslabs/desmos-cosmovisor:v0.17.2" + image: "desmoslabs/desmos-cosmovisor:v1.0.4" command: "start" ports: - "26656-26657:26656-26657" @@ -19,7 +19,7 @@ services: desmosnode1: container_name: desmosnode1 - image: "desmoslabs/desmos-cosmovisor:v0.17.2" + image: "desmoslabs/desmos-cosmovisor:v1.0.4" command: "start" ports: - "26666-26667:26656-26657" @@ -35,7 +35,7 @@ services: desmosnode2: container_name: desmosnode2 - image: "desmoslabs/desmos-cosmovisor:v0.17.2" + image: "desmoslabs/desmos-cosmovisor:v1.0.4" command: "start" ports: - "26676-26677:26656-26657" @@ -51,7 +51,7 @@ services: desmosnode3: container_name: desmosnode3 - image: "desmoslabs/desmos-cosmovisor:v0.17.2" + image: "desmoslabs/desmos-cosmovisor:v1.0.4" command: "start" ports: - "26686-26687:26656-26657" diff --git a/contrib/upgrade_testnet/start.sh b/contrib/upgrade_testnet/start.sh index 1bbacb12fd..78212311ef 100755 --- a/contrib/upgrade_testnet/start.sh +++ b/contrib/upgrade_testnet/start.sh @@ -15,7 +15,7 @@ rm -r -f $BUILDDIR # Create the 4 nodes folders with the correct denom echo "===> Creating $NODES nodes localnet" -make setup-localnet COIN_DENOM="udaric" NODES=$NODES > /dev/null > 2 &> 1 +make setup-localnet COIN_DENOM="udaric" NODES=$NODES > /dev/null > /dev/null # Run the Python script to setup the genesis echo "===> Setting up the genesis file" @@ -34,7 +34,7 @@ sed -i "s|image: \".*\"|image: \"desmoslabs/desmos-cosmovisor:$GENESIS_VERSION\" # Build the current code using Alpine to make sure it's later compatible with the devnet echo "===> Building Desmos" -docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux > /dev/null > 2 &> 1 +docker run --rm --user $ID:$GID -v $(pwd):/desmos desmoslabs/desmos-build make build-linux > /dev/null # Copy the Desmos binary into the proper folders UPGRADE_FOLDER="$BUILDDIR/node0/desmos/cosmovisor/upgrades/$UPGRADE_NAME/bin" diff --git a/go.mod b/go.mod index 22e3834bb1..2abd42e25c 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,7 @@ require ( replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 -replace github.com/cosmos/cosmos-sdk => github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20210906075223-32780842edff +replace github.com/cosmos/cosmos-sdk => github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20210927075512-e26bf1014f50 replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index a72128a91f..56e9810b46 100644 --- a/go.sum +++ b/go.sum @@ -188,8 +188,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd/go.mod h1:3xOIaNNX19p0QrX0VqWa6voPRoJRGGYtny+DH8NEPvE= github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7uMjgxke/I= github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4= -github.com/cosmos/iavl v0.16.0 h1:ICIOB8xysirTX27GmVAaoeSpeozzgSu9d49w36xkVJA= -github.com/cosmos/iavl v0.16.0/go.mod h1:2A8O/Jz9YwtjqXMO0CjnnbTYEEaovE8jWcwrakH3PoE= +github.com/cosmos/iavl v0.17.1 h1:b/Cl8h1PRMvsu24+TYNlKchIu7W6tmxIBGe6E9u2Ybw= +github.com/cosmos/iavl v0.17.1/go.mod h1:7aisPZK8yCpQdy3PMvKeO+bhq1NwDjUwjzxwwROUxFk= github.com/cosmos/ibc-go v1.2.0 h1:0RgxmKzCzIH9SwDp4ckL5VrzlO1KJ5hO0AsOAzOiWE4= github.com/cosmos/ibc-go v1.2.0/go.mod h1:wGjeNd+T4kpGrt0OC8DTiE/qXLrlmTPNpdoYsBZUjKI= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= @@ -213,8 +213,8 @@ github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/desmos-labs/Go-Emoji-Utils v1.1.1-0.20210623064146-c30bc8196d0f h1:gUywWy8Pw1ROmF4o/qLy/FP1bEyEtjPg6a/RgdXmcCA= github.com/desmos-labs/Go-Emoji-Utils v1.1.1-0.20210623064146-c30bc8196d0f/go.mod h1:5TMhouV+kDGQZZrBK+rzBP+Jmeyu0V7WvrBHqukiTv8= -github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20210906075223-32780842edff h1:qU2BNu0sp6lQq3HoMT96cpj3M3Qyo/UGRqlM7T8Kw1E= -github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20210906075223-32780842edff/go.mod h1:orG0jzFJ2KsDfzLd/X0JSOMzF4Oxc/BQz2GkcYF4gRE= +github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20210927075512-e26bf1014f50 h1:aHMy8n0itEDKqMIAnjdNJ2L8SMzBgqTx0TXzDVYKCOc= +github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20210927075512-e26bf1014f50/go.mod h1:2Gy2237TJhvo7vcn+r8hovzipVaLj51Mjtuw9eyzWEU= github.com/desmos-labs/ledger-desmos-go v0.11.2-0.20210814121638-5d87e392e8a9 h1:b77qmphsyX3+hjJraaqLyzjt9eKqbosy4LaYScPvTAs= github.com/desmos-labs/ledger-desmos-go v0.11.2-0.20210814121638-5d87e392e8a9/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/dgraph-io/badger/v2 v2.2007.1/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= @@ -826,8 +826,6 @@ github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoM github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg= github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= -github.com/tendermint/tendermint v0.34.10/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0= -github.com/tendermint/tendermint v0.34.12/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0= github.com/tendermint/tendermint v0.34.13 h1:fu+tsHudbOr5PvepjH0q47Jae59hQAvn3IqAHv2EbC8= github.com/tendermint/tendermint v0.34.13/go.mod h1:6RVVRBqwtKhA+H59APKumO+B7Nye4QXSFc6+TYxAxCI= github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= diff --git a/proto/desmos/profiles/legacy/v100/models_app_links.proto b/proto/desmos/profiles/legacy/v100/models_app_links.proto new file mode 100644 index 0000000000..af36f48d48 --- /dev/null +++ b/proto/desmos/profiles/legacy/v100/models_app_links.proto @@ -0,0 +1,155 @@ +syntax = "proto3"; +package desmos.profiles.legacy.v100; + +option go_package = "github.com/desmos-labs/desmos/x/profiles/legacy/v100"; + +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 + int64 id = 1 + [ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ]; + + // OracleScriptID is ID of an oracle script + int64 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; + + // Value that has be signed by the profile + string value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; + // 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\"" ]; + } +} \ No newline at end of file diff --git a/proto/desmos/profiles/legacy/v100/models_params.proto b/proto/desmos/profiles/legacy/v100/models_params.proto new file mode 100644 index 0000000000..17446f60a1 --- /dev/null +++ b/proto/desmos/profiles/legacy/v100/models_params.proto @@ -0,0 +1,121 @@ +syntax = "proto3"; +package desmos.profiles.legacy.v100; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/desmos-labs/desmos/x/profiles/legacy/v100"; + +// Params contains the parameters for the profiles module +message Params { + option (gogoproto.goproto_getters) = false; + + NicknameParams nickname = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"nickname\"" + ]; + + DTagParams dtag = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"dtag\"", + (gogoproto.customname) = "DTag" + ]; + + BioParams bio = 3 + [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"bio\"" ]; + + OracleParams oracle = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"oracle\"" + ]; +} + +// NicknameParams defines the parameters related to the profiles nicknames +message NicknameParams { + option (gogoproto.goproto_getters) = false; + + bytes min_length = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"min_length\"" + ]; + + bytes max_length = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"max_length\"" + ]; +} + +// DTagParams defines the parameters related to profile DTags +message DTagParams { + option (gogoproto.goproto_getters) = false; + + string reg_ex = 1 [ (gogoproto.moretags) = "yaml:\"reg_ex\"" ]; + + bytes min_length = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"min_length\"", + (gogoproto.customname) = "MinLength" + ]; + + bytes max_length = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"max_length\"", + (gogoproto.customname) = "MaxLength" + ]; +} + +// BioParams defines the parameters related to profile biography +message BioParams { + option (gogoproto.goproto_getters) = false; + + bytes max_length = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"max_length\"" + ]; +} + +// OracleParams defines the parameters related to the oracle +// that will be used to verify the ownership of a centralized +// application account by a Desmos profile +message OracleParams { + option (gogoproto.goproto_getters) = false; + + // ScriptID represents the ID of the oracle script to be called to verify the + // data + int64 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\"" ]; + + // FeePayer represents the key of the account that is going to pay for oracle + // fees if needed + string fee_payer = 6 [ (gogoproto.moretags) = "yaml:\"fee_payer\"" ]; + + // FeeAmount represents the amount of fees to be payed in order to execute the + // oracle script + repeated cosmos.base.v1beta1.Coin fee_amount = 7 [ + (gogoproto.nullable) = false, + (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/v1beta1/models_app_links.proto b/proto/desmos/profiles/v1beta1/models_app_links.proto index 66882c0034..dd729f4b02 100644 --- a/proto/desmos/profiles/v1beta1/models_app_links.proto +++ b/proto/desmos/profiles/v1beta1/models_app_links.proto @@ -152,4 +152,4 @@ message Result { // Error that is associated with the failure string error = 1 [ (gogoproto.moretags) = "yaml:\"error\"" ]; } -} \ No newline at end of file +} diff --git a/x/profiles/keeper/migrations.go b/x/profiles/keeper/migrations.go index fe4c81db33..3737da285f 100644 --- a/x/profiles/keeper/migrations.go +++ b/x/profiles/keeper/migrations.go @@ -2,6 +2,9 @@ package keeper import ( "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + v200 "github.com/desmos-labs/desmos/x/profiles/legacy/v200" ) // DONTCOVER @@ -12,10 +15,15 @@ type Migrator struct { amino *codec.LegacyAmino } -// NewMigrator returns a new Migrators -func NewMigrator(amino *codec.LegacyAmino, keeper Keeper) Migrator { +// NewMigrator returns a new Migrator +func NewMigrator(keeper Keeper, amino *codec.LegacyAmino) Migrator { return Migrator{ keeper: keeper, amino: amino, } } + +// Migrate1to2 migrates from version 1 to 2. +func (m Migrator) Migrate1to2(ctx sdk.Context) error { + return v200.MigrateStore(ctx, m.keeper.storeKey, m.keeper.paramSubspace, m.keeper.cdc, m.amino) +} diff --git a/x/profiles/legacy/v100/models_app_links.pb.go b/x/profiles/legacy/v100/models_app_links.pb.go new file mode 100644 index 0000000000..aaa29c8ef1 --- /dev/null +++ b/x/profiles/legacy/v100/models_app_links.pb.go @@ -0,0 +1,2293 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/legacy/v100/models_app_links.proto + +package v100 + +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_f4a1b113ce1d1ab5, []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.legacy.v100.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_f4a1b113ce1d1ab5, []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_f4a1b113ce1d1ab5, []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 int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` + // OracleScriptID is ID of an oracle script + OracleScriptID int64 `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_f4a1b113ce1d1ab5, []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_f4a1b113ce1d1ab5, []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_f4a1b113ce1d1ab5, []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 { + // Value that has be signed by the profile + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty" yaml:"value"` + // 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_f4a1b113ce1d1ab5, []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_f4a1b113ce1d1ab5, []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.legacy.v100.ApplicationLinkState", ApplicationLinkState_name, ApplicationLinkState_value) + proto.RegisterType((*ApplicationLink)(nil), "desmos.profiles.legacy.v100.ApplicationLink") + proto.RegisterType((*Data)(nil), "desmos.profiles.legacy.v100.Data") + proto.RegisterType((*OracleRequest)(nil), "desmos.profiles.legacy.v100.OracleRequest") + proto.RegisterType((*OracleRequest_CallData)(nil), "desmos.profiles.legacy.v100.OracleRequest.CallData") + proto.RegisterType((*Result)(nil), "desmos.profiles.legacy.v100.Result") + proto.RegisterType((*Result_Success)(nil), "desmos.profiles.legacy.v100.Result.Success") + proto.RegisterType((*Result_Failed)(nil), "desmos.profiles.legacy.v100.Result.Failed") +} + +func init() { + proto.RegisterFile("desmos/profiles/legacy/v100/models_app_links.proto", fileDescriptor_f4a1b113ce1d1ab5) +} + +var fileDescriptor_f4a1b113ce1d1ab5 = []byte{ + // 971 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xcf, 0x6e, 0xdb, 0x46, + 0x10, 0xc6, 0x45, 0x49, 0x56, 0xa4, 0x75, 0x6c, 0xab, 0x6b, 0xb7, 0x15, 0x58, 0x44, 0x64, 0xe8, + 0xa2, 0x70, 0x1d, 0x84, 0x8c, 0x95, 0x1e, 0x0a, 0x03, 0x3d, 0x88, 0x12, 0xdd, 0x30, 0x75, 0x25, + 0x63, 0x45, 0x27, 0x68, 0x2e, 0xc4, 0x9a, 0x5c, 0xab, 0x6c, 0x28, 0x51, 0xe5, 0x9f, 0xa0, 0x69, + 0xd1, 0x7b, 0x60, 0xf4, 0x90, 0x17, 0x30, 0x10, 0xa0, 0x0f, 0x52, 0xf4, 0x96, 0x63, 0x2e, 0x05, + 0x7a, 0x62, 0x0b, 0xf9, 0xd2, 0xb3, 0x9e, 0xa0, 0xe0, 0x2e, 0x29, 0xc9, 0x8d, 0xad, 0x0a, 0xc8, + 0x6d, 0xbd, 0x33, 0xdf, 0x6f, 0x86, 0xf3, 0x8d, 0x17, 0x02, 0x0d, 0x9b, 0x04, 0x03, 0x2f, 0x50, + 0x46, 0xbe, 0x77, 0xea, 0xb8, 0x24, 0x50, 0x5c, 0xd2, 0xc7, 0xd6, 0x73, 0xe5, 0xd9, 0xde, 0xbd, + 0x7b, 0xca, 0xc0, 0xb3, 0x89, 0x1b, 0x98, 0x78, 0x34, 0x32, 0x5d, 0x67, 0xf8, 0x34, 0x90, 0x47, + 0xbe, 0x17, 0x7a, 0xf0, 0x23, 0xa6, 0x91, 0x33, 0x8d, 0xcc, 0x34, 0x72, 0xa2, 0xe1, 0xb7, 0xfa, + 0x5e, 0xdf, 0xa3, 0x79, 0x4a, 0x72, 0x62, 0x12, 0x5e, 0xe8, 0x7b, 0x5e, 0xdf, 0x25, 0x0a, 0xfd, + 0xeb, 0x24, 0x3a, 0x55, 0x42, 0x67, 0x40, 0x82, 0x10, 0x0f, 0x46, 0x2c, 0x41, 0xfa, 0xa5, 0x08, + 0x36, 0x9a, 0xa3, 0x91, 0xeb, 0x58, 0x38, 0x74, 0xbc, 0xe1, 0xa1, 0x33, 0x7c, 0x0a, 0xb7, 0x41, + 0x31, 0x0a, 0x88, 0x5f, 0xe3, 0x44, 0x6e, 0xa7, 0xa2, 0x6e, 0x4c, 0x62, 0x61, 0xf5, 0x39, 0x1e, + 0xb8, 0xfb, 0x52, 0x72, 0x2b, 0x21, 0x1a, 0x84, 0x0f, 0x41, 0xd1, 0xc6, 0x21, 0xae, 0xe5, 0x45, + 0x6e, 0x67, 0xb5, 0x71, 0x5b, 0x5e, 0xd0, 0x9b, 0xdc, 0xc6, 0x21, 0x56, 0x37, 0x5f, 0xc7, 0x42, + 0x6e, 0xc6, 0x4a, 0xc4, 0x12, 0xa2, 0x0c, 0xf8, 0x0d, 0x58, 0x09, 0x42, 0x1c, 0x92, 0x5a, 0x41, + 0xe4, 0x76, 0xd6, 0x1b, 0x7b, 0x0b, 0x61, 0xff, 0xe9, 0xb6, 0x97, 0x08, 0xd5, 0xea, 0x24, 0x16, + 0x6e, 0x32, 0x30, 0x25, 0x49, 0x88, 0x11, 0xe1, 0x08, 0xac, 0x7b, 0x3e, 0xb6, 0x5c, 0x62, 0xfa, + 0xe4, 0xfb, 0x88, 0x04, 0x61, 0xad, 0x48, 0x1b, 0xde, 0x5d, 0x58, 0xa3, 0x4b, 0x25, 0x88, 0x29, + 0xd4, 0x5b, 0x69, 0xe7, 0xef, 0xb3, 0x02, 0x97, 0x79, 0x12, 0x5a, 0xf3, 0xe6, 0xb3, 0x61, 0x07, + 0x94, 0x7c, 0x12, 0x44, 0x6e, 0x58, 0x5b, 0xa1, 0x95, 0xb6, 0x17, 0x56, 0x42, 0x34, 0x55, 0x7d, + 0x6f, 0x12, 0x0b, 0x6b, 0x0c, 0xcf, 0xc4, 0x12, 0x4a, 0x29, 0x10, 0x83, 0x35, 0xcb, 0x27, 0xf4, + 0x7b, 0xcd, 0xc4, 0xbd, 0x5a, 0x89, 0x62, 0x79, 0x99, 0x59, 0x2b, 0x67, 0xd6, 0xca, 0x46, 0x66, + 0xad, 0x2a, 0xa6, 0x0d, 0x6f, 0x31, 0xe2, 0x25, 0xb9, 0xf4, 0xf2, 0x2f, 0x81, 0x43, 0x37, 0xb3, + 0xbb, 0x44, 0xb4, 0x5f, 0x7e, 0xf1, 0x4a, 0xc8, 0xfd, 0xf3, 0x4a, 0xe0, 0xa4, 0x9f, 0x40, 0x31, + 0x31, 0x0b, 0x7e, 0x0e, 0x56, 0xf1, 0x6c, 0xce, 0xe9, 0x26, 0x7c, 0x30, 0x89, 0x05, 0xc8, 0x90, + 0x73, 0x41, 0x09, 0xcd, 0xa7, 0x42, 0x05, 0x94, 0x93, 0xfd, 0x18, 0xe2, 0x01, 0xa1, 0xbb, 0x51, + 0x51, 0x37, 0x27, 0xb1, 0xb0, 0x31, 0x5b, 0xa0, 0x24, 0x22, 0xa1, 0x69, 0xd2, 0x5c, 0xf1, 0xdf, + 0x0b, 0x60, 0xed, 0xd2, 0xe4, 0xe1, 0x36, 0xc8, 0x3b, 0x36, 0xad, 0x5e, 0x50, 0x37, 0xc7, 0xb1, + 0x90, 0xd7, 0xdb, 0x93, 0x58, 0xa8, 0x30, 0x98, 0x63, 0x4b, 0x28, 0xef, 0xd8, 0xf0, 0x31, 0xa8, + 0xa6, 0x96, 0x04, 0x96, 0xef, 0x8c, 0x42, 0xd3, 0xb1, 0x69, 0xe5, 0x82, 0x7a, 0x77, 0x1c, 0x0b, + 0xeb, 0x8c, 0xd8, 0xa3, 0x21, 0x2a, 0xff, 0xf0, 0x92, 0x8d, 0x53, 0x8d, 0x84, 0xd2, 0x4d, 0x49, + 0x53, 0x6d, 0xf8, 0x1d, 0xa8, 0x58, 0xd8, 0x75, 0x4d, 0xba, 0xe7, 0x05, 0x3a, 0xf5, 0xfb, 0xcb, + 0xaf, 0x8d, 0xdc, 0xc2, 0xae, 0x4b, 0x37, 0xbf, 0x96, 0xda, 0x51, 0x4d, 0xed, 0xc8, 0x98, 0x12, + 0x2a, 0x5b, 0x69, 0x0e, 0xfc, 0x02, 0x54, 0x2c, 0xd7, 0x21, 0x43, 0xda, 0x7d, 0x91, 0xce, 0x4d, + 0x1c, 0xc7, 0x42, 0xb9, 0x45, 0x2f, 0x69, 0xdf, 0x99, 0x3c, 0x4b, 0x4b, 0xe4, 0x2c, 0x6a, 0xf3, + 0x3f, 0x83, 0x72, 0x56, 0xee, 0x1d, 0xbc, 0xdb, 0x9b, 0xff, 0x60, 0x66, 0xde, 0xd6, 0xe2, 0xbe, + 0xf7, 0x8b, 0x89, 0x73, 0x73, 0x1e, 0xfe, 0x91, 0x07, 0x25, 0xb6, 0xd3, 0xf0, 0x4b, 0x70, 0x23, + 0x88, 0x2c, 0x8b, 0x04, 0x01, 0xed, 0x61, 0xb5, 0x71, 0x67, 0x89, 0xff, 0x04, 0xb9, 0xc7, 0x24, + 0x0f, 0x72, 0x28, 0x53, 0xc3, 0x36, 0x28, 0x9d, 0x62, 0xc7, 0x25, 0x76, 0xfa, 0xd8, 0xec, 0x2e, + 0xc3, 0x39, 0xa0, 0x8a, 0x07, 0x39, 0x94, 0x6a, 0x79, 0x0f, 0xdc, 0x48, 0xd9, 0xf0, 0x13, 0xb0, + 0xf2, 0x0c, 0xbb, 0x11, 0x49, 0x67, 0x33, 0xf7, 0x78, 0xd0, 0x6b, 0x09, 0xb1, 0x30, 0x6c, 0x80, + 0x4a, 0xe0, 0xf4, 0x87, 0x38, 0x8c, 0x7c, 0xf2, 0xf6, 0x3c, 0xa6, 0x21, 0x09, 0xcd, 0xd2, 0x66, + 0xa3, 0xe0, 0xf7, 0x41, 0x89, 0x35, 0x91, 0xd4, 0x23, 0xbe, 0xef, 0xf9, 0x6f, 0xd7, 0xa3, 0xd7, + 0x12, 0x62, 0xe1, 0x99, 0x76, 0x76, 0x52, 0x57, 0x40, 0x21, 0x88, 0x06, 0xbb, 0xbf, 0x15, 0xc0, + 0xd6, 0x55, 0x2f, 0x1f, 0x7c, 0x0c, 0xe4, 0xe6, 0xd1, 0xd1, 0xa1, 0xde, 0x6a, 0x1a, 0x7a, 0xb7, + 0x63, 0x1e, 0xea, 0x9d, 0xaf, 0xcc, 0x9e, 0xd1, 0x34, 0x34, 0x53, 0xef, 0xe8, 0x86, 0xde, 0x3c, + 0xd4, 0x9f, 0x68, 0x6d, 0xf3, 0xb8, 0xd3, 0x3b, 0xd2, 0x5a, 0xfa, 0x81, 0xae, 0xb5, 0xab, 0x39, + 0x7e, 0xfb, 0xec, 0x5c, 0x14, 0xae, 0xa2, 0xe9, 0x43, 0x27, 0x74, 0xb0, 0xeb, 0xfc, 0x48, 0x6c, + 0x68, 0x80, 0x3b, 0xd7, 0x80, 0x1f, 0x69, 0x48, 0x3f, 0xc8, 0xee, 0x7b, 0x46, 0x13, 0x19, 0x5a, + 0xbb, 0xca, 0x4d, 0xa9, 0x53, 0xda, 0x23, 0xe2, 0x3b, 0xa7, 0x69, 0x89, 0x5e, 0x88, 0xfd, 0x90, + 0xd8, 0xf0, 0x08, 0x7c, 0xba, 0x0c, 0x55, 0x43, 0xa8, 0x8b, 0xaa, 0x79, 0xfe, 0xf6, 0xd9, 0xb9, + 0x78, 0xeb, 0x3a, 0xa6, 0x96, 0x0c, 0x6d, 0xe9, 0x3e, 0x8f, 0x5b, 0x2d, 0xad, 0xd7, 0xab, 0x16, + 0xfe, 0xa7, 0xcf, 0x74, 0x45, 0x1e, 0x02, 0xf1, 0x1a, 0xaa, 0xa1, 0x7f, 0xad, 0xb5, 0xcd, 0xee, + 0xb1, 0x51, 0x2d, 0xf2, 0x1f, 0x9f, 0x9d, 0x8b, 0xe2, 0x75, 0xa8, 0xe4, 0x69, 0xb5, 0xbb, 0x51, + 0xc8, 0x17, 0x5f, 0xfc, 0x5a, 0xcf, 0xa9, 0x9d, 0xd7, 0xe3, 0x3a, 0xf7, 0x66, 0x5c, 0xe7, 0xfe, + 0x1e, 0xd7, 0xb9, 0x97, 0x17, 0xf5, 0xdc, 0x9b, 0x8b, 0x7a, 0xee, 0xcf, 0x8b, 0x7a, 0xee, 0xc9, + 0x67, 0x7d, 0x27, 0xfc, 0x36, 0x3a, 0x91, 0x2d, 0x6f, 0xa0, 0xb0, 0xcd, 0xbe, 0xeb, 0xe2, 0x93, + 0x20, 0x3d, 0x2b, 0x3f, 0x5c, 0xf9, 0x23, 0xe1, 0xa4, 0x44, 0x1f, 0xfe, 0xfb, 0xff, 0x06, 0x00, + 0x00, 0xff, 0xff, 0x0a, 0xd1, 0x16, 0xc8, 0x4a, 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 |= int64(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 |= int64(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/v100/models_params.pb.go b/x/profiles/legacy/v100/models_params.pb.go new file mode 100644 index 0000000000..68da2086ce --- /dev/null +++ b/x/profiles/legacy/v100/models_params.pb.go @@ -0,0 +1,1497 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: desmos/profiles/legacy/v100/models_params.proto + +package v100 + +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_15231883c5ba9cf9, []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_15231883c5ba9cf9, []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_15231883c5ba9cf9, []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_15231883c5ba9cf9, []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 int64 `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"` + // FeePayer represents the key of the account that is going to pay for oracle + // fees if needed + FeePayer string `protobuf:"bytes,6,opt,name=fee_payer,json=feePayer,proto3" json:"fee_payer,omitempty" yaml:"fee_payer"` + // 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,7,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_15231883c5ba9cf9, []int{4} +} +func (m *OracleParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OracleParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OracleParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OracleParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_OracleParams.Merge(m, src) +} +func (m *OracleParams) XXX_Size() int { + return m.Size() +} +func (m *OracleParams) XXX_DiscardUnknown() { + xxx_messageInfo_OracleParams.DiscardUnknown(m) +} + +var xxx_messageInfo_OracleParams proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "desmos.profiles.legacy.v100.Params") + proto.RegisterType((*NicknameParams)(nil), "desmos.profiles.legacy.v100.NicknameParams") + proto.RegisterType((*DTagParams)(nil), "desmos.profiles.legacy.v100.DTagParams") + proto.RegisterType((*BioParams)(nil), "desmos.profiles.legacy.v100.BioParams") + proto.RegisterType((*OracleParams)(nil), "desmos.profiles.legacy.v100.OracleParams") +} + +func init() { + proto.RegisterFile("desmos/profiles/legacy/v100/models_params.proto", fileDescriptor_15231883c5ba9cf9) +} + +var fileDescriptor_15231883c5ba9cf9 = []byte{ + // 726 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0xdb, 0xa6, 0x2b, 0x8d, 0x3b, 0xfe, 0x2c, 0x1a, 0x50, 0x36, 0x29, 0x99, 0x7c, 0x18, + 0x45, 0x68, 0xc9, 0x3a, 0x90, 0x90, 0x26, 0x71, 0x20, 0xdb, 0x84, 0x26, 0x8d, 0x31, 0x05, 0x0e, + 0x13, 0x97, 0xe0, 0xa4, 0x5e, 0x16, 0x35, 0x89, 0xa3, 0x38, 0x9d, 0xda, 0x13, 0x57, 0x8e, 0x7c, + 0x02, 0xc4, 0x99, 0x4f, 0xb2, 0xe3, 0x8e, 0x88, 0x43, 0x86, 0xba, 0x6f, 0xd0, 0x4f, 0x80, 0x6c, + 0xa7, 0x69, 0x37, 0xa1, 0x32, 0x40, 0x9c, 0xea, 0xf8, 0xf5, 0xf3, 0x7b, 0x5e, 0xbf, 0xaf, 0x6b, + 0x03, 0xa3, 0x83, 0x69, 0x48, 0xa8, 0x11, 0x27, 0xe4, 0xc8, 0x0f, 0x30, 0x35, 0x02, 0xec, 0x21, + 0x77, 0x60, 0x9c, 0xb4, 0xd7, 0xd7, 0x8d, 0x90, 0x74, 0x70, 0x40, 0xed, 0x18, 0x25, 0x28, 0xa4, + 0x7a, 0x9c, 0x90, 0x94, 0x28, 0xcb, 0x42, 0xa0, 0x8f, 0x05, 0xba, 0x10, 0xe8, 0x4c, 0xb0, 0xb4, + 0xe8, 0x11, 0x8f, 0xf0, 0x75, 0x06, 0x1b, 0x09, 0xc9, 0x92, 0xea, 0x12, 0xee, 0xe1, 0x20, 0x8a, + 0x8d, 0x93, 0xb6, 0x83, 0x53, 0xd4, 0x36, 0x5c, 0xe2, 0x47, 0x22, 0x0e, 0x47, 0x15, 0x50, 0x3b, + 0xe0, 0x1e, 0xca, 0x7b, 0x50, 0x8f, 0x7c, 0xb7, 0x1b, 0xa1, 0x10, 0x37, 0xcb, 0x2b, 0xe5, 0x56, + 0x63, 0xe3, 0xb1, 0x3e, 0xc3, 0x50, 0xdf, 0xcf, 0x17, 0x0b, 0xb9, 0x79, 0xff, 0x34, 0xd3, 0x4a, + 0xa3, 0x4c, 0xbb, 0x3d, 0x40, 0x61, 0xb0, 0x09, 0xc7, 0x28, 0x68, 0x15, 0x54, 0xe5, 0x10, 0x54, + 0x3b, 0x29, 0xf2, 0x9a, 0x15, 0x4e, 0x7f, 0x38, 0x93, 0xbe, 0xfd, 0x16, 0x79, 0x39, 0x79, 0x99, + 0x91, 0x87, 0x99, 0x56, 0x65, 0x73, 0xa3, 0x4c, 0x6b, 0x08, 0x07, 0x86, 0x82, 0x16, 0x27, 0x2a, + 0x7b, 0x40, 0x72, 0x7c, 0xd2, 0x94, 0x38, 0x78, 0x75, 0x26, 0xd8, 0xf4, 0x49, 0xce, 0x55, 0xf2, + 0x8c, 0x81, 0xe0, 0x39, 0x3e, 0x81, 0x16, 0xc3, 0x28, 0x87, 0xa0, 0x46, 0x12, 0xe4, 0x06, 0xb8, + 0x59, 0xe5, 0xc0, 0x47, 0x33, 0x81, 0xaf, 0xf9, 0xd2, 0x9c, 0x79, 0x37, 0x67, 0xde, 0x14, 0x4c, + 0x81, 0x81, 0x56, 0xce, 0xdb, 0xac, 0x7e, 0xfc, 0xa2, 0x95, 0x60, 0x56, 0x06, 0xb7, 0x2e, 0x57, + 0x4f, 0x71, 0x00, 0x08, 0xfd, 0xc8, 0x0e, 0x70, 0xe4, 0xa5, 0xc7, 0xbc, 0xfc, 0xf3, 0xe6, 0x16, + 0x63, 0x7d, 0xcf, 0xb4, 0x55, 0xcf, 0x4f, 0x8f, 0x7b, 0x8e, 0xee, 0x92, 0xd0, 0xc8, 0xdb, 0x29, + 0x7e, 0xd6, 0x68, 0xa7, 0x6b, 0xa4, 0x83, 0x18, 0x53, 0x7d, 0x37, 0x4a, 0x47, 0x99, 0xb6, 0x20, + 0x5c, 0x27, 0x24, 0x68, 0xc9, 0xa1, 0x1f, 0xed, 0xf1, 0x31, 0xf7, 0x40, 0xfd, 0xb1, 0x47, 0xe5, + 0x1f, 0x3d, 0x0a, 0x12, 0xf3, 0x40, 0x7d, 0xe1, 0x91, 0x6f, 0xf0, 0x73, 0x05, 0x80, 0x49, 0x03, + 0x95, 0x16, 0xa8, 0x25, 0xd8, 0xb3, 0x71, 0x9f, 0x6f, 0x4c, 0x36, 0x17, 0x26, 0x05, 0x12, 0xf3, + 0xd0, 0x9a, 0x4b, 0xb0, 0xb7, 0xd3, 0x57, 0xc8, 0xa5, 0x32, 0x88, 0x14, 0x0f, 0xfe, 0x2c, 0xc5, + 0x61, 0xa6, 0xc9, 0xaf, 0xc6, 0x7b, 0xfe, 0x6d, 0x4d, 0xc8, 0xa5, 0x9a, 0x48, 0x7f, 0x6d, 0x38, + 0x2e, 0xc0, 0x35, 0x0b, 0xd4, 0x03, 0x72, 0x71, 0x0e, 0xaf, 0xf4, 0x45, 0xfa, 0x8f, 0x7d, 0x39, + 0x97, 0xc0, 0xfc, 0xf4, 0x71, 0x55, 0x9e, 0x03, 0x99, 0xba, 0x89, 0x1f, 0xa7, 0xb6, 0xdf, 0xe1, + 0xcd, 0x91, 0xcc, 0x95, 0x61, 0xa6, 0xd5, 0xdf, 0xf0, 0xc9, 0xdd, 0xed, 0x51, 0xa6, 0xdd, 0x11, + 0xdc, 0x62, 0x19, 0xb4, 0xea, 0x62, 0xbc, 0xdb, 0x51, 0xda, 0x40, 0x46, 0xb4, 0x6b, 0xbb, 0xa4, + 0x17, 0xa5, 0xbc, 0x5b, 0x55, 0x73, 0x71, 0x22, 0x29, 0x42, 0xd0, 0xaa, 0x23, 0xda, 0xdd, 0x62, + 0x43, 0x26, 0x61, 0xad, 0x10, 0x12, 0xe9, 0xaa, 0xa4, 0x08, 0x41, 0xab, 0x1e, 0xfa, 0x91, 0x90, + 0x3c, 0x03, 0x8d, 0x38, 0xc1, 0x31, 0x4a, 0xb0, 0xed, 0x21, 0xca, 0xff, 0x93, 0x55, 0xf3, 0xde, + 0x28, 0xd3, 0x14, 0x21, 0x9a, 0x0a, 0x42, 0x0b, 0xe4, 0x5f, 0x2f, 0x11, 0x65, 0x42, 0xdc, 0xc7, + 0x6e, 0x2f, 0x15, 0xc2, 0xb9, 0xab, 0xc2, 0xa9, 0x20, 0xb4, 0x40, 0xfe, 0xc5, 0x84, 0x6d, 0x20, + 0x1f, 0x61, 0x6c, 0xc7, 0x68, 0x80, 0x93, 0x66, 0x8d, 0x9f, 0xd9, 0xa9, 0x24, 0x8b, 0x10, 0xb4, + 0xea, 0x47, 0x18, 0x1f, 0xb0, 0xa1, 0xf2, 0x01, 0x00, 0x36, 0x8f, 0x42, 0xbe, 0xb1, 0x1b, 0x2b, + 0x52, 0xab, 0xb1, 0xf1, 0x40, 0x17, 0xbd, 0xd2, 0xd9, 0xed, 0xab, 0xe7, 0xb7, 0xaf, 0xbe, 0x45, + 0xfc, 0xc8, 0xdc, 0xc9, 0xef, 0x89, 0x85, 0x09, 0x52, 0x48, 0xe1, 0xd7, 0x73, 0xad, 0x75, 0x8d, + 0xa6, 0x33, 0x0a, 0xb5, 0x58, 0x9a, 0x2f, 0xb8, 0x4e, 0x74, 0xd8, 0xdc, 0x3f, 0x1d, 0xaa, 0xe5, + 0xb3, 0xa1, 0x5a, 0xfe, 0x31, 0x54, 0xcb, 0x9f, 0x2e, 0xd4, 0xd2, 0xd9, 0x85, 0x5a, 0xfa, 0x76, + 0xa1, 0x96, 0xde, 0x3d, 0x9d, 0x82, 0x8a, 0xeb, 0x6c, 0x2d, 0x40, 0x0e, 0x1d, 0x3f, 0x42, 0xfd, + 0x5f, 0x3e, 0x43, 0x4e, 0x8d, 0x3f, 0x13, 0x4f, 0x7e, 0x06, 0x00, 0x00, 0xff, 0xff, 0x96, 0x98, + 0x88, 0x61, 0xac, 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] = 0x3a + } + } + if len(m.FeePayer) > 0 { + i -= len(m.FeePayer) + copy(dAtA[i:], m.FeePayer) + i = encodeVarintModelsParams(dAtA, i, uint64(len(m.FeePayer))) + 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)) + } + l = len(m.FeePayer) + if l > 0 { + n += 1 + l + sovModelsParams(uint64(l)) + } + 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 |= int64(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 FeePayer", 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.FeePayer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + 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/v200/store.go b/x/profiles/legacy/v200/store.go new file mode 100644 index 0000000000..8fac0b9c37 --- /dev/null +++ b/x/profiles/legacy/v200/store.go @@ -0,0 +1,115 @@ +package v200 + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + + v100 "github.com/desmos-labs/desmos/x/profiles/legacy/v100" + "github.com/desmos-labs/desmos/x/profiles/types" +) + +// MigrateStore performs in-place store migrations from v1.0 to v2.0 The +// migration includes: +// +// - Change OracleRequest to have uint64 ID instead of int64 +// - Change OracleRequest to have uint64 OracleScriptID instead of int64 +// - Change OracleParams to have uint64 ScriptID instead of int64 +// - Change OracleParams to remove FeePayer +func MigrateStore( + ctx sdk.Context, storeKey sdk.StoreKey, subspace paramstypes.Subspace, + cdc codec.BinaryCodec, legacyAmino *codec.LegacyAmino, +) error { + store := ctx.KVStore(storeKey) + + err := migrateParams(ctx, subspace, legacyAmino) + if err != nil { + return err + } + + err = migrateAppLinks(store, cdc) + if err != nil { + return err + } + + return nil +} + +func migrateAppLinks(store sdk.KVStore, cdc codec.BinaryCodec) error { + iterator := sdk.KVStorePrefixIterator(store, types.UserApplicationLinkPrefix) + defer iterator.Close() + + var newLinks []types.ApplicationLink + for ; iterator.Valid(); iterator.Next() { + var v1ApplicationLink v100.ApplicationLink + err := cdc.Unmarshal(iterator.Value(), &v1ApplicationLink) + if err != nil { + return err + } + + newLinks = append(newLinks, types.NewApplicationLink( + v1ApplicationLink.User, + types.NewData(v1ApplicationLink.Data.Application, v1ApplicationLink.Data.Username), + types.ApplicationLinkState(v1ApplicationLink.State), + types.NewOracleRequest( + uint64(v1ApplicationLink.OracleRequest.ID), + uint64(v1ApplicationLink.OracleRequest.OracleScriptID), + types.NewOracleRequestCallData( + v1ApplicationLink.OracleRequest.CallData.Application, + v1ApplicationLink.OracleRequest.CallData.CallData, + ), + v1ApplicationLink.OracleRequest.ClientID, + ), + migrateAppLinkResult(v1ApplicationLink.Result), + v1ApplicationLink.CreationTime, + )) + store.Delete(iterator.Key()) + } + + for _, link := range newLinks { + store.Set( + types.UserApplicationLinkKey(link.User, link.Data.Application, link.Data.Username), + types.MustMarshalApplicationLink(cdc, link), + ) + } + + return nil +} + +func migrateAppLinkResult(r *v100.Result) *types.Result { + if r == nil { + return nil + } + + switch result := (r.Sum).(type) { + case *v100.Result_Success_: + return types.NewSuccessResult(result.Success.Value, result.Success.Signature) + case *v100.Result_Failed_: + return types.NewErrorResult(result.Failed.Error) + default: + panic(fmt.Errorf("invalid result type")) + } +} + +// migrateParams migrates the OracleParams by removing the FeePayer field +// and converting the ScriptID from int64 to uint64 +func migrateParams(ctx sdk.Context, subspace paramstypes.Subspace, legacyAmino *codec.LegacyAmino) error { + var v1Params v100.OracleParams + err := legacyAmino.UnmarshalJSON(subspace.GetRaw(ctx, types.OracleParamsKey), &v1Params) + if err != nil { + return err + } + + var v2Params = types.NewOracleParams( + uint64(v1Params.ScriptID), + v1Params.AskCount, + v1Params.MinCount, + v1Params.PrepareGas, + v1Params.ExecuteGas, + v1Params.FeeAmount..., + ) + subspace.Set(ctx, types.OracleParamsKey, &v2Params) + return nil +} diff --git a/x/profiles/module.go b/x/profiles/module.go index 9c3a1dd3d1..662795404b 100644 --- a/x/profiles/module.go +++ b/x/profiles/module.go @@ -35,7 +35,8 @@ var ( // AppModuleBasic defines the basic application module used by the profiles module. type AppModuleBasic struct { - cdc codec.Codec + cdc codec.Codec + legacyAmino *codec.LegacyAmino } // Name returns the profiles module's name. @@ -99,14 +100,17 @@ type AppModule struct { 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.keeper, am.legacyAmino) + cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2) } // NewAppModule creates a new AppModule Object func NewAppModule( - cdc codec.Codec, k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, + cdc codec.Codec, legacyAmino *codec.LegacyAmino, k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) AppModule { return AppModule{ - AppModuleBasic: AppModuleBasic{cdc: cdc}, + AppModuleBasic: AppModuleBasic{cdc: cdc, legacyAmino: legacyAmino}, keeper: k, ak: ak, bk: bk,