From fd25664ea0f905bd88ecd20453ae4a48434d9ebe Mon Sep 17 00:00:00 2001 From: Milad Zahedi Date: Fri, 13 Oct 2023 14:11:25 +0330 Subject: [PATCH] pass linter --- docs/api.md | 4 ++-- x/asset/nft/client/cli/query_test.go | 1 + x/asset/nft/client/cli/tx_test.go | 2 +- x/asset/nft/types/tx.pb.go | 12 ++++++++++-- x/deterministicgas/config_test.go | 2 +- x/deterministicgas/spec/README.md | 2 ++ 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/api.md b/docs/api.md index 3a87951b6..c48574f57 100644 --- a/docs/api.md +++ b/docs/api.md @@ -2097,8 +2097,8 @@ Msg defines the Msg service. | `Unfreeze` | [MsgUnfreeze](#coreum.asset.nft.v1.MsgUnfreeze) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | Unfreeze removes the freeze effect already put on an NFT | | | `AddToWhitelist` | [MsgAddToWhitelist](#coreum.asset.nft.v1.MsgAddToWhitelist) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | AddToWhitelist sets the account as whitelisted to hold the NFT | | | `RemoveFromWhitelist` | [MsgRemoveFromWhitelist](#coreum.asset.nft.v1.MsgRemoveFromWhitelist) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | RemoveFromWhitelist removes an account from whitelisted list of the NFT | | -| `AddToClassWhitelist` | [MsgAddToClassWhitelist](#coreum.asset.nft.v1.MsgAddToClassWhitelist) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | AddToClassWhitelist adds account as whitelist for all the NFTs in the class | | -| `RemoveFromClassWhitelist` | [MsgRemoveFromClassWhitelist](#coreum.asset.nft.v1.MsgRemoveFromClassWhitelist) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | RemoveFromClassWhitelist removes account as whitelist for the entire class NOTE: if specific whitelist is granted for an NFT, that whitelist will still be valid. | | +| `AddToClassWhitelist` | [MsgAddToClassWhitelist](#coreum.asset.nft.v1.MsgAddToClassWhitelist) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | AddToClassWhitelist adds account as whitelist for all the NFTs in the class NOTE: class whitelist does not affect the individual nft whitelisting. | | +| `RemoveFromClassWhitelist` | [MsgRemoveFromClassWhitelist](#coreum.asset.nft.v1.MsgRemoveFromClassWhitelist) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | RemoveFromClassWhitelist removes account as whitelist for the entire class NOTE: class whitelist does not affect the individual nft whitelisting. ie. if specific whitelist is granted for an NFT, that whitelist will still be valid, ater we add and remove it from the class whitelist. | | | `UpdateParams` | [MsgUpdateParams](#coreum.asset.nft.v1.MsgUpdateParams) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | UpdateParams is a governance operation that sets the parameters of the module. NOTE: all parameters must be provided. | | diff --git a/x/asset/nft/client/cli/query_test.go b/x/asset/nft/client/cli/query_test.go index 9a0bd6c42..2e96616c2 100644 --- a/x/asset/nft/client/cli/query_test.go +++ b/x/asset/nft/client/cli/query_test.go @@ -150,6 +150,7 @@ func mint( requireT.NoError(err) } +//nolint:unparam // we don't want to use constants for helpers func issueClass( requireT *require.Assertions, ctx client.Context, diff --git a/x/asset/nft/client/cli/tx_test.go b/x/asset/nft/client/cli/tx_test.go index 508d2c303..235f5079e 100644 --- a/x/asset/nft/client/cli/tx_test.go +++ b/x/asset/nft/client/cli/tx_test.go @@ -184,7 +184,7 @@ func TestCmdClassWhitelist(t *testing.T) { types.ClassFeature_whitelisting, ) // mint nft - nftID := "nft-1" + nftID := "nft" mint( requireT, ctx, diff --git a/x/asset/nft/types/tx.pb.go b/x/asset/nft/types/tx.pb.go index 3f7ceb9de..ce0e79e63 100644 --- a/x/asset/nft/types/tx.pb.go +++ b/x/asset/nft/types/tx.pb.go @@ -577,9 +577,13 @@ type MsgClient interface { // RemoveFromWhitelist removes an account from whitelisted list of the NFT RemoveFromWhitelist(ctx context.Context, in *MsgRemoveFromWhitelist, opts ...grpc.CallOption) (*EmptyResponse, error) // AddToClassWhitelist adds account as whitelist for all the NFTs in the class + // NOTE: class whitelist does not affect the individual nft whitelisting. AddToClassWhitelist(ctx context.Context, in *MsgAddToClassWhitelist, opts ...grpc.CallOption) (*EmptyResponse, error) // RemoveFromClassWhitelist removes account as whitelist for the entire class - // NOTE: if specific whitelist is granted for an NFT, that whitelist will still be valid. + // NOTE: + // class whitelist does not affect the individual nft whitelisting. + // ie. if specific whitelist is granted for an NFT, that whitelist will + // still be valid, ater we add and remove it from the class whitelist. RemoveFromClassWhitelist(ctx context.Context, in *MsgRemoveFromClassWhitelist, opts ...grpc.CallOption) (*EmptyResponse, error) // UpdateParams is a governance operation that sets the parameters of the module. // NOTE: all parameters must be provided. @@ -701,9 +705,13 @@ type MsgServer interface { // RemoveFromWhitelist removes an account from whitelisted list of the NFT RemoveFromWhitelist(context.Context, *MsgRemoveFromWhitelist) (*EmptyResponse, error) // AddToClassWhitelist adds account as whitelist for all the NFTs in the class + // NOTE: class whitelist does not affect the individual nft whitelisting. AddToClassWhitelist(context.Context, *MsgAddToClassWhitelist) (*EmptyResponse, error) // RemoveFromClassWhitelist removes account as whitelist for the entire class - // NOTE: if specific whitelist is granted for an NFT, that whitelist will still be valid. + // NOTE: + // class whitelist does not affect the individual nft whitelisting. + // ie. if specific whitelist is granted for an NFT, that whitelist will + // still be valid, ater we add and remove it from the class whitelist. RemoveFromClassWhitelist(context.Context, *MsgRemoveFromClassWhitelist) (*EmptyResponse, error) // UpdateParams is a governance operation that sets the parameters of the module. // NOTE: all parameters must be provided. diff --git a/x/deterministicgas/config_test.go b/x/deterministicgas/config_test.go index 488b7c575..9eb249113 100644 --- a/x/deterministicgas/config_test.go +++ b/x/deterministicgas/config_test.go @@ -191,7 +191,7 @@ func TestDeterministicGas_DeterministicMessages(t *testing.T) { // we assert length to be equal to exact number, so each change requires // explicit adjustment of tests. assert.Equal(t, 60, len(nondeterministicMsgs)) - assert.Equal(t, 46, len(deterministicMsgs)) + assert.Equal(t, 48, len(deterministicMsgs)) for _, sdkMsg := range deterministicMsgs { sdkMsg := sdkMsg diff --git a/x/deterministicgas/spec/README.md b/x/deterministicgas/spec/README.md index eb7bf7d18..155f7e24e 100644 --- a/x/deterministicgas/spec/README.md +++ b/x/deterministicgas/spec/README.md @@ -81,11 +81,13 @@ TotalGas = 65000 + 2 * 70000 + 2 * 1000 + max(0, 2050-2048) * 10 | `/coreum.asset.ft.v1.MsgSetWhitelistedLimit` | 9000 | | `/coreum.asset.ft.v1.MsgUnfreeze` | 8500 | | `/coreum.asset.ft.v1.MsgUpgradeTokenV1` | 25000 | +| `/coreum.asset.nft.v1.MsgAddToClassWhitelist` | 7000 | | `/coreum.asset.nft.v1.MsgAddToWhitelist` | 7000 | | `/coreum.asset.nft.v1.MsgBurn` | 26000 | | `/coreum.asset.nft.v1.MsgFreeze` | 8000 | | `/coreum.asset.nft.v1.MsgIssueClass` | 16000 | | `/coreum.asset.nft.v1.MsgMint` | 39000 | +| `/coreum.asset.nft.v1.MsgRemoveFromClassWhitelist` | 3500 | | `/coreum.asset.nft.v1.MsgRemoveFromWhitelist` | 3500 | | `/coreum.asset.nft.v1.MsgUnfreeze` | 5000 | | `/coreum.nft.v1beta1.MsgSend` | 25000 |