From 6d318abc50388bf8b8f58823787f0babd7dbabaa Mon Sep 17 00:00:00 2001 From: Yarom Swisa Date: Sat, 4 Mar 2023 22:19:51 +0000 Subject: [PATCH] added upgrade plan and fixed projects query --- app/app.go | 2 +- app/upgrades/empty_upgrades.go | 9 +- docs/static/openapi.yml | 972 ++++++++++++++++-- go.mod | 2 - go.sum | 4 - .../cli/query_show_developers_project.go | 6 +- x/projects/client/cli/query_show_project.go | 6 +- x/projects/client/cli/tx_add_project_keys.go | 5 + x/projects/types/message_add_project_keys.go | 6 +- 9 files changed, 914 insertions(+), 98 deletions(-) diff --git a/app/app.go b/app/app.go index 0b699085ab..343020fe88 100644 --- a/app/app.go +++ b/app/app.go @@ -139,7 +139,7 @@ var Upgrades = []upgrades.Upgrade{ upgrades.Upgrade_0_6_0, upgrades.Upgrade_0_6_0_RC3, upgrades.Upgrade_0_6_1, - upgrades.Upgrade_0_6_2, + upgrades.Upgrade_0_7_0, } // this line is used by starport scaffolding # stargate/wasm/app/enabledProposals diff --git a/app/upgrades/empty_upgrades.go b/app/upgrades/empty_upgrades.go index 1d853f8bb3..d897a9a9de 100644 --- a/app/upgrades/empty_upgrades.go +++ b/app/upgrades/empty_upgrades.go @@ -6,6 +6,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/lavanet/lava/app/keepers" + plansmoduletypes "github.com/lavanet/lava/x/plans/types" + projectsmoduletypes "github.com/lavanet/lava/x/projects/types" + subscriptionmoduletypes "github.com/lavanet/lava/x/subscription/types" ) var Upgrade_0_4_0 = Upgrade{ @@ -78,12 +81,12 @@ var Upgrade_0_6_1 = Upgrade{ StoreUpgrades: store.StoreUpgrades{}, // StoreUpgrades has 3 fields: Added/Renamed/Deleted any module that fits these description should be added in the way below } -var Upgrade_0_6_2 = Upgrade{ - UpgradeName: "v0.6.2", // upgrade name defined few lines above +var Upgrade_0_7_0 = Upgrade{ + UpgradeName: "v0.7.0", // upgrade name defined few lines above CreateUpgradeHandler: func(m *module.Manager, c module.Configurator, bapm BaseAppParamManager, lk *keepers.LavaKeepers) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { return m.RunMigrations(ctx, c, vm) } }, // create CreateUpgradeHandler in upgrades.go below - StoreUpgrades: store.StoreUpgrades{}, // StoreUpgrades has 3 fields: Added/Renamed/Deleted any module that fits these description should be added in the way below + StoreUpgrades: store.StoreUpgrades{Added: []string{plansmoduletypes.StoreKey, projectsmoduletypes.StoreKey, subscriptionmoduletypes.StoreKey}}, // StoreUpgrades has 3 fields: Added/Renamed/Deleted any module that fits these description should be added in the way below } diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 8a9b3cd26d..7dd2349559 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -31129,6 +31129,192 @@ paths: format: uint64 tags: - Query + /lavanet/lava/plan/params: + get: + summary: Parameters queries the parameters of the module. + operationId: LavanetLavaPlansParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /lavanet/lava/plan/show_all_plans: + get: + summary: Queries a list of ShowAllPlans items. + operationId: LavanetLavaPlansShowAllPlans + responses: + '200': + description: A successful response. + schema: + type: object + properties: + plans_info: + type: array + items: + type: object + properties: + index: + type: string + name: + type: string + price: + 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. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + '/lavanet/lava/plan/show_plan_info/{plan_index}': + get: + summary: Queries a list of ShowPlanInfo items. + operationId: LavanetLavaPlansShowPlanInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + plan_info: + type: object + properties: + index: + type: string + duration: + type: string + format: uint64 + title: duration of the plan's subscription in months + block: + type: string + format: uint64 + title: the epoch that this plan was created + price: + 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: plan price (in ulava) + compute_units: + type: string + format: uint64 + title: max CU for the whole plan duration + compute_units_per_epoch: + type: string + format: uint64 + title: max CU per epoch for the whole plan duration + servicers_to_pair: + type: string + format: uint64 + title: max providers to be paired in an epoch + allow_overuse: + type: boolean + title: allow CU overuse flag + overuse_rate: + type: string + format: uint64 + title: price of CU overuse + name: + type: string + title: plan name (non-unique "human" name) + description: + type: string + title: plan description (for humans) + type: + type: string + title: plan type + annual_discount_percentage: + type: string + format: uint64 + title: discount for buying the plan for a year + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: plan_index + in: path + required: true + type: string + tags: + - Query /lavanet/lava/projects/params: get: summary: Parameters queries the parameters of the module. @@ -31165,6 +31351,202 @@ paths: additionalProperties: {} tags: - Query + '/lavanet/lava/projects/show_developers_project/{developer}': + get: + summary: Queries a list of ShowDevelopersProject items. + operationId: LavanetLavaProjectsShowDevelopersProject + responses: + '200': + description: A successful response. + schema: + type: object + properties: + project: + type: object + properties: + index: + type: string + title: >- + unique id that will be the combination of subscription + address and project name, cannot be changed once created + subscription: + type: string + title: the subscription address that owns the project + description: + type: string + title: the description of the project for the users convinient + enabled: + type: boolean + title: enabled flag + project_keys: + type: array + items: + type: object + properties: + key: + type: string + title: the address of the project key + types: + type: array + items: + type: string + enum: + - NONE + - ADMIN + - DEVELOPER + default: NONE + title: 'bitmap, must only be power of 2' + title: 'the key type, determines the privilages of the key' + title: list of the projects keys + policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + geolocation_profile: + type: string + format: uint64 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + used_cu: + type: string + format: uint64 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: developer + in: path + required: true + type: string + tags: + - Query + '/lavanet/lava/projects/show_project/{project}': + get: + summary: Queries a list of ShowProject items. + operationId: LavanetLavaProjectsShowProject + responses: + '200': + description: A successful response. + schema: + type: object + properties: + project: + type: object + properties: + index: + type: string + title: >- + unique id that will be the combination of subscription + address and project name, cannot be changed once created + subscription: + type: string + title: the subscription address that owns the project + description: + type: string + title: the description of the project for the users convinient + enabled: + type: boolean + title: enabled flag + project_keys: + type: array + items: + type: object + properties: + key: + type: string + title: the address of the project key + types: + type: array + items: + type: string + enum: + - NONE + - ADMIN + - DEVELOPER + default: NONE + title: 'bitmap, must only be power of 2' + title: 'the key type, determines the privilages of the key' + title: list of the projects keys + policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + geolocation_profile: + type: string + format: uint64 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + used_cu: + type: string + format: uint64 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: project + in: path + required: true + type: string + tags: + - Query /lavanet/lava/spec/params: get: summary: Parameters queries the parameters of the module. @@ -32468,15 +32850,15 @@ paths: type: string block: type: string - format: int64 - packageIndex: + format: uint64 + plan_index: type: string - packageBlock: + plan_block: type: string - format: int64 - isYearly: + format: uint64 + is_yearly: type: boolean - expiryTime: + expiry_time: type: string format: uint64 usedCU: @@ -54752,39 +55134,213 @@ definitions: method signatures required by gogoproto. - address: - type: string - deadline: - type: string - format: uint64 - endpoints: - type: array - items: - type: object - properties: - iPPORT: - type: string - useType: - type: string - geolocation: - type: string - format: uint64 - geolocation: - type: string - format: uint64 - chain: - type: string - vrfpk: - type: string - moniker: - type: string - lavanet.lava.pairing.QueryUserEntryResponse: + address: + type: string + deadline: + type: string + format: uint64 + endpoints: + type: array + items: + type: object + properties: + iPPORT: + type: string + useType: + type: string + geolocation: + type: string + format: uint64 + geolocation: + type: string + format: uint64 + chain: + type: string + vrfpk: + type: string + moniker: + type: string + lavanet.lava.pairing.QueryUserEntryResponse: + type: object + properties: + consumer: + type: object + properties: + stake: + 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. + address: + type: string + deadline: + type: string + format: uint64 + endpoints: + type: array + items: + type: object + properties: + iPPORT: + type: string + useType: + type: string + geolocation: + type: string + format: uint64 + geolocation: + type: string + format: uint64 + chain: + type: string + vrfpk: + type: string + moniker: + type: string + maxCU: + type: string + format: uint64 + lavanet.lava.pairing.QueryVerifyPairingResponse: + type: object + properties: + valid: + type: boolean + index: + type: string + format: int64 + lavanet.lava.pairing.UniquePaymentStorageClientProvider: + type: object + properties: + index: + type: string + block: + type: string + format: uint64 + usedCU: + type: string + format: uint64 + lavanet.lava.plans.Params: + type: object + description: Params defines the parameters for the module. + lavanet.lava.plans.Plan: + type: object + properties: + index: + type: string + duration: + type: string + format: uint64 + title: duration of the plan's subscription in months + block: + type: string + format: uint64 + title: the epoch that this plan was created + price: + 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: plan price (in ulava) + compute_units: + type: string + format: uint64 + title: max CU for the whole plan duration + compute_units_per_epoch: + type: string + format: uint64 + title: max CU per epoch for the whole plan duration + servicers_to_pair: + type: string + format: uint64 + title: max providers to be paired in an epoch + allow_overuse: + type: boolean + title: allow CU overuse flag + overuse_rate: + type: string + format: uint64 + title: price of CU overuse + name: + type: string + title: plan name (non-unique "human" name) + description: + type: string + title: plan description (for humans) + type: + type: string + title: plan type + annual_discount_percentage: + type: string + format: uint64 + title: discount for buying the plan for a year + lavanet.lava.plans.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + description: QueryParamsResponse is response type for the Query/Params RPC method. + lavanet.lava.plans.QueryShowAllPlansResponse: + type: object + properties: + plans_info: + type: array + items: + type: object + properties: + index: + type: string + name: + type: string + price: + 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. + lavanet.lava.plans.QueryShowPlanInfoResponse: type: object properties: - consumer: + plan_info: type: object properties: - stake: + index: + type: string + duration: + type: string + format: uint64 + title: duration of the plan's subscription in months + block: + type: string + format: uint64 + title: the epoch that this plan was created + price: type: object properties: denom: @@ -54799,54 +55355,67 @@ definitions: method signatures required by gogoproto. - address: + title: plan price (in ulava) + compute_units: type: string - deadline: + format: uint64 + title: max CU for the whole plan duration + compute_units_per_epoch: type: string format: uint64 - endpoints: - type: array - items: - type: object - properties: - iPPORT: - type: string - useType: - type: string - geolocation: - type: string - format: uint64 - geolocation: + title: max CU per epoch for the whole plan duration + servicers_to_pair: type: string format: uint64 - chain: + title: max providers to be paired in an epoch + allow_overuse: + type: boolean + title: allow CU overuse flag + overuse_rate: type: string - vrfpk: + format: uint64 + title: price of CU overuse + name: type: string - moniker: + title: plan name (non-unique "human" name) + description: type: string - maxCU: - type: string - format: uint64 - lavanet.lava.pairing.QueryVerifyPairingResponse: + title: plan description (for humans) + type: + type: string + title: plan type + annual_discount_percentage: + type: string + format: uint64 + title: discount for buying the plan for a year + lavanet.lava.plans.showAllPlansInfoStruct: type: object properties: - valid: - type: boolean index: type: string - format: int64 - lavanet.lava.pairing.UniquePaymentStorageClientProvider: + name: + type: string + price: + 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. + lavanet.lava.projects.ChainPolicy: type: object properties: - index: - type: string - block: - type: string - format: uint64 - usedCU: + chain_id: type: string - format: uint64 + apis: + type: array + items: + type: string lavanet.lava.projects.MsgAddProjectKeysResponse: type: object lavanet.lava.projects.MsgSetProjectPolicyResponse: @@ -54854,6 +55423,117 @@ definitions: lavanet.lava.projects.Params: type: object description: Params defines the parameters for the module. + lavanet.lava.projects.Policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + geolocation_profile: + type: string + format: uint64 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + lavanet.lava.projects.Project: + type: object + properties: + index: + type: string + title: >- + unique id that will be the combination of subscription address and + project name, cannot be changed once created + subscription: + type: string + title: the subscription address that owns the project + description: + type: string + title: the description of the project for the users convinient + enabled: + type: boolean + title: enabled flag + project_keys: + type: array + items: + type: object + properties: + key: + type: string + title: the address of the project key + types: + type: array + items: + type: string + enum: + - NONE + - ADMIN + - DEVELOPER + default: NONE + title: 'bitmap, must only be power of 2' + title: 'the key type, determines the privilages of the key' + title: list of the projects keys + policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + geolocation_profile: + type: string + format: uint64 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + used_cu: + type: string + format: uint64 + lavanet.lava.projects.ProjectKey: + type: object + properties: + key: + type: string + title: the address of the project key + types: + type: array + items: + type: string + enum: + - NONE + - ADMIN + - DEVELOPER + default: NONE + title: 'bitmap, must only be power of 2' + title: 'the key type, determines the privilages of the key' + lavanet.lava.projects.ProjectKey.KEY_TYPE: + type: string + enum: + - NONE + - ADMIN + - DEVELOPER + default: NONE + title: 'bitmap, must only be power of 2' lavanet.lava.projects.QueryParamsResponse: type: object properties: @@ -54861,6 +55541,138 @@ definitions: description: params holds all the parameters of this module. type: object description: QueryParamsResponse is response type for the Query/Params RPC method. + lavanet.lava.projects.QueryShowDevelopersProjectResponse: + type: object + properties: + project: + type: object + properties: + index: + type: string + title: >- + unique id that will be the combination of subscription address and + project name, cannot be changed once created + subscription: + type: string + title: the subscription address that owns the project + description: + type: string + title: the description of the project for the users convinient + enabled: + type: boolean + title: enabled flag + project_keys: + type: array + items: + type: object + properties: + key: + type: string + title: the address of the project key + types: + type: array + items: + type: string + enum: + - NONE + - ADMIN + - DEVELOPER + default: NONE + title: 'bitmap, must only be power of 2' + title: 'the key type, determines the privilages of the key' + title: list of the projects keys + policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + geolocation_profile: + type: string + format: uint64 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + used_cu: + type: string + format: uint64 + lavanet.lava.projects.QueryShowProjectResponse: + type: object + properties: + project: + type: object + properties: + index: + type: string + title: >- + unique id that will be the combination of subscription address and + project name, cannot be changed once created + subscription: + type: string + title: the subscription address that owns the project + description: + type: string + title: the description of the project for the users convinient + enabled: + type: boolean + title: enabled flag + project_keys: + type: array + items: + type: object + properties: + key: + type: string + title: the address of the project key + types: + type: array + items: + type: string + enum: + - NONE + - ADMIN + - DEVELOPER + default: NONE + title: 'bitmap, must only be power of 2' + title: 'the key type, determines the privilages of the key' + title: list of the projects keys + policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + geolocation_profile: + type: string + format: uint64 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + used_cu: + type: string + format: uint64 lavanet.lava.spec.ApiInterface: type: object properties: @@ -55900,15 +56712,15 @@ definitions: type: string block: type: string - format: int64 - packageIndex: + format: uint64 + plan_index: type: string - packageBlock: + plan_block: type: string - format: int64 - isYearly: + format: uint64 + is_yearly: type: boolean - expiryTime: + expiry_time: type: string format: uint64 usedCU: @@ -55933,15 +56745,15 @@ definitions: type: string block: type: string - format: int64 - packageIndex: + format: uint64 + plan_index: type: string - packageBlock: + plan_block: type: string - format: int64 - isYearly: + format: uint64 + is_yearly: type: boolean - expiryTime: + expiry_time: type: string format: uint64 usedCU: diff --git a/go.mod b/go.mod index 0ecde8db5c..b1a2999641 100644 --- a/go.mod +++ b/go.mod @@ -48,8 +48,6 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/gogo/googleapis v1.4.0 // indirect - github.com/golang/glog v1.0.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect github.com/pelletier/go-toml/v2 v2.0.5 // indirect golang.org/x/mod v0.7.0 // indirect golang.org/x/tools v0.2.0 // indirect diff --git a/go.sum b/go.sum index ab0be1ee80..b943f086a5 100644 --- a/go.sum +++ b/go.sum @@ -657,8 +657,6 @@ github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -783,8 +781,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 h1:gDLXvp5S9izjldquuoAhDzccbskOL6tDC5jMSyx3zxE= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2/go.mod h1:7pdNwVWBBHGiCxa9lAszqCJMbfTISJ7oMftp8+UGV08= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= diff --git a/x/projects/client/cli/query_show_developers_project.go b/x/projects/client/cli/query_show_developers_project.go index 1bd6bd36fb..c46c13dd03 100644 --- a/x/projects/client/cli/query_show_developers_project.go +++ b/x/projects/client/cli/query_show_developers_project.go @@ -13,9 +13,9 @@ var _ = strconv.Itoa(0) func CmdShowDevelopersProject() *cobra.Command { cmd := &cobra.Command{ - Use: "show-developers-project", + Use: "show-developers-project [developer address]", Short: "Query ShowDevelopersProject", - Args: cobra.ExactArgs(0), + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -24,7 +24,7 @@ func CmdShowDevelopersProject() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - params := &types.QueryShowDevelopersProjectRequest{} + params := &types.QueryShowDevelopersProjectRequest{Developer: args[0]} res, err := queryClient.ShowDevelopersProject(cmd.Context(), params) if err != nil { diff --git a/x/projects/client/cli/query_show_project.go b/x/projects/client/cli/query_show_project.go index 46d58799ee..6b168a1aa7 100644 --- a/x/projects/client/cli/query_show_project.go +++ b/x/projects/client/cli/query_show_project.go @@ -13,9 +13,9 @@ var _ = strconv.Itoa(0) func CmdShowProject() *cobra.Command { cmd := &cobra.Command{ - Use: "show-project", + Use: "show-project [projectID]", Short: "Query ShowProject", - Args: cobra.ExactArgs(0), + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -24,7 +24,7 @@ func CmdShowProject() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - params := &types.QueryShowProjectRequest{} + params := &types.QueryShowProjectRequest{Project: args[0]} res, err := queryClient.ShowProject(cmd.Context(), params) if err != nil { diff --git a/x/projects/client/cli/tx_add_project_keys.go b/x/projects/client/cli/tx_add_project_keys.go index e556512caf..093a24095c 100644 --- a/x/projects/client/cli/tx_add_project_keys.go +++ b/x/projects/client/cli/tx_add_project_keys.go @@ -23,8 +23,13 @@ func CmdAddProjectKeys() *cobra.Command { return err } + projectID := args[0] + + // TODO extract keys from CMD, look at stake provider msg := types.NewMsgAddProjectKeys( clientCtx.GetFromAddress().String(), + projectID, + []types.ProjectKey{}, ) if err := msg.ValidateBasic(); err != nil { return err diff --git a/x/projects/types/message_add_project_keys.go b/x/projects/types/message_add_project_keys.go index 70f9a88e45..76abfe79bd 100644 --- a/x/projects/types/message_add_project_keys.go +++ b/x/projects/types/message_add_project_keys.go @@ -9,9 +9,11 @@ const TypeMsgAddProjectKeys = "add_project_keys" var _ sdk.Msg = &MsgAddProjectKeys{} -func NewMsgAddProjectKeys(creator string) *MsgAddProjectKeys { +func NewMsgAddProjectKeys(creator string, projectID string, projectKeys []ProjectKey) *MsgAddProjectKeys { return &MsgAddProjectKeys{ - Creator: creator, + Creator: creator, + Project: projectID, + ProjectKeys: projectKeys, } }