From 652d86e084391f741c8b9dde5b82a919088547ad Mon Sep 17 00:00:00 2001 From: Michael Pretorius Date: Thu, 17 Oct 2024 10:06:07 +0200 Subject: [PATCH] chore(app): finalise upgrade v4 --- .gitignore | 2 + app/app.go | 5 +- app/modules.go | 2 +- app/upgrades/types.go | 3 +- app/upgrades/v2/upgrades.go | 25 +- app/upgrades/v3/upgrades.go | 2 + app/upgrades/v4/README.md | 3 + app/upgrades/v4/constants.go | 56 + app/upgrades/v4/upgrades.go | 214 ++ docker-compose.yaml | 34 + docs/core/proto-docs.html | 32 +- docs/core/proto-docs.json | 28 +- docs/core/proto-docs.md | 6 +- docs/swagger-ui/swagger.yaml | 3048 ++++++++-------- go.mod | 1 + proto/ixo/claims/v1beta1/query.proto | 16 +- proto/ixo/claims/v1beta1/tx.proto | 14 +- proto/ixo/epochs/v1beta1/query.proto | 2 +- proto/ixo/mint/v1beta1/query.proto | 2 +- scripts/run_with_all_data_2.sh | 63 + wasmbinding/stargate_whitelist.go | 7 +- x/claims/keeper/claims.go | 17 +- x/claims/keeper/migrations.go | 14 +- x/claims/keeper/msg_server.go | 54 +- x/claims/keeper/payments.go | 51 +- x/claims/migrations/v3/legacy_types.go | 4496 ++++++++++++++++++++++++ x/claims/migrations/v3/store.go | 120 + x/claims/module.go | 16 +- x/claims/types/claims.go | 14 + x/claims/types/constants.go | 7 + x/claims/types/params.go | 3 +- x/claims/types/query.pb.go | 115 +- x/claims/types/query.pb.gw.go | 16 +- x/claims/types/tx.pb.go | 12 +- x/epochs/types/genesis.go | 7 +- x/epochs/types/query.pb.go | 54 +- x/epochs/types/query.pb.gw.go | 44 +- x/mint/keeper/keeper.go | 2 +- x/mint/types/keys.go | 2 +- x/mint/types/params.go | 22 +- x/mint/types/query.pb.go | 17 +- 41 files changed, 6834 insertions(+), 1814 deletions(-) create mode 100755 app/upgrades/v4/README.md create mode 100755 app/upgrades/v4/constants.go create mode 100755 app/upgrades/v4/upgrades.go create mode 100755 scripts/run_with_all_data_2.sh create mode 100644 x/claims/migrations/v3/legacy_types.go create mode 100755 x/claims/migrations/v3/store.go create mode 100644 x/claims/types/constants.go diff --git a/.gitignore b/.gitignore index 25dd2218..f21a3da3 100755 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ .DS_STORE # docker-compose volume mapping for chain config and data .data +.data2 +.data3 # Created by https://www.toptal.com/developers/gitignore/api/intellij,vscode,macos,windows # Edit at https://www.toptal.com/developers/gitignore?templates=intellij,vscode,macos,windows diff --git a/app/app.go b/app/app.go index 11e56ad7..66933eaf 100755 --- a/app/app.go +++ b/app/app.go @@ -49,6 +49,7 @@ import ( "github.com/ixofoundation/ixo-blockchain/v3/app/upgrades" v2 "github.com/ixofoundation/ixo-blockchain/v3/app/upgrades/v2" v3 "github.com/ixofoundation/ixo-blockchain/v3/app/upgrades/v3" + v4 "github.com/ixofoundation/ixo-blockchain/v3/app/upgrades/v4" "github.com/ixofoundation/ixo-blockchain/v3/docs" "github.com/ixofoundation/ixo-blockchain/v3/lib/ixo" "github.com/spf13/cast" @@ -66,7 +67,7 @@ var ( maccPerms = moduleAccountPermissions // scheduled upgrades and forks - Upgrades = []upgrades.Upgrade{v2.Upgrade, v3.Upgrade} + Upgrades = []upgrades.Upgrade{v2.Upgrade, v3.Upgrade, v4.Upgrade} Forks = []upgrades.Fork{} // EmptyWasmOpts defines a type alias for a list of wasm options. @@ -544,7 +545,7 @@ func (app *IxoApp) setupUpgradeHandlers() { for _, upgrade := range Upgrades { app.UpgradeKeeper.SetUpgradeHandler( upgrade.UpgradeName, - upgrade.CreateUpgradeHandler(app.ModuleManager, app.configurator), + upgrade.CreateUpgradeHandler(app.ModuleManager, app.configurator, app.AppKeepers), ) } } diff --git a/app/modules.go b/app/modules.go index e882e3c2..68630fd6 100755 --- a/app/modules.go +++ b/app/modules.go @@ -139,7 +139,7 @@ func appModules( bonds.NewAppModule(app.BondsKeeper), entitymodule.NewAppModule(app.EntityKeeper), tokenmodule.NewAppModule(app.TokenKeeper), - claimsmodule.NewAppModule(app.ClaimsKeeper), + claimsmodule.NewAppModule(app.ClaimsKeeper, app.GetSubspace(claimsmoduletypes.ModuleName)), smartaccount.NewAppModule(*app.SmartAccountKeeper), epochs.NewAppModule(*app.EpochsKeeper), } diff --git a/app/upgrades/types.go b/app/upgrades/types.go index 7b00b5f6..376ca213 100755 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -5,6 +5,7 @@ import ( upgradetypes "cosmossdk.io/x/upgrade/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/ixofoundation/ixo-blockchain/v3/app/keepers" ) // Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal @@ -16,7 +17,7 @@ type Upgrade struct { UpgradeName string // CreateUpgradeHandler defines the function that creates an upgrade handler - CreateUpgradeHandler func(*module.Manager, module.Configurator) upgradetypes.UpgradeHandler + CreateUpgradeHandler func(*module.Manager, module.Configurator, keepers.AppKeepers) upgradetypes.UpgradeHandler // used for any new modules introduced, new modules deleted, or store names renamed StoreUpgrades store.StoreUpgrades diff --git a/app/upgrades/v2/upgrades.go b/app/upgrades/v2/upgrades.go index 7ac75713..f3f60442 100755 --- a/app/upgrades/v2/upgrades.go +++ b/app/upgrades/v2/upgrades.go @@ -6,11 +6,13 @@ import ( upgradetypes "cosmossdk.io/x/upgrade/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/ixofoundation/ixo-blockchain/v3/app/keepers" ) func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, + _ keepers.AppKeepers, ) upgradetypes.UpgradeHandler { return func(context context.Context, plan upgradetypes.Plan, _ module.VersionMap) (module.VersionMap, error) { ctx := sdk.UnwrapSDKContext(context) @@ -50,29 +52,6 @@ func CreateUpgradeHandler( // Run migrations before applying any other state changes. migrations, err := mm.RunMigrations(ctx, configurator, fromVM) - - // ctx.Logger().Info("set ICQKeeper params") - // setICQParams(ctx, keepers.ICQKeeper) - - // ctx.Logger().Info("update ICAHostKeeper params to allow all messages") - // setICAHostParams(ctx, &keepers.ICAHostKeeper) - return migrations, err } } - -// TODO pass keepers through with cosmos sdk upgrade and implement this, not needed for now -// func setICQParams(ctx sdk.Context, icqKeeper *icqkeeper.Keeper) { -// icqparams := icqtypes.DefaultParams() -// icqparams.AllowQueries = wasmbinding.GetStargateWhitelistedPaths() -// // Adding SmartContractState query to allowlist -// icqparams.AllowQueries = append(icqparams.AllowQueries, "/cosmwasm.wasm.v1.Query/SmartContractState") -// icqKeeper.SetParams(ctx, icqparams) -// } - -// func setICAHostParams(ctx sdk.Context, icahostkeeper *icahostkeeper.Keeper) { -// icahostkeeper.SetParams(ctx, icahosttypes.Params{ -// HostEnabled: true, -// AllowMessages: []string{"*"}, -// }) -// } diff --git a/app/upgrades/v3/upgrades.go b/app/upgrades/v3/upgrades.go index 90152061..d1e6b310 100755 --- a/app/upgrades/v3/upgrades.go +++ b/app/upgrades/v3/upgrades.go @@ -6,11 +6,13 @@ import ( upgradetypes "cosmossdk.io/x/upgrade/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/ixofoundation/ixo-blockchain/v3/app/keepers" ) func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, + _ keepers.AppKeepers, ) upgradetypes.UpgradeHandler { return func(context context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ctx := sdk.UnwrapSDKContext(context) diff --git a/app/upgrades/v4/README.md b/app/upgrades/v4/README.md new file mode 100755 index 00000000..03c8c9e6 --- /dev/null +++ b/app/upgrades/v4/README.md @@ -0,0 +1,3 @@ +# v4 + +v4 release changes is available [here](https://github.com/ixofoundation/ixo-blockchain/releases/tag/v4.0.0). diff --git a/app/upgrades/v4/constants.go b/app/upgrades/v4/constants.go new file mode 100755 index 00000000..ce73fd8e --- /dev/null +++ b/app/upgrades/v4/constants.go @@ -0,0 +1,56 @@ +package v4 + +import ( + store "cosmossdk.io/store/types" + circuittypes "cosmossdk.io/x/circuit/types" + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + cosmosminttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v8/types" + "github.com/ixofoundation/ixo-blockchain/v3/app/upgrades" + epochstypes "github.com/ixofoundation/ixo-blockchain/v3/x/epochs/types" + minttypes "github.com/ixofoundation/ixo-blockchain/v3/x/mint/types" + smartaccounttypes "github.com/ixofoundation/ixo-blockchain/v3/x/smart-account/types" +) + +// UpgradeName defines the on-chain upgrade name for the Ixo v4 upgrade. +const ( + UpgradeName = "v4" + + // BlockMaxBytes is the max bytes for a block, 10mb (current 22020096) + BlockMaxBytes = int64(10000000) + // BlockMaxGas is the max gas allowed in a block (current 200000000) + BlockMaxGas = int64(300000000) + + // Normal proposal deposit is 10k ixo, make expedited proposal deposit 3x + ExpeditedProposalDeposit = 30000000000 + MinInitialDepositRatio = "0.100000000000000000" + + // MaximumUnauthenticatedGas for smart account transactions to verify the fee payer + MaximumUnauthenticatedGas = uint64(250_000) + // IsSmartAccountActive is used for the smart account circuit breaker, smartaccounts are activated for v4 + IsSmartAccountActive = false +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{ + smartaccounttypes.StoreKey, + minttypes.StoreKey, + epochstypes.StoreKey, + ibchooks.StoreKey, + // Add circuittypes as per 0.47 to 0.50 upgrade handler + // https://github.com/cosmos/cosmos-sdk/blob/b7d9d4c8a9b6b8b61716d2023982d29bdc9839a6/simapp/upgrades.go#L21 + circuittypes.ModuleName, + // v47 modules + crisistypes.ModuleName, + consensustypes.ModuleName, + }, + Deleted: []string{ + cosmosminttypes.StoreKey, + "intertx", // uninstalled module + }, + }, +} diff --git a/app/upgrades/v4/upgrades.go b/app/upgrades/v4/upgrades.go new file mode 100755 index 00000000..0bba3c59 --- /dev/null +++ b/app/upgrades/v4/upgrades.go @@ -0,0 +1,214 @@ +package v4 + +import ( + "context" + + wasmv2 "github.com/CosmWasm/wasmd/x/wasm/migrations/v2" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + + cmttypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + + packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" + icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types" + icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" + icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + + // Local + "github.com/ixofoundation/ixo-blockchain/v3/app/keepers" + "github.com/ixofoundation/ixo-blockchain/v3/lib/ixo" + "github.com/ixofoundation/ixo-blockchain/v3/wasmbinding" + bondstypes "github.com/ixofoundation/ixo-blockchain/v3/x/bonds/types" + claimsmoduletypes "github.com/ixofoundation/ixo-blockchain/v3/x/claims/types" + entitytypes "github.com/ixofoundation/ixo-blockchain/v3/x/entity/types" + smartaccounttypes "github.com/ixofoundation/ixo-blockchain/v3/x/smart-account/types" + tokentypes "github.com/ixofoundation/ixo-blockchain/v3/x/token/types" + + // SDK v47 modules + "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/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" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + keepers keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(context context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + ctx := sdk.UnwrapSDKContext(context) + ctx.Logger().Info("🚀 executing Ixo " + UpgradeName + "upgrade 🚀") + + // ------------------------------------------------- + // Migrate Params + // ------------------------------------------------- + ctx.Logger().Info("Migrate params") + baseAppLegacySS := keepers.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) + // https://github.com/cosmos/cosmos-sdk/pull/12363/files + // Set param key table for params module migration + for _, subspace := range keepers.ParamsKeeper.GetSubspaces() { + subspace := subspace + + var keyTable paramstypes.KeyTable + switch subspace.Name() { + // sdk + case authtypes.ModuleName: + keyTable = authtypes.ParamKeyTable() //nolint:staticcheck + case banktypes.ModuleName: + keyTable = banktypes.ParamKeyTable() //nolint:staticcheck + case stakingtypes.ModuleName: + keyTable = stakingtypes.ParamKeyTable() //nolint:staticcheck + case minttypes.ModuleName: + keyTable = minttypes.ParamKeyTable() //nolint:staticcheck + case distrtypes.ModuleName: + keyTable = distrtypes.ParamKeyTable() //nolint:staticcheck + case slashingtypes.ModuleName: + keyTable = slashingtypes.ParamKeyTable() //nolint:staticcheck + case govtypes.ModuleName: + keyTable = govv1.ParamKeyTable() //nolint:staticcheck + case crisistypes.ModuleName: + keyTable = crisistypes.ParamKeyTable() //nolint:staticcheck + + // ibc types + case ibcexported.ModuleName: + keyTable = ibcclienttypes.ParamKeyTable() + keyTable.RegisterParamSet(&ibcconnectiontypes.Params{}) + case ibctransfertypes.ModuleName: + keyTable = ibctransfertypes.ParamKeyTable() //nolint:staticcheck + case icahosttypes.SubModuleName: + keyTable = icahosttypes.ParamKeyTable() //nolint:staticcheck + case icacontrollertypes.SubModuleName: + keyTable = icacontrollertypes.ParamKeyTable() //nolint:staticcheck + case icqtypes.ModuleName: + keyTable = icqtypes.ParamKeyTable() //nolint:staticcheck + case packetforwardtypes.ModuleName: + keyTable = packetforwardtypes.ParamKeyTable() //nolint:staticcheck + // case ibchookstypes.ModuleName: + // keyTable = ibchookstypes.ParamKeyTable() //nolint:staticcheck + + // wasm + case wasmtypes.ModuleName: + keyTable = wasmv2.ParamKeyTable() //nolint:staticcheck + + // ixo modules + case bondstypes.ModuleName: + keyTable = bondstypes.ParamKeyTable() //nolint:staticcheck + case claimsmoduletypes.ModuleName: + keyTable = claimsmoduletypes.ParamKeyTable() //nolint:staticcheck + case entitytypes.ModuleName: + keyTable = entitytypes.ParamKeyTable() //nolint:staticcheck + // epochs doesn't have params + // iidtypes doesn't have params + case tokentypes.ModuleName: + keyTable = tokentypes.ParamKeyTable() //nolint:staticcheck + case smartaccounttypes.ModuleName: + keyTable = smartaccounttypes.ParamKeyTable() //nolint:staticcheck + + default: + continue + } + + if !subspace.HasKeyTable() { + subspace.WithKeyTable(keyTable) + } + } + + // Migrate Tendermint consensus parameters from x/params module to a deprecated x/consensus module. + // The old params module is required to still be imported in your app.go in order to handle this migration. + err := baseapp.MigrateParams(ctx, baseAppLegacySS, keepers.ConsensusParamsKeeper.ParamsStore) + if err != nil { + return nil, err + } + + // Remove "mint" from fromVM since have custom mint module and want to run init genesis for it + delete(fromVM, minttypes.ModuleName) + + // ------------------------------------------------- + // Run migrations before applying any other state changes. + // NOTE: DO NOT PUT ANY STATE CHANGES BEFORE RunMigrations(). + // ------------------------------------------------- + ctx.Logger().Info("Run migrations") + migrations, err := mm.RunMigrations(ctx, configurator, fromVM) + if err != nil { + return nil, err + } + + // ------------------------------------------------- + // Set proposal param: + // ------------------------------------------------- + ctx.Logger().Info("Set expedited proposal params") + govParams, err := keepers.GovKeeper.Params.Get(ctx) + if err != nil { + return nil, err + } + // normal proposal deposit is 10k ixo, make expedited proposal deposit 3x + govParams.ExpeditedMinDeposit = sdk.NewCoins(sdk.NewCoin(ixo.IxoNativeToken, math.NewInt(ExpeditedProposalDeposit))) + govParams.MinInitialDepositRatio = MinInitialDepositRatio + err = keepers.GovKeeper.Params.Set(ctx, govParams) + if err != nil { + return nil, err + } + + // ------------------------------------------------- + // Set consensus params: + // ------------------------------------------------- + ctx.Logger().Info("Set consensus params") + defaultConsensusParams := cmttypes.DefaultConsensusParams().ToProto() + defaultConsensusParams.Block.MaxBytes = BlockMaxBytes // previously 5000000 + defaultConsensusParams.Block.MaxGas = BlockMaxGas // unchanged + err = keepers.ConsensusParamsKeeper.ParamsStore.Set(ctx, defaultConsensusParams) + if err != nil { + return nil, err + } + + // ------------------------------------------------- + // Set the authenticator params in the store + // ------------------------------------------------- + ctx.Logger().Info("Set authenticator params") + authenticatorParams := keepers.SmartAccountKeeper.GetParams(ctx) + authenticatorParams.MaximumUnauthenticatedGas = MaximumUnauthenticatedGas + authenticatorParams.IsSmartAccountActive = IsSmartAccountActive + keepers.SmartAccountKeeper.SetParams(ctx, authenticatorParams) + + // ------------------------------------------------- + // Set the ICQ params in the store + // ------------------------------------------------- + ctx.Logger().Info("Set ICQKeeper params") + icqparams := icqtypes.DefaultParams() + icqparams.AllowQueries = wasmbinding.GetStargateWhitelistedPaths() + // Adding SmartContractState query to allowlist + icqparams.AllowQueries = append(icqparams.AllowQueries, "/cosmwasm.wasm.v1.Query/SmartContractState") + err = keepers.ICQKeeper.SetParams(ctx, icqparams) + if err != nil { + return nil, err + } + + // ------------------------------------------------- + // Set the ICA Host params in the store + // ------------------------------------------------- + ctx.Logger().Info("Set ICAHostKeeper params") + // Allow all messages + hostParams := icahosttypes.Params{ + HostEnabled: true, + AllowMessages: []string{"*"}, + } + keepers.ICAHostKeeper.SetParams(ctx, hostParams) + + return migrations, nil + } +} diff --git a/docker-compose.yaml b/docker-compose.yaml index dbbf7213..fa544f0f 100755 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -16,3 +16,37 @@ services: - '1317:1317' # API - '26657:26657' # RPC - '9090:9090' # gRPC + + ixo-blockchain-2: + container_name: ixo_blockchain_2 + platform: linux/amd64 + build: + context: . + dockerfile: .infra/dockerfiles/Dockerfile + tty: true + image: ixo-chain:devel + restart: unless-stopped + volumes: + - './:/app' + - '.data2/:/root/.ixod' + ports: + - '1318:1317' # API + - '26658:26657' # RPC + - '9091:9090' # gRPC + + ixo-blockchain-3: + container_name: ixo_blockchain_3 + platform: linux/amd64 + build: + context: . + dockerfile: .infra/dockerfiles/Dockerfile + tty: true + image: ixo-chain:devel + restart: unless-stopped + volumes: + - './:/app' + - '.data3/:/root/.ixod' + ports: + - '1319:1317' # API + - '26659:26657' # RPC + - '9092:9090' # gRPC diff --git a/docs/core/proto-docs.html b/docs/core/proto-docs.html index 3ed5cb24..43fb1567 100755 --- a/docs/core/proto-docs.html +++ b/docs/core/proto-docs.html @@ -7277,7 +7277,7 @@

Methods with HTTP bindings

Collection GET - /ixo/collection/{id} + /ixo/claims/collection/{id} @@ -7287,7 +7287,7 @@

Methods with HTTP bindings

CollectionList GET - /ixo/collection + /ixo/claims/collections @@ -7297,7 +7297,7 @@

Methods with HTTP bindings

Claim GET - /ixo/claim/{id} + /ixo/claims/claim/{id} @@ -7307,7 +7307,7 @@

Methods with HTTP bindings

ClaimList GET - /ixo/claim + /ixo/claims/claims @@ -7317,7 +7317,7 @@

Methods with HTTP bindings

Dispute GET - /ixo/dispute/{proof} + /ixo/claims/dispute/{proof} @@ -7327,7 +7327,7 @@

Methods with HTTP bindings

DisputeList GET - /ixo/dispute + /ixo/claims/disputes @@ -7337,7 +7337,7 @@

Methods with HTTP bindings

Intent GET - /ixo/intent/{agentAddress}/{collectionId}/{id} + /ixo/claims/intent/{agentAddress}/{collectionId}/{id} @@ -7347,7 +7347,7 @@

Methods with HTTP bindings

IntentList GET - /ixo/intent + /ixo/claims/intents @@ -7680,16 +7680,20 @@

MsgEvaluateClaim

amount cosmos.base.v1beta1.Coin repeated -

NOTE: if both amount and cw20 amount are empty then use collection default -custom amount specified by evaluator for claim approval

+

NOTE: if claim is using intent, then amount and cw20 amount are ignored and +overriden with intent amounts NOTE: if both amount and cw20 amount are +empty then use collection default custom amount specified by evaluator for +claim approval

cw20_payment CW20Payment repeated -

NOTE: if both amount and cw20 amount are empty then use collection default -custom cw20 payments specified by evaluator for claim approval

+

NOTE: if claim is using intent, then amount and cw20 amount are ignored and +overriden with intent amounts NOTE: if both amount and cw20 amount are +empty then use collection default custom cw20 payments specified by +evaluator for claim approval

@@ -12016,7 +12020,7 @@

Methods with HTTP bindings

CurrentEpoch GET - /ixo/epochs/v1beta1/current_epoch + /ixo/epochs/v1beta1/epochs/{identifier} @@ -12577,7 +12581,7 @@

QueryEpochProvisionsRespo epoch_provisions - bytes + string

epoch_provisions is the current minting per epoch provisions value.

diff --git a/docs/core/proto-docs.json b/docs/core/proto-docs.json index 363f6e28..41b46eb1 100755 --- a/docs/core/proto-docs.json +++ b/docs/core/proto-docs.json @@ -6561,7 +6561,7 @@ "rules": [ { "method": "GET", - "pattern": "/ixo/collection/{id}" + "pattern": "/ixo/claims/collection/{id}" } ] } @@ -6583,7 +6583,7 @@ "rules": [ { "method": "GET", - "pattern": "/ixo/collection" + "pattern": "/ixo/claims/collections" } ] } @@ -6605,7 +6605,7 @@ "rules": [ { "method": "GET", - "pattern": "/ixo/claim/{id}" + "pattern": "/ixo/claims/claim/{id}" } ] } @@ -6627,7 +6627,7 @@ "rules": [ { "method": "GET", - "pattern": "/ixo/claim" + "pattern": "/ixo/claims/claims" } ] } @@ -6649,7 +6649,7 @@ "rules": [ { "method": "GET", - "pattern": "/ixo/dispute/{proof}" + "pattern": "/ixo/claims/dispute/{proof}" } ] } @@ -6671,7 +6671,7 @@ "rules": [ { "method": "GET", - "pattern": "/ixo/dispute" + "pattern": "/ixo/claims/disputes" } ] } @@ -6693,7 +6693,7 @@ "rules": [ { "method": "GET", - "pattern": "/ixo/intent/{agentAddress}/{collectionId}/{id}" + "pattern": "/ixo/claims/intent/{agentAddress}/{collectionId}/{id}" } ] } @@ -6715,7 +6715,7 @@ "rules": [ { "method": "GET", - "pattern": "/ixo/intent" + "pattern": "/ixo/claims/intents" } ] } @@ -7178,7 +7178,7 @@ }, { "name": "amount", - "description": "NOTE: if both amount and cw20 amount are empty then use collection default\ncustom amount specified by evaluator for claim approval", + "description": "NOTE: if claim is using intent, then amount and cw20 amount are ignored and\noverriden with intent amounts NOTE: if both amount and cw20 amount are\nempty then use collection default custom amount specified by evaluator for\nclaim approval", "label": "repeated", "type": "Coin", "longType": "cosmos.base.v1beta1.Coin", @@ -7190,7 +7190,7 @@ }, { "name": "cw20_payment", - "description": "NOTE: if both amount and cw20 amount are empty then use collection default\ncustom cw20 payments specified by evaluator for claim approval", + "description": "NOTE: if claim is using intent, then amount and cw20 amount are ignored and\noverriden with intent amounts NOTE: if both amount and cw20 amount are\nempty then use collection default custom cw20 payments specified by\nevaluator for claim approval", "label": "repeated", "type": "CW20Payment", "longType": "CW20Payment", @@ -12832,7 +12832,7 @@ "rules": [ { "method": "GET", - "pattern": "/ixo/epochs/v1beta1/current_epoch" + "pattern": "/ixo/epochs/v1beta1/epochs/{identifier}" } ] } @@ -13445,9 +13445,9 @@ "name": "epoch_provisions", "description": "epoch_provisions is the current minting per epoch provisions value.", "label": "", - "type": "bytes", - "longType": "bytes", - "fullType": "bytes", + "type": "string", + "longType": "string", + "fullType": "string", "ismap": false, "isoneof": false, "oneofdecl": "", diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 4bda5960..8bf57807 100755 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -2891,8 +2891,8 @@ Collection entity, or have authz cap, aka is agent | status | [EvaluationStatus](#ixo.claims.v1beta1.EvaluationStatus) | | status is the evaluation status expressed as an integer (2=approved, 3=rejected, ...) | | reason | [uint32](#uint32) | | reason is the code expressed as an integer, for why the evaluation result was given (codes defined by evaluator) | | verification_proof | [string](#string) | | verificationProof is the cid of the evaluation Verfiable Credential | -| amount | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | NOTE: if both amount and cw20 amount are empty then use collection default custom amount specified by evaluator for claim approval | -| cw20_payment | [CW20Payment](#ixo.claims.v1beta1.CW20Payment) | repeated | NOTE: if both amount and cw20 amount are empty then use collection default custom cw20 payments specified by evaluator for claim approval | +| amount | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | NOTE: if claim is using intent, then amount and cw20 amount are ignored and overriden with intent amounts NOTE: if both amount and cw20 amount are empty then use collection default custom amount specified by evaluator for claim approval | +| cw20_payment | [CW20Payment](#ixo.claims.v1beta1.CW20Payment) | repeated | NOTE: if claim is using intent, then amount and cw20 amount are ignored and overriden with intent amounts NOTE: if both amount and cw20 amount are empty then use collection default custom cw20 payments specified by evaluator for claim approval | @@ -5230,7 +5230,7 @@ Query/EpochProvisions RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| epoch_provisions | [bytes](#bytes) | | epoch_provisions is the current minting per epoch provisions value. | +| epoch_provisions | [string](#string) | | epoch_provisions is the current minting per epoch provisions value. | diff --git a/docs/swagger-ui/swagger.yaml b/docs/swagger-ui/swagger.yaml index 4a68ed56..85b7ebcd 100644 --- a/docs/swagger-ui/swagger.yaml +++ b/docs/swagger-ui/swagger.yaml @@ -50621,520 +50621,137 @@ paths: type: string tags: - Query - /ixo/claim: + /ixo/claims/claim/{id}: get: - operationId: ClaimList + operationId: Claim responses: '200': description: A successful response. schema: type: object properties: - claims: - type: array - items: - type: object - properties: - collection_id: - type: string - title: >- - collection_id indicates to which Collection this claim - belongs - agent_did: - type: string - title: agent is the DID of the agent submitting the claim - agent_address: - type: string - submission_date: - type: string - format: date-time - title: >- - submissionDate is the date and time that the claim was - submitted on-chain - claim_id: - type: string - title: >- - claimID is the unique identifier of the claim in the cid - hash format - evaluation: - title: >- - evaluation is the result of one or more claim - evaluations - type: object - properties: - claim_id: - type: string - title: >- - claim_id indicates which Claim this evaluation is - for - collection_id: - type: string - title: >- - collection_id indicates to which Collection the - claim being evaluated + claim: + type: object + properties: + collection_id: + type: string + title: >- + collection_id indicates to which Collection this claim + belongs + agent_did: + type: string + title: agent is the DID of the agent submitting the claim + agent_address: + type: string + submission_date: + type: string + format: date-time + title: >- + submissionDate is the date and time that the claim was + submitted on-chain + claim_id: + type: string + title: >- + claimID is the unique identifier of the claim in the cid + hash format + evaluation: + title: evaluation is the result of one or more claim evaluations + type: object + properties: + claim_id: + type: string + title: claim_id indicates which Claim this evaluation is for + collection_id: + type: string + title: >- + collection_id indicates to which Collection the claim + being evaluated - belongs to - oracle: - type: string - title: >- - oracle is the DID of the Oracle entity that - evaluates the claim - agent_did: - type: string - title: >- - agent is the DID of the agent that submits the - evaluation - agent_address: - type: string - status: - title: >- - status is the evaluation status expressed as an - integer (2=approved, + belongs to + oracle: + type: string + title: >- + oracle is the DID of the Oracle entity that evaluates + the claim + agent_did: + type: string + title: >- + agent is the DID of the agent that submits the + evaluation + agent_address: + type: string + status: + title: >- + status is the evaluation status expressed as an + integer (2=approved, - 3=rejected, ...) - type: string - enum: - - PENDING - - APPROVED - - REJECTED - - DISPUTED - - INVALIDATED - default: PENDING - reason: - type: integer - format: int64 - title: >- - reason is the code expressed as an integer, for why - the evaluation result + 3=rejected, ...) + type: string + enum: + - PENDING + - APPROVED + - REJECTED + - DISPUTED + - INVALIDATED + default: PENDING + reason: + type: integer + format: int64 + title: >- + reason is the code expressed as an integer, for why + the evaluation result - was given (codes defined by evaluator) - verification_proof: - type: string - title: >- - verificationProof is the cid of the evaluation - Verfiable Credential - evaluation_date: - type: string - format: date-time - title: >- - evaluationDate is the date and time that the claim - evaluation was submitted + was given (codes defined by evaluator) + verification_proof: + type: string + title: >- + verificationProof is the cid of the evaluation + Verfiable Credential + evaluation_date: + type: string + format: date-time + title: >- + evaluationDate is the date and time that the claim + evaluation was submitted - on-chain - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. + on-chain + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - NOTE: The amount field is an Int which implements - the custom method + NOTE: The amount field is an Int which implements + the custom method - signatures required by gogoproto. - title: >- - if both amount and cw20 amount are empty then use - default by Collection + signatures required by gogoproto. + title: >- + if both amount and cw20 amount are empty then use + default by Collection - custom amount specified by evaluator for claim - approval - cw20_payment: - type: array - items: - type: object - properties: - address: - type: string - amount: - type: string - format: uint64 - title: >- - chose uint64 for now as amounts should be - small enough to fit in a - - uint64(max 18446744073709551615) - title: >- - custom cw20 payments specified by evaluator for - claim approval - payments_status: - title: >- - payments_status is the status of the payments for the - claim - type: object - properties: - submission: - type: string - enum: - - NO_PAYMENT - - PROMISED - - AUTHORIZED - - GUARANTEED - - PAID - - FAILED - - DISPUTED_PAYMENT - default: NO_PAYMENT - title: >- - - PROMISED: Promised: Agent is contracted to receive - payment - - AUTHORIZED: Authorized: Authz set up, no guarantee - - GUARANTEED: Guaranteed: Escrow set up with funds blocked - - PAID: Paid: Funds have been paid - - FAILED: Failed: Payment failed, most probably due to insufficient funds - - DISPUTED_PAYMENT: DisputedPayment: Payment disputed - evaluation: - type: string - enum: - - NO_PAYMENT - - PROMISED - - AUTHORIZED - - GUARANTEED - - PAID - - FAILED - - DISPUTED_PAYMENT - default: NO_PAYMENT - title: >- - - PROMISED: Promised: Agent is contracted to receive - payment - - AUTHORIZED: Authorized: Authz set up, no guarantee - - GUARANTEED: Guaranteed: Escrow set up with funds blocked - - PAID: Paid: Funds have been paid - - FAILED: Failed: Payment failed, most probably due to insufficient funds - - DISPUTED_PAYMENT: DisputedPayment: Payment disputed - approval: - type: string - enum: - - NO_PAYMENT - - PROMISED - - AUTHORIZED - - GUARANTEED - - PAID - - FAILED - - DISPUTED_PAYMENT - default: NO_PAYMENT - title: >- - - PROMISED: Promised: Agent is contracted to receive - payment - - AUTHORIZED: Authorized: Authz set up, no guarantee - - GUARANTEED: Guaranteed: Escrow set up with funds blocked - - PAID: Paid: Funds have been paid - - FAILED: Failed: Payment failed, most probably due to insufficient funds - - DISPUTED_PAYMENT: DisputedPayment: Payment disputed - rejection: - type: string - enum: - - NO_PAYMENT - - PROMISED - - AUTHORIZED - - GUARANTEED - - PAID - - FAILED - - DISPUTED_PAYMENT - default: NO_PAYMENT - title: >- - - PROMISED: Promised: Agent is contracted to receive - payment - - AUTHORIZED: Authorized: Authz set up, no guarantee - - GUARANTEED: Guaranteed: Escrow set up with funds blocked - - PAID: Paid: Funds have been paid - - FAILED: Failed: Payment failed, most probably due to insufficient funds - - DISPUTED_PAYMENT: DisputedPayment: Payment disputed - use_intent: - type: boolean - title: intent_id is the id of the intent for this claim, if any - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. - - - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - title: >- - NOTE: if both amount and cw20 amount are empty then use - default by - - Collection custom amount specified by service agent for - claim approval - cw20_payment: - type: array - items: - type: object - properties: - address: - type: string - amount: - type: string - format: uint64 - title: >- - chose uint64 for now as amounts should be small - enough to fit in a - - uint64(max 18446744073709551615) - title: >- - NOTE: if both amount and cw20 amount are empty then use - default by - - Collection custom cw20 payments specified by service - agent for claim - - approval - pagination: - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - tags: - - Query - /ixo/claim/{id}: - get: - operationId: Claim - responses: - '200': - description: A successful response. - schema: - type: object - properties: - claim: - type: object - properties: - collection_id: - type: string - title: >- - collection_id indicates to which Collection this claim - belongs - agent_did: - type: string - title: agent is the DID of the agent submitting the claim - agent_address: - type: string - submission_date: - type: string - format: date-time - title: >- - submissionDate is the date and time that the claim was - submitted on-chain - claim_id: - type: string - title: >- - claimID is the unique identifier of the claim in the cid - hash format - evaluation: - title: evaluation is the result of one or more claim evaluations - type: object - properties: - claim_id: - type: string - title: claim_id indicates which Claim this evaluation is for - collection_id: - type: string - title: >- - collection_id indicates to which Collection the claim - being evaluated - - belongs to - oracle: - type: string - title: >- - oracle is the DID of the Oracle entity that evaluates - the claim - agent_did: - type: string - title: >- - agent is the DID of the agent that submits the - evaluation - agent_address: - type: string - status: - title: >- - status is the evaluation status expressed as an - integer (2=approved, - - 3=rejected, ...) - type: string - enum: - - PENDING - - APPROVED - - REJECTED - - DISPUTED - - INVALIDATED - default: PENDING - reason: - type: integer - format: int64 - title: >- - reason is the code expressed as an integer, for why - the evaluation result - - was given (codes defined by evaluator) - verification_proof: - type: string - title: >- - verificationProof is the cid of the evaluation - Verfiable Credential - evaluation_date: - type: string - format: date-time - title: >- - evaluationDate is the date and time that the claim - evaluation was submitted - - on-chain - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. - - - NOTE: The amount field is an Int which implements - the custom method - - signatures required by gogoproto. - title: >- - if both amount and cw20 amount are empty then use - default by Collection - - custom amount specified by evaluator for claim - approval - cw20_payment: - type: array - items: - type: object - properties: - address: - type: string - amount: - type: string - format: uint64 - title: >- - chose uint64 for now as amounts should be small - enough to fit in a + custom amount specified by evaluator for claim + approval + cw20_payment: + type: array + items: + type: object + properties: + address: + type: string + amount: + type: string + format: uint64 + title: >- + chose uint64 for now as amounts should be small + enough to fit in a uint64(max 18446744073709551615) title: >- @@ -51232,45 +50849,376 @@ paths: properties: denom: type: string - amount: + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: >- + NOTE: if both amount and cw20 amount are empty then use + default by + + Collection custom amount specified by service agent for + claim approval + cw20_payment: + type: array + items: + type: object + properties: + address: + type: string + amount: + type: string + format: uint64 + title: >- + chose uint64 for now as amounts should be small + enough to fit in a + + uint64(max 18446744073709551615) + title: >- + NOTE: if both amount and cw20 amount are empty then use + default by + + Collection custom cw20 payments specified by service agent + for claim + + approval + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: id + in: path + required: true + type: string + tags: + - Query + /ixo/claims/claims: + get: + operationId: ClaimList + responses: + '200': + description: A successful response. + schema: + type: object + properties: + claims: + type: array + items: + type: object + properties: + collection_id: + type: string + title: >- + collection_id indicates to which Collection this claim + belongs + agent_did: + type: string + title: agent is the DID of the agent submitting the claim + agent_address: + type: string + submission_date: + type: string + format: date-time + title: >- + submissionDate is the date and time that the claim was + submitted on-chain + claim_id: + type: string + title: >- + claimID is the unique identifier of the claim in the cid + hash format + evaluation: + title: >- + evaluation is the result of one or more claim + evaluations + type: object + properties: + claim_id: + type: string + title: >- + claim_id indicates which Claim this evaluation is + for + collection_id: + type: string + title: >- + collection_id indicates to which Collection the + claim being evaluated + + belongs to + oracle: + type: string + title: >- + oracle is the DID of the Oracle entity that + evaluates the claim + agent_did: type: string - description: >- - Coin defines a token with a denomination and an amount. + title: >- + agent is the DID of the agent that submits the + evaluation + agent_address: + type: string + status: + title: >- + status is the evaluation status expressed as an + integer (2=approved, + 3=rejected, ...) + type: string + enum: + - PENDING + - APPROVED + - REJECTED + - DISPUTED + - INVALIDATED + default: PENDING + reason: + type: integer + format: int64 + title: >- + reason is the code expressed as an integer, for why + the evaluation result - NOTE: The amount field is an Int which implements the - custom method + was given (codes defined by evaluator) + verification_proof: + type: string + title: >- + verificationProof is the cid of the evaluation + Verfiable Credential + evaluation_date: + type: string + format: date-time + title: >- + evaluationDate is the date and time that the claim + evaluation was submitted - signatures required by gogoproto. - title: >- - NOTE: if both amount and cw20 amount are empty then use - default by + on-chain + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - Collection custom amount specified by service agent for - claim approval - cw20_payment: - type: array - items: + + NOTE: The amount field is an Int which implements + the custom method + + signatures required by gogoproto. + title: >- + if both amount and cw20 amount are empty then use + default by Collection + + custom amount specified by evaluator for claim + approval + cw20_payment: + type: array + items: + type: object + properties: + address: + type: string + amount: + type: string + format: uint64 + title: >- + chose uint64 for now as amounts should be + small enough to fit in a + + uint64(max 18446744073709551615) + title: >- + custom cw20 payments specified by evaluator for + claim approval + payments_status: + title: >- + payments_status is the status of the payments for the + claim type: object properties: - address: + submission: type: string - amount: + enum: + - NO_PAYMENT + - PROMISED + - AUTHORIZED + - GUARANTEED + - PAID + - FAILED + - DISPUTED_PAYMENT + default: NO_PAYMENT + title: >- + - PROMISED: Promised: Agent is contracted to receive + payment + - AUTHORIZED: Authorized: Authz set up, no guarantee + - GUARANTEED: Guaranteed: Escrow set up with funds blocked + - PAID: Paid: Funds have been paid + - FAILED: Failed: Payment failed, most probably due to insufficient funds + - DISPUTED_PAYMENT: DisputedPayment: Payment disputed + evaluation: type: string - format: uint64 + enum: + - NO_PAYMENT + - PROMISED + - AUTHORIZED + - GUARANTEED + - PAID + - FAILED + - DISPUTED_PAYMENT + default: NO_PAYMENT title: >- - chose uint64 for now as amounts should be small - enough to fit in a + - PROMISED: Promised: Agent is contracted to receive + payment + - AUTHORIZED: Authorized: Authz set up, no guarantee + - GUARANTEED: Guaranteed: Escrow set up with funds blocked + - PAID: Paid: Funds have been paid + - FAILED: Failed: Payment failed, most probably due to insufficient funds + - DISPUTED_PAYMENT: DisputedPayment: Payment disputed + approval: + type: string + enum: + - NO_PAYMENT + - PROMISED + - AUTHORIZED + - GUARANTEED + - PAID + - FAILED + - DISPUTED_PAYMENT + default: NO_PAYMENT + title: >- + - PROMISED: Promised: Agent is contracted to receive + payment + - AUTHORIZED: Authorized: Authz set up, no guarantee + - GUARANTEED: Guaranteed: Escrow set up with funds blocked + - PAID: Paid: Funds have been paid + - FAILED: Failed: Payment failed, most probably due to insufficient funds + - DISPUTED_PAYMENT: DisputedPayment: Payment disputed + rejection: + type: string + enum: + - NO_PAYMENT + - PROMISED + - AUTHORIZED + - GUARANTEED + - PAID + - FAILED + - DISPUTED_PAYMENT + default: NO_PAYMENT + title: >- + - PROMISED: Promised: Agent is contracted to receive + payment + - AUTHORIZED: Authorized: Authz set up, no guarantee + - GUARANTEED: Guaranteed: Escrow set up with funds blocked + - PAID: Paid: Funds have been paid + - FAILED: Failed: Payment failed, most probably due to insufficient funds + - DISPUTED_PAYMENT: DisputedPayment: Payment disputed + use_intent: + type: boolean + title: intent_id is the id of the intent for this claim, if any + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - uint64(max 18446744073709551615) + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: >- + NOTE: if both amount and cw20 amount are empty then use + default by + + Collection custom amount specified by service agent for + claim approval + cw20_payment: + type: array + items: + type: object + properties: + address: + type: string + amount: + type: string + format: uint64 + title: >- + chose uint64 for now as amounts should be small + enough to fit in a + + uint64(max 18446744073709551615) + title: >- + NOTE: if both amount and cw20 amount are empty then use + default by + + Collection custom cw20 payments specified by service + agent for claim + + approval + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 title: >- - NOTE: if both amount and cw20 amount are empty then use - default by + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the - Collection custom cw20 payments specified by service agent - for claim + corresponding request message has used PageRequest. - approval + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } default: description: An unexpected error response. schema: @@ -51294,531 +51242,501 @@ paths: type: string format: byte parameters: - - name: id - in: path - required: true + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query - /ixo/claims/params: + /ixo/claims/collection/{id}: get: - summary: Parameters queries the parameters of the module. - operationId: IXOClaimsParams + operationId: Collection responses: '200': description: A successful response. schema: type: object properties: - params: - description: params holds all the parameters of this module. + collection: type: object properties: - collection_sequence: + id: type: string - format: uint64 - ixo_account: + title: >- + collection id is the incremented internal id for the + collection of claims + entity: type: string - network_fee_percentage: + title: >- + entity is the DID of the entity for which the claims are + being created + admin: type: string - node_fee_percentage: + title: >- + admin is the account address that will authorize or revoke + agents and + + payments (the grantor), and can update the collection + protocol: type: string - intent_sequence: + title: protocol is the DID of the claim protocol + start_date: type: string - format: uint64 - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - tags: - - Query - /ixo/collection: - get: - operationId: CollectionList - responses: - '200': - description: A successful response. - schema: - type: object - properties: - collections: - type: array - items: - type: object - properties: - id: - type: string - title: >- - collection id is the incremented internal id for the - collection of claims - entity: - type: string - title: >- - entity is the DID of the entity for which the claims are - being created - admin: - type: string - title: >- - admin is the account address that will authorize or - revoke agents and - - payments (the grantor), and can update the collection - protocol: - type: string - title: protocol is the DID of the claim protocol - start_date: - type: string - format: date-time - title: >- - startDate is the date after which claims may be - submitted - end_date: - type: string - format: date-time - title: >- - endDate is the date after which no more claims may be - submitted (no endDate - - is allowed) - quota: - type: string - format: uint64 - title: >- - quota is the maximum number of claims that may be - submitted, 0 is unlimited - count: - type: string - format: uint64 - title: >- - count is the number of claims already submitted - (internally calculated) - evaluated: - type: string - format: uint64 - title: >- - evaluated is the number of claims that have been - evaluated (internally - - calculated) - approved: - type: string - format: uint64 - title: >- - approved is the number of claims that have been - evaluated and approved - - (internally calculated) - rejected: - type: string - format: uint64 - title: >- - rejected is the number of claims that have been - evaluated and rejected + format: date-time + title: startDate is the date after which claims may be submitted + end_date: + type: string + format: date-time + title: >- + endDate is the date after which no more claims may be + submitted (no endDate - (internally calculated) - disputed: - type: string - format: uint64 - title: >- - disputed is the number of claims that have disputed - status (internally + is allowed) + quota: + type: string + format: uint64 + title: >- + quota is the maximum number of claims that may be + submitted, 0 is unlimited + count: + type: string + format: uint64 + title: >- + count is the number of claims already submitted + (internally calculated) + evaluated: + type: string + format: uint64 + title: >- + evaluated is the number of claims that have been evaluated + (internally - calculated) - state: - title: >- - state is the current state of this Collection (open, - paused, closed) - type: string - enum: - - OPEN - - PAUSED - - CLOSED - default: OPEN - payments: - title: >- - payments is the amount paid for claim submission, - evaluation, approval, or + calculated) + approved: + type: string + format: uint64 + title: >- + approved is the number of claims that have been evaluated + and approved - rejection - type: object - properties: - submission: - type: object - properties: - account: - type: string - title: >- - account is the entity account address from which - the payment will be made - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and - an amount. + (internally calculated) + rejected: + type: string + format: uint64 + title: >- + rejected is the number of claims that have been evaluated + and rejected + (internally calculated) + disputed: + type: string + format: uint64 + title: >- + disputed is the number of claims that have disputed status + (internally - NOTE: The amount field is an Int which - implements the custom method + calculated) + state: + title: >- + state is the current state of this Collection (open, + paused, closed) + type: string + enum: + - OPEN + - PAUSED + - CLOSED + default: OPEN + payments: + title: >- + payments is the amount paid for claim submission, + evaluation, approval, or - signatures required by gogoproto. - contract_1155_payment: - title: >- - if empty(nil) then no contract payment, not - allowed for Evaluation Payment + rejection + type: object + properties: + submission: + type: object + properties: + account: + type: string + title: >- + account is the entity account address from which + the payment will be made + amount: + type: array + items: type: object properties: - address: - type: string - token_id: + denom: type: string amount: - type: integer - format: int64 - timeout_ns: - type: string - title: >- - timeout after claim/evaluation to create authZ - for payment, if 0 then - - immediate direct payment - cw20_payment: - type: array - items: - type: object - properties: - address: - type: string - amount: - type: string - format: uint64 - title: >- - chose uint64 for now as amounts should be - small enough to fit in a - - uint64(max 18446744073709551615) - title: cw20 payments, can be empty or multiple - is_oracle_payment: - type: boolean - title: >- - boolean to indicate if the payment is for oracle - payments, aka it will go - - through network fees split NOTE: if true the - payment can only have amount + type: string + description: >- + Coin defines a token with a denomination and an + amount. - values(Native coins), no cw20 payments allowed - then - evaluation: - type: object - properties: - account: - type: string - title: >- - account is the entity account address from which - the payment will be made - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and - an amount. + NOTE: The amount field is an Int which + implements the custom method - NOTE: The amount field is an Int which - implements the custom method + signatures required by gogoproto. + contract_1155_payment: + title: >- + if empty(nil) then no contract payment, not + allowed for Evaluation Payment + type: object + properties: + address: + type: string + token_id: + type: string + amount: + type: integer + format: int64 + timeout_ns: + type: string + title: >- + timeout after claim/evaluation to create authZ for + payment, if 0 then - signatures required by gogoproto. - contract_1155_payment: - title: >- - if empty(nil) then no contract payment, not - allowed for Evaluation Payment + immediate direct payment + cw20_payment: + type: array + items: type: object properties: address: type: string - token_id: - type: string amount: - type: integer - format: int64 - timeout_ns: - type: string - title: >- - timeout after claim/evaluation to create authZ - for payment, if 0 then - - immediate direct payment - cw20_payment: - type: array - items: - type: object - properties: - address: - type: string - amount: - type: string - format: uint64 - title: >- - chose uint64 for now as amounts should be - small enough to fit in a + type: string + format: uint64 + title: >- + chose uint64 for now as amounts should be + small enough to fit in a - uint64(max 18446744073709551615) - title: cw20 payments, can be empty or multiple - is_oracle_payment: - type: boolean - title: >- - boolean to indicate if the payment is for oracle - payments, aka it will go + uint64(max 18446744073709551615) + title: cw20 payments, can be empty or multiple + is_oracle_payment: + type: boolean + title: >- + boolean to indicate if the payment is for oracle + payments, aka it will go - through network fees split NOTE: if true the - payment can only have amount + through network fees split NOTE: if true the + payment can only have amount - values(Native coins), no cw20 payments allowed - then - approval: - type: object - properties: - account: - type: string - title: >- - account is the entity account address from which - the payment will be made - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and - an amount. + values(Native coins), no cw20 payments allowed + then + evaluation: + type: object + properties: + account: + type: string + title: >- + account is the entity account address from which + the payment will be made + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - NOTE: The amount field is an Int which - implements the custom method + NOTE: The amount field is an Int which + implements the custom method - signatures required by gogoproto. - contract_1155_payment: - title: >- - if empty(nil) then no contract payment, not - allowed for Evaluation Payment + signatures required by gogoproto. + contract_1155_payment: + title: >- + if empty(nil) then no contract payment, not + allowed for Evaluation Payment + type: object + properties: + address: + type: string + token_id: + type: string + amount: + type: integer + format: int64 + timeout_ns: + type: string + title: >- + timeout after claim/evaluation to create authZ for + payment, if 0 then + + immediate direct payment + cw20_payment: + type: array + items: type: object properties: address: type: string - token_id: - type: string amount: - type: integer - format: int64 - timeout_ns: - type: string - title: >- - timeout after claim/evaluation to create authZ - for payment, if 0 then + type: string + format: uint64 + title: >- + chose uint64 for now as amounts should be + small enough to fit in a - immediate direct payment - cw20_payment: - type: array - items: - type: object - properties: - address: - type: string - amount: - type: string - format: uint64 - title: >- - chose uint64 for now as amounts should be - small enough to fit in a + uint64(max 18446744073709551615) + title: cw20 payments, can be empty or multiple + is_oracle_payment: + type: boolean + title: >- + boolean to indicate if the payment is for oracle + payments, aka it will go - uint64(max 18446744073709551615) - title: cw20 payments, can be empty or multiple - is_oracle_payment: - type: boolean - title: >- - boolean to indicate if the payment is for oracle - payments, aka it will go + through network fees split NOTE: if true the + payment can only have amount - through network fees split NOTE: if true the - payment can only have amount + values(Native coins), no cw20 payments allowed + then + approval: + type: object + properties: + account: + type: string + title: >- + account is the entity account address from which + the payment will be made + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - values(Native coins), no cw20 payments allowed - then - rejection: - type: object - properties: - account: - type: string - title: >- - account is the entity account address from which - the payment will be made - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and - an amount. + NOTE: The amount field is an Int which + implements the custom method - NOTE: The amount field is an Int which - implements the custom method + signatures required by gogoproto. + contract_1155_payment: + title: >- + if empty(nil) then no contract payment, not + allowed for Evaluation Payment + type: object + properties: + address: + type: string + token_id: + type: string + amount: + type: integer + format: int64 + timeout_ns: + type: string + title: >- + timeout after claim/evaluation to create authZ for + payment, if 0 then - signatures required by gogoproto. - contract_1155_payment: - title: >- - if empty(nil) then no contract payment, not - allowed for Evaluation Payment + immediate direct payment + cw20_payment: + type: array + items: type: object properties: address: type: string - token_id: - type: string amount: - type: integer - format: int64 - timeout_ns: - type: string - title: >- - timeout after claim/evaluation to create authZ - for payment, if 0 then + type: string + format: uint64 + title: >- + chose uint64 for now as amounts should be + small enough to fit in a - immediate direct payment - cw20_payment: - type: array - items: - type: object - properties: - address: - type: string - amount: - type: string - format: uint64 - title: >- - chose uint64 for now as amounts should be - small enough to fit in a + uint64(max 18446744073709551615) + title: cw20 payments, can be empty or multiple + is_oracle_payment: + type: boolean + title: >- + boolean to indicate if the payment is for oracle + payments, aka it will go - uint64(max 18446744073709551615) - title: cw20 payments, can be empty or multiple - is_oracle_payment: - type: boolean - title: >- - boolean to indicate if the payment is for oracle - payments, aka it will go + through network fees split NOTE: if true the + payment can only have amount - through network fees split NOTE: if true the - payment can only have amount + values(Native coins), no cw20 payments allowed + then + rejection: + type: object + properties: + account: + type: string + title: >- + account is the entity account address from which + the payment will be made + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - values(Native coins), no cw20 payments allowed - then - signer: - type: string - title: signer address - invalidated: - type: string - format: uint64 - title: >- - invalidated is the number of claims that have been - evaluated as invalid - (internally calculated) - escrow_account: - type: string - title: >- - escrow_account is the escrow account address for this - collection created at + NOTE: The amount field is an Int which + implements the custom method + + signatures required by gogoproto. + contract_1155_payment: + title: >- + if empty(nil) then no contract payment, not + allowed for Evaluation Payment + type: object + properties: + address: + type: string + token_id: + type: string + amount: + type: integer + format: int64 + timeout_ns: + type: string + title: >- + timeout after claim/evaluation to create authZ for + payment, if 0 then + + immediate direct payment + cw20_payment: + type: array + items: + type: object + properties: + address: + type: string + amount: + type: string + format: uint64 + title: >- + chose uint64 for now as amounts should be + small enough to fit in a - collection creation, current purpose is to transfer - payments to escrow + uint64(max 18446744073709551615) + title: cw20 payments, can be empty or multiple + is_oracle_payment: + type: boolean + title: >- + boolean to indicate if the payment is for oracle + payments, aka it will go - account for GUARANTEED payments through intents - intents: - title: >- - intents is the option for intents for this collection - (allow, deny, + through network fees split NOTE: if true the + payment can only have amount - required) - type: string - enum: - - ALLOW - - DENY - - REQUIRED - default: ALLOW - description: |2- - - ALLOW: Allow: Intents can be made for claims, but claims can also be made without - intents. - - DENY: Deny: Intents cannot be made for claims for the collection. - - REQUIRED: Required: Claims cannot be made without an associated intent. An intent is - mandatory before a claim can be submitted. - pagination: - type: object - properties: - next_key: + values(Native coins), no cw20 payments allowed + then + signer: type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + title: signer address + invalidated: type: string format: uint64 title: >- - total is total number of results available if - PageRequest.count_total + invalidated is the number of claims that have been + evaluated as invalid - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + (internally calculated) + escrow_account: + type: string + title: >- + escrow_account is the escrow account address for this + collection created at - corresponding request message has used PageRequest. + collection creation, current purpose is to transfer + payments to escrow - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } + account for GUARANTEED payments through intents + intents: + title: >- + intents is the option for intents for this collection + (allow, deny, + + required) + type: string + enum: + - ALLOW + - DENY + - REQUIRED + default: ALLOW + description: |2- + - ALLOW: Allow: Intents can be made for claims, but claims can also be made without + intents. + - DENY: Deny: Intents cannot be made for claims for the collection. + - REQUIRED: Required: Claims cannot be made without an associated intent. An intent is + mandatory before a claim can be submitted. default: description: An unexpected error response. schema: @@ -51842,501 +51760,591 @@ paths: type: string format: byte parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false + - name: id + in: path + required: true type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean tags: - Query - /ixo/collection/{id}: + /ixo/claims/collections: get: - operationId: Collection + operationId: CollectionList responses: '200': description: A successful response. schema: type: object properties: - collection: - type: object - properties: - id: - type: string - title: >- - collection id is the incremented internal id for the - collection of claims - entity: - type: string - title: >- - entity is the DID of the entity for which the claims are - being created - admin: - type: string - title: >- - admin is the account address that will authorize or revoke - agents and - - payments (the grantor), and can update the collection - protocol: - type: string - title: protocol is the DID of the claim protocol - start_date: - type: string - format: date-time - title: startDate is the date after which claims may be submitted - end_date: - type: string - format: date-time - title: >- - endDate is the date after which no more claims may be - submitted (no endDate + collections: + type: array + items: + type: object + properties: + id: + type: string + title: >- + collection id is the incremented internal id for the + collection of claims + entity: + type: string + title: >- + entity is the DID of the entity for which the claims are + being created + admin: + type: string + title: >- + admin is the account address that will authorize or + revoke agents and - is allowed) - quota: - type: string - format: uint64 - title: >- - quota is the maximum number of claims that may be - submitted, 0 is unlimited - count: - type: string - format: uint64 - title: >- - count is the number of claims already submitted - (internally calculated) - evaluated: - type: string - format: uint64 - title: >- - evaluated is the number of claims that have been evaluated - (internally + payments (the grantor), and can update the collection + protocol: + type: string + title: protocol is the DID of the claim protocol + start_date: + type: string + format: date-time + title: >- + startDate is the date after which claims may be + submitted + end_date: + type: string + format: date-time + title: >- + endDate is the date after which no more claims may be + submitted (no endDate - calculated) - approved: - type: string - format: uint64 - title: >- - approved is the number of claims that have been evaluated - and approved + is allowed) + quota: + type: string + format: uint64 + title: >- + quota is the maximum number of claims that may be + submitted, 0 is unlimited + count: + type: string + format: uint64 + title: >- + count is the number of claims already submitted + (internally calculated) + evaluated: + type: string + format: uint64 + title: >- + evaluated is the number of claims that have been + evaluated (internally - (internally calculated) - rejected: - type: string - format: uint64 - title: >- - rejected is the number of claims that have been evaluated - and rejected + calculated) + approved: + type: string + format: uint64 + title: >- + approved is the number of claims that have been + evaluated and approved - (internally calculated) - disputed: - type: string - format: uint64 - title: >- - disputed is the number of claims that have disputed status - (internally + (internally calculated) + rejected: + type: string + format: uint64 + title: >- + rejected is the number of claims that have been + evaluated and rejected - calculated) - state: - title: >- - state is the current state of this Collection (open, - paused, closed) - type: string - enum: - - OPEN - - PAUSED - - CLOSED - default: OPEN - payments: - title: >- - payments is the amount paid for claim submission, - evaluation, approval, or + (internally calculated) + disputed: + type: string + format: uint64 + title: >- + disputed is the number of claims that have disputed + status (internally - rejection - type: object - properties: - submission: - type: object - properties: - account: - type: string - title: >- - account is the entity account address from which - the payment will be made - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. + calculated) + state: + title: >- + state is the current state of this Collection (open, + paused, closed) + type: string + enum: + - OPEN + - PAUSED + - CLOSED + default: OPEN + payments: + title: >- + payments is the amount paid for claim submission, + evaluation, approval, or + rejection + type: object + properties: + submission: + type: object + properties: + account: + type: string + title: >- + account is the entity account address from which + the payment will be made + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and + an amount. - NOTE: The amount field is an Int which - implements the custom method - signatures required by gogoproto. - contract_1155_payment: - title: >- - if empty(nil) then no contract payment, not - allowed for Evaluation Payment - type: object - properties: - address: - type: string - token_id: - type: string - amount: - type: integer - format: int64 - timeout_ns: - type: string - title: >- - timeout after claim/evaluation to create authZ for - payment, if 0 then + NOTE: The amount field is an Int which + implements the custom method - immediate direct payment - cw20_payment: - type: array - items: + signatures required by gogoproto. + contract_1155_payment: + title: >- + if empty(nil) then no contract payment, not + allowed for Evaluation Payment type: object properties: address: type: string - amount: + token_id: type: string - format: uint64 - title: >- - chose uint64 for now as amounts should be - small enough to fit in a + amount: + type: integer + format: int64 + timeout_ns: + type: string + title: >- + timeout after claim/evaluation to create authZ + for payment, if 0 then - uint64(max 18446744073709551615) - title: cw20 payments, can be empty or multiple - is_oracle_payment: - type: boolean - title: >- - boolean to indicate if the payment is for oracle - payments, aka it will go + immediate direct payment + cw20_payment: + type: array + items: + type: object + properties: + address: + type: string + amount: + type: string + format: uint64 + title: >- + chose uint64 for now as amounts should be + small enough to fit in a - through network fees split NOTE: if true the - payment can only have amount + uint64(max 18446744073709551615) + title: cw20 payments, can be empty or multiple + is_oracle_payment: + type: boolean + title: >- + boolean to indicate if the payment is for oracle + payments, aka it will go - values(Native coins), no cw20 payments allowed - then - evaluation: - type: object - properties: - account: - type: string - title: >- - account is the entity account address from which - the payment will be made - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. + through network fees split NOTE: if true the + payment can only have amount + values(Native coins), no cw20 payments allowed + then + evaluation: + type: object + properties: + account: + type: string + title: >- + account is the entity account address from which + the payment will be made + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and + an amount. - NOTE: The amount field is an Int which - implements the custom method - signatures required by gogoproto. - contract_1155_payment: - title: >- - if empty(nil) then no contract payment, not - allowed for Evaluation Payment - type: object - properties: - address: - type: string - token_id: - type: string - amount: - type: integer - format: int64 - timeout_ns: - type: string - title: >- - timeout after claim/evaluation to create authZ for - payment, if 0 then + NOTE: The amount field is an Int which + implements the custom method - immediate direct payment - cw20_payment: - type: array - items: + signatures required by gogoproto. + contract_1155_payment: + title: >- + if empty(nil) then no contract payment, not + allowed for Evaluation Payment type: object properties: address: type: string - amount: + token_id: type: string - format: uint64 - title: >- - chose uint64 for now as amounts should be - small enough to fit in a + amount: + type: integer + format: int64 + timeout_ns: + type: string + title: >- + timeout after claim/evaluation to create authZ + for payment, if 0 then - uint64(max 18446744073709551615) - title: cw20 payments, can be empty or multiple - is_oracle_payment: - type: boolean - title: >- - boolean to indicate if the payment is for oracle - payments, aka it will go + immediate direct payment + cw20_payment: + type: array + items: + type: object + properties: + address: + type: string + amount: + type: string + format: uint64 + title: >- + chose uint64 for now as amounts should be + small enough to fit in a - through network fees split NOTE: if true the - payment can only have amount + uint64(max 18446744073709551615) + title: cw20 payments, can be empty or multiple + is_oracle_payment: + type: boolean + title: >- + boolean to indicate if the payment is for oracle + payments, aka it will go - values(Native coins), no cw20 payments allowed - then - approval: - type: object - properties: - account: - type: string - title: >- - account is the entity account address from which - the payment will be made - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. + through network fees split NOTE: if true the + payment can only have amount + values(Native coins), no cw20 payments allowed + then + approval: + type: object + properties: + account: + type: string + title: >- + account is the entity account address from which + the payment will be made + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and + an amount. - NOTE: The amount field is an Int which - implements the custom method - signatures required by gogoproto. - contract_1155_payment: - title: >- - if empty(nil) then no contract payment, not - allowed for Evaluation Payment - type: object - properties: - address: - type: string - token_id: - type: string - amount: - type: integer - format: int64 - timeout_ns: - type: string - title: >- - timeout after claim/evaluation to create authZ for - payment, if 0 then + NOTE: The amount field is an Int which + implements the custom method - immediate direct payment - cw20_payment: - type: array - items: + signatures required by gogoproto. + contract_1155_payment: + title: >- + if empty(nil) then no contract payment, not + allowed for Evaluation Payment type: object properties: address: type: string - amount: - type: string - format: uint64 - title: >- - chose uint64 for now as amounts should be - small enough to fit in a - - uint64(max 18446744073709551615) - title: cw20 payments, can be empty or multiple - is_oracle_payment: - type: boolean - title: >- - boolean to indicate if the payment is for oracle - payments, aka it will go - - through network fees split NOTE: if true the - payment can only have amount - - values(Native coins), no cw20 payments allowed - then - rejection: - type: object - properties: - account: - type: string - title: >- - account is the entity account address from which - the payment will be made - amount: - type: array - items: - type: object - properties: - denom: + token_id: type: string amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. + type: integer + format: int64 + timeout_ns: + type: string + title: >- + timeout after claim/evaluation to create authZ + for payment, if 0 then + immediate direct payment + cw20_payment: + type: array + items: + type: object + properties: + address: + type: string + amount: + type: string + format: uint64 + title: >- + chose uint64 for now as amounts should be + small enough to fit in a - NOTE: The amount field is an Int which - implements the custom method + uint64(max 18446744073709551615) + title: cw20 payments, can be empty or multiple + is_oracle_payment: + type: boolean + title: >- + boolean to indicate if the payment is for oracle + payments, aka it will go - signatures required by gogoproto. - contract_1155_payment: - title: >- - if empty(nil) then no contract payment, not - allowed for Evaluation Payment - type: object - properties: - address: - type: string - token_id: - type: string - amount: - type: integer - format: int64 - timeout_ns: - type: string - title: >- - timeout after claim/evaluation to create authZ for - payment, if 0 then + through network fees split NOTE: if true the + payment can only have amount + + values(Native coins), no cw20 payments allowed + then + rejection: + type: object + properties: + account: + type: string + title: >- + account is the entity account address from which + the payment will be made + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and + an amount. - immediate direct payment - cw20_payment: - type: array - items: + + NOTE: The amount field is an Int which + implements the custom method + + signatures required by gogoproto. + contract_1155_payment: + title: >- + if empty(nil) then no contract payment, not + allowed for Evaluation Payment type: object properties: address: type: string - amount: + token_id: type: string - format: uint64 - title: >- - chose uint64 for now as amounts should be - small enough to fit in a + amount: + type: integer + format: int64 + timeout_ns: + type: string + title: >- + timeout after claim/evaluation to create authZ + for payment, if 0 then - uint64(max 18446744073709551615) - title: cw20 payments, can be empty or multiple - is_oracle_payment: - type: boolean - title: >- - boolean to indicate if the payment is for oracle - payments, aka it will go + immediate direct payment + cw20_payment: + type: array + items: + type: object + properties: + address: + type: string + amount: + type: string + format: uint64 + title: >- + chose uint64 for now as amounts should be + small enough to fit in a - through network fees split NOTE: if true the - payment can only have amount + uint64(max 18446744073709551615) + title: cw20 payments, can be empty or multiple + is_oracle_payment: + type: boolean + title: >- + boolean to indicate if the payment is for oracle + payments, aka it will go - values(Native coins), no cw20 payments allowed - then - signer: + through network fees split NOTE: if true the + payment can only have amount + + values(Native coins), no cw20 payments allowed + then + signer: + type: string + title: signer address + invalidated: + type: string + format: uint64 + title: >- + invalidated is the number of claims that have been + evaluated as invalid + + (internally calculated) + escrow_account: + type: string + title: >- + escrow_account is the escrow account address for this + collection created at + + collection creation, current purpose is to transfer + payments to escrow + + account for GUARANTEED payments through intents + intents: + title: >- + intents is the option for intents for this collection + (allow, deny, + + required) + type: string + enum: + - ALLOW + - DENY + - REQUIRED + default: ALLOW + description: |2- + - ALLOW: Allow: Intents can be made for claims, but claims can also be made without + intents. + - DENY: Deny: Intents cannot be made for claims for the collection. + - REQUIRED: Required: Claims cannot be made without an associated intent. An intent is + mandatory before a claim can be submitted. + pagination: + type: object + properties: + next_key: type: string - title: signer address - invalidated: + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: type: string format: uint64 title: >- - invalidated is the number of claims that have been - evaluated as invalid + total is total number of results available if + PageRequest.count_total - (internally calculated) - escrow_account: - type: string - title: >- - escrow_account is the escrow account address for this - collection created at + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the - collection creation, current purpose is to transfer - payments to escrow + corresponding request message has used PageRequest. - account for GUARANTEED payments through intents - intents: - title: >- - intents is the option for intents for this collection - (allow, deny, + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - required) - type: string - enum: - - ALLOW - - DENY - - REQUIRED - default: ALLOW - description: |2- - - ALLOW: Allow: Intents can be made for claims, but claims can also be made without - intents. - - DENY: Deny: Intents cannot be made for claims for the collection. - - REQUIRED: Required: Claims cannot be made without an associated intent. An intent is - mandatory before a claim can be submitted. + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /ixo/claims/dispute/{proof}: + get: + operationId: Dispute + responses: + '200': + description: A successful response. + schema: + type: object + properties: + dispute: + type: object + properties: + subject_id: + type: string + type: + type: integer + format: int32 + title: type is expressed as an integer, interpreted by the client + data: + type: object + properties: + uri: + type: string + type: + type: string + proof: + type: string + encrypted: + type: boolean default: description: An unexpected error response. schema: @@ -52360,13 +52368,13 @@ paths: type: string format: byte parameters: - - name: id + - name: proof in: path required: true type: string tags: - Query - /ixo/dispute: + /ixo/claims/disputes: get: operationId: DisputeList responses: @@ -52508,35 +52516,108 @@ paths: type: boolean tags: - Query - /ixo/dispute/{proof}: + /ixo/claims/intent/{agentAddress}/{collectionId}/{id}: get: - operationId: Dispute + operationId: Intent responses: '200': description: A successful response. schema: type: object properties: - dispute: + intent: type: object properties: - subject_id: + id: type: string - type: - type: integer - format: int32 - title: type is expressed as an integer, interpreted by the client - data: - type: object - properties: - uri: - type: string - type: - type: string - proof: - type: string - encrypted: - type: boolean + title: id is the incremented internal id for the intent + agent_did: + type: string + description: The service agent's DID (Decentralized Identifier). + agent_address: + type: string + description: The service agent's address. + collection_id: + type: string + description: The id of the collection this intent is linked to. + claim_id: + type: string + title: claim_id (optional, set when claim is submitted) + created_at: + type: string + format: date-time + description: The time the intent was created. + expire_at: + type: string + format: date-time + description: >- + Timeout period for the intent. If the claim is not + submitted by this time, + + the intent expires. + status: + description: Status of the intent (e.g., "ACTIVE" or "FULFILLED"). + type: string + enum: + - ACTIVE + - FULFILLED + - EXPIRED + default: ACTIVE + title: >- + - ACTIVE: Active: Intent is created and active, payments + have been transferred to + + escrow if there is any + - FULFILLED: Fulfilled: Intent is fulfilled, was used to create a claim and funds will + be released on claim APPROVAL, or funds will be reverted + on claim REJECTION + + or DISPUTE + - EXPIRED: Expired: Intent has expired, payments have been transferred back out of + escrow + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: The payment amount the agent intends to claim, if any. + cw20_payment: + type: array + items: + type: object + properties: + address: + type: string + amount: + type: string + format: uint64 + title: >- + chose uint64 for now as amounts should be small + enough to fit in a + + uint64(max 18446744073709551615) + description: The CW20Payment amount the agent intends to claim, if any. + from_address: + type: string + title: the address the escrow payment came from + escrow_address: + type: string + title: the escrow account address + description: >- + Intent defines the structure for a service agent's claim + intent. default: description: An unexpected error response. schema: @@ -52560,13 +52641,21 @@ paths: type: string format: byte parameters: - - name: proof + - name: agentAddress + in: path + required: true + type: string + - name: collectionId + in: path + required: true + type: string + - name: id in: path required: true type: string tags: - Query - /ixo/intent: + /ixo/claims/intents: get: operationId: IntentList responses: @@ -52782,108 +52871,32 @@ paths: type: boolean tags: - Query - /ixo/intent/{agentAddress}/{collectionId}/{id}: + /ixo/claims/params: get: - operationId: Intent + summary: Parameters queries the parameters of the module. + operationId: IXOClaimsParams responses: '200': description: A successful response. schema: type: object properties: - intent: + params: + description: params holds all the parameters of this module. type: object properties: - id: - type: string - title: id is the incremented internal id for the intent - agent_did: - type: string - description: The service agent's DID (Decentralized Identifier). - agent_address: - type: string - description: The service agent's address. - collection_id: - type: string - description: The id of the collection this intent is linked to. - claim_id: - type: string - title: claim_id (optional, set when claim is submitted) - created_at: + collection_sequence: type: string - format: date-time - description: The time the intent was created. - expire_at: + format: uint64 + ixo_account: type: string - format: date-time - description: >- - Timeout period for the intent. If the claim is not - submitted by this time, - - the intent expires. - status: - description: Status of the intent (e.g., "ACTIVE" or "FULFILLED"). + network_fee_percentage: type: string - enum: - - ACTIVE - - FULFILLED - - EXPIRED - default: ACTIVE - title: >- - - ACTIVE: Active: Intent is created and active, payments - have been transferred to - - escrow if there is any - - FULFILLED: Fulfilled: Intent is fulfilled, was used to create a claim and funds will - be released on claim APPROVAL, or funds will be reverted - on claim REJECTION - - or DISPUTE - - EXPIRED: Expired: Intent has expired, payments have been transferred back out of - escrow - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - description: The payment amount the agent intends to claim, if any. - cw20_payment: - type: array - items: - type: object - properties: - address: - type: string - amount: - type: string - format: uint64 - title: >- - chose uint64 for now as amounts should be small - enough to fit in a - - uint64(max 18446744073709551615) - description: The CW20Payment amount the agent intends to claim, if any. - from_address: + node_fee_percentage: type: string - title: the address the escrow payment came from - escrow_address: + intent_sequence: type: string - title: the escrow account address - description: >- - Intent defines the structure for a service agent's claim - intent. + format: uint64 default: description: An unexpected error response. schema: @@ -52906,19 +52919,6 @@ paths: value: type: string format: byte - parameters: - - name: agentAddress - in: path - required: true - type: string - - name: collectionId - in: path - required: true - type: string - - name: id - in: path - required: true - type: string tags: - Query /ixo/entity: diff --git a/go.mod b/go.mod index 1bfa9d47..d28eef8b 100755 --- a/go.mod +++ b/go.mod @@ -12,6 +12,7 @@ require ( cosmossdk.io/store v1.1.1 cosmossdk.io/tools/confix v0.1.2 cosmossdk.io/tools/rosetta v0.2.1-0.20230613133644-0a778132a60f + cosmossdk.io/x/circuit v0.1.1 cosmossdk.io/x/evidence v0.1.1 cosmossdk.io/x/feegrant v0.1.1 cosmossdk.io/x/tx v0.13.5 diff --git a/proto/ixo/claims/v1beta1/query.proto b/proto/ixo/claims/v1beta1/query.proto index 29274d45..6b7c9b4f 100644 --- a/proto/ixo/claims/v1beta1/query.proto +++ b/proto/ixo/claims/v1beta1/query.proto @@ -15,30 +15,30 @@ service Query { option (google.api.http).get = "/ixo/claims/params"; } rpc Collection(QueryCollectionRequest) returns (QueryCollectionResponse) { - option (google.api.http).get = "/ixo/collection/{id}"; + option (google.api.http).get = "/ixo/claims/collection/{id}"; } rpc CollectionList(QueryCollectionListRequest) returns (QueryCollectionListResponse) { - option (google.api.http).get = "/ixo/collection"; + option (google.api.http).get = "/ixo/claims/collections"; } rpc Claim(QueryClaimRequest) returns (QueryClaimResponse) { - option (google.api.http).get = "/ixo/claim/{id}"; + option (google.api.http).get = "/ixo/claims/claim/{id}"; } rpc ClaimList(QueryClaimListRequest) returns (QueryClaimListResponse) { - option (google.api.http).get = "/ixo/claim"; + option (google.api.http).get = "/ixo/claims/claims"; } rpc Dispute(QueryDisputeRequest) returns (QueryDisputeResponse) { - option (google.api.http).get = "/ixo/dispute/{proof}"; + option (google.api.http).get = "/ixo/claims/dispute/{proof}"; } rpc DisputeList(QueryDisputeListRequest) returns (QueryDisputeListResponse) { - option (google.api.http).get = "/ixo/dispute"; + option (google.api.http).get = "/ixo/claims/disputes"; } rpc Intent(QueryIntentRequest) returns (QueryIntentResponse) { option (google.api.http).get = - "/ixo/intent/{agentAddress}/{collectionId}/{id}"; + "/ixo/claims/intent/{agentAddress}/{collectionId}/{id}"; } rpc IntentList(QueryIntentListRequest) returns (QueryIntentListResponse) { - option (google.api.http).get = "/ixo/intent"; + option (google.api.http).get = "/ixo/claims/intents"; } } diff --git a/proto/ixo/claims/v1beta1/tx.proto b/proto/ixo/claims/v1beta1/tx.proto index dd14b341..6cf49b47 100644 --- a/proto/ixo/claims/v1beta1/tx.proto +++ b/proto/ixo/claims/v1beta1/tx.proto @@ -114,16 +114,18 @@ message MsgEvaluateClaim { uint32 reason = 8; // verificationProof is the cid of the evaluation Verfiable Credential string verification_proof = 9; - // NOTE: if claim is using intent, then amount and cw20 amount are ignored and overriden with intent amounts - // NOTE: if both amount and cw20 amount are empty then use collection default - // custom amount specified by evaluator for claim approval + // NOTE: if claim is using intent, then amount and cw20 amount are ignored and + // overriden with intent amounts NOTE: if both amount and cw20 amount are + // empty then use collection default custom amount specified by evaluator for + // claim approval repeated cosmos.base.v1beta1.Coin amount = 10 [ (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; - // NOTE: if claim is using intent, then amount and cw20 amount are ignored and overriden with intent amounts - // NOTE: if both amount and cw20 amount are empty then use collection default - // custom cw20 payments specified by evaluator for claim approval + // NOTE: if claim is using intent, then amount and cw20 amount are ignored and + // overriden with intent amounts NOTE: if both amount and cw20 amount are + // empty then use collection default custom cw20 payments specified by + // evaluator for claim approval repeated CW20Payment cw20_payment = 11; } message MsgEvaluateClaimResponse {} diff --git a/proto/ixo/epochs/v1beta1/query.proto b/proto/ixo/epochs/v1beta1/query.proto index 64f0a92d..acc8e5db 100644 --- a/proto/ixo/epochs/v1beta1/query.proto +++ b/proto/ixo/epochs/v1beta1/query.proto @@ -17,7 +17,7 @@ service Query { // CurrentEpoch provide current epoch of specified identifier rpc CurrentEpoch(QueryCurrentEpochRequest) returns (QueryCurrentEpochResponse) { - option (google.api.http).get = "/ixo/epochs/v1beta1/current_epoch"; + option (google.api.http).get = "/ixo/epochs/v1beta1/epochs/{identifier}"; } } diff --git a/proto/ixo/mint/v1beta1/query.proto b/proto/ixo/mint/v1beta1/query.proto index 3512eee6..f34f0e72 100644 --- a/proto/ixo/mint/v1beta1/query.proto +++ b/proto/ixo/mint/v1beta1/query.proto @@ -38,7 +38,7 @@ message QueryEpochProvisionsRequest {} // Query/EpochProvisions RPC method. message QueryEpochProvisionsResponse { // epoch_provisions is the current minting per epoch provisions value. - bytes epoch_provisions = 1 [ + string epoch_provisions = 1 [ (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; diff --git a/scripts/run_with_all_data_2.sh b/scripts/run_with_all_data_2.sh new file mode 100755 index 00000000..9813fdaa --- /dev/null +++ b/scripts/run_with_all_data_2.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +# This is to spin up another node for development, run this to get everything ready, run this then copy over the genesis file + +# Must be run from root path inside ixo-blockchain for source to work +source ./scripts/constants.sh + +ixod init local2 --chain-id $CHAIN_ID + +# first add and remove a dummy user so PASSWORD can be set in keychain +yes $PASSWORD | ixod keys add dummy &>/dev/null +yes $PASSWORD | ixod keys delete ${USERS[i]} -y &>/dev/null + +for ((i = 0; i < ${#USERS[@]}; ++i)); do + # delete key if exists + yes $PASSWORD | ixod keys delete ${USERS[i]} -y 2>/dev/null + # create key with constant mnemonic in /scripts/constants.sh + ( + echo ${MNEMONICS[i]} + echo $PASSWORD + ) | ixod keys add ${USERS[i]} --recover +done + +# Set min-gas-prices (using fee token) +FROM="minimum-gas-prices = \"\"" +TO="minimum-gas-prices = \"0.025$FEE_TOKEN\"" +sed -i "s/$FROM/$TO/" "$HOME"/.ixod/config/app.toml + +# Enable REST API, RPC, and gRPC +FROM="enable = false" +TO="enable = true" +sed -i "s/$FROM/$TO/" "$HOME"/.ixod/config/app.toml +FROM="address = \"tcp:\/\/localhost:1317\"" +TO="address = \"tcp:\/\/0.0.0.0:1317\"" +sed -i "s/$FROM/$TO/" "$HOME"/.ixod/config/app.toml +FROM="address = \"localhost:9090\"" +TO="address = \"0.0.0.0:9090\"" +sed -i "s/$FROM/$TO/" "$HOME"/.ixod/config/app.toml + +# Enable cors +FROM="enabled-unsafe-cors = false" +TO="enabled-unsafe-cors = true" +sed -i "s/$FROM/$TO/" "$HOME"/.ixod/config/app.toml +FROM="cors_allowed_origins = \[\]" +TO="cors_allowed_origins = \[\"*\"\]" +sed -i "s/$FROM/$TO/" "$HOME"/.ixod/config/config.toml + +# Enable Swagger docs +FROM="swagger = false" +TO="swagger = true" +sed -i "s/$FROM/$TO/" "$HOME"/.ixod/config/app.toml + +# Broadcast node RPC endpoint +FROM="laddr = \"tcp:\/\/127.0.0.1:26657\"" +TO="laddr = \"tcp:\/\/0.0.0.0:26657\"" +sed -i "s/$FROM/$TO/" "$HOME"/.ixod/config/config.toml + +# Set timeouts to 1s for shorter block times +sed -i 's/timeout_commit = "5s"/timeout_commit = "1s"/g' "$HOME"/.ixod/config/config.toml +sed -i 's/timeout_propose = "3s"/timeout_propose = "1s"/g' "$HOME"/.ixod/config/config.toml + +# ixod start --pruning "nothing" --log_level "trace" --trace +# ixod start --pruning "nothing" diff --git a/wasmbinding/stargate_whitelist.go b/wasmbinding/stargate_whitelist.go index c9a4292d..207a13c5 100755 --- a/wasmbinding/stargate_whitelist.go +++ b/wasmbinding/stargate_whitelist.go @@ -2,6 +2,7 @@ package wasmbinding import ( "fmt" + "sort" "sync" wasmvmtypes "github.com/CosmWasm/wasmvm/types" @@ -44,7 +45,6 @@ func init() { // cosmos-sdk queries // ============================= - // auth setWhitelistedQuery("/cosmos.auth.v1beta1.Query/Account", &authtypes.QueryAccountResponse{}) setWhitelistedQuery("/cosmos.auth.v1beta1.Query/Params", &authtypes.QueryParamsResponse{}) @@ -79,8 +79,6 @@ func init() { // ixo queries // ============================= - // TODO: add new queries also, add queries to icq in migration - // bonds setWhitelistedQuery("/ixo.bonds.v1beta1.Query/Params", &bondstypes.QueryParamsResponse{}) setWhitelistedQuery("/ixo.bonds.v1beta1.Query/Bond", &bondstypes.QueryBondResponse{}) @@ -182,5 +180,8 @@ func GetStargateWhitelistedPaths() (keys []string) { for k := range stargateResponsePools { keys = append(keys, k) } + + // Sort the keys to ensure determinism + sort.Strings(keys) return keys } diff --git a/x/claims/keeper/claims.go b/x/claims/keeper/claims.go index 172eb318..49c2ebda 100755 --- a/x/claims/keeper/claims.go +++ b/x/claims/keeper/claims.go @@ -8,7 +8,6 @@ import ( storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/ixofoundation/ixo-blockchain/v3/x/claims/types" "github.com/ixofoundation/ixo-blockchain/v3/x/token/types/contracts/cw20" ) @@ -308,20 +307,6 @@ func (k Keeper) TransferIntentPayments(ctx sdk.Context, fromAddress, toAddress s return nil } -// Create a module account for entity id and name of account as fragemnt in form: did#name -func (k Keeper) CreateNewCollectionEscrow(ctx sdk.Context, collectionId string) (sdk.AccAddress, error) { - address := types.GetModuleAccountAddressEscrow(collectionId) - - if k.AccountKeeper.GetAccount(ctx, address) != nil { - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "account already exists") - } - - account := k.AccountKeeper.NewAccountWithAddress(ctx, address) - k.AccountKeeper.SetAccount(ctx, account) - - return account.GetAddress(), nil -} - // CollectionPersistAndEmitEvents persists the collection and emits the events. func (k Keeper) CollectionPersistAndEmitEvents(ctx sdk.Context, collection types.Collection) error { // persist the Collection @@ -329,7 +314,7 @@ func (k Keeper) CollectionPersistAndEmitEvents(ctx sdk.Context, collection types // emit the events if err := ctx.EventManager().EmitTypedEvent( - &types.CollectionCreatedEvent{ + &types.CollectionUpdatedEvent{ Collection: &collection, }, ); err != nil { diff --git a/x/claims/keeper/migrations.go b/x/claims/keeper/migrations.go index 562b7cf3..eb67f1a4 100755 --- a/x/claims/keeper/migrations.go +++ b/x/claims/keeper/migrations.go @@ -2,20 +2,28 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" v2claims "github.com/ixofoundation/ixo-blockchain/v3/x/claims/migrations/v2" + v3claims "github.com/ixofoundation/ixo-blockchain/v3/x/claims/migrations/v3" ) // Migrator is a struct for handling in-place store migrations. type Migrator struct { - keeper Keeper + keeper Keeper + legacySubspace paramstypes.Subspace } // NewMigrator returns a new Migrator. -func NewMigrator(keeper Keeper) Migrator { - return Migrator{keeper: keeper} +func NewMigrator(keeper Keeper, legacySubspace paramstypes.Subspace) Migrator { + return Migrator{keeper: keeper, legacySubspace: legacySubspace} } // Migrate1to2 migrates from version 1 to 2. func (m Migrator) Migrate1to2(ctx sdk.Context) error { return v2claims.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc) } + +// Migrate2to3 migrates from version 2 to 3. +func (m Migrator) Migrate2to3(ctx sdk.Context) error { + return v3claims.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc, m.legacySubspace, m.keeper.AccountKeeper) +} diff --git a/x/claims/keeper/msg_server.go b/x/claims/keeper/msg_server.go index ecb42b26..b2643c6a 100755 --- a/x/claims/keeper/msg_server.go +++ b/x/claims/keeper/msg_server.go @@ -24,7 +24,6 @@ func NewMsgServerImpl(keeper *Keeper) types.MsgServer { return &msgServer{Keeper: keeper} } -// TODO: ensure to creatre escrow accounts on migration for existing collections // TODO: ADD 1155 and 721 capabilities to claims and payments also. // TODO: add possibility to allow multiple intents per agent based of collection flag @@ -97,13 +96,19 @@ func (s msgServer) CreateCollection(goCtx context.Context, msg *types.MsgCreateC } // create escrow account for the collection - escrowAccount, err := s.Keeper.CreateNewCollectionEscrow(ctx, collection.Id) + escrowAccount, err := types.CreateNewCollectionEscrow(ctx, s.Keeper.AccountKeeper, collection.Id) if err != nil { return nil, errorsmod.Wrapf(err, "failed to create escrow account for collection: %s", collection.Id) } collection.EscrowAccount = escrowAccount.String() - if err := s.Keeper.CollectionPersistAndEmitEvents(ctx, collection); err != nil { + // persist and emit the events + s.Keeper.SetCollection(ctx, collection) + if err := ctx.EventManager().EmitTypedEvent( + &types.CollectionCreatedEvent{ + Collection: &collection, + }, + ); err != nil { return nil, err } @@ -231,6 +236,11 @@ func (s msgServer) SubmitClaim(goCtx context.Context, msg *types.MsgSubmitClaim) return nil, err } + // start payout process for claim submission + if err = processPayment(ctx, *s.Keeper, agent, collection.Payments.Submission, types.PaymentType_submission, &claim, collection, false); err != nil { + return nil, err + } + // persist claim and emit the events s.Keeper.SetClaim(ctx, claim) if err := ctx.EventManager().EmitTypedEvents( @@ -241,11 +251,6 @@ func (s msgServer) SubmitClaim(goCtx context.Context, msg *types.MsgSubmitClaim) return nil, err } - // start payout process for claim submission - if err = processPayment(ctx, *s.Keeper, agent, collection.Payments.Submission, types.PaymentType_submission, msg.ClaimId, collection, false); err != nil { - return nil, err - } - return &types.MsgSubmitClaimResponse{}, nil } @@ -316,12 +321,9 @@ func (s msgServer) EvaluateClaim(goCtx context.Context, msg *types.MsgEvaluateCl evaluation.Cw20Payment = claim.Cw20Payment } - claim.Evaluation = &evaluation - s.Keeper.SetClaim(ctx, claim) - // start payout process for evaluation submission, if evaluation has status invalidated, dont run evaluation payout process if msg.Status != types.EvaluationStatus_invalidated { - if err = processPayment(ctx, *s.Keeper, evalAgent, collection.Payments.Evaluation, types.PaymentType_evaluation, msg.ClaimId, collection, false); err != nil { + if err = processPayment(ctx, *s.Keeper, evalAgent, collection.Payments.Evaluation, types.PaymentType_evaluation, &claim, collection, false); err != nil { return nil, err } @@ -345,7 +347,7 @@ func (s msgServer) EvaluateClaim(goCtx context.Context, msg *types.MsgEvaluateCl return nil, err } // Update payment status to no payment again as was guaranteed with intent - err = updatePaymentStatus(ctx, *s.Keeper, types.PaymentType_approval, msg.ClaimId, types.PaymentStatus_no_payment) + err = updatePaymentStatus(types.PaymentType_approval, &claim, types.PaymentStatus_no_payment) if err != nil { return nil, err } @@ -357,7 +359,7 @@ func (s msgServer) EvaluateClaim(goCtx context.Context, msg *types.MsgEvaluateCl collection.Approved++ // Dereference the pointer to avoid changing collection payments as collection is saved in keeper below approvedPayment := collection.Payments.Approval.Clone() - // if intent on claim then overide payments with claim payments as it used the intent and payment must be intent amount + // if intent on claim then override payments with claim payments as it used the intent and payment must be intent amount // also override payment account to escrow account, so funds can be transferred from escrow to agent if claim.UseIntent { approvedPayment.Amount = claim.Amount @@ -375,20 +377,20 @@ func (s msgServer) EvaluateClaim(goCtx context.Context, msg *types.MsgEvaluateCl if collection.Payments.Approval.IsOraclePayment && !types.IsZeroCW20Payments(approvedPayment.Cw20Payment) { return nil, types.ErrOraclePaymentOnlyNative } - if err = processPayment(ctx, *s.Keeper, claimAgent, approvedPayment, types.PaymentType_approval, msg.ClaimId, collection, claim.UseIntent); err != nil { + if err = processPayment(ctx, *s.Keeper, claimAgent, approvedPayment, types.PaymentType_approval, &claim, collection, claim.UseIntent); err != nil { return nil, err } } else if msg.Status == types.EvaluationStatus_rejected { // payout process for evaluation rejected to claim agent collection.Rejected++ - if err = processPayment(ctx, *s.Keeper, claimAgent, collection.Payments.Rejection, types.PaymentType_rejection, msg.ClaimId, collection, false); err != nil { + if err = processPayment(ctx, *s.Keeper, claimAgent, collection.Payments.Rejection, types.PaymentType_rejection, &claim, collection, false); err != nil { return nil, err } } else if msg.Status == types.EvaluationStatus_disputed { // no payment for disputed collection.Disputed++ // update payment status to disputed - err := updatePaymentStatus(ctx, *s.Keeper, types.PaymentType_approval, msg.ClaimId, types.PaymentStatus_disputed) + err := updatePaymentStatus(types.PaymentType_approval, &claim, types.PaymentStatus_disputed) if err != nil { return nil, err } @@ -401,7 +403,9 @@ func (s msgServer) EvaluateClaim(goCtx context.Context, msg *types.MsgEvaluateCl return nil, err } - // emit the events + // persist and emit the events + claim.Evaluation = &evaluation + s.Keeper.SetClaim(ctx, claim) if err := ctx.EventManager().EmitTypedEvents( &types.ClaimEvaluatedEvent{ Evaluation: &evaluation, @@ -513,7 +517,6 @@ func (s msgServer) DisputeClaim(goCtx context.Context, msg *types.MsgDisputeClai // -------------------------- // WITHDRAW PAYMENT // -------------------------- -// TODO: test upgrade scenario where no cw20 payment, then upgrade then handle previous existing authz func (s msgServer) WithdrawPayment(goCtx context.Context, msg *types.MsgWithdrawPayment) (*types.MsgWithdrawPaymentResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -559,10 +562,21 @@ func (s msgServer) WithdrawPayment(goCtx context.Context, msg *types.MsgWithdraw } // make payout - err = payout(ctx, *s.Keeper, msg.Inputs, msg.Outputs, msg.PaymentType, msg.ClaimId, collection, msg.ReleaseDate, msg.Contract_1155Payment, msg.Cw20Payment, fromAddress, toAddress) + err = payout(ctx, *s.Keeper, msg.Inputs, msg.Outputs, msg.PaymentType, &claim, collection, msg.ReleaseDate, msg.Contract_1155Payment, msg.Cw20Payment, fromAddress, toAddress) if err != nil { return nil, err } + + // persist and emit the events + s.Keeper.SetClaim(ctx, claim) + if err := ctx.EventManager().EmitTypedEvent( + &types.ClaimUpdatedEvent{ + Claim: &claim, + }, + ); err != nil { + return nil, err + } + return &types.MsgWithdrawPaymentResponse{}, nil } diff --git a/x/claims/keeper/payments.go b/x/claims/keeper/payments.go index d24428e4..0bfc35d6 100755 --- a/x/claims/keeper/payments.go +++ b/x/claims/keeper/payments.go @@ -24,9 +24,9 @@ import ( // 2. if any other paymentType, it sets the output for payment to the amount set in the payment // // after the native coin payments is calculated, it does the following: -// 1. if timeout for the payment is nil, it makes the payment by calling payout() function +// 1. if timeout for the payment is nil(or it is intent payment) it makes the payment by calling payout() function // 2. if timeout for the payment is not nil, it creates an authz grant to make the payment by calling createAuthz() function -func processPayment(ctx sdk.Context, k Keeper, receiver sdk.AccAddress, payment *types.Payment, paymentType types.PaymentType, claimId string, collection types.Collection, useIntent bool) error { +func processPayment(ctx sdk.Context, k Keeper, receiver sdk.AccAddress, payment *types.Payment, paymentType types.PaymentType, claim *types.Claim, collection types.Collection, useIntent bool) error { // check that there is outcome payment to make, otherwise skip this with no error as no payment for action paymentExists := false if !payment.Amount.IsZero() || !types.IsZeroCW20Payments(payment.Cw20Payment) { @@ -130,7 +130,7 @@ func processPayment(ctx sdk.Context, k Keeper, receiver sdk.AccAddress, payment // if no timeout in payment or use intent is true make payout immediately // if use intent then funds is already in escrow account, so no need to wait even if timeout is set if payment.TimeoutNs == 0 || useIntent { - if err := payout(ctx, k, inputs, outputs, paymentType, claimId, collection, &time.Time{}, payment.Contract_1155Payment, payment.Cw20Payment, payerAddress, receiver); err != nil { + if err := payout(ctx, k, inputs, outputs, paymentType, claim, collection, &time.Time{}, payment.Contract_1155Payment, payment.Cw20Payment, payerAddress, receiver); err != nil { return err } } else { @@ -141,7 +141,7 @@ func processPayment(ctx sdk.Context, k Keeper, receiver sdk.AccAddress, payment } // else create authz WithdrawPaymentAuthorization for receiver to execute to receive payout once timeout has passed - if err := createAuthz(ctx, k, receiver, adminAddress, inputs, outputs, paymentType, claimId, payment.TimeoutNs, payment.Contract_1155Payment, payment.Cw20Payment, payerAddress, receiver); err != nil { + if err := createAuthz(ctx, k, receiver, adminAddress, inputs, outputs, paymentType, claim, payment.TimeoutNs, payment.Contract_1155Payment, payment.Cw20Payment, payerAddress, receiver); err != nil { return err } } @@ -157,7 +157,7 @@ func processPayment(ctx sdk.Context, k Keeper, receiver sdk.AccAddress, payment // 4. if paymentCw20s is not nil, it makes the payments by calling k.WasmKeeper.Execute() // 5. update the claim payment status to success // 6. emit PaymentWithdrawnEvent event -func payout(ctx sdk.Context, k Keeper, inputs []banktypes.Input, outputs []banktypes.Output, paymentType types.PaymentType, claimId string, collection types.Collection, releaseDate *time.Time, payment1155 *types.Contract1155Payment, paymentCw20s []*types.CW20Payment, fromAddress, toAddress sdk.AccAddress) error { +func payout(ctx sdk.Context, k Keeper, inputs []banktypes.Input, outputs []banktypes.Output, paymentType types.PaymentType, claim *types.Claim, collection types.Collection, releaseDate *time.Time, payment1155 *types.Contract1155Payment, paymentCw20s []*types.CW20Payment, fromAddress, toAddress sdk.AccAddress) error { // get entity payout is for to validate if from address is valid entity module account _, entity, err := k.EntityKeeper.ResolveEntity(ctx, collection.Entity) if err != nil { @@ -186,7 +186,7 @@ func payout(ctx sdk.Context, k Keeper, inputs []banktypes.Input, outputs []bankt } } - // TODO: Test case where one output will have 0 amount + // Note: Check into case where one output will have 0 amount // distribute the payment according to the outputs for Cosmos Coins if has inputs and outputs if len(cleanedInput.Coins) != 0 && len(outputs) != 0 { if err := k.BankKeeper.InputOutputCoins(ctx, cleanedInput, outputs); err != nil { @@ -238,7 +238,7 @@ func payout(ctx sdk.Context, k Keeper, inputs []banktypes.Input, outputs []bankt } // update payment status to success - if err := updatePaymentStatus(ctx, k, paymentType, claimId, types.PaymentStatus_paid); err != nil { + if err := updatePaymentStatus(paymentType, claim, types.PaymentStatus_paid); err != nil { return err } @@ -246,7 +246,7 @@ func payout(ctx sdk.Context, k Keeper, inputs []banktypes.Input, outputs []bankt if err := ctx.EventManager().EmitTypedEvents( &types.PaymentWithdrawnEvent{ Withdraw: &types.WithdrawPaymentConstraints{ - ClaimId: claimId, + ClaimId: claim.ClaimId, Inputs: inputs, Outputs: outputs, PaymentType: paymentType, @@ -269,7 +269,7 @@ func payout(ctx sdk.Context, k Keeper, inputs []banktypes.Input, outputs []bankt // 2. create and add the new WithdrawPaymentConstraints to the current existing constraints, and persist // 3. update the payment status to authorized // 4. emit PaymentWithdrawCreatedEvent event -func createAuthz(ctx sdk.Context, k Keeper, receiver, admin sdk.AccAddress, inputs []banktypes.Input, outputs []banktypes.Output, paymentType types.PaymentType, claimId string, timeoutNs time.Duration, payment1155 *types.Contract1155Payment, paymentCw20s []*types.CW20Payment, fromAddress, toAddress sdk.AccAddress) error { +func createAuthz(ctx sdk.Context, k Keeper, receiver, admin sdk.AccAddress, inputs []banktypes.Input, outputs []banktypes.Output, paymentType types.PaymentType, claim *types.Claim, timeoutNs time.Duration, payment1155 *types.Contract1155Payment, paymentCw20s []*types.CW20Payment, fromAddress, toAddress sdk.AccAddress) error { // get user's current WithdrawPaymentAuthorization authorization authzMsgType := sdk.MsgTypeURL(&types.MsgWithdrawPayment{}) auth, _ := k.AuthzKeeper.GetAuthorization(ctx, receiver, admin, authzMsgType) @@ -277,7 +277,7 @@ func createAuthz(ctx sdk.Context, k Keeper, receiver, admin sdk.AccAddress, inpu releaseDate := ctx.BlockTime().Add(timeoutNs) var constraints []*types.WithdrawPaymentConstraints constraint := types.WithdrawPaymentConstraints{ - ClaimId: claimId, + ClaimId: claim.ClaimId, Inputs: inputs, Outputs: outputs, PaymentType: paymentType, @@ -305,7 +305,7 @@ func createAuthz(ctx sdk.Context, k Keeper, receiver, admin sdk.AccAddress, inpu } // update payment status to authorized - if err := updatePaymentStatus(ctx, k, paymentType, claimId, types.PaymentStatus_authorized); err != nil { + if err := updatePaymentStatus(paymentType, claim, types.PaymentStatus_authorized); err != nil { return err } @@ -313,7 +313,7 @@ func createAuthz(ctx sdk.Context, k Keeper, receiver, admin sdk.AccAddress, inpu if err := ctx.EventManager().EmitTypedEvents( &types.PaymentWithdrawCreatedEvent{ Withdraw: &types.WithdrawPaymentConstraints{ - ClaimId: claimId, + ClaimId: claim.ClaimId, Inputs: inputs, Outputs: outputs, PaymentType: paymentType, @@ -331,20 +331,11 @@ func createAuthz(ctx sdk.Context, k Keeper, receiver, admin sdk.AccAddress, inpu return nil } -// TODO: analyse claims events emited after this change? // updatePaymentStatus updates the payment status for the provided different paymentType. -// it does the following: -// 1. get claim and payment is for -// 2. update the payment status to the provided paymentStatus -// 3. persist the updated claim -// 4. emit PaymentWithdrawnEvent event -func updatePaymentStatus(ctx sdk.Context, k Keeper, paymentType types.PaymentType, claimId string, paymentStatus types.PaymentStatus) error { - // get claim and payment is for - claim, err := k.GetClaim(ctx, claimId) - if err != nil { - return err +func updatePaymentStatus(paymentType types.PaymentType, claim *types.Claim, paymentStatus types.PaymentStatus) error { + if claim == nil { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "claim cannot be nil") } - switch paymentType { case types.PaymentType_approval: claim.PaymentsStatus.Approval = paymentStatus @@ -354,17 +345,5 @@ func updatePaymentStatus(ctx sdk.Context, k Keeper, paymentType types.PaymentTyp claim.PaymentsStatus.Submission = paymentStatus } - // persist claim changes - k.SetClaim(ctx, claim) - - // emit the events - if err := ctx.EventManager().EmitTypedEvents( - &types.ClaimUpdatedEvent{ - Claim: &claim, - }, - ); err != nil { - return err - } - return nil } diff --git a/x/claims/migrations/v3/legacy_types.go b/x/claims/migrations/v3/legacy_types.go new file mode 100644 index 00000000..6348b284 --- /dev/null +++ b/x/claims/migrations/v3/legacy_types.go @@ -0,0 +1,4496 @@ +//nolint:all +package v3claims + +import ( + fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + time "time" + + cosmossdk_io_math "cosmossdk.io/math" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "google.golang.org/protobuf/types/known/timestamppb" +) + +// 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 + +type CollectionState int32 + +const ( + CollectionState_open CollectionState = 0 + CollectionState_paused CollectionState = 1 + CollectionState_closed CollectionState = 2 +) + +var CollectionState_name = map[int32]string{ + 0: "OPEN", + 1: "PAUSED", + 2: "CLOSED", +} + +var CollectionState_value = map[string]int32{ + "OPEN": 0, + "PAUSED": 1, + "CLOSED": 2, +} + +func (x CollectionState) String() string { + return proto.EnumName(CollectionState_name, int32(x)) +} + +func (CollectionState) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_619c1a0876cd0592, []int{0} +} + +type EvaluationStatus int32 + +const ( + EvaluationStatus_pending EvaluationStatus = 0 + EvaluationStatus_approved EvaluationStatus = 1 + EvaluationStatus_rejected EvaluationStatus = 2 + EvaluationStatus_disputed EvaluationStatus = 3 + EvaluationStatus_invalidated EvaluationStatus = 4 +) + +var EvaluationStatus_name = map[int32]string{ + 0: "PENDING", + 1: "APPROVED", + 2: "REJECTED", + 3: "DISPUTED", + 4: "INVALIDATED", +} + +var EvaluationStatus_value = map[string]int32{ + "PENDING": 0, + "APPROVED": 1, + "REJECTED": 2, + "DISPUTED": 3, + "INVALIDATED": 4, +} + +func (x EvaluationStatus) String() string { + return proto.EnumName(EvaluationStatus_name, int32(x)) +} + +func (EvaluationStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_619c1a0876cd0592, []int{1} +} + +type PaymentType int32 + +const ( + PaymentType_submission PaymentType = 0 + PaymentType_approval PaymentType = 1 + PaymentType_evaluation PaymentType = 2 + PaymentType_rejection PaymentType = 3 +) + +var PaymentType_name = map[int32]string{ + 0: "SUBMISSION", + 1: "APPROVAL", + 2: "EVALUATION", + 3: "REJECTION", +} + +var PaymentType_value = map[string]int32{ + "SUBMISSION": 0, + "APPROVAL": 1, + "EVALUATION": 2, + "REJECTION": 3, +} + +func (x PaymentType) String() string { + return proto.EnumName(PaymentType_name, int32(x)) +} + +func (PaymentType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_619c1a0876cd0592, []int{2} +} + +type PaymentStatus int32 + +const ( + PaymentStatus_no_payment PaymentStatus = 0 + PaymentStatus_promised PaymentStatus = 1 + PaymentStatus_authorized PaymentStatus = 2 + PaymentStatus_gauranteed PaymentStatus = 3 + PaymentStatus_paid PaymentStatus = 4 + PaymentStatus_failed PaymentStatus = 5 + PaymentStatus_disputed PaymentStatus = 6 +) + +var PaymentStatus_name = map[int32]string{ + 0: "NO_PAYMENT", + 1: "PROMISED", + 2: "AUTHORIZED", + 3: "GAURANTEED", + 4: "PAID", + 5: "FAILED", + 6: "DISPUTED", +} + +var PaymentStatus_value = map[string]int32{ + "NO_PAYMENT": 0, + "PROMISED": 1, + "AUTHORIZED": 2, + "GAURANTEED": 3, + "PAID": 4, + "FAILED": 5, + "DISPUTED": 6, +} + +func (x PaymentStatus) String() string { + return proto.EnumName(PaymentStatus_name, int32(x)) +} + +func (PaymentStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_619c1a0876cd0592, []int{3} +} + +type Params struct { + CollectionSequence uint64 `protobuf:"varint,1,opt,name=collection_sequence,json=collectionSequence,proto3" json:"collection_sequence,omitempty"` + IxoAccount string `protobuf:"bytes,2,opt,name=ixo_account,json=ixoAccount,proto3" json:"ixo_account,omitempty"` + NetworkFeePercentage cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=network_fee_percentage,json=networkFeePercentage,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"network_fee_percentage"` + NodeFeePercentage cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=node_fee_percentage,json=nodeFeePercentage,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"node_fee_percentage"` +} + +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_619c1a0876cd0592, []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 + +func (m *Params) GetCollectionSequence() uint64 { + if m != nil { + return m.CollectionSequence + } + return 0 +} + +func (m *Params) GetIxoAccount() string { + if m != nil { + return m.IxoAccount + } + return "" +} + +type Collection struct { + // collection id is the incremented internal id for the collection of claims + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // entity is the DID of the entity for which the claims are being created + Entity string `protobuf:"bytes,2,opt,name=entity,proto3" json:"entity,omitempty"` + // admin is the account address that will authorize or revoke agents and + // payments (the grantor), and can update the collection + Admin string `protobuf:"bytes,3,opt,name=admin,proto3" json:"admin,omitempty"` + // protocol is the DID of the claim protocol + Protocol string `protobuf:"bytes,4,opt,name=protocol,proto3" json:"protocol,omitempty"` + // startDate is the date after which claims may be submitted + StartDate *time.Time `protobuf:"bytes,5,opt,name=start_date,json=startDate,proto3,stdtime" json:"start_date,omitempty"` + // endDate is the date after which no more claims may be submitted (no endDate + // is allowed) + EndDate *time.Time `protobuf:"bytes,6,opt,name=end_date,json=endDate,proto3,stdtime" json:"end_date,omitempty"` + // quota is the maximum number of claims that may be submitted, 0 is unlimited + Quota uint64 `protobuf:"varint,7,opt,name=quota,proto3" json:"quota,omitempty"` + // count is the number of claims already submitted (internally calculated) + Count uint64 `protobuf:"varint,8,opt,name=count,proto3" json:"count,omitempty"` + // evaluated is the number of claims that have been evaluated (internally + // calculated) + Evaluated uint64 `protobuf:"varint,9,opt,name=evaluated,proto3" json:"evaluated,omitempty"` + // approved is the number of claims that have been evaluated and approved + // (internally calculated) + Approved uint64 `protobuf:"varint,10,opt,name=approved,proto3" json:"approved,omitempty"` + // rejected is the number of claims that have been evaluated and rejected + // (internally calculated) + Rejected uint64 `protobuf:"varint,11,opt,name=rejected,proto3" json:"rejected,omitempty"` + // disputed is the number of claims that have disputed status (internally + // calculated) + Disputed uint64 `protobuf:"varint,12,opt,name=disputed,proto3" json:"disputed,omitempty"` + // state is the current state of this Collection (open, paused, closed) + State CollectionState `protobuf:"varint,13,opt,name=state,proto3,enum=ixo.claims.v1beta1.CollectionState" json:"state,omitempty"` + // payments is the amount paid for claim submission, evaluation, approval, or + // rejection + Payments *Payments `protobuf:"bytes,14,opt,name=payments,proto3" json:"payments,omitempty"` + // signer address + Signer string `protobuf:"bytes,15,opt,name=signer,proto3" json:"signer,omitempty"` + // invalidated is the number of claims that have been evaluated as invalid + // (internally calculated) + Invalidated uint64 `protobuf:"varint,16,opt,name=invalidated,proto3" json:"invalidated,omitempty"` +} + +func (m *Collection) Reset() { *m = Collection{} } +func (m *Collection) String() string { return proto.CompactTextString(m) } +func (*Collection) ProtoMessage() {} +func (*Collection) Descriptor() ([]byte, []int) { + return fileDescriptor_619c1a0876cd0592, []int{1} +} +func (m *Collection) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Collection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Collection.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 *Collection) XXX_Merge(src proto.Message) { + xxx_messageInfo_Collection.Merge(m, src) +} +func (m *Collection) XXX_Size() int { + return m.Size() +} +func (m *Collection) XXX_DiscardUnknown() { + xxx_messageInfo_Collection.DiscardUnknown(m) +} + +var xxx_messageInfo_Collection proto.InternalMessageInfo + +func (m *Collection) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Collection) GetEntity() string { + if m != nil { + return m.Entity + } + return "" +} + +func (m *Collection) GetAdmin() string { + if m != nil { + return m.Admin + } + return "" +} + +func (m *Collection) GetProtocol() string { + if m != nil { + return m.Protocol + } + return "" +} + +func (m *Collection) GetStartDate() *time.Time { + if m != nil { + return m.StartDate + } + return nil +} + +func (m *Collection) GetEndDate() *time.Time { + if m != nil { + return m.EndDate + } + return nil +} + +func (m *Collection) GetQuota() uint64 { + if m != nil { + return m.Quota + } + return 0 +} + +func (m *Collection) GetCount() uint64 { + if m != nil { + return m.Count + } + return 0 +} + +func (m *Collection) GetEvaluated() uint64 { + if m != nil { + return m.Evaluated + } + return 0 +} + +func (m *Collection) GetApproved() uint64 { + if m != nil { + return m.Approved + } + return 0 +} + +func (m *Collection) GetRejected() uint64 { + if m != nil { + return m.Rejected + } + return 0 +} + +func (m *Collection) GetDisputed() uint64 { + if m != nil { + return m.Disputed + } + return 0 +} + +func (m *Collection) GetState() CollectionState { + if m != nil { + return m.State + } + return CollectionState_open +} + +func (m *Collection) GetPayments() *Payments { + if m != nil { + return m.Payments + } + return nil +} + +func (m *Collection) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *Collection) GetInvalidated() uint64 { + if m != nil { + return m.Invalidated + } + return 0 +} + +type Payments struct { + Submission *Payment `protobuf:"bytes,1,opt,name=submission,proto3" json:"submission,omitempty"` + Evaluation *Payment `protobuf:"bytes,2,opt,name=evaluation,proto3" json:"evaluation,omitempty"` + Approval *Payment `protobuf:"bytes,3,opt,name=approval,proto3" json:"approval,omitempty"` + Rejection *Payment `protobuf:"bytes,4,opt,name=rejection,proto3" json:"rejection,omitempty"` +} + +func (m *Payments) Reset() { *m = Payments{} } +func (m *Payments) String() string { return proto.CompactTextString(m) } +func (*Payments) ProtoMessage() {} +func (*Payments) Descriptor() ([]byte, []int) { + return fileDescriptor_619c1a0876cd0592, []int{2} +} +func (m *Payments) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Payments) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Payments.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 *Payments) XXX_Merge(src proto.Message) { + xxx_messageInfo_Payments.Merge(m, src) +} +func (m *Payments) XXX_Size() int { + return m.Size() +} +func (m *Payments) XXX_DiscardUnknown() { + xxx_messageInfo_Payments.DiscardUnknown(m) +} + +var xxx_messageInfo_Payments proto.InternalMessageInfo + +func (m *Payments) GetSubmission() *Payment { + if m != nil { + return m.Submission + } + return nil +} + +func (m *Payments) GetEvaluation() *Payment { + if m != nil { + return m.Evaluation + } + return nil +} + +func (m *Payments) GetApproval() *Payment { + if m != nil { + return m.Approval + } + return nil +} + +func (m *Payments) GetRejection() *Payment { + if m != nil { + return m.Rejection + } + return nil +} + +type Payment struct { + // account is the entity account address from which the payment will be made + Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` + // if empty(nil) then no contract payment, not allowed for Evaluation Payment + Contract_1155Payment *Contract1155Payment `protobuf:"bytes,3,opt,name=contract_1155_payment,json=contract1155Payment,proto3" json:"contract_1155_payment,omitempty"` + // timeout after claim/evaluation to create authZ for payment, if 0 then + // immidiate direct payment + TimeoutNs time.Duration `protobuf:"bytes,4,opt,name=timeout_ns,json=timeoutNs,proto3,stdduration" json:"timeout_ns"` +} + +func (m *Payment) Reset() { *m = Payment{} } +func (m *Payment) String() string { return proto.CompactTextString(m) } +func (*Payment) ProtoMessage() {} +func (*Payment) Descriptor() ([]byte, []int) { + return fileDescriptor_619c1a0876cd0592, []int{3} +} +func (m *Payment) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Payment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Payment.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 *Payment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Payment.Merge(m, src) +} +func (m *Payment) XXX_Size() int { + return m.Size() +} +func (m *Payment) XXX_DiscardUnknown() { + xxx_messageInfo_Payment.DiscardUnknown(m) +} + +var xxx_messageInfo_Payment proto.InternalMessageInfo + +func (m *Payment) GetAccount() string { + if m != nil { + return m.Account + } + return "" +} + +func (m *Payment) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Amount + } + return nil +} + +func (m *Payment) GetContract_1155Payment() *Contract1155Payment { + if m != nil { + return m.Contract_1155Payment + } + return nil +} + +func (m *Payment) GetTimeoutNs() time.Duration { + if m != nil { + return m.TimeoutNs + } + return 0 +} + +type Contract1155Payment struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + TokenId string `protobuf:"bytes,2,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` + Amount uint32 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *Contract1155Payment) Reset() { *m = Contract1155Payment{} } +func (m *Contract1155Payment) String() string { return proto.CompactTextString(m) } +func (*Contract1155Payment) ProtoMessage() {} +func (*Contract1155Payment) Descriptor() ([]byte, []int) { + return fileDescriptor_619c1a0876cd0592, []int{4} +} +func (m *Contract1155Payment) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Contract1155Payment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Contract1155Payment.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 *Contract1155Payment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Contract1155Payment.Merge(m, src) +} +func (m *Contract1155Payment) XXX_Size() int { + return m.Size() +} +func (m *Contract1155Payment) XXX_DiscardUnknown() { + xxx_messageInfo_Contract1155Payment.DiscardUnknown(m) +} + +var xxx_messageInfo_Contract1155Payment proto.InternalMessageInfo + +func (m *Contract1155Payment) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Contract1155Payment) GetTokenId() string { + if m != nil { + return m.TokenId + } + return "" +} + +func (m *Contract1155Payment) GetAmount() uint32 { + if m != nil { + return m.Amount + } + return 0 +} + +type Claim struct { + // collection_id indicates to which Collection this claim belongs + CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` + // agent is the DID of the agent submitting the claim + AgentDid string `protobuf:"bytes,2,opt,name=agent_did,json=agentDid,proto3" json:"agent_did,omitempty"` + AgentAddress string `protobuf:"bytes,3,opt,name=agent_address,json=agentAddress,proto3" json:"agent_address,omitempty"` + // submissionDate is the date and time that the claim was submitted on-chain + SubmissionDate *time.Time `protobuf:"bytes,4,opt,name=submission_date,json=submissionDate,proto3,stdtime" json:"submission_date,omitempty"` + // claimID is the unique identifier of the claim in the cid hash format + ClaimId string `protobuf:"bytes,5,opt,name=claim_id,json=claimId,proto3" json:"claim_id,omitempty"` + // evaluation is the result of one or more claim evaluations + Evaluation *Evaluation `protobuf:"bytes,6,opt,name=evaluation,proto3" json:"evaluation,omitempty"` + PaymentsStatus *ClaimPayments `protobuf:"bytes,7,opt,name=payments_status,json=paymentsStatus,proto3" json:"payments_status,omitempty"` +} + +func (m *Claim) Reset() { *m = Claim{} } +func (m *Claim) String() string { return proto.CompactTextString(m) } +func (*Claim) ProtoMessage() {} +func (*Claim) Descriptor() ([]byte, []int) { + return fileDescriptor_619c1a0876cd0592, []int{5} +} +func (m *Claim) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Claim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Claim.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 *Claim) XXX_Merge(src proto.Message) { + xxx_messageInfo_Claim.Merge(m, src) +} +func (m *Claim) XXX_Size() int { + return m.Size() +} +func (m *Claim) XXX_DiscardUnknown() { + xxx_messageInfo_Claim.DiscardUnknown(m) +} + +var xxx_messageInfo_Claim proto.InternalMessageInfo + +func (m *Claim) GetCollectionId() string { + if m != nil { + return m.CollectionId + } + return "" +} + +func (m *Claim) GetAgentDid() string { + if m != nil { + return m.AgentDid + } + return "" +} + +func (m *Claim) GetAgentAddress() string { + if m != nil { + return m.AgentAddress + } + return "" +} + +func (m *Claim) GetSubmissionDate() *time.Time { + if m != nil { + return m.SubmissionDate + } + return nil +} + +func (m *Claim) GetClaimId() string { + if m != nil { + return m.ClaimId + } + return "" +} + +func (m *Claim) GetEvaluation() *Evaluation { + if m != nil { + return m.Evaluation + } + return nil +} + +func (m *Claim) GetPaymentsStatus() *ClaimPayments { + if m != nil { + return m.PaymentsStatus + } + return nil +} + +type ClaimPayments struct { + Submission PaymentStatus `protobuf:"varint,1,opt,name=submission,proto3,enum=ixo.claims.v1beta1.PaymentStatus" json:"submission,omitempty"` + Evaluation PaymentStatus `protobuf:"varint,2,opt,name=evaluation,proto3,enum=ixo.claims.v1beta1.PaymentStatus" json:"evaluation,omitempty"` + Approval PaymentStatus `protobuf:"varint,3,opt,name=approval,proto3,enum=ixo.claims.v1beta1.PaymentStatus" json:"approval,omitempty"` + Rejection PaymentStatus `protobuf:"varint,4,opt,name=rejection,proto3,enum=ixo.claims.v1beta1.PaymentStatus" json:"rejection,omitempty"` +} + +func (m *ClaimPayments) Reset() { *m = ClaimPayments{} } +func (m *ClaimPayments) String() string { return proto.CompactTextString(m) } +func (*ClaimPayments) ProtoMessage() {} +func (*ClaimPayments) Descriptor() ([]byte, []int) { + return fileDescriptor_619c1a0876cd0592, []int{6} +} +func (m *ClaimPayments) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClaimPayments) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClaimPayments.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 *ClaimPayments) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClaimPayments.Merge(m, src) +} +func (m *ClaimPayments) XXX_Size() int { + return m.Size() +} +func (m *ClaimPayments) XXX_DiscardUnknown() { + xxx_messageInfo_ClaimPayments.DiscardUnknown(m) +} + +var xxx_messageInfo_ClaimPayments proto.InternalMessageInfo + +func (m *ClaimPayments) GetSubmission() PaymentStatus { + if m != nil { + return m.Submission + } + return PaymentStatus_no_payment +} + +func (m *ClaimPayments) GetEvaluation() PaymentStatus { + if m != nil { + return m.Evaluation + } + return PaymentStatus_no_payment +} + +func (m *ClaimPayments) GetApproval() PaymentStatus { + if m != nil { + return m.Approval + } + return PaymentStatus_no_payment +} + +func (m *ClaimPayments) GetRejection() PaymentStatus { + if m != nil { + return m.Rejection + } + return PaymentStatus_no_payment +} + +type Evaluation struct { + // claim_id indicates which Claim this evaluation is for + ClaimId string `protobuf:"bytes,1,opt,name=claim_id,json=claimId,proto3" json:"claim_id,omitempty"` + // collection_id indicates to which Collection the claim being evaluated + // belongs to + CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` + // oracle is the DID of the Oracle entity that evaluates the claim + Oracle string `protobuf:"bytes,3,opt,name=oracle,proto3" json:"oracle,omitempty"` + // agent is the DID of the agent that submits the evaluation + AgentDid string `protobuf:"bytes,4,opt,name=agent_did,json=agentDid,proto3" json:"agent_did,omitempty"` + AgentAddress string `protobuf:"bytes,5,opt,name=agent_address,json=agentAddress,proto3" json:"agent_address,omitempty"` + // status is the evaluation status expressed as an integer (2=approved, + // 3=rejected, ...) + Status EvaluationStatus `protobuf:"varint,6,opt,name=status,proto3,enum=ixo.claims.v1beta1.EvaluationStatus" json:"status,omitempty"` + // reason is the code expressed as an integer, for why the evaluation result + // was given (codes defined by evaluator) + Reason uint32 `protobuf:"varint,7,opt,name=reason,proto3" json:"reason,omitempty"` + // verificationProof is the cid of the evaluation Verfiable Credential + VerificationProof string `protobuf:"bytes,8,opt,name=verification_proof,json=verificationProof,proto3" json:"verification_proof,omitempty"` + // evaluationDate is the date and time that the claim evaluation was submitted + // on-chain + EvaluationDate *time.Time `protobuf:"bytes,9,opt,name=evaluation_date,json=evaluationDate,proto3,stdtime" json:"evaluation_date,omitempty"` + // custom amount specified by evaluator for claim approval, if empty list then + // use default by Collection + Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,10,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` +} + +func (m *Evaluation) Reset() { *m = Evaluation{} } +func (m *Evaluation) String() string { return proto.CompactTextString(m) } +func (*Evaluation) ProtoMessage() {} +func (*Evaluation) Descriptor() ([]byte, []int) { + return fileDescriptor_619c1a0876cd0592, []int{7} +} +func (m *Evaluation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Evaluation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Evaluation.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 *Evaluation) XXX_Merge(src proto.Message) { + xxx_messageInfo_Evaluation.Merge(m, src) +} +func (m *Evaluation) XXX_Size() int { + return m.Size() +} +func (m *Evaluation) XXX_DiscardUnknown() { + xxx_messageInfo_Evaluation.DiscardUnknown(m) +} + +var xxx_messageInfo_Evaluation proto.InternalMessageInfo + +func (m *Evaluation) GetClaimId() string { + if m != nil { + return m.ClaimId + } + return "" +} + +func (m *Evaluation) GetCollectionId() string { + if m != nil { + return m.CollectionId + } + return "" +} + +func (m *Evaluation) GetOracle() string { + if m != nil { + return m.Oracle + } + return "" +} + +func (m *Evaluation) GetAgentDid() string { + if m != nil { + return m.AgentDid + } + return "" +} + +func (m *Evaluation) GetAgentAddress() string { + if m != nil { + return m.AgentAddress + } + return "" +} + +func (m *Evaluation) GetStatus() EvaluationStatus { + if m != nil { + return m.Status + } + return EvaluationStatus_pending +} + +func (m *Evaluation) GetReason() uint32 { + if m != nil { + return m.Reason + } + return 0 +} + +func (m *Evaluation) GetVerificationProof() string { + if m != nil { + return m.VerificationProof + } + return "" +} + +func (m *Evaluation) GetEvaluationDate() *time.Time { + if m != nil { + return m.EvaluationDate + } + return nil +} + +func (m *Evaluation) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Amount + } + return nil +} + +type Dispute struct { + SubjectId string `protobuf:"bytes,1,opt,name=subject_id,json=subjectId,proto3" json:"subject_id,omitempty"` + // type is expressed as an integer, interpreted by the client + Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` + Data *DisputeData `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *Dispute) Reset() { *m = Dispute{} } +func (m *Dispute) String() string { return proto.CompactTextString(m) } +func (*Dispute) ProtoMessage() {} +func (*Dispute) Descriptor() ([]byte, []int) { + return fileDescriptor_619c1a0876cd0592, []int{8} +} +func (m *Dispute) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Dispute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Dispute.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 *Dispute) XXX_Merge(src proto.Message) { + xxx_messageInfo_Dispute.Merge(m, src) +} +func (m *Dispute) XXX_Size() int { + return m.Size() +} +func (m *Dispute) XXX_DiscardUnknown() { + xxx_messageInfo_Dispute.DiscardUnknown(m) +} + +var xxx_messageInfo_Dispute proto.InternalMessageInfo + +func (m *Dispute) GetSubjectId() string { + if m != nil { + return m.SubjectId + } + return "" +} + +func (m *Dispute) GetType() int32 { + if m != nil { + return m.Type + } + return 0 +} + +func (m *Dispute) GetData() *DisputeData { + if m != nil { + return m.Data + } + return nil +} + +type DisputeData struct { + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Proof string `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` + Encrypted bool `protobuf:"varint,4,opt,name=encrypted,proto3" json:"encrypted,omitempty"` +} + +func (m *DisputeData) Reset() { *m = DisputeData{} } +func (m *DisputeData) String() string { return proto.CompactTextString(m) } +func (*DisputeData) ProtoMessage() {} +func (*DisputeData) Descriptor() ([]byte, []int) { + return fileDescriptor_619c1a0876cd0592, []int{9} +} +func (m *DisputeData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DisputeData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DisputeData.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 *DisputeData) XXX_Merge(src proto.Message) { + xxx_messageInfo_DisputeData.Merge(m, src) +} +func (m *DisputeData) XXX_Size() int { + return m.Size() +} +func (m *DisputeData) XXX_DiscardUnknown() { + xxx_messageInfo_DisputeData.DiscardUnknown(m) +} + +var xxx_messageInfo_DisputeData proto.InternalMessageInfo + +func (m *DisputeData) GetUri() string { + if m != nil { + return m.Uri + } + return "" +} + +func (m *DisputeData) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *DisputeData) GetProof() string { + if m != nil { + return m.Proof + } + return "" +} + +func (m *DisputeData) GetEncrypted() bool { + if m != nil { + return m.Encrypted + } + return false +} + +func init() { + proto.RegisterEnum("ixo.claims.v1beta1.CollectionState", CollectionState_name, CollectionState_value) + proto.RegisterEnum("ixo.claims.v1beta1.EvaluationStatus", EvaluationStatus_name, EvaluationStatus_value) + proto.RegisterEnum("ixo.claims.v1beta1.PaymentType", PaymentType_name, PaymentType_value) + proto.RegisterEnum("ixo.claims.v1beta1.PaymentStatus", PaymentStatus_name, PaymentStatus_value) + proto.RegisterType((*Params)(nil), "ixo.claims.v1beta1.Params") + proto.RegisterType((*Collection)(nil), "ixo.claims.v1beta1.Collection") + proto.RegisterType((*Payments)(nil), "ixo.claims.v1beta1.Payments") + proto.RegisterType((*Payment)(nil), "ixo.claims.v1beta1.Payment") + proto.RegisterType((*Contract1155Payment)(nil), "ixo.claims.v1beta1.Contract1155Payment") + proto.RegisterType((*Claim)(nil), "ixo.claims.v1beta1.Claim") + proto.RegisterType((*ClaimPayments)(nil), "ixo.claims.v1beta1.ClaimPayments") + proto.RegisterType((*Evaluation)(nil), "ixo.claims.v1beta1.Evaluation") + proto.RegisterType((*Dispute)(nil), "ixo.claims.v1beta1.Dispute") + proto.RegisterType((*DisputeData)(nil), "ixo.claims.v1beta1.DisputeData") +} + +func init() { proto.RegisterFile("ixo/claims/v1beta1/claims.proto", fileDescriptor_619c1a0876cd0592) } + +var fileDescriptor_619c1a0876cd0592 = []byte{ + // 1544 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xdb, 0x6b, 0x1b, 0x57, + 0x1a, 0xf7, 0xc8, 0x92, 0x2c, 0x7d, 0xf2, 0x2d, 0xc7, 0xde, 0x20, 0x2b, 0x59, 0x49, 0xab, 0x2c, + 0xbb, 0xc6, 0x10, 0x69, 0xed, 0x10, 0x76, 0xb3, 0xd9, 0x6d, 0x18, 0x5b, 0x4a, 0x3a, 0xc1, 0x91, + 0xc5, 0xc8, 0x0e, 0x34, 0x85, 0x8a, 0xe3, 0x99, 0x63, 0xf9, 0xd4, 0xd2, 0x9c, 0xc9, 0x5c, 0x5c, + 0xbb, 0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0xe8, 0xff, 0x4c, 0xb1, 0x9a, 0xfb, 0x69, 0xc1, 0x0d, 0xb7, 0x7e, 0x0f, 0x00, 0x00, 0xff, 0xff, + 0xfb, 0xec, 0xd3, 0x3e, 0x82, 0x0e, 0x00, 0x00, +} + +func (this *Contract1155Payment) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Contract1155Payment) + if !ok { + that2, ok := that.(Contract1155Payment) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Address != that1.Address { + return false + } + if this.TokenId != that1.TokenId { + return false + } + if this.Amount != that1.Amount { + return false + } + return true +} +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 := m.NodeFeePercentage.Size() + i -= size + if _, err := m.NodeFeePercentage.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintClaims(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.NetworkFeePercentage.Size() + i -= size + if _, err := m.NetworkFeePercentage.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintClaims(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.IxoAccount) > 0 { + i -= len(m.IxoAccount) + copy(dAtA[i:], m.IxoAccount) + i = encodeVarintClaims(dAtA, i, uint64(len(m.IxoAccount))) + i-- + dAtA[i] = 0x12 + } + if m.CollectionSequence != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.CollectionSequence)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Collection) 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 *Collection) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Collection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Invalidated != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Invalidated)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintClaims(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x7a + } + if m.Payments != nil { + { + size, err := m.Payments.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClaims(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if m.State != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x68 + } + if m.Disputed != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Disputed)) + i-- + dAtA[i] = 0x60 + } + if m.Rejected != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Rejected)) + i-- + dAtA[i] = 0x58 + } + if m.Approved != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Approved)) + i-- + dAtA[i] = 0x50 + } + if m.Evaluated != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Evaluated)) + i-- + dAtA[i] = 0x48 + } + if m.Count != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x40 + } + if m.Quota != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Quota)) + i-- + dAtA[i] = 0x38 + } + if m.EndDate != nil { + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndDate):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintClaims(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x32 + } + if m.StartDate != nil { + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.StartDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartDate):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintClaims(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x2a + } + if len(m.Protocol) > 0 { + i -= len(m.Protocol) + copy(dAtA[i:], m.Protocol) + i = encodeVarintClaims(dAtA, i, uint64(len(m.Protocol))) + i-- + dAtA[i] = 0x22 + } + if len(m.Admin) > 0 { + i -= len(m.Admin) + copy(dAtA[i:], m.Admin) + i = encodeVarintClaims(dAtA, i, uint64(len(m.Admin))) + i-- + dAtA[i] = 0x1a + } + if len(m.Entity) > 0 { + i -= len(m.Entity) + copy(dAtA[i:], m.Entity) + i = encodeVarintClaims(dAtA, i, uint64(len(m.Entity))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintClaims(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Payments) 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 *Payments) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Payments) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Rejection != nil { + { + size, err := m.Rejection.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClaims(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Approval != nil { + { + size, err := m.Approval.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClaims(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Evaluation != nil { + { + size, err := m.Evaluation.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClaims(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Submission != nil { + { + size, err := m.Submission.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClaims(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Payment) 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 *Payment) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Payment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n8, err8 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.TimeoutNs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.TimeoutNs):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintClaims(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0x22 + if m.Contract_1155Payment != nil { + { + size, err := m.Contract_1155Payment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClaims(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClaims(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Account) > 0 { + i -= len(m.Account) + copy(dAtA[i:], m.Account) + i = encodeVarintClaims(dAtA, i, uint64(len(m.Account))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Contract1155Payment) 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 *Contract1155Payment) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Contract1155Payment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Amount != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Amount)) + i-- + dAtA[i] = 0x18 + } + if len(m.TokenId) > 0 { + i -= len(m.TokenId) + copy(dAtA[i:], m.TokenId) + i = encodeVarintClaims(dAtA, i, uint64(len(m.TokenId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintClaims(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Claim) 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 *Claim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Claim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PaymentsStatus != nil { + { + size, err := m.PaymentsStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClaims(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.Evaluation != nil { + { + size, err := m.Evaluation.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClaims(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.ClaimId) > 0 { + i -= len(m.ClaimId) + copy(dAtA[i:], m.ClaimId) + i = encodeVarintClaims(dAtA, i, uint64(len(m.ClaimId))) + i-- + dAtA[i] = 0x2a + } + if m.SubmissionDate != nil { + n12, err12 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.SubmissionDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.SubmissionDate):]) + if err12 != nil { + return 0, err12 + } + i -= n12 + i = encodeVarintClaims(dAtA, i, uint64(n12)) + i-- + dAtA[i] = 0x22 + } + if len(m.AgentAddress) > 0 { + i -= len(m.AgentAddress) + copy(dAtA[i:], m.AgentAddress) + i = encodeVarintClaims(dAtA, i, uint64(len(m.AgentAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.AgentDid) > 0 { + i -= len(m.AgentDid) + copy(dAtA[i:], m.AgentDid) + i = encodeVarintClaims(dAtA, i, uint64(len(m.AgentDid))) + i-- + dAtA[i] = 0x12 + } + if len(m.CollectionId) > 0 { + i -= len(m.CollectionId) + copy(dAtA[i:], m.CollectionId) + i = encodeVarintClaims(dAtA, i, uint64(len(m.CollectionId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ClaimPayments) 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 *ClaimPayments) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClaimPayments) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Rejection != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Rejection)) + i-- + dAtA[i] = 0x20 + } + if m.Approval != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Approval)) + i-- + dAtA[i] = 0x18 + } + if m.Evaluation != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Evaluation)) + i-- + dAtA[i] = 0x10 + } + if m.Submission != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Submission)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Evaluation) 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 *Evaluation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Evaluation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClaims(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + } + if m.EvaluationDate != nil { + n13, err13 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EvaluationDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EvaluationDate):]) + if err13 != nil { + return 0, err13 + } + i -= n13 + i = encodeVarintClaims(dAtA, i, uint64(n13)) + i-- + dAtA[i] = 0x4a + } + if len(m.VerificationProof) > 0 { + i -= len(m.VerificationProof) + copy(dAtA[i:], m.VerificationProof) + i = encodeVarintClaims(dAtA, i, uint64(len(m.VerificationProof))) + i-- + dAtA[i] = 0x42 + } + if m.Reason != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Reason)) + i-- + dAtA[i] = 0x38 + } + if m.Status != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x30 + } + if len(m.AgentAddress) > 0 { + i -= len(m.AgentAddress) + copy(dAtA[i:], m.AgentAddress) + i = encodeVarintClaims(dAtA, i, uint64(len(m.AgentAddress))) + i-- + dAtA[i] = 0x2a + } + if len(m.AgentDid) > 0 { + i -= len(m.AgentDid) + copy(dAtA[i:], m.AgentDid) + i = encodeVarintClaims(dAtA, i, uint64(len(m.AgentDid))) + i-- + dAtA[i] = 0x22 + } + if len(m.Oracle) > 0 { + i -= len(m.Oracle) + copy(dAtA[i:], m.Oracle) + i = encodeVarintClaims(dAtA, i, uint64(len(m.Oracle))) + i-- + dAtA[i] = 0x1a + } + if len(m.CollectionId) > 0 { + i -= len(m.CollectionId) + copy(dAtA[i:], m.CollectionId) + i = encodeVarintClaims(dAtA, i, uint64(len(m.CollectionId))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClaimId) > 0 { + i -= len(m.ClaimId) + copy(dAtA[i:], m.ClaimId) + i = encodeVarintClaims(dAtA, i, uint64(len(m.ClaimId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Dispute) 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 *Dispute) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Dispute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Data != nil { + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClaims(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Type != 0 { + i = encodeVarintClaims(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x10 + } + if len(m.SubjectId) > 0 { + i -= len(m.SubjectId) + copy(dAtA[i:], m.SubjectId) + i = encodeVarintClaims(dAtA, i, uint64(len(m.SubjectId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DisputeData) 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 *DisputeData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DisputeData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Encrypted { + i-- + if m.Encrypted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(m.Proof) > 0 { + i -= len(m.Proof) + copy(dAtA[i:], m.Proof) + i = encodeVarintClaims(dAtA, i, uint64(len(m.Proof))) + i-- + dAtA[i] = 0x1a + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintClaims(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x12 + } + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintClaims(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintClaims(dAtA []byte, offset int, v uint64) int { + offset -= sovClaims(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 + if m.CollectionSequence != 0 { + n += 1 + sovClaims(uint64(m.CollectionSequence)) + } + l = len(m.IxoAccount) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + l = m.NetworkFeePercentage.Size() + n += 1 + l + sovClaims(uint64(l)) + l = m.NodeFeePercentage.Size() + n += 1 + l + sovClaims(uint64(l)) + return n +} + +func (m *Collection) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.Entity) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.Admin) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.Protocol) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + if m.StartDate != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartDate) + n += 1 + l + sovClaims(uint64(l)) + } + if m.EndDate != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndDate) + n += 1 + l + sovClaims(uint64(l)) + } + if m.Quota != 0 { + n += 1 + sovClaims(uint64(m.Quota)) + } + if m.Count != 0 { + n += 1 + sovClaims(uint64(m.Count)) + } + if m.Evaluated != 0 { + n += 1 + sovClaims(uint64(m.Evaluated)) + } + if m.Approved != 0 { + n += 1 + sovClaims(uint64(m.Approved)) + } + if m.Rejected != 0 { + n += 1 + sovClaims(uint64(m.Rejected)) + } + if m.Disputed != 0 { + n += 1 + sovClaims(uint64(m.Disputed)) + } + if m.State != 0 { + n += 1 + sovClaims(uint64(m.State)) + } + if m.Payments != nil { + l = m.Payments.Size() + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + if m.Invalidated != 0 { + n += 2 + sovClaims(uint64(m.Invalidated)) + } + return n +} + +func (m *Payments) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Submission != nil { + l = m.Submission.Size() + n += 1 + l + sovClaims(uint64(l)) + } + if m.Evaluation != nil { + l = m.Evaluation.Size() + n += 1 + l + sovClaims(uint64(l)) + } + if m.Approval != nil { + l = m.Approval.Size() + n += 1 + l + sovClaims(uint64(l)) + } + if m.Rejection != nil { + l = m.Rejection.Size() + n += 1 + l + sovClaims(uint64(l)) + } + return n +} + +func (m *Payment) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Account) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovClaims(uint64(l)) + } + } + if m.Contract_1155Payment != nil { + l = m.Contract_1155Payment.Size() + n += 1 + l + sovClaims(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.TimeoutNs) + n += 1 + l + sovClaims(uint64(l)) + return n +} + +func (m *Contract1155Payment) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.TokenId) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + if m.Amount != 0 { + n += 1 + sovClaims(uint64(m.Amount)) + } + return n +} + +func (m *Claim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CollectionId) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.AgentDid) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.AgentAddress) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + if m.SubmissionDate != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.SubmissionDate) + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.ClaimId) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + if m.Evaluation != nil { + l = m.Evaluation.Size() + n += 1 + l + sovClaims(uint64(l)) + } + if m.PaymentsStatus != nil { + l = m.PaymentsStatus.Size() + n += 1 + l + sovClaims(uint64(l)) + } + return n +} + +func (m *ClaimPayments) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Submission != 0 { + n += 1 + sovClaims(uint64(m.Submission)) + } + if m.Evaluation != 0 { + n += 1 + sovClaims(uint64(m.Evaluation)) + } + if m.Approval != 0 { + n += 1 + sovClaims(uint64(m.Approval)) + } + if m.Rejection != 0 { + n += 1 + sovClaims(uint64(m.Rejection)) + } + return n +} + +func (m *Evaluation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClaimId) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.CollectionId) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.Oracle) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.AgentDid) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.AgentAddress) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovClaims(uint64(m.Status)) + } + if m.Reason != 0 { + n += 1 + sovClaims(uint64(m.Reason)) + } + l = len(m.VerificationProof) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + if m.EvaluationDate != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.EvaluationDate) + n += 1 + l + sovClaims(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovClaims(uint64(l)) + } + } + return n +} + +func (m *Dispute) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SubjectId) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + if m.Type != 0 { + n += 1 + sovClaims(uint64(m.Type)) + } + if m.Data != nil { + l = m.Data.Size() + n += 1 + l + sovClaims(uint64(l)) + } + return n +} + +func (m *DisputeData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Uri) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovClaims(uint64(l)) + } + if m.Encrypted { + n += 2 + } + return n +} + +func sovClaims(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozClaims(x uint64) (n int) { + return sovClaims(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 ErrIntOverflowClaims + } + 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollectionSequence", wireType) + } + m.CollectionSequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CollectionSequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IxoAccount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IxoAccount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NetworkFeePercentage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.NetworkFeePercentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeFeePercentage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.NodeFeePercentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClaims(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthClaims + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Collection) 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 ErrIntOverflowClaims + } + 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: Collection: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Collection: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Entity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Admin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Protocol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StartDate == nil { + m.StartDate = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.StartDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.EndDate == nil { + m.EndDate = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.EndDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Quota", wireType) + } + m.Quota = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Quota |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Evaluated", wireType) + } + m.Evaluated = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Evaluated |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Approved", wireType) + } + m.Approved = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Approved |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Rejected", wireType) + } + m.Rejected = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Rejected |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Disputed", wireType) + } + m.Disputed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Disputed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + 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 ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= CollectionState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payments", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Payments == nil { + m.Payments = &Payments{} + } + if err := m.Payments.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Invalidated", wireType) + } + m.Invalidated = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Invalidated |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipClaims(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthClaims + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Payments) 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 ErrIntOverflowClaims + } + 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: Payments: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Payments: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Submission", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Submission == nil { + m.Submission = &Payment{} + } + if err := m.Submission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evaluation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Evaluation == nil { + m.Evaluation = &Payment{} + } + if err := m.Evaluation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Approval", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Approval == nil { + m.Approval = &Payment{} + } + if err := m.Approval.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rejection", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Rejection == nil { + m.Rejection = &Payment{} + } + if err := m.Rejection.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClaims(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthClaims + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Payment) 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 ErrIntOverflowClaims + } + 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: Payment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Payment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Account = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = append(m.Amount, types.Coin{}) + if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contract_1155Payment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Contract_1155Payment == nil { + m.Contract_1155Payment = &Contract1155Payment{} + } + if err := m.Contract_1155Payment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutNs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.TimeoutNs, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClaims(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthClaims + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Contract1155Payment) 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 ErrIntOverflowClaims + } + 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: Contract1155Payment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Contract1155Payment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokenId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + m.Amount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Amount |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipClaims(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthClaims + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Claim) 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 ErrIntOverflowClaims + } + 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: Claim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Claim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CollectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CollectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentDid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AgentDid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AgentAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubmissionDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SubmissionDate == nil { + m.SubmissionDate = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.SubmissionDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClaimId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evaluation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Evaluation == nil { + m.Evaluation = &Evaluation{} + } + if err := m.Evaluation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PaymentsStatus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PaymentsStatus == nil { + m.PaymentsStatus = &ClaimPayments{} + } + if err := m.PaymentsStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClaims(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthClaims + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClaimPayments) 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 ErrIntOverflowClaims + } + 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: ClaimPayments: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClaimPayments: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Submission", wireType) + } + m.Submission = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Submission |= PaymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Evaluation", wireType) + } + m.Evaluation = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Evaluation |= PaymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Approval", wireType) + } + m.Approval = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Approval |= PaymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Rejection", wireType) + } + m.Rejection = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Rejection |= PaymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipClaims(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthClaims + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Evaluation) 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 ErrIntOverflowClaims + } + 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: Evaluation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Evaluation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClaimId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CollectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CollectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Oracle", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Oracle = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentDid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AgentDid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AgentAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= EvaluationStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + m.Reason = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Reason |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VerificationProof", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VerificationProof = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvaluationDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.EvaluationDate == nil { + m.EvaluationDate = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.EvaluationDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = append(m.Amount, types.Coin{}) + if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClaims(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthClaims + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Dispute) 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 ErrIntOverflowClaims + } + 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: Dispute: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Dispute: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubjectId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubjectId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClaims + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Data == nil { + m.Data = &DisputeData{} + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClaims(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthClaims + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DisputeData) 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 ErrIntOverflowClaims + } + 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: DisputeData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DisputeData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + 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 ErrInvalidLengthClaims + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClaims + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proof = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Encrypted", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClaims + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Encrypted = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipClaims(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthClaims + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipClaims(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, ErrIntOverflowClaims + } + 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, ErrIntOverflowClaims + } + 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, ErrIntOverflowClaims + } + 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, ErrInvalidLengthClaims + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupClaims + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthClaims + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthClaims = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowClaims = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupClaims = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/claims/migrations/v3/store.go b/x/claims/migrations/v3/store.go new file mode 100755 index 00000000..7fe868cb --- /dev/null +++ b/x/claims/migrations/v3/store.go @@ -0,0 +1,120 @@ +package v3claims + +import ( + errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/ixofoundation/ixo-blockchain/v3/x/claims/types" +) + +// MigrateStore performs in-place store migrations from ConsensusVersion 2 to 3. +func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, paramstore paramstypes.Subspace, accKeeper types.AccountKeeper) error { + // --------------------------- + // Migrate Claim Params + // --------------------------- + if paramstore.HasKeyTable() { + paramstore.Set(ctx, types.KeyIntentSequence, types.DefaultIntentSequence) + } else { + paramstore.WithKeyTable(types.ParamKeyTable()) + paramstore.Set(ctx, types.KeyIntentSequence, types.DefaultIntentSequence) + } + + // --------------------------- + // Migrate Claim Collections + // --------------------------- + store := ctx.KVStore(storeKey) + iterator := storetypes.KVStorePrefixIterator(store, types.CollectionKey) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var oldCollection Collection // Define struct for v2 collections + err := cdc.Unmarshal(iterator.Value(), &oldCollection) + if err != nil { + return errorsmod.Wrap(err, "failed to unmarshal collection") + } + + // Create escrow accounts introduced in v3 claims module + escrowAccount, err := types.CreateNewCollectionEscrow(ctx, accKeeper, oldCollection.Id) + if err != nil { + return errorsmod.Wrapf(err, "failed to create escrow account for collection: %s", oldCollection.Id) + } + + // Convert v2 collection to v3 collection + newCollection := types.Collection{ + Id: oldCollection.Id, + Entity: oldCollection.Entity, + Admin: oldCollection.Admin, + Protocol: oldCollection.Protocol, + StartDate: oldCollection.StartDate, + EndDate: oldCollection.EndDate, + Quota: oldCollection.Quota, + Count: oldCollection.Count, + Evaluated: oldCollection.Evaluated, + Approved: oldCollection.Approved, + Rejected: oldCollection.Rejected, + Disputed: oldCollection.Disputed, + State: types.CollectionState(oldCollection.State), + Payments: convertPayments(*oldCollection.Payments), + Signer: oldCollection.Signer, + Invalidated: oldCollection.Invalidated, + // Add the 2 new fields for v3 collections + EscrowAccount: escrowAccount.String(), + Intents: types.CollectionIntentOptions_allow, + } + + // Marshal the new collection and store it with the same key + marshaled, err := cdc.Marshal(&newCollection) + if err != nil { + return errorsmod.Wrap(err, "failed to marshal new collection") + } + store.Set(iterator.Key(), marshaled) + } + + return nil +} + +// Define a function to convert old Contract1155Payment type to new Contract1155Payment type +func convertContract1155Payment(oldContract *Contract1155Payment) *types.Contract1155Payment { + if oldContract == nil { + return nil + } + + return &types.Contract1155Payment{ + Address: oldContract.Address, + TokenId: oldContract.TokenId, + Amount: oldContract.Amount, + } +} + +// Define a function to convert old Payment type to new Payment type +func convertPayment(oldPayment *Payment) *types.Payment { + if oldPayment == nil { + return nil + } + + newPayment := &types.Payment{ + Account: oldPayment.Account, + Amount: oldPayment.Amount, + TimeoutNs: oldPayment.TimeoutNs, + // default values for new fields + IsOraclePayment: false, + Cw20Payment: nil, + } + + // Convert Contract1155Payment if present + newPayment.Contract_1155Payment = convertContract1155Payment(oldPayment.Contract_1155Payment) + + return newPayment +} + +// Define a function to convert old Payments type to new Payments type +func convertPayments(oldPayments Payments) *types.Payments { + return &types.Payments{ + Submission: convertPayment(oldPayments.Submission), + Evaluation: convertPayment(oldPayments.Evaluation), + Approval: convertPayment(oldPayments.Approval), + Rejection: convertPayment(oldPayments.Rejection), + } +} diff --git a/x/claims/module.go b/x/claims/module.go index 02283e08..2c75fdf2 100755 --- a/x/claims/module.go +++ b/x/claims/module.go @@ -11,6 +11,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/ixofoundation/ixo-blockchain/v3/x/claims/client/cli" "github.com/ixofoundation/ixo-blockchain/v3/x/claims/keeper" @@ -89,13 +90,17 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { type AppModule struct { AppModuleBasic keeper keeper.Keeper + + // legacySubspace is used solely for migration of x/params managed parameters + legacySubspace paramstypes.Subspace } // NewAppModule creates a new AppModule object -func NewAppModule(keeper keeper.Keeper) AppModule { +func NewAppModule(keeper keeper.Keeper, ss paramstypes.Subspace) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{}, keeper: keeper, + legacySubspace: ss, } } @@ -115,9 +120,12 @@ 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) + m := keeper.NewMigrator(am.keeper, am.legacySubspace) if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - panic(err) + panic(fmt.Sprintf("failed to migrate x/%s from version 1 to 2: %v", types.ModuleName, err)) + } + if err := cfg.RegisterMigration(types.ModuleName, 2, m.Migrate2to3); err != nil { + panic(fmt.Sprintf("failed to migrate x/%s from version 2 to 3: %v", types.ModuleName, err)) } } @@ -148,5 +156,5 @@ func (am AppModule) EndBlock(context context.Context) error { // introduced by the module. To avoid wrong/empty versions, the initial version // should be set to 1. func (am AppModule) ConsensusVersion() uint64 { - return 2 + return 3 } diff --git a/x/claims/types/claims.go b/x/claims/types/claims.go index 6be62119..81cd6400 100755 --- a/x/claims/types/claims.go +++ b/x/claims/types/claims.go @@ -310,3 +310,17 @@ func ValidateCoinsAllowZero(coins sdk.Coins) error { return nil } } + +// Create a module account for entity id and name of account as fragemnt in form: did#name +func CreateNewCollectionEscrow(ctx sdk.Context, accKeeper AccountKeeper, collectionId string) (sdk.AccAddress, error) { + address := GetModuleAccountAddressEscrow(collectionId) + + if accKeeper.GetAccount(ctx, address) != nil { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "account already exists") + } + + account := accKeeper.NewAccountWithAddress(ctx, address) + accKeeper.SetAccount(ctx, account) + + return account.GetAddress(), nil +} diff --git a/x/claims/types/constants.go b/x/claims/types/constants.go new file mode 100644 index 00000000..ce2e73dc --- /dev/null +++ b/x/claims/types/constants.go @@ -0,0 +1,7 @@ +package types + +const ( + DefaultIxoAccount = "ixo1kqmtxkggcqa9u34lnr6shy0euvclgatw4f9zz5" + DefaultCollectionSequence = uint64(1) + DefaultIntentSequence = uint64(1) +) diff --git a/x/claims/types/params.go b/x/claims/types/params.go index 309de3c3..5d82dbb1 100755 --- a/x/claims/types/params.go +++ b/x/claims/types/params.go @@ -37,10 +37,9 @@ func NewParams(collectionSequence, intentSequence uint64, ixoAccount string, // DefaultParams returns a default set of parameters func DefaultParams() Params { - defaultIxoAccount := "ixo1kqmtxkggcqa9u34lnr6shy0euvclgatw4f9zz5" tenPercentFee := math.LegacyNewDec(10) - return NewParams(1, 1, defaultIxoAccount, tenPercentFee, tenPercentFee) + return NewParams(DefaultCollectionSequence, DefaultIntentSequence, DefaultIxoAccount, tenPercentFee, tenPercentFee) } // ParamSetPairs get the params.ParamSet diff --git a/x/claims/types/query.pb.go b/x/claims/types/query.pb.go index 92da96da..e7d479c5 100644 --- a/x/claims/types/query.pb.go +++ b/x/claims/types/query.pb.go @@ -887,63 +887,64 @@ func init() { func init() { proto.RegisterFile("ixo/claims/v1beta1/query.proto", fileDescriptor_496f233aff18959b) } var fileDescriptor_496f233aff18959b = []byte{ - // 895 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x4f, 0xd4, 0x5a, - 0x18, 0x9e, 0x0e, 0x77, 0x86, 0x3b, 0xef, 0x70, 0xb9, 0xe1, 0x30, 0x02, 0x16, 0x52, 0x4c, 0x8d, - 0x80, 0xa0, 0xad, 0x40, 0xfc, 0x8e, 0x0b, 0x91, 0x60, 0x88, 0x26, 0xea, 0xb0, 0x73, 0x83, 0x9d, - 0x69, 0x29, 0x8d, 0x33, 0x3d, 0x65, 0xda, 0x21, 0xc0, 0x64, 0x5c, 0x68, 0xe2, 0xc2, 0x95, 0xc6, - 0x9d, 0x0b, 0x17, 0xfe, 0x00, 0x7f, 0x07, 0x4b, 0x12, 0x37, 0xae, 0x8c, 0x01, 0x7f, 0x88, 0xe9, - 0x39, 0x6f, 0xa7, 0x2d, 0xd3, 0xf9, 0x58, 0xc0, 0x6e, 0x7a, 0xce, 0xf3, 0x9e, 0xe7, 0x79, 0x3f, - 0xce, 0x73, 0x06, 0x24, 0x6b, 0x8f, 0xaa, 0xe5, 0x8a, 0x66, 0x55, 0x5d, 0x75, 0x77, 0xb1, 0x64, - 0x78, 0xda, 0xa2, 0xba, 0x53, 0x37, 0x6a, 0xfb, 0x8a, 0x53, 0xa3, 0x1e, 0x25, 0xc4, 0xda, 0xa3, - 0x0a, 0xdf, 0x57, 0x70, 0x5f, 0x2c, 0x98, 0xd4, 0xa4, 0x6c, 0x5b, 0xf5, 0x7f, 0x71, 0xa4, 0x38, - 0x65, 0x52, 0x6a, 0x56, 0x0c, 0x55, 0x73, 0x2c, 0x55, 0xb3, 0x6d, 0xea, 0x69, 0x9e, 0x45, 0x6d, - 0x17, 0x77, 0xe7, 0xcb, 0xd4, 0xad, 0x52, 0x57, 0x2d, 0x69, 0xae, 0xc1, 0x09, 0x5a, 0x74, 0x8e, - 0x66, 0x5a, 0x36, 0x03, 0x23, 0x76, 0x3a, 0x41, 0x13, 0x4a, 0x60, 0x00, 0xb9, 0x00, 0xe4, 0x85, - 0x7f, 0xc4, 0x73, 0xad, 0xa6, 0x55, 0xdd, 0xa2, 0xb1, 0x53, 0x37, 0x5c, 0x4f, 0x7e, 0x06, 0xa3, - 0xb1, 0x55, 0xd7, 0xa1, 0xb6, 0x6b, 0x90, 0x3b, 0x90, 0x75, 0xd8, 0xca, 0x84, 0x70, 0x49, 0x98, - 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 0xc2, 0x18, 0xb9, 0x67, 0xa8, 0x8d, 0xa8, 0xdf, 0x36, 0xd5, 0x46, 0xd4, - 0x5a, 0x9b, 0x7c, 0x0e, 0x0e, 0x00, 0x42, 0x9f, 0xea, 0x72, 0x15, 0xdb, 0xfc, 0xb2, 0xcb, 0x55, - 0x6c, 0x37, 0x3e, 0x79, 0x94, 0xc9, 0xfb, 0x8f, 0xe4, 0x23, 0xf2, 0x56, 0x36, 0x0e, 0x8f, 0x25, - 0xe1, 0xe8, 0x58, 0x12, 0x7e, 0x1f, 0x4b, 0xc2, 0xc7, 0x13, 0x29, 0x75, 0x74, 0x22, 0xa5, 0x7e, - 0x9e, 0x48, 0xa9, 0x97, 0x77, 0x4d, 0xcb, 0xdb, 0xae, 0x97, 0x94, 0x32, 0xad, 0xfa, 0x01, 0x5b, - 0xb4, 0x6e, 0xeb, 0xcc, 0xbc, 0xfc, 0xaf, 0xeb, 0xa5, 0x0a, 0x2d, 0xbf, 0x2e, 0x6f, 0x6b, 0x96, - 0xad, 0xee, 0x2e, 0xab, 0x7b, 0x81, 0xbb, 0x78, 0xfb, 0x8e, 0xe1, 0x96, 0xb2, 0xec, 0x9f, 0xfa, - 0xf2, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x2e, 0xd5, 0x39, 0x60, 0x0c, 0x00, 0x00, + // 908 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x4f, 0xfc, 0x54, + 0x14, 0x9d, 0x0e, 0xce, 0xe0, 0x5c, 0x0c, 0x89, 0x8f, 0x01, 0x86, 0x0e, 0x16, 0x53, 0x22, 0x20, + 0x68, 0x1b, 0x20, 0x04, 0xff, 0x84, 0x85, 0x48, 0x30, 0x44, 0x13, 0x75, 0xd8, 0xb9, 0xc1, 0xce, + 0xb4, 0x94, 0xc6, 0x99, 0xbe, 0x32, 0xaf, 0x43, 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, 0xa7, 0xd1, 0xfb, 0x71, 0x97, 0x1e, 0xe8, 0xfd, 0xb8, 0x21, 0x0f, 0x44, 0x9f, + 0xdc, 0x4a, 0x00, 0x91, 0xbd, 0xe5, 0xbc, 0xe0, 0x94, 0xcd, 0xe6, 0xbc, 0xe0, 0xb4, 0x5f, 0xaa, + 0x75, 0x2e, 0x73, 0x9e, 0xcc, 0xa5, 0x65, 0xb2, 0xc3, 0xd3, 0xbb, 0x07, 0x45, 0xba, 0x7f, 0x50, + 0xa4, 0xff, 0x1f, 0x14, 0xe9, 0xe7, 0x47, 0xa5, 0x70, 0xff, 0xa8, 0x14, 0xfe, 0x7d, 0x54, 0x0a, + 0xdf, 0x7c, 0x68, 0x3b, 0xfe, 0x45, 0xaf, 0xa9, 0xb5, 0x68, 0x27, 0x08, 0x3c, 0xa7, 0x3d, 0xd7, + 0xe4, 0xde, 0x17, 0x7c, 0xbd, 0xdf, 0x6c, 0xd3, 0xd6, 0x77, 0xad, 0x0b, 0xc3, 0x71, 0xf5, 0xab, + 0x5d, 0xfd, 0x3a, 0x3c, 0xd6, 0xbf, 0xf1, 0x2c, 0xd6, 0x2c, 0xf3, 0x1f, 0xfa, 0xbb, 0x2f, 0x03, + 0x00, 0x00, 0xff, 0xff, 0x61, 0x36, 0x2e, 0x51, 0x9f, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/claims/types/query.pb.gw.go b/x/claims/types/query.pb.gw.go index c9f7c87e..45b621d8 100644 --- a/x/claims/types/query.pb.gw.go +++ b/x/claims/types/query.pb.gw.go @@ -895,21 +895,21 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ixo", "claims", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Collection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"ixo", "collection", "id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Collection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ixo", "claims", "collection", "id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_CollectionList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"ixo", "collection"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_CollectionList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ixo", "claims", "collections"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Claim_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"ixo", "claim", "id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Claim_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ixo", "claims", "claim", "id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ClaimList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"ixo", "claim"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ClaimList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1}, []string{"ixo", "claims"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Dispute_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"ixo", "dispute", "proof"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Dispute_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ixo", "claims", "dispute", "proof"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_DisputeList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"ixo", "dispute"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_DisputeList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ixo", "claims", "disputes"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Intent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"ixo", "intent", "agentAddress", "collectionId", "id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Intent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"ixo", "claims", "intent", "agentAddress", "collectionId", "id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_IntentList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"ixo", "intent"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_IntentList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ixo", "claims", "intents"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/claims/types/tx.pb.go b/x/claims/types/tx.pb.go index 4242c450..bf52ec6f 100644 --- a/x/claims/types/tx.pb.go +++ b/x/claims/types/tx.pb.go @@ -362,11 +362,15 @@ type MsgEvaluateClaim struct { Reason uint32 `protobuf:"varint,8,opt,name=reason,proto3" json:"reason,omitempty"` // verificationProof is the cid of the evaluation Verfiable Credential VerificationProof string `protobuf:"bytes,9,opt,name=verification_proof,json=verificationProof,proto3" json:"verification_proof,omitempty"` - // NOTE: if both amount and cw20 amount are empty then use collection default - // custom amount specified by evaluator for claim approval + // NOTE: if claim is using intent, then amount and cw20 amount are ignored and + // overriden with intent amounts NOTE: if both amount and cw20 amount are + // empty then use collection default custom amount specified by evaluator for + // claim approval Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,10,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` - // NOTE: if both amount and cw20 amount are empty then use collection default - // custom cw20 payments specified by evaluator for claim approval + // NOTE: if claim is using intent, then amount and cw20 amount are ignored and + // overriden with intent amounts NOTE: if both amount and cw20 amount are + // empty then use collection default custom cw20 payments specified by + // evaluator for claim approval Cw20Payment []*CW20Payment `protobuf:"bytes,11,rep,name=cw20_payment,json=cw20Payment,proto3" json:"cw20_payment,omitempty"` } diff --git a/x/epochs/types/genesis.go b/x/epochs/types/genesis.go index ef5a9328..83d1a40f 100644 --- a/x/epochs/types/genesis.go +++ b/x/epochs/types/genesis.go @@ -15,10 +15,11 @@ func NewGenesisState(epochs []EpochInfo) *GenesisState { // DefaultGenesis returns the default Capability genesis state. func DefaultGenesis() *GenesisState { epochs := []EpochInfo{ - NewGenesisEpochInfo("2min", time.Minute*2), // alphabetical order + // comment out 2min, used for testing + // NewGenesisEpochInfo("2min", time.Minute*2), // alphabetical order NewGenesisEpochInfo("day", time.Hour*24), - // NewGenesisEpochInfo("hour", time.Hour), - // NewGenesisEpochInfo("week", time.Hour*24*7), + NewGenesisEpochInfo("hour", time.Hour), + NewGenesisEpochInfo("week", time.Hour*24*7), } return NewGenesisState(epochs) } diff --git a/x/epochs/types/query.pb.go b/x/epochs/types/query.pb.go index 1437c8fd..e3c4f4a7 100644 --- a/x/epochs/types/query.pb.go +++ b/x/epochs/types/query.pb.go @@ -208,33 +208,33 @@ func init() { func init() { proto.RegisterFile("ixo/epochs/v1beta1/query.proto", fileDescriptor_3709f8637f220d21) } var fileDescriptor_3709f8637f220d21 = []byte{ - // 409 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x3d, 0xef, 0xd2, 0x40, - 0x18, 0xef, 0xfd, 0x51, 0x12, 0x4f, 0x5c, 0x2e, 0x46, 0x6b, 0x83, 0x27, 0x96, 0x05, 0x51, 0x7a, - 0x01, 0x26, 0x75, 0x31, 0x18, 0x07, 0x47, 0x6b, 0xe2, 0xe0, 0x62, 0xda, 0x72, 0x94, 0x8b, 0x70, - 0x4f, 0xe9, 0x5d, 0x09, 0xac, 0x6e, 0x6e, 0x26, 0x26, 0x7e, 0x0a, 0x3f, 0x08, 0x23, 0x89, 0x8b, - 0x93, 0x31, 0xe0, 0x07, 0x31, 0xbd, 0x56, 0x82, 0xa1, 0x24, 0x6c, 0xbd, 0xfb, 0xbd, 0x3e, 0x4f, - 0x0f, 0x53, 0xb1, 0x02, 0xc6, 0x13, 0x88, 0xa6, 0x8a, 0x2d, 0xfb, 0x21, 0xd7, 0x41, 0x9f, 0x2d, - 0x32, 0x9e, 0xae, 0xbd, 0x24, 0x05, 0x0d, 0x84, 0x88, 0x15, 0x78, 0x05, 0xee, 0x95, 0xb8, 0x73, - 0x3b, 0x86, 0x18, 0x0c, 0xcc, 0xf2, 0xaf, 0x82, 0xe9, 0x34, 0x63, 0x80, 0x78, 0xc6, 0x59, 0x90, - 0x08, 0x16, 0x48, 0x09, 0x3a, 0xd0, 0x02, 0xa4, 0x2a, 0xd1, 0x6e, 0x04, 0x6a, 0x0e, 0x8a, 0x85, - 0x81, 0xe2, 0x45, 0xc0, 0x21, 0x2e, 0x09, 0x62, 0x21, 0x0d, 0xb9, 0xe4, 0x56, 0x75, 0x32, 0xc7, - 0x02, 0x77, 0x6d, 0x7c, 0xe7, 0x4d, 0xee, 0xf0, 0xca, 0x50, 0x5e, 0xcb, 0x09, 0xf8, 0x7c, 0x91, - 0x71, 0xa5, 0xdd, 0x77, 0xf8, 0xee, 0x09, 0xa2, 0x12, 0x90, 0x8a, 0x93, 0xe7, 0xb8, 0x5e, 0x58, - 0xda, 0xa8, 0x55, 0xeb, 0xdc, 0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xf4, 0x31, 0x9a, 0x06, 0x42, 0xb2, 0xe5, 0x90, - 0xad, 0xfe, 0x85, 0xe8, 0x75, 0xc2, 0x55, 0x58, 0x37, 0x4f, 0x6f, 0xf8, 0x37, 0x00, 0x00, 0xff, - 0xff, 0xbf, 0xd8, 0x64, 0xbe, 0x30, 0x03, 0x00, 0x00, + // 414 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x3f, 0xcf, 0xd2, 0x40, + 0x18, 0xef, 0xbd, 0x28, 0x89, 0x27, 0x2e, 0x17, 0xa3, 0xb5, 0xc1, 0x93, 0xd4, 0x41, 0x44, 0xe9, + 0x05, 0x98, 0xd4, 0xc5, 0x60, 0x1c, 0x1c, 0xad, 0x89, 0x83, 0x8b, 0x69, 0xcb, 0x51, 0x2e, 0xc2, + 0x3d, 0xa5, 0x77, 0x25, 0x10, 0xe3, 0xe2, 0xe6, 0x66, 0xe2, 0xea, 0xa7, 0xf0, 0x53, 0x30, 0x92, + 0xb8, 0x38, 0x19, 0x03, 0x7e, 0x10, 0xd3, 0x6b, 0xe5, 0x25, 0xa1, 0x24, 0x6c, 0xbd, 0xfb, 0xfd, + 0x7d, 0x9e, 0x1e, 0xa6, 0x62, 0x09, 0x8c, 0x27, 0x10, 0x4d, 0x14, 0x5b, 0xf4, 0x42, 0xae, 0x83, + 0x1e, 0x9b, 0x67, 0x3c, 0x5d, 0x79, 0x49, 0x0a, 0x1a, 0x08, 0x11, 0x4b, 0xf0, 0x0a, 0xdc, 0x2b, + 0x71, 0xe7, 0x66, 0x0c, 0x31, 0x18, 0x98, 0xe5, 0x5f, 0x05, 0xd3, 0x69, 0xc6, 0x00, 0xf1, 0x94, + 0xb3, 0x20, 0x11, 0x2c, 0x90, 0x12, 0x74, 0xa0, 0x05, 0x48, 0x55, 0xa2, 0x9d, 0x08, 0xd4, 0x0c, + 0x14, 0x0b, 0x03, 0xc5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, 0x1e, 0x9c, 0x6e, 0xc4, 0x3e, 0x5e, 0x6e, + 0xfd, 0xd3, 0xf0, 0xcd, 0x7a, 0x4b, 0xd1, 0x66, 0x4b, 0xd1, 0x9f, 0x2d, 0x45, 0x5f, 0x77, 0xd4, + 0xda, 0xec, 0xa8, 0xf5, 0x6b, 0x47, 0xad, 0x77, 0x4f, 0x62, 0xa1, 0x27, 0x59, 0xe8, 0x45, 0x30, + 0xcb, 0xcd, 0xc6, 0x90, 0xc9, 0x91, 0x79, 0x7e, 0xf9, 0xa9, 0x1b, 0x4e, 0x21, 0xfa, 0x10, 0x4d, + 0x02, 0x21, 0xd9, 0x62, 0xc0, 0x96, 0xff, 0xbd, 0xf5, 0x2a, 0xe1, 0x2a, 0xac, 0x9b, 0x07, 0x38, + 0xf8, 0x17, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x3b, 0x8d, 0x1b, 0x36, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/epochs/types/query.pb.gw.go b/x/epochs/types/query.pb.gw.go index 43152a0f..da50766c 100644 --- a/x/epochs/types/query.pb.gw.go +++ b/x/epochs/types/query.pb.gw.go @@ -51,19 +51,26 @@ func local_request_Query_EpochInfos_0(ctx context.Context, marshaler runtime.Mar } -var ( - filter_Query_CurrentEpoch_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - func request_Query_CurrentEpoch_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryCurrentEpochRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["identifier"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "identifier") } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_CurrentEpoch_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + protoReq.Identifier, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "identifier", err) } msg, err := client.CurrentEpoch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -75,11 +82,22 @@ func local_request_Query_CurrentEpoch_0(ctx context.Context, marshaler runtime.M var protoReq QueryCurrentEpochRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["identifier"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "identifier") } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_CurrentEpoch_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + protoReq.Identifier, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "identifier", err) } msg, err := server.CurrentEpoch(ctx, &protoReq) @@ -226,7 +244,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_EpochInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"ixo", "epochs", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_CurrentEpoch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ixo", "epochs", "v1beta1", "current_epoch"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_CurrentEpoch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 1, 0, 4, 1, 5, 3}, []string{"ixo", "epochs", "v1beta1", "identifier"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/mint/keeper/keeper.go b/x/mint/keeper/keeper.go index 58b5a279..fd5ec7a3 100644 --- a/x/mint/keeper/keeper.go +++ b/x/mint/keeper/keeper.go @@ -162,7 +162,7 @@ func (k Keeper) distributeToModule(ctx sdk.Context, recipientModule string, mint if err != nil { return ixomath.Int{}, err } - ctx.Logger().Info("distributeToModule", "module", types.ModuleName, "recepientModule", recipientModule, "distributionCoin", distributionCoin, "height", ctx.BlockHeight()) + ctx.Logger().Info("distributeToModule", "module", types.ModuleName, "recipientModule", recipientModule, "distributionCoin", distributionCoin, "height", ctx.BlockHeight()) if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, recipientModule, sdk.NewCoins(distributionCoin)); err != nil { return ixomath.Int{}, err } diff --git a/x/mint/types/keys.go b/x/mint/types/keys.go index 567d2e78..e8beec83 100644 --- a/x/mint/types/keys.go +++ b/x/mint/types/keys.go @@ -5,7 +5,7 @@ const ( ModuleName = "mint" // StoreKey is the default store key for mint. - StoreKey = ModuleName + StoreKey = ModuleName + "-store" ) var ( diff --git a/x/mint/types/params.go b/x/mint/types/params.go index a5787f16..8007c010 100644 --- a/x/mint/types/params.go +++ b/x/mint/types/params.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/ixofoundation/ixo-blockchain/v3/ixomath" + "github.com/ixofoundation/ixo-blockchain/v3/lib/ixo" epochtypes "github.com/ixofoundation/ixo-blockchain/v3/x/epochs/types" ) @@ -41,20 +42,21 @@ func NewParams( // DefaultParams returns the default minting module parameters. func DefaultParams() Params { return Params{ - MintDenom: sdk.DefaultBondDenom, - GenesisEpochProvisions: ixomath.NewDec(5000000), - // EpochIdentifier: "2min", // 1 day - // ReductionPeriodInEpochs: 4, // 1 years - EpochIdentifier: "day", // 1 day - ReductionPeriodInEpochs: 365, // 1 years - ReductionFactor: ixomath.NewDecWithPrec(5, 1), // 0.5 + MintDenom: ixo.IxoNativeToken, + GenesisEpochProvisions: ixomath.NewDec(43_500_000_000), // 43_500 IXO + // comment out 2min and uncomment day, 2min is for local testing + // EpochIdentifier: "2min", // 2 min + // ReductionPeriodInEpochs: 7, // 14 min + EpochIdentifier: "day", // 1 day + ReductionPeriodInEpochs: 365, // 1 years + ReductionFactor: ixomath.NewDecWithPrec(666666666666666666, 18), // 0.666666666666666666 DistributionProportions: DistributionProportions{ - Staking: ixomath.NewDecWithPrec(9, 1), // 0.9 - ImpactRewards: ixomath.NewDecWithPrec(1, 1), // 0.1 + Staking: ixomath.NewDecWithPrec(1, 0), // 1.0 + ImpactRewards: ixomath.NewDecWithPrec(0, 1), // 0.0 CommunityPool: ixomath.NewDecWithPrec(0, 1), // 0.0 }, WeightedImpactRewardsReceivers: []WeightedAddress{}, - MintingRewardsDistributionStartEpoch: 0, + MintingRewardsDistributionStartEpoch: 1, } } diff --git a/x/mint/types/query.pb.go b/x/mint/types/query.pb.go index 0c4eb3e0..c7739e93 100644 --- a/x/mint/types/query.pb.go +++ b/x/mint/types/query.pb.go @@ -203,7 +203,7 @@ func init() { proto.RegisterFile("ixo/mint/v1beta1/query.proto", fileDescriptor_ var fileDescriptor_249feb5acefc22ab = []byte{ // 402 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x8b, 0xd3, 0x40, - 0x1c, 0xc5, 0x93, 0x45, 0x7b, 0x18, 0x85, 0x5d, 0xc6, 0x3d, 0x94, 0xb4, 0x66, 0x97, 0xb8, 0x82, + 0x1c, 0xc5, 0x93, 0x45, 0x0b, 0x8e, 0x87, 0x5d, 0xc6, 0x3d, 0x94, 0xb4, 0x66, 0x97, 0xb8, 0x82, 0x08, 0x9d, 0xa1, 0x2d, 0xe8, 0xbd, 0xe8, 0x4d, 0xa5, 0xed, 0xd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c, 0xcc, 0x8f, 0xed, 0x55, 0x2b, 0x02, 0x95, 0x82, 0x52, 0x93, 0x29, 0x11, 0x40, 0x53, 0xa6, 0x13, 0xf2, 0x8a, 0xc7, 0x2c, 0x5a, 0xbd, 0xe0, 0xd1, 0xf8, 0x9c, 0x1f, 0xfa, 0xf6, 0xbe, 0x9e, 0xa1, 0xbb, 0x36, 0x10, 0x7f, 0x40, 0x8d, 0x12, 0x18, 0xdf, 0xd4, 0x9f, 0x52, 0xef, 0xc5, 0x7b, 0xfc, 0x9f, 0xa9, 0x12, 0x38, 0xb8, 0xfe, 0xf8, @@ -226,7 +226,7 @@ var fileDescriptor_249feb5acefc22ab = []byte{ 0xce, 0x77, 0x3f, 0xed, 0x7d, 0x67, 0xb3, 0xf7, 0x9d, 0xef, 0x7b, 0xdf, 0x79, 0xfb, 0x3c, 0x16, 0x3a, 0x29, 0x42, 0x12, 0x41, 0x6a, 0x7c, 0xde, 0x43, 0x21, 0x27, 0x76, 0xdb, 0xcc, 0x5f, 0x27, 0x9c, 0x41, 0x34, 0x8d, 0x12, 0x26, 0x24, 0x5d, 0xf4, 0xe9, 0xb2, 0x4c, 0xd1, 0xab, 0x8c, 0xab, - 0xb0, 0x61, 0xf7, 0xad, 0xff, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x8d, 0x27, 0xc8, 0x5c, 0xf2, 0x02, + 0xb0, 0x61, 0xf7, 0xad, 0xff, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x15, 0xf4, 0xa0, 0x40, 0xf2, 0x02, 0x00, 0x00, } @@ -735,7 +735,7 @@ func (m *QueryEpochProvisionsResponse) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EpochProvisions", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -745,15 +745,16 @@ func (m *QueryEpochProvisionsResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery }