diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a78aa2c7..90debb028 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,19 @@ # Changelog +## v1.2.0 +This release introduces the Manchurian upgrade to the testnet. + +Features: +* [#525](https://github.com/bnb-chain/greenfield/pull/525) feat: introduce the Eddystone upgrade +* [#526](https://github.com/bnb-chain/greenfield/pull/526) feat: add new msg MsgSetTag + +Chore: +* [#527](https://github.com/bnb-chain/greenfield/pull/527) chore: cleanup legacy annotation +* [#535](https://github.com/bnb-chain/greenfield/pull/535) chore: update fields of EventSetTag +* [#536](https://github.com/bnb-chain/greenfield/pull/536) chore: change max length limit of resource tags key value + +Bugfixes: +* [#532](https://github.com/bnb-chain/greenfield/pull/532) fix: restrict on creating GVG and allow empty family +* [#522](https://github.com/bnb-chain/greenfield/pull/522) fix: bucket status causing event emitted ## v1.1.1 This release introduces the Pampas upgrade to the mainnet. diff --git a/app/ante/ante_test.go b/app/ante/ante_test.go index 410e6d84b..26e06964c 100644 --- a/app/ante/ante_test.go +++ b/app/ante/ante_test.go @@ -112,6 +112,15 @@ func (suite *AnteTestSuite) TestAnteHandler() { return txBuilder.GetTx() }, true, false, true, }, + { + "success - DeliverTx EIP712 signed Cosmos Tx MsgCreateBucket", + func() sdk.Tx { + gas := uint64(16e3) + fee := sdk.NewCoins(sdk.NewCoin(test.TEST_TOKEN_NAME, sdk.NewIntFromUint64(gas))) + txBuilder := suite.CreateTestEIP712TxBuilderMsgCreateBucket(addr, privKey, test.TEST_CHAIN_ID, gas, fee) + return txBuilder.GetTx() + }, true, false, true, + }, { "fails - DeliverTx legacy msg MsgSubmitProposal v1beta", func() sdk.Tx { diff --git a/app/ante/utils_test.go b/app/ante/utils_test.go index aa309b1cb..7c7632432 100644 --- a/app/ante/utils_test.go +++ b/app/ante/utils_test.go @@ -38,6 +38,8 @@ import ( "github.com/bnb-chain/greenfield/sdk/keys" "github.com/bnb-chain/greenfield/testutil" "github.com/bnb-chain/greenfield/testutil/sample" + "github.com/bnb-chain/greenfield/types/common" + storagetypes "github.com/bnb-chain/greenfield/x/storage/types" ) type AnteTestSuite struct { @@ -205,6 +207,23 @@ func (suite *AnteTestSuite) CreateTestEIP712TxBuilderMsgGrant(from sdk.AccAddres return suite.CreateTestEIP712CosmosTxBuilder(from, priv, chainId, gas, gasAmount, msgGrant) } +func (suite *AnteTestSuite) CreateTestEIP712TxBuilderMsgCreateBucket(from sdk.AccAddress, priv keys.KeyManager, chainId string, gas uint64, gasAmount sdk.Coins) client.TxBuilder { + msgCreateBucket := &storagetypes.MsgCreateBucket{ + Creator: from.String(), + BucketName: "test", + Visibility: 0, + PaymentAddress: from.String(), + PrimarySpAddress: from.String(), + PrimarySpApproval: &common.Approval{ + ExpiredHeight: 1, + GlobalVirtualGroupFamilyId: 1, + Sig: []byte("test"), + }, + ChargedReadQuota: 0, + } + return suite.CreateTestEIP712CosmosTxBuilder(from, priv, chainId, gas, gasAmount, msgCreateBucket) +} + func (suite *AnteTestSuite) CreateTestEIP712CosmosTxBuilder( from sdk.AccAddress, priv keys.KeyManager, chainId string, gas uint64, gasAmount sdk.Coins, msg sdk.Msg, ) client.TxBuilder { diff --git a/app/upgrade.go b/app/upgrade.go index 48185de08..eec456885 100644 --- a/app/upgrade.go +++ b/app/upgrade.go @@ -4,6 +4,7 @@ import ( serverconfig "github.com/cosmos/cosmos-sdk/server/config" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + gashubtypes "github.com/cosmos/cosmos-sdk/x/gashub/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" bridgemoduletypes "github.com/bnb-chain/greenfield/x/bridge/types" @@ -22,6 +23,7 @@ func (app *App) RegisterUpgradeHandlers(chainID string, serverCfg *serverconfig. // Register the upgrade handlers here app.registerNagquUpgradeHandler() app.registerPampasUpgradeHandler() + app.registerManchurianUpgradeHandler() // app.register...() // ... return nil @@ -104,3 +106,25 @@ func (app *App) registerPampasUpgradeHandler() { return nil }) } + +func (app *App) registerManchurianUpgradeHandler() { + // Register the upgrade handler + app.UpgradeKeeper.SetUpgradeHandler(upgradetypes.Manchurian, + func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + app.Logger().Info("upgrade to ", plan.Name) + + typeUrl := sdk.MsgTypeURL(&storagemoduletypes.MsgSetTag{}) + msgSetTagGasParams := gashubtypes.NewMsgGasParamsWithFixedGas(typeUrl, 1.2e3) + app.GashubKeeper.SetMsgGasParams(ctx, *msgSetTagGasParams) + + return app.mm.RunMigrations(ctx, app.configurator, fromVM) + }) + + // Register the upgrade initializer + app.UpgradeKeeper.SetUpgradeInitializer(upgradetypes.Manchurian, + func() error { + app.Logger().Info("Init Manchurian upgrade") + + return nil + }) +} diff --git a/cmd/gnfd/cmd/root.go b/cmd/gnfd/cmd/root.go index 91b59bb15..0b864b42a 100644 --- a/cmd/gnfd/cmd/root.go +++ b/cmd/gnfd/cmd/root.go @@ -45,7 +45,7 @@ import ( ) var ( - appConfig *app.AppConfig = app.NewDefaultAppConfig() + appConfig = app.NewDefaultAppConfig() ) // NewRootCmd creates a new root command for a Cosmos SDK application @@ -64,7 +64,7 @@ func NewRootCmd() (*cobra.Command, appparams.EncodingConfig) { rootCmd := &cobra.Command{ Use: app.ShortName, - Short: "Stargate CosmosHub App", + Short: "Greenfield Daemon(server)", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { // set the default command outputs cmd.SetOut(cmd.OutOrStdout()) @@ -181,7 +181,6 @@ func initRootCmd( tmcli.NewCompletionCmd(rootCmd, true), debug.Cmd(), config.Cmd(), - // this line is used by starport scaffolding # root/commands ) a := appCreator{ @@ -287,7 +286,6 @@ func txCommand() *cobra.Command { func addModuleInitFlags(startCmd *cobra.Command) { crisis.AddModuleInitFlags(startCmd) - // this line is used by starport scaffolding # root/arguments } func overwriteFlagDefaults(c *cobra.Command, defaults map[string]string) { diff --git a/deployment/localup/localup.sh b/deployment/localup/localup.sh index 1acf7890b..80b82686d 100644 --- a/deployment/localup/localup.sh +++ b/deployment/localup/localup.sh @@ -173,6 +173,7 @@ function generate_genesis() { sed -i -e "s/log_level = \"info\"/\log_level= \"debug\"/g" ${workspace}/.local/validator${i}/config/config.toml echo -e '[[upgrade]]\nname = "Nagqu"\nheight = 20\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml echo -e '[[upgrade]]\nname = "Pampas"\nheight = 20\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml + echo -e '[[upgrade]]\nname = "Manchurian"\nheight = 20\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml done # enable swagger API for validator0 diff --git a/e2e/tests/storage_test.go b/e2e/tests/storage_test.go index 9e4bff8c8..f9d90d6ec 100644 --- a/e2e/tests/storage_test.go +++ b/e2e/tests/storage_test.go @@ -27,6 +27,7 @@ import ( "github.com/bnb-chain/greenfield/sdk/keys" "github.com/bnb-chain/greenfield/sdk/types" storageutils "github.com/bnb-chain/greenfield/testutil/storage" + types2 "github.com/bnb-chain/greenfield/types" sptypes "github.com/bnb-chain/greenfield/x/sp/types" storagetypes "github.com/bnb-chain/greenfield/x/storage/types" ) @@ -2073,3 +2074,37 @@ func (s *StorageTestSuite) TestMaintenanceSPCreateBucketAndObject() { // s.Require().Error(err) // s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketStatus, storagetypes.BUCKET_STATUS_CREATED) //} + +func (s *StorageTestSuite) TestSetTag() { + var err error + user := s.GenAndChargeAccounts(1, 1000000) + + // CreateBucket + sp := s.BaseSuite.PickStorageProvider() + gvg, found := sp.GetFirstGlobalVirtualGroup() + s.Require().True(found) + + bucketName := storageutils.GenRandomBucketName() + msgCreateBucket := storagetypes.NewMsgCreateBucket( + user[0].GetAddr(), bucketName, storagetypes.VISIBILITY_TYPE_PUBLIC_READ, sp.OperatorKey.GetAddr(), + nil, math.MaxUint, nil, 0) + msgCreateBucket.PrimarySpApproval.GlobalVirtualGroupFamilyId = gvg.FamilyId + msgCreateBucket.PrimarySpApproval.Sig, err = sp.ApprovalKey.Sign(msgCreateBucket.GetApprovalBytes()) + s.Require().NoError(err) + s.SendTxBlock(user[0], msgCreateBucket) + + // Set tag + grn := types2.NewBucketGRN(bucketName) + var tags storagetypes.ResourceTags + tags.Tags = append(tags.Tags, storagetypes.ResourceTags_Tag{Key: "key1", Value: "value1"}) + msgSetTag := storagetypes.NewMsgSetTag(user[0].GetAddr(), grn.String(), &tags) + s.SendTxBlock(user[0], msgSetTag) + + // Query + req := storagetypes.QueryHeadBucketRequest{ + BucketName: bucketName, + } + resp, err := s.Client.HeadBucket(context.Background(), &req) + s.Require().NoError(err) + s.Require().Equal(tags, *resp.BucketInfo.Tags) +} diff --git a/e2e/tests/virtualgroup_test.go b/e2e/tests/virtualgroup_test.go index c344ecfad..9e6bba771 100644 --- a/e2e/tests/virtualgroup_test.go +++ b/e2e/tests/virtualgroup_test.go @@ -42,6 +42,19 @@ func TestVirtualGroupTestSuite(t *testing.T) { suite.Run(t, new(VirtualGroupTestSuite)) } +func (s *VirtualGroupTestSuite) getSecondarySPIDs(primarySPID uint32) []uint32 { + var secondarySPIDs []uint32 + for _, ssp := range s.StorageProviders { + if ssp.Info.Id != primarySPID { + secondarySPIDs = append(secondarySPIDs, ssp.Info.Id) + } + if len(secondarySPIDs) == 6 { + break + } + } + return secondarySPIDs +} + func (s *VirtualGroupTestSuite) queryGlobalVirtualGroup(gvgID uint32) *virtualgroupmoduletypes.GlobalVirtualGroup { resp, err := s.Client.GlobalVirtualGroup( context.Background(), @@ -50,7 +63,7 @@ func (s *VirtualGroupTestSuite) queryGlobalVirtualGroup(gvgID uint32) *virtualgr return resp.GlobalVirtualGroup } -func (s *VirtualGroupTestSuite) queryGlobalVirtualGroupByFamily(familyID uint32) []*virtualgroupmoduletypes.GlobalVirtualGroup { +func (s *VirtualGroupTestSuite) queryGlobalVirtualGroupsByFamily(familyID uint32) []*virtualgroupmoduletypes.GlobalVirtualGroup { s.T().Logf("familyID: %d", familyID) resp, err := s.Client.GlobalVirtualGroupByFamilyID( context.Background(), @@ -93,17 +106,12 @@ func (s *VirtualGroupTestSuite) TestBasic() { availableGvgFamilyIds := s.queryAvailableGlobalVirtualGroupFamilies([]uint32{gvg.FamilyId}) s.Require().Equal(availableGvgFamilyIds[0], gvg.FamilyId) - srcGVGs := s.queryGlobalVirtualGroupByFamily(gvg.FamilyId) + srcGVGs := s.queryGlobalVirtualGroupsByFamily(gvg.FamilyId) - var secondarySPIDs []uint32 - for _, ssp := range s.StorageProviders { - if ssp.Info.Id != primarySP.Info.Id { - secondarySPIDs = append(secondarySPIDs, ssp.Info.Id) - } - } + secondarySPIDs := s.getSecondarySPIDs(primarySP.Info.Id) s.BaseSuite.CreateGlobalVirtualGroup(primarySP, gvg.FamilyId, secondarySPIDs, 1) - gvgs = s.queryGlobalVirtualGroupByFamily(gvg.FamilyId) + gvgs = s.queryGlobalVirtualGroupsByFamily(gvg.FamilyId) s.Require().Equal(len(gvgs), len(srcGVGs)+1) oldGVGIDs := make(map[uint32]bool) @@ -159,7 +167,7 @@ func (s *VirtualGroupTestSuite) TestBasic() { } s.SendTxBlock(primarySP.OperatorKey, &msgDeleteGVG) - newGVGs := s.queryGlobalVirtualGroupByFamily(newGVG.FamilyId) + newGVGs := s.queryGlobalVirtualGroupsByFamily(newGVG.FamilyId) for _, gvg := range newGVGs { if gvg.Id == newGVG.Id { @@ -203,6 +211,26 @@ func (s *VirtualGroupTestSuite) TestBasic() { } s.SendTxBlockWithExpectErrorString(&msgCreateGVG, primarySP.OperatorKey, virtualgroupmoduletypes.ErrDuplicateSecondarySP.Error()) + // test create a duplicated GVG in a family + secondarySPIDs = s.getSecondarySPIDs(primarySP.Info.Id) + gvgID, familyID := s.BaseSuite.CreateGlobalVirtualGroup(primarySP, 0, secondarySPIDs, 1) + gvgResp, err := s.Client.VirtualGroupQueryClient.GlobalVirtualGroup(context.Background(), &virtualgroupmoduletypes.QueryGlobalVirtualGroupRequest{ + GlobalVirtualGroupId: gvgID, + }) + s.Require().NoError(err) + s.Require().Equal(secondarySPIDs, gvgResp.GlobalVirtualGroup.SecondarySpIds) + s.Require().Equal(familyID, gvgResp.GlobalVirtualGroup.FamilyId) + + msgCreateGVG = virtualgroupmoduletypes.MsgCreateGlobalVirtualGroup{ + StorageProvider: primarySP.OperatorKey.GetAddr().String(), + FamilyId: familyID, + SecondarySpIds: secondarySPIDs, + Deposit: sdk.Coin{ + Denom: s.Config.Denom, + Amount: types.NewIntFromInt64WithDecimal(1, types.DecimalBNB), + }, + } + s.SendTxBlockWithExpectErrorString(&msgCreateGVG, primarySP.OperatorKey, virtualgroupmoduletypes.ErrDuplicateGVG.Error()) } func (s *VirtualGroupTestSuite) TestSettle() { @@ -679,3 +707,58 @@ CheckProposalStatus: s.T().Errorf("update params failed") } } + +func (s *VirtualGroupTestSuite) TestEmptyGlobalVirtualGroupFamily() { + primarySP := s.BaseSuite.PickStorageProvider() + user := s.GenAndChargeAccounts(1, 1000000)[0] + + secondarySPIDs := s.getSecondarySPIDs(primarySP.Info.Id) + + // The Sp creates a family which has 1 GVG. + gvgID, familyID := s.BaseSuite.CreateGlobalVirtualGroup(primarySP, 0, secondarySPIDs, 1) + gvgs := s.queryGlobalVirtualGroupsByFamily(familyID) + s.Require().Equal(1, len(gvgs)) + + // a User creates an object served by this GVG + bucketName := storagetestutil.GenRandomBucketName() + objectName := storagetestutil.GenRandomObjectName() + s.BaseSuite.CreateObject(user, primarySP, gvgID, bucketName, objectName) + + // The User deletes the object + s.SendTxBlock(user, storagetypes.NewMsgDeleteObject(user.GetAddr(), bucketName, objectName)) + + // object isn't found onchain + _, err := s.Client.HeadObject(context.Background(), &storagetypes.QueryHeadObjectRequest{ + BucketName: bucketName, + ObjectName: objectName, + }) + s.Require().Error(err) + + // The SP deletes the GVG + msgDeleteGVG := virtualgroupmoduletypes.MsgDeleteGlobalVirtualGroup{ + StorageProvider: primarySP.OperatorKey.GetAddr().String(), + GlobalVirtualGroupId: gvgID, + } + s.SendTxBlock(primarySP.OperatorKey, &msgDeleteGVG) + _, err = s.Client.GlobalVirtualGroup(context.Background(), &virtualgroupmoduletypes.QueryGlobalVirtualGroupRequest{GlobalVirtualGroupId: gvgID}) + s.Require().Error(err) + + // The bucket onchain still shows the family info, and the family is indeed exist + bucket, err := s.Client.HeadBucket(context.Background(), &storagetypes.QueryHeadBucketRequest{ + BucketName: bucketName, + }) + s.Require().NoError(err) + s.Require().Equal(familyID, bucket.BucketInfo.GlobalVirtualGroupFamilyId) + + family, err := s.Client.GlobalVirtualGroupFamily(context.Background(), &virtualgroupmoduletypes.QueryGlobalVirtualGroupFamilyRequest{ + FamilyId: bucket.BucketInfo.GlobalVirtualGroupFamilyId, + }) + s.Require().NoError(err) + s.Require().Equal(0, len(family.GlobalVirtualGroupFamily.GlobalVirtualGroupIds)) + + //the SP can create new GVG on this empty family + newGVGID, _ := s.BaseSuite.CreateGlobalVirtualGroup(primarySP, familyID, secondarySPIDs, 1) + gvgs = s.queryGlobalVirtualGroupsByFamily(familyID) + s.Require().Equal(1, len(gvgs)) + s.Require().Equal(gvgs[0].Id, newGVGID) +} diff --git a/go.mod b/go.mod index 944b0d825..04aa1cbb4 100644 --- a/go.mod +++ b/go.mod @@ -180,7 +180,7 @@ replace ( github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.1.0 github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.1.1 + github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.2.0 github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/wercker/journalhook => github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117 diff --git a/go.sum b/go.sum index 810dc1072..687b15ca5 100644 --- a/go.sum +++ b/go.sum @@ -163,8 +163,8 @@ github.com/bnb-chain/greenfield-cometbft v1.1.0 h1:jqnkDWIZW6f/rUn5/pE26YZMT9xzp github.com/bnb-chain/greenfield-cometbft v1.1.0/go.mod h1:NZ2/ZJK2HYe3++0CsPiw4LTG6UrC6pH7fQ3VOz6pqJw= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1/go.mod h1:ey1CiK4bYo1RBNJLRiVbYr5CMdSxci9S/AZRINLtppI= -github.com/bnb-chain/greenfield-cosmos-sdk v1.1.1 h1:wAg2caLOe2hjQVKZVWv5+tDwPox8irme82Eomc220oY= -github.com/bnb-chain/greenfield-cosmos-sdk v1.1.1/go.mod h1:Yrvq+J1Lsm7OHFX+M/AZWBTGt1TRHUTC4VYOMlvW3fs= +github.com/bnb-chain/greenfield-cosmos-sdk v1.2.0 h1:oxwxEiwF+Dani7vr9//nybjrTNLfk2rnO7PjpWSNrNI= +github.com/bnb-chain/greenfield-cosmos-sdk v1.2.0/go.mod h1:Yrvq+J1Lsm7OHFX+M/AZWBTGt1TRHUTC4VYOMlvW3fs= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210 h1:GHPbV2bC+gmuO6/sG0Tm8oGal3KKSRlyE+zPscDjlA8= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210/go.mod h1:vhsZxXE9tYJeYB5JR4hPhd6Pc/uPf7j1T8IJ7p9FdeM= github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210 h1:FLVOn4+OVbsKi2+YJX5kmD27/4dRu4FW7xCXFhzDO5s= diff --git a/proto/greenfield/bridge/event.proto b/proto/greenfield/bridge/event.proto index e6031cab0..3bfa11a88 100644 --- a/proto/greenfield/bridge/event.proto +++ b/proto/greenfield/bridge/event.proto @@ -4,8 +4,6 @@ package greenfield.bridge; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -// this line is used by starport scaffolding # proto/tx/import - option go_package = "github.com/bnb-chain/greenfield/x/bridge/types"; enum RefundReason { diff --git a/proto/greenfield/bridge/genesis.proto b/proto/greenfield/bridge/genesis.proto index fea7f4072..113bc849b 100644 --- a/proto/greenfield/bridge/genesis.proto +++ b/proto/greenfield/bridge/genesis.proto @@ -6,11 +6,8 @@ import "greenfield/bridge/params.proto"; option go_package = "github.com/bnb-chain/greenfield/x/bridge/types"; -// this line is used by starport scaffolding # genesis/proto/import - // GenesisState defines the bridge module's genesis state. message GenesisState { // Params defines all the paramaters of the module. Params params = 1 [(gogoproto.nullable) = false]; - // this line is used by starport scaffolding # genesis/proto/state } diff --git a/proto/greenfield/bridge/query.proto b/proto/greenfield/bridge/query.proto index 461ea5694..3be687f2f 100644 --- a/proto/greenfield/bridge/query.proto +++ b/proto/greenfield/bridge/query.proto @@ -5,7 +5,6 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "greenfield/bridge/params.proto"; -// this line is used by starport scaffolding # 1 option go_package = "github.com/bnb-chain/greenfield/x/bridge/types"; @@ -15,7 +14,6 @@ service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/greenfield/bridge/params"; } - // this line is used by starport scaffolding # 2 } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -26,5 +24,3 @@ message QueryParamsResponse { // params holds all the parameters of this module. Params params = 1 [(gogoproto.nullable) = false]; } - -// this line is used by starport scaffolding # 3 diff --git a/proto/greenfield/bridge/tx.proto b/proto/greenfield/bridge/tx.proto index 6e1693a2f..aa06787e2 100644 --- a/proto/greenfield/bridge/tx.proto +++ b/proto/greenfield/bridge/tx.proto @@ -7,8 +7,6 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "greenfield/bridge/params.proto"; -// this line is used by starport scaffolding # proto/tx/import - option go_package = "github.com/bnb-chain/greenfield/x/bridge/types"; // Msg defines the Msg service. @@ -20,7 +18,6 @@ service Msg { // // Since: cosmos-sdk 0.47 rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // this line is used by starport scaffolding # proto/tx/rpc } // MsgTransferOut is the Msg/TransferOut request type. @@ -54,5 +51,3 @@ message MsgUpdateParams { // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. message MsgUpdateParamsResponse {} - -// this line is used by starport scaffolding # proto/tx/message diff --git a/proto/greenfield/challenge/genesis.proto b/proto/greenfield/challenge/genesis.proto index fe7dfcdb3..e792df18f 100644 --- a/proto/greenfield/challenge/genesis.proto +++ b/proto/greenfield/challenge/genesis.proto @@ -4,12 +4,10 @@ package greenfield.challenge; import "gogoproto/gogo.proto"; import "greenfield/challenge/params.proto"; import "greenfield/challenge/types.proto"; -// this line is used by starport scaffolding # genesis/proto/import option go_package = "github.com/bnb-chain/greenfield/x/challenge/types"; // GenesisState defines the challenge module's genesis state. message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; - // this line is used by starport scaffolding # genesis/proto/state } diff --git a/proto/greenfield/challenge/query.proto b/proto/greenfield/challenge/query.proto index 45c93c2e0..6c01831e3 100644 --- a/proto/greenfield/challenge/query.proto +++ b/proto/greenfield/challenge/query.proto @@ -9,8 +9,6 @@ import "google/api/annotations.proto"; import "greenfield/challenge/params.proto"; import "greenfield/challenge/types.proto"; -// this line is used by starport scaffolding # 1 - option go_package = "github.com/bnb-chain/greenfield/x/challenge/types"; // Query defines the gRPC querier service. @@ -31,8 +29,6 @@ service Query { rpc InturnAttestationSubmitter(QueryInturnAttestationSubmitterRequest) returns (QueryInturnAttestationSubmitterResponse) { option (google.api.http).get = "/greenfield/challenge/inturn_attestation_submitter"; } - - // this line is used by starport scaffolding # 2 } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -77,5 +73,3 @@ message SubmitInterval { uint64 start = 1; uint64 end = 2; } - -// this line is used by starport scaffolding # 3 diff --git a/proto/greenfield/challenge/tx.proto b/proto/greenfield/challenge/tx.proto index 8de2e95ae..a1f9cd14d 100644 --- a/proto/greenfield/challenge/tx.proto +++ b/proto/greenfield/challenge/tx.proto @@ -7,8 +7,6 @@ import "gogoproto/gogo.proto"; import "greenfield/challenge/params.proto"; import "greenfield/challenge/types.proto"; -// this line is used by starport scaffolding # proto/tx/import - option go_package = "github.com/bnb-chain/greenfield/x/challenge/types"; // Msg defines the Msg service. @@ -21,7 +19,6 @@ service Msg { // // Since: cosmos-sdk 0.47 rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // this line is used by starport scaffolding # proto/tx/rpc } // MsgSubmit defines the message for submitting challenges. @@ -103,4 +100,3 @@ message MsgUpdateParams { // MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message. message MsgUpdateParamsResponse {} -// this line is used by starport scaffolding # proto/tx/message diff --git a/proto/greenfield/payment/genesis.proto b/proto/greenfield/payment/genesis.proto index 0d97ff21f..7963602bd 100644 --- a/proto/greenfield/payment/genesis.proto +++ b/proto/greenfield/payment/genesis.proto @@ -9,8 +9,6 @@ import "greenfield/payment/payment_account.proto"; import "greenfield/payment/payment_account_count.proto"; import "greenfield/payment/stream_record.proto"; -// this line is used by starport scaffolding # genesis/proto/import - option go_package = "github.com/bnb-chain/greenfield/x/payment/types"; // GenesisState defines the payment module's genesis state. @@ -20,5 +18,4 @@ message GenesisState { repeated PaymentAccountCount payment_account_count_list = 3 [(gogoproto.nullable) = false]; repeated PaymentAccount payment_account_list = 4 [(gogoproto.nullable) = false]; repeated AutoSettleRecord auto_settle_record_list = 5 [(gogoproto.nullable) = false]; - // this line is used by starport scaffolding # genesis/proto/state } diff --git a/proto/greenfield/payment/query.proto b/proto/greenfield/payment/query.proto index c19b6f85d..befcf2604 100644 --- a/proto/greenfield/payment/query.proto +++ b/proto/greenfield/payment/query.proto @@ -14,8 +14,6 @@ import "greenfield/payment/payment_account.proto"; import "greenfield/payment/payment_account_count.proto"; import "greenfield/payment/stream_record.proto"; -// this line is used by starport scaffolding # 1 - option go_package = "github.com/bnb-chain/greenfield/x/payment/types"; // Query defines the gRPC querier service. diff --git a/proto/greenfield/payment/tx.proto b/proto/greenfield/payment/tx.proto index 14f51a6a2..b87ece6f1 100644 --- a/proto/greenfield/payment/tx.proto +++ b/proto/greenfield/payment/tx.proto @@ -7,8 +7,6 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "greenfield/payment/params.proto"; -// this line is used by starport scaffolding # proto/tx/import - option go_package = "github.com/bnb-chain/greenfield/x/payment/types"; // Msg defines the Msg service. diff --git a/proto/greenfield/permission/tx.proto b/proto/greenfield/permission/tx.proto index 45aefc9e1..01ddbd7a9 100644 --- a/proto/greenfield/permission/tx.proto +++ b/proto/greenfield/permission/tx.proto @@ -17,8 +17,6 @@ service Msg { // // Since: cosmos-sdk 0.47 rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - - // this line is used by starport scaffolding # proto/tx/rpc } // MsgUpdateParams is the Msg/UpdateParams request type. diff --git a/proto/greenfield/sp/genesis.proto b/proto/greenfield/sp/genesis.proto index 683780dc5..c5ca957ec 100644 --- a/proto/greenfield/sp/genesis.proto +++ b/proto/greenfield/sp/genesis.proto @@ -4,7 +4,6 @@ package greenfield.sp; import "gogoproto/gogo.proto"; import "greenfield/sp/params.proto"; import "greenfield/sp/types.proto"; -// this line is used by starport scaffolding # genesis/proto/import option go_package = "github.com/bnb-chain/greenfield/x/sp/types"; diff --git a/proto/greenfield/sp/query.proto b/proto/greenfield/sp/query.proto index e9d4b331f..5a9328fe8 100644 --- a/proto/greenfield/sp/query.proto +++ b/proto/greenfield/sp/query.proto @@ -9,7 +9,6 @@ import "google/api/annotations.proto"; import "greenfield/sp/params.proto"; import "greenfield/sp/types.proto"; -// this line is used by starport scaffolding # 1 option go_package = "github.com/bnb-chain/greenfield/x/sp/types"; // Query defines the gRPC querier service. @@ -19,8 +18,6 @@ service Query { option (google.api.http).get = "/greenfield/sp/params"; } - // this line is used by starport scaffolding # 2 - // Queries a list of GetStorageProviders items. rpc StorageProviders(QueryStorageProvidersRequest) returns (QueryStorageProvidersResponse) { option (google.api.http).get = "/greenfield/storage_providers"; @@ -61,7 +58,6 @@ message QueryParamsResponse { Params params = 1 [(gogoproto.nullable) = false]; } -// this line is used by starport scaffolding # 3 message QueryStorageProvidersRequest { // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 1; diff --git a/proto/greenfield/sp/tx.proto b/proto/greenfield/sp/tx.proto index de3b36096..162e2480c 100644 --- a/proto/greenfield/sp/tx.proto +++ b/proto/greenfield/sp/tx.proto @@ -8,8 +8,6 @@ import "gogoproto/gogo.proto"; import "greenfield/sp/params.proto"; import "greenfield/sp/types.proto"; -// this line is used by starport scaffolding # proto/tx/import - option go_package = "github.com/bnb-chain/greenfield/x/sp/types"; // Msg defines the Msg service for creating a new storage provider. @@ -26,7 +24,6 @@ service Msg { // // Since: cosmos-sdk 0.47 rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // this line is used by starport scaffolding # proto/tx/rpc } // MsgCreateStorageProvider defines message for creating a new storage provider. diff --git a/proto/greenfield/storage/events.proto b/proto/greenfield/storage/events.proto index d3dde1f82..51f2269a7 100644 --- a/proto/greenfield/storage/events.proto +++ b/proto/greenfield/storage/events.proto @@ -4,6 +4,7 @@ package greenfield.storage; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; +import "greenfield/resource/types.proto"; import "greenfield/storage/common.proto"; import "greenfield/storage/types.proto"; @@ -37,6 +38,8 @@ message EventCreateBucket { uint32 global_virtual_group_family_id = 10; // status define the status of the bucket. BucketStatus status = 11; + // tags define the tag of the bucket + ResourceTags tags = 12; } // EventDeleteBucket is emitted on MsgDeleteBucket @@ -137,6 +140,8 @@ message EventCreateObject { repeated bytes checksums = 16; // local_virtual_group_id defines the unique id of lvg which the object stored uint32 local_virtual_group_id = 17; + // tags define the tag of the object + ResourceTags tags = 18; } // EventCancelCreateObject is emitted on MsgCancelCreateObject @@ -291,6 +296,8 @@ message EventCreateGroup { SourceType source_type = 4; // extra defines extra info for the group string extra = 5; + // tags define the tag of the group + ResourceTags tags = 6; } // EventDeleteGroup is emitted on MsgDeleteGroup @@ -553,3 +560,10 @@ message EventCompleteMigrationBucket { // The src_primary_sp_id defines the primary sp id of the bucket before migrate. uint32 src_primary_sp_id = 5; } + +message EventSetTag { + // resource defines a greenfield standard resource name that can be generated by GRN structure + string resource = 1; + // tags define the tag of the source + ResourceTags tags = 2; +} diff --git a/proto/greenfield/storage/genesis.proto b/proto/greenfield/storage/genesis.proto index f46f0344b..5e28ebd90 100644 --- a/proto/greenfield/storage/genesis.proto +++ b/proto/greenfield/storage/genesis.proto @@ -3,12 +3,10 @@ package greenfield.storage; import "gogoproto/gogo.proto"; import "greenfield/storage/params.proto"; -// this line is used by starport scaffolding # genesis/proto/import option go_package = "github.com/bnb-chain/greenfield/x/storage/types"; // GenesisState defines the bridge module's genesis state. message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; - // this line is used by starport scaffolding # genesis/proto/state } diff --git a/proto/greenfield/storage/query.proto b/proto/greenfield/storage/query.proto index c7fca7c2c..f78a7a582 100644 --- a/proto/greenfield/storage/query.proto +++ b/proto/greenfield/storage/query.proto @@ -12,8 +12,6 @@ import "greenfield/storage/params.proto"; import "greenfield/storage/types.proto"; import "greenfield/virtualgroup/types.proto"; -// this line is used by starport scaffolding # 1 - option go_package = "github.com/bnb-chain/greenfield/x/storage/types"; // Query defines the gRPC querier service. @@ -147,8 +145,6 @@ service Query { rpc QueryGroupsExistById(QueryGroupsExistByIdRequest) returns (QueryGroupsExistResponse) { option (google.api.http).get = "/greenfield/storage/groups_exist_by_id/{group_ids}"; } - - // this line is used by starport scaffolding # 2 } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -406,5 +402,3 @@ message QueryGroupsExistByIdRequest { message QueryGroupsExistResponse { map exists = 1; } - -// this line is used by starport scaffolding # 3 diff --git a/proto/greenfield/storage/tx.proto b/proto/greenfield/storage/tx.proto index 27757cd4b..9169abd1b 100644 --- a/proto/greenfield/storage/tx.proto +++ b/proto/greenfield/storage/tx.proto @@ -3,7 +3,6 @@ syntax = "proto3"; package greenfield.storage; import "cosmos/msg/v1/msg.proto"; -// this line is used by starport scaffolding # proto/tx/import import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; @@ -12,6 +11,7 @@ import "greenfield/common/wrapper.proto"; import "greenfield/permission/common.proto"; import "greenfield/storage/common.proto"; import "greenfield/storage/params.proto"; +import "greenfield/storage/types.proto"; option go_package = "github.com/bnb-chain/greenfield/x/storage/types"; @@ -54,12 +54,15 @@ service Msg { // Since: cosmos-sdk 0.47 rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // this line is used by starport scaffolding # proto/tx/rpc rpc MigrateBucket(MsgMigrateBucket) returns (MsgMigrateBucketResponse); rpc CompleteMigrateBucket(MsgCompleteMigrateBucket) returns (MsgCompleteMigrateBucketResponse); rpc CancelMigrateBucket(MsgCancelMigrateBucket) returns (MsgCancelMigrateBucketResponse); rpc RejectMigrateBucket(MsgRejectMigrateBucket) returns (MsgRejectMigrateBucketResponse); + + // Since: Manchurian upgrade + rpc SetTag(MsgSetTag) returns (MsgSetTagResponse); } + message MsgCreateBucket { option (cosmos.msg.v1.signer) = "creator"; @@ -86,6 +89,9 @@ message MsgCreateBucket { // The available read data for each user is the sum of the free read data provided by SP and // the ChargeReadQuota specified here. uint64 charged_read_quota = 7; + + // tags defines a list of tags which will be set to the bucket + ResourceTags tags = 8 [(gogoproto.nullable) = false]; } message MsgCreateBucketResponse { @@ -153,6 +159,9 @@ message MsgCreateObject { // redundancy_type can be ec or replica RedundancyType redundancy_type = 9; + + // tags defines a list of tags which will be set to the object + ResourceTags tags = 10 [(gogoproto.nullable) = false]; } message MsgCreateObjectResponse { @@ -278,6 +287,9 @@ message MsgCreateGroup { // extra defines extra info for the group string extra = 3; + + // tags defines a list of tags which will be set to the group + ResourceTags tags = 4 [(gogoproto.nullable) = false]; } message MsgCreateGroupResponse { @@ -573,7 +585,6 @@ message MsgUpdateParams { // MsgUpdateParamsResponse defines the response structure for executing a message MsgUpdateParamsResponse {} -// this line is used by starport scaffolding # proto/tx/message message MsgMigrateBucket { option (cosmos.msg.v1.signer) = "operator"; @@ -628,3 +639,18 @@ message MsgRejectMigrateBucket { } message MsgRejectMigrateBucketResponse {} + +message MsgSetTag { + option (cosmos.msg.v1.signer) = "operator"; + + // operator defines the operator who adds the tags + string operator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // resource defines a greenfield standard resource name that can be generated by GRN structure + string resource = 2; + + // tags defines a list of tags which will be set to the resource + ResourceTags tags = 3; +} + +message MsgSetTagResponse {} diff --git a/proto/greenfield/storage/types.proto b/proto/greenfield/storage/types.proto index a166e9a19..ab7ae73a1 100644 --- a/proto/greenfield/storage/types.proto +++ b/proto/greenfield/storage/types.proto @@ -8,7 +8,6 @@ import "greenfield/payment/out_flow.proto"; import "greenfield/payment/stream_record.proto"; import "greenfield/storage/common.proto"; -// this line is used by starport scaffolding # proto/tx/import option go_package = "github.com/bnb-chain/greenfield/x/storage/types"; message BucketInfo { @@ -38,6 +37,8 @@ message BucketInfo { uint64 charged_read_quota = 9; // bucket_status define the status of the bucket. BucketStatus bucket_status = 10; + // tags defines a list of tags the bucket has + ResourceTags tags = 11; } message InternalBucketInfo { @@ -84,6 +85,8 @@ message ObjectInfo { // checksums define the root hash of the pieces which stored in a SP. // add omit tag to omit the field when converting to NFT metadata repeated bytes checksums = 14 [(gogoproto.moretags) = "traits:\"omit\""]; + // tags defines a list of tags the object has + ResourceTags tags = 15; } message GroupInfo { @@ -101,6 +104,8 @@ message GroupInfo { ]; // extra is used to store extra info for the group string extra = 5; + // tags defines a list of tags the group has + ResourceTags tags = 6; } message Trait { @@ -173,3 +178,12 @@ message MigrationBucketInfo { (gogoproto.nullable) = false ]; } + +message ResourceTags { + message Tag { + string key = 1; + string value = 2; + } + // tags defines a list of tags the resource has + repeated Tag tags = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/greenfield/virtualgroup/genesis.proto b/proto/greenfield/virtualgroup/genesis.proto index 5e2600517..f56e646a9 100644 --- a/proto/greenfield/virtualgroup/genesis.proto +++ b/proto/greenfield/virtualgroup/genesis.proto @@ -6,11 +6,8 @@ import "greenfield/virtualgroup/params.proto"; option go_package = "github.com/bnb-chain/greenfield/x/virtualgroup/types"; -// this line is used by starport scaffolding # genesis/proto/import - // GenesisState defines the virtualgroup module's genesis state. // GenesisState defines the raw genesis transaction in JSON. message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; - // this line is used by starport scaffolding # genesis/proto/state } diff --git a/proto/greenfield/virtualgroup/query.proto b/proto/greenfield/virtualgroup/query.proto index b4856916d..0b71cc417 100644 --- a/proto/greenfield/virtualgroup/query.proto +++ b/proto/greenfield/virtualgroup/query.proto @@ -8,8 +8,6 @@ import "google/api/annotations.proto"; import "greenfield/virtualgroup/params.proto"; import "greenfield/virtualgroup/types.proto"; -// this line is used by starport scaffolding # 1 - option go_package = "github.com/bnb-chain/greenfield/x/virtualgroup/types"; // Query defines the gRPC query service. @@ -34,8 +32,6 @@ service Query { option (google.api.http).get = "/greenfield/virtualgroup/global_virtual_group_family"; } - // this line is used by starport scaffolding # 2 - // Queries a list of GlobalVirtualGroupFamilies items. rpc GlobalVirtualGroupFamilies(QueryGlobalVirtualGroupFamiliesRequest) returns (QueryGlobalVirtualGroupFamiliesResponse) { option (google.api.http).get = "/greenfield/virtualgroup/global_virtual_group_families"; @@ -80,7 +76,6 @@ message QueryGlobalVirtualGroupFamilyResponse { GlobalVirtualGroupFamily global_virtual_group_family = 1; } -// this line is used by starport scaffolding # 3 message QueryGlobalVirtualGroupFamiliesRequest { cosmos.base.query.v1beta1.PageRequest pagination = 1; } diff --git a/proto/greenfield/virtualgroup/tx.proto b/proto/greenfield/virtualgroup/tx.proto index 1e2aa2d34..42c8eb3a2 100644 --- a/proto/greenfield/virtualgroup/tx.proto +++ b/proto/greenfield/virtualgroup/tx.proto @@ -4,7 +4,6 @@ package greenfield.virtualgroup; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/msg/v1/msg.proto"; -// this line is used by starport scaffolding # proto/tx/import import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "greenfield/common/approval.proto"; @@ -14,7 +13,6 @@ option go_package = "github.com/bnb-chain/greenfield/x/virtualgroup/types"; // Msg defines the Msg service. service Msg { - // this line is used by starport scaffolding # proto/tx/import rpc CreateGlobalVirtualGroup(MsgCreateGlobalVirtualGroup) returns (MsgCreateGlobalVirtualGroupResponse); rpc DeleteGlobalVirtualGroup(MsgDeleteGlobalVirtualGroup) returns (MsgDeleteGlobalVirtualGroupResponse); rpc Deposit(MsgDeposit) returns (MsgDepositResponse); @@ -172,7 +170,6 @@ message MsgSettle { message MsgSettleResponse {} -// this line is used by starport scaffolding # proto/tx/message message MsgStorageProviderExit { option (cosmos.msg.v1.signer) = "storage_provider"; diff --git a/swagger/static/swagger.yaml b/swagger/static/swagger.yaml index 332447eb1..7139239f6 100644 --- a/swagger/static/swagger.yaml +++ b/swagger/static/swagger.yaml @@ -2607,6 +2607,20 @@ paths: - BUCKET_STATUS_DISCONTINUED - BUCKET_STATUS_MIGRATING default: BUCKET_STATUS_CREATED + tags: + title: tags defines a list of tags the bucket has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has default: description: An unexpected error response. schema: @@ -2717,6 +2731,20 @@ paths: - BUCKET_STATUS_DISCONTINUED - BUCKET_STATUS_MIGRATING default: BUCKET_STATUS_CREATED + tags: + title: tags defines a list of tags the bucket has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has default: description: An unexpected error response. schema: @@ -2951,6 +2979,20 @@ paths: extra: type: string title: extra is used to store extra info for the group + tags: + title: tags defines a list of tags the group has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has default: description: An unexpected error response. schema: @@ -3217,6 +3259,20 @@ paths: add omit tag to omit the field when converting to NFT metadata + tags: + title: tags defines a list of tags the object has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has global_virtual_group: type: object properties: @@ -3405,6 +3461,20 @@ paths: add omit tag to omit the field when converting to NFT metadata + tags: + title: tags defines a list of tags the object has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has global_virtual_group: type: object properties: @@ -3691,6 +3761,20 @@ paths: - BUCKET_STATUS_DISCONTINUED - BUCKET_STATUS_MIGRATING default: BUCKET_STATUS_CREATED + tags: + title: tags defines a list of tags the bucket has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has pagination: type: object properties: @@ -3868,6 +3952,20 @@ paths: extra: type: string title: extra is used to store extra info for the group + tags: + title: tags defines a list of tags the group has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has default: description: An unexpected error response. schema: @@ -4057,6 +4155,20 @@ paths: add omit tag to omit the field when converting to NFT metadata + tags: + title: tags defines a list of tags the object has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has pagination: type: object properties: @@ -4274,6 +4386,20 @@ paths: add omit tag to omit the field when converting to NFT metadata + tags: + title: tags defines a list of tags the object has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has pagination: type: object properties: @@ -34292,6 +34418,20 @@ definitions: - BUCKET_STATUS_DISCONTINUED - BUCKET_STATUS_MIGRATING default: BUCKET_STATUS_CREATED + tags: + title: tags defines a list of tags the bucket has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has greenfield.storage.BucketMetaData: type: object properties: @@ -34356,6 +34496,20 @@ definitions: extra: type: string title: extra is used to store extra info for the group + tags: + title: tags defines a list of tags the group has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has greenfield.storage.GroupMetaData: type: object properties: @@ -34558,6 +34712,20 @@ definitions: title: |- checksums define the root hash of the pieces which stored in a SP. add omit tag to omit the field when converting to NFT metadata + tags: + title: tags defines a list of tags the object has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has greenfield.storage.ObjectMetaData: type: object properties: @@ -34928,6 +35096,20 @@ definitions: - BUCKET_STATUS_DISCONTINUED - BUCKET_STATUS_MIGRATING default: BUCKET_STATUS_CREATED + tags: + title: tags defines a list of tags the bucket has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has greenfield.storage.QueryHeadGroupMemberResponse: type: object properties: @@ -34978,6 +35160,20 @@ definitions: extra: type: string title: extra is used to store extra info for the group + tags: + title: tags defines a list of tags the group has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has greenfield.storage.QueryHeadObjectResponse: type: object properties: @@ -35065,6 +35261,20 @@ definitions: title: |- checksums define the root hash of the pieces which stored in a SP. add omit tag to omit the field when converting to NFT metadata + tags: + title: tags defines a list of tags the object has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has global_virtual_group: type: object properties: @@ -35210,6 +35420,20 @@ definitions: - BUCKET_STATUS_DISCONTINUED - BUCKET_STATUS_MIGRATING default: BUCKET_STATUS_CREATED + tags: + title: tags defines a list of tags the bucket has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has pagination: type: object properties: @@ -35295,6 +35519,20 @@ definitions: extra: type: string title: extra is used to store extra info for the group + tags: + title: tags defines a list of tags the group has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has greenfield.storage.QueryListObjectsResponse: type: object properties: @@ -35386,6 +35624,20 @@ definitions: SP. add omit tag to omit the field when converting to NFT metadata + tags: + title: tags defines a list of tags the object has + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has pagination: type: object properties: @@ -36183,6 +36435,26 @@ definitions: description: |- RedundancyType represents the redundancy algorithm type for object data, which can be either multi-replica or erasure coding. + greenfield.storage.ResourceTags: + type: object + properties: + tags: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + title: tags defines a list of tags the resource has + greenfield.storage.ResourceTags.Tag: + type: object + properties: + key: + type: string + value: + type: string greenfield.storage.SourceType: type: string enum: diff --git a/x/bridge/client/cli/query.go b/x/bridge/client/cli/query.go index dbdb274b9..bc2328c82 100644 --- a/x/bridge/client/cli/query.go +++ b/x/bridge/client/cli/query.go @@ -21,7 +21,6 @@ func GetQueryCmd() *cobra.Command { } cmd.AddCommand(CmdQueryParams()) - // this line is used by starport scaffolding # 1 return cmd } diff --git a/x/bridge/client/cli/tx.go b/x/bridge/client/cli/tx.go index 3bc52b97e..8bd52660e 100644 --- a/x/bridge/client/cli/tx.go +++ b/x/bridge/client/cli/tx.go @@ -20,7 +20,6 @@ func GetTxCmd() *cobra.Command { } cmd.AddCommand(CmdTransferOut()) - // this line is used by starport scaffolding # 1 return cmd } diff --git a/x/bridge/module_simulation.go b/x/bridge/module_simulation.go index 86d4388c9..7484d5d0a 100644 --- a/x/bridge/module_simulation.go +++ b/x/bridge/module_simulation.go @@ -26,8 +26,6 @@ const ( opWeightMsgTransferOut = "op_weight_msg_transfer_out" // TODO: Determine the simulation weight value defaultWeightMsgTransferOut int = 100 - - // this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module @@ -38,7 +36,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } bridgeGenesis := types.GenesisState{ Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&bridgeGenesis) } @@ -66,7 +63,5 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp bridgesimulation.SimulateMsgTransferOut(am.accountKeeper, am.bankKeeper, am.keeper), )) - // this line is used by starport scaffolding # simapp/module/operation - return operations } diff --git a/x/bridge/types/codec.go b/x/bridge/types/codec.go index a8614a4bf..36e2a98e2 100644 --- a/x/bridge/types/codec.go +++ b/x/bridge/types/codec.go @@ -9,7 +9,6 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgTransferOut{}, "bridge/TransferOut", nil) - // this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -19,7 +18,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}, ) - // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/bridge/types/genesis_test.go b/x/bridge/types/genesis_test.go index df6fb8809..6f5c811c8 100644 --- a/x/bridge/types/genesis_test.go +++ b/x/bridge/types/genesis_test.go @@ -27,7 +27,6 @@ func TestGenesisState_Validate(t *testing.T) { BscTransferOutRelayerFee: sdkmath.NewInt(1), BscTransferOutAckRelayerFee: sdkmath.NewInt(0), }, - // this line is used by starport scaffolding # types/genesis/validField }, valid: true, }, diff --git a/x/challenge/client/cli/query.go b/x/challenge/client/cli/query.go index c084f1861..d1607e396 100644 --- a/x/challenge/client/cli/query.go +++ b/x/challenge/client/cli/query.go @@ -27,8 +27,6 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand(CmdAttestedChallenge()) cmd.AddCommand(CmdInturnChallenger()) - // this line is used by starport scaffolding # 1 - return cmd } diff --git a/x/challenge/client/cli/tx.go b/x/challenge/client/cli/tx.go index 33f6fe8ce..8c6b02a5b 100644 --- a/x/challenge/client/cli/tx.go +++ b/x/challenge/client/cli/tx.go @@ -31,7 +31,6 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdSubmit()) cmd.AddCommand(CmdAttest()) - // this line is used by starport scaffolding # 1 return cmd } diff --git a/x/challenge/genesis.go b/x/challenge/genesis.go index 409be3048..5f48ce15c 100644 --- a/x/challenge/genesis.go +++ b/x/challenge/genesis.go @@ -9,7 +9,6 @@ import ( // InitGenesis initializes the module's state from a provided genesis state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - // this line is used by starport scaffolding # genesis/module/init err := k.SetParams(ctx, genState.Params) if err != nil { panic(err) @@ -20,8 +19,5 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - - // this line is used by starport scaffolding # genesis/module/export - return genesis } diff --git a/x/challenge/genesis_test.go b/x/challenge/genesis_test.go index 0aaed9ffa..2c9d8dbbd 100644 --- a/x/challenge/genesis_test.go +++ b/x/challenge/genesis_test.go @@ -20,8 +20,6 @@ import ( func TestGenesis(t *testing.T) { genesisState := types.GenesisState{ Params: types.DefaultParams(), - - // this line is used by starport scaffolding # genesis/test/state } k, ctx := makeKeeper(t) @@ -31,8 +29,6 @@ func TestGenesis(t *testing.T) { nullify.Fill(&genesisState) nullify.Fill(got) - - // this line is used by starport scaffolding # genesis/test/assert } func makeKeeper(t *testing.T) (*keeper.Keeper, sdk.Context) { diff --git a/x/challenge/module_simulation.go b/x/challenge/module_simulation.go index 971952cfd..5fca7296f 100644 --- a/x/challenge/module_simulation.go +++ b/x/challenge/module_simulation.go @@ -30,8 +30,6 @@ const ( opWeightMsgAttest = "op_weight_msg_attest" // TODO: Determine the simulation weight value defaultWeightMsgAttest int = 100 - - // this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module @@ -42,7 +40,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } challengeGenesis := types.GenesisState{ Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&challengeGenesis) } @@ -81,7 +78,5 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp challengesimulation.SimulateMsgAttest(am.accountKeeper, am.bankKeeper, am.keeper), )) - // this line is used by starport scaffolding # simapp/module/operation - return operations } diff --git a/x/challenge/types/codec.go b/x/challenge/types/codec.go index ee74bc58c..ef92d5214 100644 --- a/x/challenge/types/codec.go +++ b/x/challenge/types/codec.go @@ -10,7 +10,6 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgSubmit{}, "challenge/Submit", nil) cdc.RegisterConcrete(&MsgAttest{}, "challenge/Attest", nil) - // this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -23,7 +22,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}, ) - // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/challenge/types/genesis.go b/x/challenge/types/genesis.go index f2689b73b..bdb9f4151 100644 --- a/x/challenge/types/genesis.go +++ b/x/challenge/types/genesis.go @@ -6,7 +6,6 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } } @@ -14,7 +13,5 @@ func DefaultGenesis() *GenesisState { // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - // this line is used by starport scaffolding # genesis/types/validate - return gs.Params.Validate() } diff --git a/x/challenge/types/genesis_test.go b/x/challenge/types/genesis_test.go index 01b212b69..855d971d4 100644 --- a/x/challenge/types/genesis_test.go +++ b/x/challenge/types/genesis_test.go @@ -23,12 +23,9 @@ func TestGenesisState_Validate(t *testing.T) { desc: "valid genesis state", genState: &types.GenesisState{ Params: types.DefaultParams(), - - // this line is used by starport scaffolding # types/genesis/validField }, valid: true, }, - // this line is used by starport scaffolding # types/genesis/testcase } { t.Run(tc.desc, func(t *testing.T) { err := tc.genState.Validate() diff --git a/x/gensp/genesis.go b/x/gensp/genesis.go index 9d16e516d..ed6a4a71f 100644 --- a/x/gensp/genesis.go +++ b/x/gensp/genesis.go @@ -13,7 +13,6 @@ func InitGenesis(ctx sdk.Context, stakingKeeper types.StakingKeeper, deliverTx deliverTxfn, genesisState types.GenesisState, txEncodingConfig client.TxEncodingConfig, ) (validators []abci.ValidatorUpdate, err error) { - // this line is used by starport scaffolding # genesis/module/init if len(genesisState.GenspTxs) > 0 { validators, err = DeliverGenTxs(ctx, genesisState.GenspTxs, stakingKeeper, deliverTx, txEncodingConfig) } diff --git a/x/gensp/types/codec.go b/x/gensp/types/codec.go index 8eb43994e..e154a6686 100644 --- a/x/gensp/types/codec.go +++ b/x/gensp/types/codec.go @@ -6,13 +6,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/msgservice" ) -func RegisterCodec(cdc *codec.LegacyAmino) { - // this line is used by starport scaffolding # 2 -} +func RegisterCodec(cdc *codec.LegacyAmino) {} func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - // this line is used by starport scaffolding # 3 - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/payment/client/cli/query.go b/x/payment/client/cli/query.go index 7c130eb7b..c50b7a531 100644 --- a/x/payment/client/cli/query.go +++ b/x/payment/client/cli/query.go @@ -30,7 +30,6 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand(CmdDynamicBalance()) cmd.AddCommand(CmdGetPaymentAccountsByOwner()) cmd.AddCommand(CmdListAutoSettleRecord()) - // this line is used by starport scaffolding # 1 return cmd } diff --git a/x/payment/client/cli/tx.go b/x/payment/client/cli/tx.go index 776341d06..af3305d07 100644 --- a/x/payment/client/cli/tx.go +++ b/x/payment/client/cli/tx.go @@ -34,7 +34,6 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdDeposit()) cmd.AddCommand(CmdWithdraw()) cmd.AddCommand(CmdDisableRefund()) - // this line is used by starport scaffolding # 1 return cmd } diff --git a/x/payment/genesis.go b/x/payment/genesis.go index 6594c2349..13f4b1b74 100644 --- a/x/payment/genesis.go +++ b/x/payment/genesis.go @@ -40,7 +40,6 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.PaymentAccountCountList = k.GetAllPaymentAccountCount(ctx) genesis.PaymentAccountList = k.GetAllPaymentAccount(ctx) genesis.AutoSettleRecordList = k.GetAllAutoSettleRecord(ctx) - // this line is used by starport scaffolding # genesis/module/export return genesis } diff --git a/x/payment/module_simulation.go b/x/payment/module_simulation.go index 99746bd8a..26da0dd2d 100644 --- a/x/payment/module_simulation.go +++ b/x/payment/module_simulation.go @@ -21,10 +21,6 @@ var ( _ = baseapp.Paramspace ) -const ( -// this line is used by starport scaffolding # simapp/module/const -) - // GenerateGenesisState creates a randomized GenState of the module func (AppModule) GenerateGenesisState(simState *module.SimulationState) { accs := make([]string, len(simState.Accounts)) @@ -33,7 +29,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } paymentGenesis := types.GenesisState{ Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&paymentGenesis) } @@ -49,6 +44,5 @@ func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) - // this line is used by starport scaffolding # simapp/module/operation return operations } diff --git a/x/payment/types/codec.go b/x/payment/types/codec.go index d90639591..394371c04 100644 --- a/x/payment/types/codec.go +++ b/x/payment/types/codec.go @@ -12,7 +12,6 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgDeposit{}, "payment/Deposit", nil) cdc.RegisterConcrete(&MsgWithdraw{}, "payment/Withdraw", nil) cdc.RegisterConcrete(&MsgDisableRefund{}, "payment/DisableRefund", nil) - // this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -31,7 +30,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}, ) - // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/payment/types/genesis.go b/x/payment/types/genesis.go index 2840d7f10..d0a72eb7c 100644 --- a/x/payment/types/genesis.go +++ b/x/payment/types/genesis.go @@ -16,8 +16,7 @@ func DefaultGenesis() *GenesisState { PaymentAccountCountList: []PaymentAccountCount{}, PaymentAccountList: []PaymentAccount{}, AutoSettleRecordList: []AutoSettleRecord{}, - // this line is used by starport scaffolding # genesis/types/default - Params: DefaultParams(), + Params: DefaultParams(), } } @@ -65,7 +64,6 @@ func (gs GenesisState) Validate() error { } autoSettleRecordIndexMap[index] = struct{}{} } - // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() } diff --git a/x/permission/client/cli/query.go b/x/permission/client/cli/query.go index 9e0b0119a..0974fccc0 100644 --- a/x/permission/client/cli/query.go +++ b/x/permission/client/cli/query.go @@ -21,7 +21,6 @@ func GetQueryCmd(queryRoute string) *cobra.Command { } cmd.AddCommand(CmdQueryParams()) - // this line is used by starport scaffolding # 1 return cmd } diff --git a/x/permission/client/cli/tx.go b/x/permission/client/cli/tx.go index f7966c875..11ce240ac 100644 --- a/x/permission/client/cli/tx.go +++ b/x/permission/client/cli/tx.go @@ -19,7 +19,5 @@ func GetTxCmd() *cobra.Command { RunE: client.ValidateCmd, } - // this line is used by starport scaffolding # 1 - return cmd } diff --git a/x/permission/genesis.go b/x/permission/genesis.go index 29b8e5478..d1c9a7b6a 100644 --- a/x/permission/genesis.go +++ b/x/permission/genesis.go @@ -9,7 +9,6 @@ import ( // InitGenesis initializes the module's state from a provided genesis state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - // this line is used by starport scaffolding # genesis/module/init err := k.SetParams(ctx, genState.Params) if err != nil { panic(err) @@ -20,8 +19,5 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - - // this line is used by starport scaffolding # genesis/module/export - return genesis } diff --git a/x/permission/genesis_test.go b/x/permission/genesis_test.go index 52f0b4146..3f317fe4a 100644 --- a/x/permission/genesis_test.go +++ b/x/permission/genesis_test.go @@ -21,8 +21,6 @@ import ( func TestGenesis(t *testing.T) { genesisState := types.GenesisState{ Params: types.DefaultParams(), - - // this line is used by starport scaffolding # genesis/test/state } k, ctx := makeKeeper(t) permission.InitGenesis(ctx, *k, genesisState) @@ -31,8 +29,6 @@ func TestGenesis(t *testing.T) { nullify.Fill(&genesisState) nullify.Fill(got) - - // this line is used by starport scaffolding # genesis/test/assert } func makeKeeper(t *testing.T) (*keeper.Keeper, sdk.Context) { diff --git a/x/permission/keeper/keeper.go b/x/permission/keeper/keeper.go index 3c105514a..7dc41bbcc 100644 --- a/x/permission/keeper/keeper.go +++ b/x/permission/keeper/keeper.go @@ -540,8 +540,8 @@ func (k Keeper) RemoveExpiredPolicies(ctx sdk.Context) { ctx.EventManager().EmitTypedEvents(&types.EventDeletePolicy{PolicyId: policyId}) //nolint: errcheck count++ - //1. the policy is an account policy, delete policyKey -> policyId. - //2. the policy is group policy within a policy group, delete the index in the policy group + // 1. the policy is an account policy, delete policyKey -> policyId. + // 2. the policy is group policy within a policy group, delete the index in the policy group if ctx.IsUpgraded(upgradetypes.Pampas) { if policy.Principal.Type == types.PRINCIPAL_TYPE_GNFD_ACCOUNT { policyKey := types.GetPolicyForAccountKey(policy.ResourceId, policy.ResourceType, diff --git a/x/permission/module_simulation.go b/x/permission/module_simulation.go index 5a1bd3239..c51f4efb4 100644 --- a/x/permission/module_simulation.go +++ b/x/permission/module_simulation.go @@ -20,11 +20,6 @@ var ( _ = baseapp.Paramspace ) -const ( - -// this line is used by starport scaffolding # simapp/module/const -) - // GenerateGenesisState creates a randomized GenState of the module func (AppModule) GenerateGenesisState(simState *module.SimulationState) { accs := make([]string, len(simState.Accounts)) @@ -33,7 +28,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } permissionGenesis := types.GenesisState{ Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&permissionGenesis) } @@ -49,8 +43,5 @@ func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) - - // this line is used by starport scaffolding # simapp/module/operation - return operations } diff --git a/x/permission/types/codec.go b/x/permission/types/codec.go index d2f5211f9..e43dc5650 100644 --- a/x/permission/types/codec.go +++ b/x/permission/types/codec.go @@ -7,12 +7,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/msgservice" ) -func RegisterCodec(cdc *codec.LegacyAmino) { - // this line is used by starport scaffolding # 2 -} +func RegisterCodec(cdc *codec.LegacyAmino) {} func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - // this line is used by starport scaffolding # 3 registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}, ) diff --git a/x/permission/types/genesis.go b/x/permission/types/genesis.go index f2689b73b..bdb9f4151 100644 --- a/x/permission/types/genesis.go +++ b/x/permission/types/genesis.go @@ -6,7 +6,6 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } } @@ -14,7 +13,5 @@ func DefaultGenesis() *GenesisState { // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - // this line is used by starport scaffolding # genesis/types/validate - return gs.Params.Validate() } diff --git a/x/permission/types/genesis_test.go b/x/permission/types/genesis_test.go index 52d22e8f4..6b48c79d0 100644 --- a/x/permission/types/genesis_test.go +++ b/x/permission/types/genesis_test.go @@ -19,7 +19,6 @@ func TestGenesisState_Validate(t *testing.T) { genState: types.DefaultGenesis(), valid: true, }, - // this line is used by starport scaffolding # types/genesis/testcase } { t.Run(tc.desc, func(t *testing.T) { err := tc.genState.Validate() diff --git a/x/sp/client/cli/query.go b/x/sp/client/cli/query.go index b8dcdc820..f0cfed775 100644 --- a/x/sp/client/cli/query.go +++ b/x/sp/client/cli/query.go @@ -33,7 +33,6 @@ func GetQueryCmd() *cobra.Command { CmdStorageProviderGlobalPrice(), ) - // this line is used by starport scaffolding # 1 return cmd } diff --git a/x/sp/client/cli/tx.go b/x/sp/client/cli/tx.go index 4b5b3c223..925e86bf7 100644 --- a/x/sp/client/cli/tx.go +++ b/x/sp/client/cli/tx.go @@ -41,8 +41,6 @@ func GetTxCmd() *cobra.Command { CmdUpdateStorageProviderStoragePrice(), ) - // this line is used by starport scaffolding # 1 - return spTxCmd } diff --git a/x/sp/genesis.go b/x/sp/genesis.go index 4da798b77..60698c12e 100644 --- a/x/sp/genesis.go +++ b/x/sp/genesis.go @@ -9,7 +9,6 @@ import ( // InitGenesis initializes the module's state from a provided genesis state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - // this line is used by starport scaffolding # genesis/module/init err := k.SetParams(ctx, genState.Params) if err != nil { panic(err) @@ -23,7 +22,6 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - // this line is used by starport scaffolding # genesis/module/export genesis.StorageProviders = k.GetAllStorageProviders(ctx) genesis.SpStoragePriceList = k.GetAllSpStoragePrice(ctx) diff --git a/x/sp/genesis_test.go b/x/sp/genesis_test.go index e72346c31..4717942c8 100644 --- a/x/sp/genesis_test.go +++ b/x/sp/genesis_test.go @@ -54,7 +54,6 @@ func TestGenesis(t *testing.T) { Status: types.STATUS_IN_SERVICE, }, }, - // this line is used by starport scaffolding # genesis/test/state } ctx := testCtx.Ctx @@ -65,6 +64,4 @@ func TestGenesis(t *testing.T) { nullify.Fill(&genesisState) nullify.Fill(got) - - // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/sp/module_simulation.go b/x/sp/module_simulation.go index 35d2a7207..e0219eab5 100644 --- a/x/sp/module_simulation.go +++ b/x/sp/module_simulation.go @@ -20,10 +20,6 @@ var ( _ = baseapp.Paramspace ) -const ( -// this line is used by starport scaffolding # simapp/module/const -) - // GenerateGenesisState creates a randomized GenState of the module func (AppModule) GenerateGenesisState(simState *module.SimulationState) { accs := make([]string, len(simState.Accounts)) @@ -32,7 +28,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } spGenesis := types.GenesisState{ Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&spGenesis) } @@ -48,6 +43,5 @@ func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) - // this line is used by starport scaffolding # simapp/module/operation return operations } diff --git a/x/sp/types/codec.go b/x/sp/types/codec.go index 0bcdd1c44..e3d791588 100644 --- a/x/sp/types/codec.go +++ b/x/sp/types/codec.go @@ -15,8 +15,6 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgUpdateSpStoragePrice{}, "sp/UpdateSpStoragePrice", nil) cdc.RegisterConcrete(&DepositAuthorization{}, "sp/DepositAuthorization", nil) cdc.RegisterConcrete(&MsgUpdateStorageProviderStatus{}, "sp/UpdateSpStatus", nil) - - // this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -43,7 +41,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { (*authz.Authorization)(nil), &DepositAuthorization{}, ) - // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/sp/types/genesis.go b/x/sp/types/genesis.go index a62d1a194..87c4f01f7 100644 --- a/x/sp/types/genesis.go +++ b/x/sp/types/genesis.go @@ -1,14 +1,11 @@ package types -// this line is used by starport scaffolding # genesis/types/import - // DefaultIndex is the default global index const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), StorageProviders: []StorageProvider{}, @@ -18,7 +15,5 @@ func DefaultGenesis() *GenesisState { // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - // this line is used by starport scaffolding # genesis/types/validate - return gs.Params.Validate() } diff --git a/x/sp/types/genesis_test.go b/x/sp/types/genesis_test.go index 01addf27b..1a8031d04 100644 --- a/x/sp/types/genesis_test.go +++ b/x/sp/types/genesis_test.go @@ -23,11 +23,9 @@ func TestGenesisState_Validate(t *testing.T) { desc: "valid genesis state", genState: &types.GenesisState{ Params: types.DefaultParams(), - // this line is used by starport scaffolding # types/genesis/validField }, valid: true, }, - // this line is used by starport scaffolding # types/genesis/testcase } { t.Run(tc.desc, func(t *testing.T) { err := tc.genState.Validate() diff --git a/x/sp/types/query.pb.go b/x/sp/types/query.pb.go index f471c1987..37465e5ca 100644 --- a/x/sp/types/query.pb.go +++ b/x/sp/types/query.pb.go @@ -114,7 +114,6 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } -// this line is used by starport scaffolding # 3 type QueryStorageProvidersRequest struct { // pagination defines an optional pagination for the request. Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` diff --git a/x/storage/client/cli/flags.go b/x/storage/client/cli/flags.go index de7de4af1..095c0b8d6 100644 --- a/x/storage/client/cli/flags.go +++ b/x/storage/client/cli/flags.go @@ -2,6 +2,7 @@ package cli import ( "math" + "strings" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" @@ -29,6 +30,7 @@ const ( FlagGroupId = "group-id" FlagGroupName = "group-name" FlagExtra = "extra" + FlagTags = "tags" ) func GetVisibilityType(str string) (storagetypes.VisibilityType, error) { @@ -73,7 +75,6 @@ func GetPrincipal(str string) (permissiontypes.Principal, error) { Type: principalType, Value: principalValue, }, nil - } // GetPrimarySPField returns a from account address, account name and keyring type, given either an address or key name. @@ -134,7 +135,7 @@ func GetPaymentAccountField(kr keyring.Keyring, paymentAcc string) (sdk.AccAddre return addr, k.Name, k.GetType(), nil } -// FlagSetVisibility Returns the flagset for set visibility related operations. +// FlagSetVisibility Returns the flagSet for set visibility related operations. func FlagSetVisibility() *flag.FlagSet { fs := flag.NewFlagSet("", flag.ContinueOnError) fs.String(FlagVisibility, "VISIBILITY_TYPE_PRIVATE", "If private, only owner and grantee can access it. Otherwise,"+ @@ -148,3 +149,28 @@ func FlagSetApproval() *flag.FlagSet { fs.Uint64(FlagApproveTimeoutHeight, math.MaxUint, "The approval timeout height of primarySp") return fs } + +func GetTags(str string) *storagetypes.ResourceTags { + var tags storagetypes.ResourceTags + if str == "" || str == "{}" { + return nil + } + + tagsStr := str + if tagsStr[0] == '{' { + tagsStr = tagsStr[1:] + } + if tagsStr[len(tagsStr)-1] == '}' { + tagsStr = tagsStr[:len(tagsStr)-1] + } + + for _, tagStr := range strings.Split(tagsStr, ",") { + kv := strings.Split(tagStr, "=") + if len(kv) != 2 { + continue + } + tags.Tags = append(tags.Tags, storagetypes.ResourceTags_Tag{Key: kv[0], Value: kv[1]}) + } + + return &tags +} diff --git a/x/storage/client/cli/query.go b/x/storage/client/cli/query.go index 65d784838..9a246cc2d 100644 --- a/x/storage/client/cli/query.go +++ b/x/storage/client/cli/query.go @@ -5,14 +5,13 @@ import ( "fmt" "strings" - gnfd "github.com/bnb-chain/greenfield/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" "github.com/spf13/cobra" + gnfd "github.com/bnb-chain/greenfield/types" "github.com/bnb-chain/greenfield/x/storage/types" ) @@ -41,8 +40,6 @@ func GetQueryCmd() *cobra.Command { CmdQueryGroupPolicy(), ) - // this line is used by starport scaffolding # 1 - return storageQueryCmd } diff --git a/x/storage/client/cli/tx.go b/x/storage/client/cli/tx.go index 469a8d91f..1b5cf1174 100644 --- a/x/storage/client/cli/tx.go +++ b/x/storage/client/cli/tx.go @@ -9,8 +9,6 @@ import ( "strings" "time" - "github.com/bnb-chain/greenfield/types/common" - cmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -19,6 +17,7 @@ import ( "github.com/cosmos/cosmos-sdk/version" "github.com/spf13/cobra" + "github.com/bnb-chain/greenfield/types/common" gnfderrors "github.com/bnb-chain/greenfield/types/errors" "github.com/bnb-chain/greenfield/x/storage/types" ) @@ -67,7 +66,10 @@ func GetTxCmd() *cobra.Command { CmdPutPolicy(), CmdDeletePolicy(), ) - // this line is used by starport scaffolding # 1 + + cmd.AddCommand( + CmdSetTag(), + ) return cmd } @@ -115,6 +117,9 @@ func CmdCreateBucket() *cobra.Command { approveSignature, _ := cmd.Flags().GetString(FlagApproveSignature) approveTimeoutHeight, _ := cmd.Flags().GetUint64(FlagApproveTimeoutHeight) + tagsStr, _ := cmd.Flags().GetString(FlagTags) + tags := GetTags(tagsStr) + approveSignatureBytes, err := hex.DecodeString(approveSignature) if err != nil { return err @@ -129,6 +134,10 @@ func CmdCreateBucket() *cobra.Command { approveSignatureBytes, chargedReadQuota, ) + if tags != nil { + msg.Tags = *tags + } + if err := msg.ValidateBasic(); err != nil { return err } @@ -141,6 +150,7 @@ func CmdCreateBucket() *cobra.Command { cmd.Flags().AddFlagSet(FlagSetApproval()) cmd.Flags().String(FlagPaymentAccount, "", "The address of the account used to pay for the read fee. The default is the sender account.") cmd.Flags().String(FlagPrimarySP, "", "The operator account address of primarySp") + cmd.Flags().String(FlagTags, "", "The tags of the resource. It should be like: `key1=value1,key2=value2`") flags.AddTxFlagsToCmd(cmd) return cmd @@ -285,6 +295,8 @@ func CmdCreateObject() *cobra.Command { redundancyTypeFlag, _ := cmd.Flags().GetString(FlagRedundancyType) approveSignature, _ := cmd.Flags().GetString(FlagApproveSignature) approveTimeoutHeight, _ := cmd.Flags().GetUint64(FlagApproveTimeoutHeight) + tagsStr, _ := cmd.Flags().GetString(FlagTags) + tags := GetTags(tagsStr) approveSignatureBytes, err := hex.DecodeString(approveSignature) if err != nil { @@ -325,6 +337,9 @@ func CmdCreateObject() *cobra.Command { approveTimeoutHeight, approveSignatureBytes, ) + if tags != nil { + msg.Tags = *tags + } if err := msg.ValidateBasic(); err != nil { return err @@ -333,12 +348,14 @@ func CmdCreateObject() *cobra.Command { }, } - flags.AddTxFlagsToCmd(cmd) cmd.Flags().AddFlagSet(FlagSetVisibility()) cmd.Flags().AddFlagSet(FlagSetApproval()) cmd.Flags().String(FlagPrimarySP, "", "The operator account address of primarySp") cmd.Flags().String(FlagExpectChecksums, "", "The checksums that calculate by redundancy algorithm") cmd.Flags().String(FlagRedundancyType, "", "The redundancy type, EC or Replica ") + cmd.Flags().String(FlagTags, "", "The tags of the resource. It should be like: `key1=value1,key2=value2`") + flags.AddTxFlagsToCmd(cmd) + return cmd } @@ -514,18 +531,25 @@ func CmdCreateGroup() *cobra.Command { Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) (err error) { argGroupName := args[0] - extra, _ := cmd.Flags().GetString(FlagExtra) clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } + extra, _ := cmd.Flags().GetString(FlagExtra) + tagsStr, _ := cmd.Flags().GetString(FlagTags) + tags := GetTags(tagsStr) + msg := types.NewMsgCreateGroup( clientCtx.GetFromAddress(), argGroupName, extra, ) + if tags != nil { + msg.Tags = *tags + } + if err := msg.ValidateBasic(); err != nil { return err } @@ -534,6 +558,7 @@ func CmdCreateGroup() *cobra.Command { } cmd.Flags().String(FlagExtra, "", "extra info for the group") + cmd.Flags().String(FlagTags, "", "The tags of the resource. It should be like: `key1=value1,key2=value2`") flags.AddTxFlagsToCmd(cmd) return cmd @@ -1115,3 +1140,33 @@ func CmdMirrorGroup() *cobra.Command { return cmd } + +func CmdSetTag() *cobra.Command { + cmd := &cobra.Command{ + Use: "set-tag [grn]", + Short: "set a bucket/object/group's tag.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argResource := args[0] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + tagsStr, _ := cmd.Flags().GetString(FlagTags) + tags := GetTags(tagsStr) + + msg := types.NewMsgSetTag(clientCtx.GetFromAddress(), argResource, tags) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().String(FlagTags, "", "The tags of the resource. It should be like: `key1=value1,key2=value2`") + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/genesis.go b/x/storage/genesis.go index 386fbe80a..ae532215b 100644 --- a/x/storage/genesis.go +++ b/x/storage/genesis.go @@ -9,7 +9,6 @@ import ( // InitGenesis initializes the module's state from a provided genesis state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - // this line is used by starport scaffolding # genesis/module/init err := k.SetParams(ctx, genState.Params) if err != nil { panic(err) @@ -20,6 +19,5 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - // this line is used by starport scaffolding # genesis/module/export return genesis } diff --git a/x/storage/genesis_test.go b/x/storage/genesis_test.go index 56471b5f3..d69008e38 100644 --- a/x/storage/genesis_test.go +++ b/x/storage/genesis_test.go @@ -43,8 +43,6 @@ func makeKeeper(t *testing.T) (*keeper.Keeper, sdk.Context) { func TestGenesis(t *testing.T) { genesisState := types.GenesisState{ Params: types.DefaultParams(), - - // this line is used by starport scaffolding # genesis/test/state } k, ctx := makeKeeper(t) @@ -54,6 +52,4 @@ func TestGenesis(t *testing.T) { nullify.Fill(&genesisState) nullify.Fill(got) - - // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/storage/keeper/grpc_query.go b/x/storage/keeper/grpc_query.go index 90d920016..6994932e0 100644 --- a/x/storage/keeper/grpc_query.go +++ b/x/storage/keeper/grpc_query.go @@ -424,7 +424,7 @@ func (k Keeper) QueryPolicyForAccount(goCtx context.Context, req *types.QueryPol return nil, err } - policy, err := k.GetPolicy(ctx, &grn, permtypes.NewPrincipalWithAccount(principalAcc)) + policy, err := k.GetPolicy(ctx, grn, permtypes.NewPrincipalWithAccount(principalAcc)) if err != nil { return nil, err } @@ -452,9 +452,7 @@ func (k Keeper) QueryPolicyForGroup(goCtx context.Context, req *types.QueryPolic return nil, status.Errorf(codes.InvalidArgument, "failed to parse GRN %s: %v", req.Resource, err) } - policy, err := k.GetPolicy( - ctx, &grn, permtypes.NewPrincipalWithGroupId(id), - ) + policy, err := k.GetPolicy(ctx, grn, permtypes.NewPrincipalWithGroupId(id)) if err != nil { return nil, err } diff --git a/x/storage/keeper/keeper.go b/x/storage/keeper/keeper.go index 6e7c4f2c2..170bb2c98 100644 --- a/x/storage/keeper/keeper.go +++ b/x/storage/keeper/keeper.go @@ -15,8 +15,11 @@ import ( "github.com/bnb-chain/greenfield/internal/sequence" gnfdtypes "github.com/bnb-chain/greenfield/types" + types2 "github.com/bnb-chain/greenfield/types" "github.com/bnb-chain/greenfield/types/common" + gnfderrors "github.com/bnb-chain/greenfield/types/errors" "github.com/bnb-chain/greenfield/types/resource" + gnfdresource "github.com/bnb-chain/greenfield/types/resource" paymenttypes "github.com/bnb-chain/greenfield/x/payment/types" permtypes "github.com/bnb-chain/greenfield/x/permission/types" sptypes "github.com/bnb-chain/greenfield/x/sp/types" @@ -136,6 +139,7 @@ func (k Keeper) CreateBucket( ChargedReadQuota: opts.ChargedReadQuota, PaymentAddress: paymentAcc.String(), GlobalVirtualGroupFamilyId: gvgFamily.Id, + Tags: opts.Tags, } internalBucketInfo := types.InternalBucketInfo{PriceTime: ctx.BlockTime().Unix()} @@ -170,6 +174,7 @@ func (k Keeper) CreateBucket( PaymentAddress: bucketInfo.PaymentAddress, PrimarySpId: sp.Id, GlobalVirtualGroupFamilyId: bucketInfo.GlobalVirtualGroupFamilyId, + Tags: bucketInfo.Tags, }); err != nil { return sdkmath.Uint{}, err } @@ -469,7 +474,7 @@ func (k Keeper) DiscontinueBucket(ctx sdk.Context, operator sdk.AccAddress, buck if count+1 > max { return types.ErrNoMoreDiscontinue.Wrapf("no more buckets can be requested in this window") } - + previousStatus := bucketInfo.BucketStatus bucketInfo.BucketStatus = types.BUCKET_STATUS_DISCONTINUED store := ctx.KVStore(k.storeKey) @@ -481,7 +486,7 @@ func (k Keeper) DiscontinueBucket(ctx sdk.Context, operator sdk.AccAddress, buck k.appendDiscontinueBucketIds(ctx, deleteAt, []sdkmath.Uint{bucketInfo.Id}) k.SetDiscontinueBucketCount(ctx, operator, count+1) - if bucketInfo.BucketStatus == types.BUCKET_STATUS_MIGRATING { + if previousStatus == types.BUCKET_STATUS_MIGRATING { if err := ctx.EventManager().EmitTypedEvents(&types.EventCancelMigrationBucket{ Operator: operator.String(), BucketName: bucketInfo.BucketName, @@ -536,8 +541,8 @@ func (k Keeper) GetBucketInfoById(ctx sdk.Context, bucketId sdkmath.Uint) (*type } func (k Keeper) CreateObject( - ctx sdk.Context, operator sdk.AccAddress, bucketName, objectName string, - payloadSize uint64, opts types.CreateObjectOptions, + ctx sdk.Context, operator sdk.AccAddress, bucketName, objectName string, payloadSize uint64, + opts types.CreateObjectOptions, ) (sdkmath.Uint, error) { store := ctx.KVStore(k.storeKey) @@ -613,6 +618,7 @@ func (k Keeper) CreateObject( RedundancyType: opts.RedundancyType, SourceType: opts.SourceType, Checksums: opts.Checksums, + Tags: opts.Tags, } if objectInfo.PayloadSize == 0 { @@ -652,6 +658,7 @@ func (k Keeper) CreateObject( SourceType: objectInfo.SourceType, Checksums: objectInfo.Checksums, LocalVirtualGroupId: objectInfo.LocalVirtualGroupId, + Tags: opts.Tags, }); err != nil { return objectInfo.Id, err } @@ -1252,6 +1259,7 @@ func (k Keeper) CreateGroup( Id: k.GenNextGroupId(ctx), GroupName: groupName, Extra: opts.Extra, + Tags: opts.Tags, } // Can not create a group with the same name. @@ -1270,6 +1278,7 @@ func (k Keeper) CreateGroup( GroupId: groupInfo.Id, SourceType: groupInfo.SourceType, Extra: opts.Extra, + Tags: opts.Tags, }); err != nil { return sdkmath.ZeroUint(), err } @@ -2199,3 +2208,79 @@ func (k Keeper) GetSourceTypeByChainId(ctx sdk.Context, chainId sdk.ChainID) (ty return 0, types.ErrChainNotSupported } + +func (k Keeper) SetTag(ctx sdk.Context, operator sdk.AccAddress, grn types2.GRN, tags *types.ResourceTags) error { + store := ctx.KVStore(k.storeKey) + + switch grn.ResourceType() { + case gnfdresource.RESOURCE_TYPE_BUCKET: + bucketName, grnErr := grn.GetBucketName() + if grnErr != nil { + return grnErr + } + bucketInfo, found := k.GetBucketInfo(ctx, bucketName) + if !found { + return types.ErrNoSuchBucket.Wrapf("bucketName: %s", bucketName) + } + resOwner := sdk.MustAccAddressFromHex(bucketInfo.Owner) + if !operator.Equals(resOwner) { + return types.ErrAccessDenied.Wrapf( + "Only resource owner can set tag, operator (%s), owner(%s)", + operator.String(), resOwner.String()) + } + + bucketInfo.Tags = tags + bz := k.cdc.MustMarshal(bucketInfo) + store.Set(types.GetBucketByIDKey(bucketInfo.Id), bz) + case gnfdresource.RESOURCE_TYPE_OBJECT: + bucketName, objectName, grnErr := grn.GetBucketAndObjectName() + if grnErr != nil { + return grnErr + } + objectInfo, found := k.GetObjectInfo(ctx, bucketName, objectName) + if !found { + return types.ErrNoSuchObject.Wrapf("BucketName: %s, objectName: %s", bucketName, objectName) + } + resOwner := sdk.MustAccAddressFromHex(objectInfo.Owner) + if !operator.Equals(resOwner) { + return types.ErrAccessDenied.Wrapf( + "Only resource owner can set tag, operator (%s), owner(%s)", + operator.String(), resOwner.String()) + } + + objectInfo.Tags = tags + obz := k.cdc.MustMarshal(objectInfo) + store.Set(types.GetObjectByIDKey(objectInfo.Id), obz) + case gnfdresource.RESOURCE_TYPE_GROUP: + groupOwner, groupName, grnErr := grn.GetGroupOwnerAndAccount() + if grnErr != nil { + return grnErr + } + groupInfo, found := k.GetGroupInfo(ctx, groupOwner, groupName) + if !found { + return types.ErrNoSuchBucket.Wrapf("groupOwner: %s, groupName: %s", groupOwner.String(), groupName) + } + resOwner := sdk.MustAccAddressFromHex(groupInfo.Owner) + if !operator.Equals(resOwner) { + return types.ErrAccessDenied.Wrapf( + "Only resource owner can set tag, operator (%s), owner(%s)", + operator.String(), resOwner.String()) + } + + groupInfo.Tags = tags + gbz := k.cdc.MustMarshal(groupInfo) + store.Set(types.GetGroupByIDKey(groupInfo.Id), gbz) + default: + return gnfderrors.ErrInvalidGRN.Wrap("Unknown resource type in greenfield resource name") + } + + // emit Event + if err := ctx.EventManager().EmitTypedEvents(&types.EventSetTag{ + Resource: grn.String(), + Tags: tags, + }); err != nil { + return err + } + + return nil +} diff --git a/x/storage/keeper/msg_server.go b/x/storage/keeper/msg_server.go index 826963f4e..9e144a5fe 100644 --- a/x/storage/keeper/msg_server.go +++ b/x/storage/keeper/msg_server.go @@ -45,6 +45,7 @@ func (k msgServer) CreateBucket(goCtx context.Context, msg *types.MsgCreateBucke SourceType: types.SOURCE_TYPE_ORIGIN, PrimarySpApproval: msg.PrimarySpApproval, ApprovalMsgBytes: msg.GetApprovalBytes(), + Tags: &msg.Tags, }) if err != nil { return nil, err @@ -121,6 +122,7 @@ func (k msgServer) CreateObject(goCtx context.Context, msg *types.MsgCreateObjec Checksums: msg.ExpectChecksums, PrimarySpApproval: msg.PrimarySpApproval, ApprovalMsgBytes: msg.GetApprovalBytes(), + Tags: &msg.Tags, }) if err != nil { return nil, err @@ -153,7 +155,6 @@ func (k msgServer) SealObject(goCtx context.Context, msg *types.MsgSealObject) ( GlobalVirtualGroupId: msg.GlobalVirtualGroupId, SecondarySpBlsSignatures: msg.SecondarySpBlsAggSignatures, }) - if err != nil { return nil, err } @@ -189,7 +190,6 @@ func (k msgServer) DeleteObject(goCtx context.Context, msg *types.MsgDeleteObjec err := k.Keeper.DeleteObject(ctx, operatorAcc, msg.BucketName, msg.ObjectName, storagetypes.DeleteObjectOptions{ SourceType: types.SOURCE_TYPE_ORIGIN, }) - if err != nil { return nil, err } @@ -234,7 +234,7 @@ func (k msgServer) CreateGroup(goCtx context.Context, msg *types.MsgCreateGroup) ownerAcc := sdk.MustAccAddressFromHex(msg.Creator) - id, err := k.Keeper.CreateGroup(ctx, ownerAcc, msg.GroupName, storagetypes.CreateGroupOptions{Extra: msg.Extra}) + id, err := k.Keeper.CreateGroup(ctx, ownerAcc, msg.GroupName, storagetypes.CreateGroupOptions{Extra: msg.Extra, Tags: &msg.Tags}) if err != nil { return nil, err } @@ -384,7 +384,6 @@ func (k msgServer) PutPolicy(goCtx context.Context, msg *types.MsgPutPolicy) (*t return nil, err } return &types.MsgPutPolicyResponse{PolicyId: policyID}, nil - } func (k msgServer) DeletePolicy(goCtx context.Context, msg *types.MsgDeletePolicy) (*types.MsgDeletePolicyResponse, error) { @@ -695,6 +694,23 @@ func (k msgServer) RejectMigrateBucket(goCtx context.Context, msg *storagetypes. return &types.MsgRejectMigrateBucketResponse{}, nil } +func (k msgServer) SetTag(goCtx context.Context, msg *types.MsgSetTag) (*types.MsgSetTagResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + operatorAddr := sdk.MustAccAddressFromHex(msg.Operator) + + var grn types2.GRN + err := grn.ParseFromString(msg.Resource, true) + if err != nil { + return nil, err + } + + if err := k.Keeper.SetTag(ctx, operatorAddr, grn, msg.Tags); err != nil { + return nil, err + } + return &types.MsgSetTagResponse{}, nil +} + func (k Keeper) verifyGVGSignatures(ctx sdk.Context, bucketID math.Uint, dstSP *sptypes.StorageProvider, gvgMappings []*storagetypes.GVGMapping) error { // verify secondary sp signature for _, newLvg2gvg := range gvgMappings { diff --git a/x/storage/keeper/permission.go b/x/storage/keeper/permission.go index 5c1df583b..79521a243 100644 --- a/x/storage/keeper/permission.go +++ b/x/storage/keeper/permission.go @@ -36,7 +36,8 @@ var ( // 1. If the policy is evaluated as "allow", return "allow" to the user. // 2. If it is evaluated as "deny" or "unspecified", return "deny". func (k Keeper) VerifyBucketPermission(ctx sdk.Context, bucketInfo *types.BucketInfo, operator sdk.AccAddress, - action permtypes.ActionType, options *permtypes.VerifyOptions) permtypes.Effect { + action permtypes.ActionType, options *permtypes.VerifyOptions, +) permtypes.Effect { // if bucket is public, anyone can read but can not write it. if bucketInfo.Visibility == storagetypes.VISIBILITY_TYPE_PUBLIC_READ && PublicReadBucketAllowedActions[action] { return permtypes.EFFECT_ALLOW @@ -70,7 +71,8 @@ func (k Keeper) VerifyBucketPermission(ctx sdk.Context, bucketInfo *types.Bucket // 3. If it is evaluated as "unspecified", then if the EffectBucket is "allow", return allow // 4. If it is evaluated as "unspecified", then if the EffectBucket is "unspecified", return deny func (k Keeper) VerifyObjectPermission(ctx sdk.Context, bucketInfo *types.BucketInfo, objectInfo *types.ObjectInfo, - operator sdk.AccAddress, action permtypes.ActionType) permtypes.Effect { + operator sdk.AccAddress, action permtypes.ActionType, +) permtypes.Effect { // anyone can read but can not write it when the following case: 1) object is public 2) object is inherit, only when bucket is public visibility := false if objectInfo.Visibility == storagetypes.VISIBILITY_TYPE_PUBLIC_READ || @@ -113,7 +115,8 @@ func (k Keeper) VerifyObjectPermission(ctx sdk.Context, bucketInfo *types.Bucket } func (k Keeper) VerifyGroupPermission(ctx sdk.Context, groupInfo *types.GroupInfo, operator sdk.AccAddress, - action permtypes.ActionType) permtypes.Effect { + action permtypes.ActionType, +) permtypes.Effect { // The owner has full permissions if strings.EqualFold(groupInfo.Owner, operator.String()) { return permtypes.EFFECT_ALLOW @@ -129,7 +132,8 @@ func (k Keeper) VerifyGroupPermission(ctx sdk.Context, groupInfo *types.GroupInf } func (k Keeper) VerifyPolicy(ctx sdk.Context, resourceID math.Uint, resourceType gnfdresource.ResourceType, - operator sdk.AccAddress, action permtypes.ActionType, opts *permtypes.VerifyOptions) permtypes.Effect { + operator sdk.AccAddress, action permtypes.ActionType, opts *permtypes.VerifyOptions, +) permtypes.Effect { // verify policy which grant permission to account policy, found := k.permKeeper.GetPolicyForAccount(ctx, resourceID, resourceType, operator) if found { @@ -185,42 +189,10 @@ func (k Keeper) VerifyPolicy(ctx sdk.Context, resourceID math.Uint, resourceType return permtypes.EFFECT_UNSPECIFIED } -func (k Keeper) GetPolicy(ctx sdk.Context, grn *types2.GRN, principal *permtypes.Principal) (*permtypes.Policy, error) { - var resID math.Uint - switch grn.ResourceType() { - case gnfdresource.RESOURCE_TYPE_BUCKET: - bucketName, grnErr := grn.GetBucketName() - if grnErr != nil { - return nil, grnErr - } - bucketInfo, found := k.GetBucketInfo(ctx, bucketName) - if !found { - return nil, types.ErrNoSuchBucket.Wrapf("bucketName: %s", bucketName) - } - resID = bucketInfo.Id - case gnfdresource.RESOURCE_TYPE_OBJECT: - bucketName, objectName, grnErr := grn.GetBucketAndObjectName() - if grnErr != nil { - return nil, grnErr - } - objectInfo, found := k.GetObjectInfo(ctx, bucketName, objectName) - if !found { - return nil, types.ErrNoSuchObject.Wrapf("BucketName: %s, objectName: %s", bucketName, objectName) - } - - resID = objectInfo.Id - case gnfdresource.RESOURCE_TYPE_GROUP: - groupOwner, groupName, grnErr := grn.GetGroupOwnerAndAccount() - if grnErr != nil { - return nil, grnErr - } - groupInfo, found := k.GetGroupInfo(ctx, groupOwner, groupName) - if !found { - return nil, types.ErrNoSuchBucket.Wrapf("groupOwner: %s, groupName: %s", groupOwner.String(), groupName) - } - resID = groupInfo.Id - default: - return nil, gnfderrors.ErrInvalidGRN.Wrap("Unknown resource type in greenfield resource name") +func (k Keeper) GetPolicy(ctx sdk.Context, grn types2.GRN, principal *permtypes.Principal) (*permtypes.Policy, error) { + _, resID, err := k.getResourceOwnerAndIdFromGRN(ctx, grn) + if err != nil { + return nil, err } var policy *permtypes.Policy @@ -241,61 +213,20 @@ func (k Keeper) GetPolicy(ctx sdk.Context, grn *types2.GRN, principal *permtypes } func (k Keeper) PutPolicy(ctx sdk.Context, operator sdk.AccAddress, grn types2.GRN, - policy *permtypes.Policy) (math.Uint, error) { - - var resOwner sdk.AccAddress - var resID math.Uint - switch grn.ResourceType() { - case gnfdresource.RESOURCE_TYPE_BUCKET: - bucketName, grnErr := grn.GetBucketName() - if grnErr != nil { - return math.ZeroUint(), grnErr - } - bucketInfo, found := k.GetBucketInfo(ctx, bucketName) - if !found { - return math.ZeroUint(), types.ErrNoSuchBucket.Wrapf("bucketName: %s", bucketName) - } - resOwner = sdk.MustAccAddressFromHex(bucketInfo.Owner) - resID = bucketInfo.Id - case gnfdresource.RESOURCE_TYPE_OBJECT: - bucketName, objectName, grnErr := grn.GetBucketAndObjectName() - if grnErr != nil { - return math.ZeroUint(), grnErr - } - objectInfo, found := k.GetObjectInfo(ctx, bucketName, objectName) - if !found { - return math.ZeroUint(), types.ErrNoSuchObject.Wrapf("BucketName: %s, objectName: %s", bucketName, objectName) - } - - resOwner = sdk.MustAccAddressFromHex(objectInfo.Owner) - resID = objectInfo.Id - case gnfdresource.RESOURCE_TYPE_GROUP: - groupOwner, groupName, grnErr := grn.GetGroupOwnerAndAccount() - if grnErr != nil { - return math.ZeroUint(), grnErr - } - groupInfo, found := k.GetGroupInfo(ctx, groupOwner, groupName) - if !found { - return math.ZeroUint(), types.ErrNoSuchBucket.Wrapf("groupOwner: %s, groupName: %s", groupOwner.String(), groupName) - } - - resOwner = sdk.MustAccAddressFromHex(groupInfo.Owner) - resID = groupInfo.Id - - if policy.Principal.Type == permtypes.PRINCIPAL_TYPE_GNFD_GROUP { - return math.ZeroUint(), permtypes.ErrInvalidPrincipal.Wrapf("Not allow grant group's permission to another group") - } - default: - return math.ZeroUint(), gnfderrors.ErrInvalidGRN.Wrap("Unknown resource type in greenfield resource name") + policy *permtypes.Policy, +) (math.Uint, error) { + resOwner, resID, err := k.getResourceOwnerAndIdFromGRN(ctx, grn) + if err != nil { + return math.ZeroUint(), err } if !operator.Equals(resOwner) { return math.ZeroUint(), types.ErrAccessDenied.Wrapf( - "Only resource owner can put bucket policy, operator (%s), owner(%s)", + "Only resource owner can put policy, operator (%s), owner(%s)", operator.String(), resOwner.String()) } k.normalizePrincipal(ctx, policy.Principal) - err := k.validatePrincipal(ctx, resOwner, policy.Principal) + err = k.validatePrincipal(ctx, resOwner, policy.Principal) if err != nil { return math.ZeroUint(), err } @@ -303,48 +234,12 @@ func (k Keeper) PutPolicy(ctx sdk.Context, operator sdk.AccAddress, grn types2.G return k.permKeeper.PutPolicy(ctx, policy) } -func (k Keeper) DeletePolicy(ctx sdk.Context, operator sdk.AccAddress, principal *permtypes.Principal, - grn types2.GRN) (math.Uint, - error) { - var resOwner sdk.AccAddress - var resID math.Uint - - switch grn.ResourceType() { - case gnfdresource.RESOURCE_TYPE_BUCKET: - bucketName, grnErr := grn.GetBucketName() - if grnErr != nil { - return math.ZeroUint(), grnErr - } - bucketInfo, found := k.GetBucketInfo(ctx, bucketName) - if !found { - return math.ZeroUint(), types.ErrNoSuchBucket.Wrapf("bucketName: %s", bucketName) - } - resOwner = sdk.MustAccAddressFromHex(bucketInfo.Owner) - resID = bucketInfo.Id - case gnfdresource.RESOURCE_TYPE_OBJECT: - bucketName, objectName, grnErr := grn.GetBucketAndObjectName() - if grnErr != nil { - return math.ZeroUint(), grnErr - } - objectInfo, found := k.GetObjectInfo(ctx, bucketName, objectName) - if !found { - return math.ZeroUint(), types.ErrNoSuchObject.Wrapf("BucketName: %s, objectName: %s", bucketName, objectName) - } - resOwner = sdk.MustAccAddressFromHex(objectInfo.Owner) - resID = objectInfo.Id - case gnfdresource.RESOURCE_TYPE_GROUP: - groupOwner, groupName, grnErr := grn.GetGroupOwnerAndAccount() - if grnErr != nil { - return math.ZeroUint(), grnErr - } - groupInfo, found := k.GetGroupInfo(ctx, groupOwner, groupName) - if !found { - return math.ZeroUint(), types.ErrNoSuchBucket.Wrapf("groupOwner: %s, groupName: %s", groupOwner.String(), groupName) - } - resOwner = sdk.MustAccAddressFromHex(groupInfo.Owner) - resID = groupInfo.Id - default: - return math.ZeroUint(), gnfderrors.ErrInvalidGRN.Wrap("Unknown resource type in greenfield resource name") +func (k Keeper) DeletePolicy( + ctx sdk.Context, operator sdk.AccAddress, principal *permtypes.Principal, grn types2.GRN, +) (math.Uint, error) { + resOwner, resID, err := k.getResourceOwnerAndIdFromGRN(ctx, grn) + if err != nil { + return math.ZeroUint(), err } if !operator.Equals(resOwner) { @@ -398,3 +293,45 @@ func (k Keeper) validatePrincipal(ctx sdk.Context, resOwner sdk.AccAddress, prin } return nil } + +func (k Keeper) getResourceOwnerAndIdFromGRN(ctx sdk.Context, grn types2.GRN) (resOwner sdk.AccAddress, resID math.Uint, err error) { + switch grn.ResourceType() { + case gnfdresource.RESOURCE_TYPE_BUCKET: + bucketName, grnErr := grn.GetBucketName() + if grnErr != nil { + return resOwner, resID, grnErr + } + bucketInfo, found := k.GetBucketInfo(ctx, bucketName) + if !found { + return resOwner, resID, types.ErrNoSuchBucket.Wrapf("bucketName: %s", bucketName) + } + resOwner = sdk.MustAccAddressFromHex(bucketInfo.Owner) + resID = bucketInfo.Id + case gnfdresource.RESOURCE_TYPE_OBJECT: + bucketName, objectName, grnErr := grn.GetBucketAndObjectName() + if grnErr != nil { + return resOwner, resID, grnErr + } + objectInfo, found := k.GetObjectInfo(ctx, bucketName, objectName) + if !found { + return resOwner, resID, types.ErrNoSuchObject.Wrapf("BucketName: %s, objectName: %s", bucketName, objectName) + } + resOwner = sdk.MustAccAddressFromHex(objectInfo.Owner) + resID = objectInfo.Id + case gnfdresource.RESOURCE_TYPE_GROUP: + groupOwner, groupName, grnErr := grn.GetGroupOwnerAndAccount() + if grnErr != nil { + return resOwner, resID, grnErr + } + groupInfo, found := k.GetGroupInfo(ctx, groupOwner, groupName) + if !found { + return resOwner, resID, types.ErrNoSuchBucket.Wrapf("groupOwner: %s, groupName: %s", groupOwner.String(), groupName) + } + resOwner = sdk.MustAccAddressFromHex(groupInfo.Owner) + resID = groupInfo.Id + default: + return resOwner, resID, gnfderrors.ErrInvalidGRN.Wrap("Unknown resource type in greenfield resource name") + } + + return resOwner, resID, nil +} diff --git a/x/storage/module_simulation.go b/x/storage/module_simulation.go index 6d58c4a58..c62146bf7 100644 --- a/x/storage/module_simulation.go +++ b/x/storage/module_simulation.go @@ -20,10 +20,6 @@ var ( _ = baseapp.Paramspace ) -const ( -// this line is used by starport scaffolding # simapp/module/const -) - // GenerateGenesisState creates a randomized GenState of the module func (AppModule) GenerateGenesisState(simState *module.SimulationState) { accs := make([]string, len(simState.Accounts)) @@ -32,7 +28,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } greenfieldGenesis := types.GenesisState{ Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&greenfieldGenesis) } @@ -48,7 +43,5 @@ func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) - - // this line is used by starport scaffolding # simapp/module/operation return operations } diff --git a/x/storage/types/codec.go b/x/storage/types/codec.go index 3aaf068b7..241228f30 100644 --- a/x/storage/types/codec.go +++ b/x/storage/types/codec.go @@ -27,7 +27,6 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgCompleteMigrateBucket{}, "storage/CompleteMigrateBucket", nil) cdc.RegisterConcrete(&MsgCancelMigrateBucket{}, "storage/CancelMigrateBucket", nil) cdc.RegisterConcrete(&MsgRejectMigrateBucket{}, "storage/RejectMigrateBucket", nil) - // this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -116,7 +115,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgRejectMigrateBucket{}, ) - // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/storage/types/events.pb.go b/x/storage/types/events.pb.go index b8848116b..c946185ff 100644 --- a/x/storage/types/events.pb.go +++ b/x/storage/types/events.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + _ "github.com/bnb-chain/greenfield/types/resource" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" @@ -52,6 +53,8 @@ type EventCreateBucket struct { GlobalVirtualGroupFamilyId uint32 `protobuf:"varint,10,opt,name=global_virtual_group_family_id,json=globalVirtualGroupFamilyId,proto3" json:"global_virtual_group_family_id,omitempty"` // status define the status of the bucket. Status BucketStatus `protobuf:"varint,11,opt,name=status,proto3,enum=greenfield.storage.BucketStatus" json:"status,omitempty"` + // tags define the tag of the bucket + Tags *ResourceTags `protobuf:"bytes,12,opt,name=tags,proto3" json:"tags,omitempty"` } func (m *EventCreateBucket) Reset() { *m = EventCreateBucket{} } @@ -157,6 +160,13 @@ func (m *EventCreateBucket) GetStatus() BucketStatus { return BUCKET_STATUS_CREATED } +func (m *EventCreateBucket) GetTags() *ResourceTags { + if m != nil { + return m.Tags + } + return nil +} + // EventDeleteBucket is emitted on MsgDeleteBucket type EventDeleteBucket struct { // operator define the account address of operator who delete the bucket @@ -425,6 +435,8 @@ type EventCreateObject struct { Checksums [][]byte `protobuf:"bytes,16,rep,name=checksums,proto3" json:"checksums,omitempty"` // local_virtual_group_id defines the unique id of lvg which the object stored LocalVirtualGroupId uint32 `protobuf:"varint,17,opt,name=local_virtual_group_id,json=localVirtualGroupId,proto3" json:"local_virtual_group_id,omitempty"` + // tags define the tag of the object + Tags *ResourceTags `protobuf:"bytes,18,opt,name=tags,proto3" json:"tags,omitempty"` } func (m *EventCreateObject) Reset() { *m = EventCreateObject{} } @@ -558,6 +570,13 @@ func (m *EventCreateObject) GetLocalVirtualGroupId() uint32 { return 0 } +func (m *EventCreateObject) GetTags() *ResourceTags { + if m != nil { + return m.Tags + } + return nil +} + // EventCancelCreateObject is emitted on MsgCancelCreateObject type EventCancelCreateObject struct { // operator define the account address of operator who cancel create object @@ -1115,6 +1134,8 @@ type EventCreateGroup struct { SourceType SourceType `protobuf:"varint,4,opt,name=source_type,json=sourceType,proto3,enum=greenfield.storage.SourceType" json:"source_type,omitempty"` // extra defines extra info for the group Extra string `protobuf:"bytes,5,opt,name=extra,proto3" json:"extra,omitempty"` + // tags define the tag of the group + Tags *ResourceTags `protobuf:"bytes,6,opt,name=tags,proto3" json:"tags,omitempty"` } func (m *EventCreateGroup) Reset() { *m = EventCreateGroup{} } @@ -1178,6 +1199,13 @@ func (m *EventCreateGroup) GetExtra() string { return "" } +func (m *EventCreateGroup) GetTags() *ResourceTags { + if m != nil { + return m.Tags + } + return nil +} + // EventDeleteGroup is emitted on MsgDeleteGroup type EventDeleteGroup struct { // owner define the account address of group owner @@ -2318,6 +2346,60 @@ func (m *EventCompleteMigrationBucket) GetSrcPrimarySpId() uint32 { return 0 } +type EventSetTag struct { + // resource defines a greenfield standard resource name that can be generated by GRN structure + Resource string `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + // tags define the tag of the source + Tags *ResourceTags `protobuf:"bytes,2,opt,name=tags,proto3" json:"tags,omitempty"` +} + +func (m *EventSetTag) Reset() { *m = EventSetTag{} } +func (m *EventSetTag) String() string { return proto.CompactTextString(m) } +func (*EventSetTag) ProtoMessage() {} +func (*EventSetTag) Descriptor() ([]byte, []int) { + return fileDescriptor_946dcba4f763ddc4, []int{30} +} +func (m *EventSetTag) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSetTag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventSetTag.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 *EventSetTag) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSetTag.Merge(m, src) +} +func (m *EventSetTag) XXX_Size() int { + return m.Size() +} +func (m *EventSetTag) XXX_DiscardUnknown() { + xxx_messageInfo_EventSetTag.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSetTag proto.InternalMessageInfo + +func (m *EventSetTag) GetResource() string { + if m != nil { + return m.Resource + } + return "" +} + +func (m *EventSetTag) GetTags() *ResourceTags { + if m != nil { + return m.Tags + } + return nil +} + func init() { proto.RegisterType((*EventCreateBucket)(nil), "greenfield.storage.EventCreateBucket") proto.RegisterType((*EventDeleteBucket)(nil), "greenfield.storage.EventDeleteBucket") @@ -2349,116 +2431,121 @@ func init() { proto.RegisterType((*EventCancelMigrationBucket)(nil), "greenfield.storage.EventCancelMigrationBucket") proto.RegisterType((*EventRejectMigrateBucket)(nil), "greenfield.storage.EventRejectMigrateBucket") proto.RegisterType((*EventCompleteMigrationBucket)(nil), "greenfield.storage.EventCompleteMigrationBucket") + proto.RegisterType((*EventSetTag)(nil), "greenfield.storage.EventSetTag") } func init() { proto.RegisterFile("greenfield/storage/events.proto", fileDescriptor_946dcba4f763ddc4) } var fileDescriptor_946dcba4f763ddc4 = []byte{ - // 1658 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xcd, 0x8f, 0xdb, 0x44, - 0x1b, 0x5f, 0x27, 0x4e, 0x36, 0x3b, 0xd9, 0x24, 0x5d, 0xbf, 0xfb, 0xb6, 0x7e, 0xb7, 0x7d, 0xb3, - 0xa9, 0x0f, 0x7d, 0xb7, 0xaf, 0x68, 0x82, 0xb6, 0x80, 0x7a, 0xab, 0xf6, 0xa3, 0xa0, 0x08, 0xfa, - 0x81, 0xb7, 0xed, 0x81, 0x8b, 0x35, 0xb1, 0x67, 0xb3, 0xa6, 0xb6, 0xc7, 0xd8, 0x93, 0x6d, 0xd3, - 0x7f, 0x80, 0x13, 0x52, 0x25, 0x84, 0x04, 0x97, 0x9e, 0x91, 0x10, 0x12, 0x87, 0x5e, 0xb9, 0x97, - 0x5b, 0x29, 0x17, 0x3e, 0xa4, 0x82, 0xda, 0x53, 0x91, 0x10, 0x9c, 0x39, 0x21, 0xcf, 0x8c, 0x1d, - 0x3b, 0xce, 0x36, 0xeb, 0x94, 0xed, 0xa6, 0xdc, 0xe2, 0xc9, 0x6f, 0xc6, 0xcf, 0xf3, 0xcc, 0xef, - 0xf9, 0x3d, 0xcf, 0x8c, 0xc1, 0x72, 0xd7, 0x43, 0xc8, 0xd9, 0x36, 0x91, 0x65, 0xb4, 0x7c, 0x82, - 0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x4f, 0x8f, 0xd1, 0x6f, 0xbd, 0x7d, 0xff, 0x71, 0x5d, 0x78, 0xf0, 0xb8, 0x2e, 0xfc, 0xf2, 0xb8, - 0x2e, 0xdc, 0x79, 0x52, 0x9f, 0x79, 0xf0, 0xa4, 0x3e, 0xf3, 0xfd, 0x93, 0xfa, 0xcc, 0x7b, 0xad, - 0xae, 0x49, 0x76, 0x7a, 0x9d, 0xa6, 0x8e, 0xed, 0x56, 0xc7, 0xe9, 0x9c, 0xa1, 0x8a, 0xd0, 0x8a, - 0x7d, 0xc3, 0xbf, 0x95, 0xfc, 0x8a, 0xdf, 0x29, 0xd2, 0xce, 0xee, 0xec, 0x5f, 0x01, 0x00, 0x00, - 0xff, 0xff, 0x47, 0x07, 0x50, 0x6a, 0x90, 0x20, 0x00, 0x00, + // 1727 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x5a, 0xcf, 0x8f, 0xdb, 0x4a, + 0x1d, 0x5f, 0xe7, 0xd7, 0x66, 0xc7, 0x9b, 0xa4, 0x6b, 0x96, 0x3e, 0xb3, 0xef, 0x91, 0xcd, 0xf3, + 0xe1, 0x91, 0x87, 0x68, 0x82, 0xf6, 0x3d, 0x50, 0x6f, 0xd5, 0xfe, 0x28, 0x28, 0x82, 0xfe, 0xc0, + 0xbb, 0xed, 0x81, 0x8b, 0x35, 0xb1, 0x67, 0xbd, 0xa6, 0xb6, 0xc7, 0x78, 0x26, 0xdb, 0xa6, 0xff, + 0x00, 0xe2, 0x80, 0xd4, 0x0b, 0x12, 0x5c, 0x7a, 0x44, 0x48, 0x08, 0x89, 0x43, 0xaf, 0xdc, 0xdb, + 0x5b, 0xe9, 0x89, 0x1f, 0x52, 0x41, 0xed, 0xa9, 0x48, 0x88, 0x3b, 0x27, 0xe4, 0x99, 0xb1, 0x63, + 0xc7, 0xd9, 0x66, 0x9d, 0xb2, 0xdd, 0x2d, 0xb7, 0x78, 0xf2, 0x99, 0xf1, 0xf7, 0xfb, 0x99, 0xcf, + 0xf7, 0xc7, 0x4c, 0x02, 0x36, 0xed, 0x10, 0x21, 0xff, 0xd0, 0x41, 0xae, 0xd5, 0x27, 0x14, 0x87, + 0xd0, 0x46, 0x7d, 0x74, 0x8c, 0x7c, 0x4a, 0x7a, 0x41, 0x88, 0x29, 0x56, 0x94, 0x09, 0xa0, 0x27, + 0x00, 0x1b, 0x5f, 0x33, 0x31, 0xf1, 0x30, 0x31, 0x18, 0xa2, 0xcf, 0x1f, 0x38, 0x7c, 0x63, 0xdd, + 0xc6, 0x36, 0xe6, 0xe3, 0xd1, 0x27, 0x31, 0xba, 0x69, 0x63, 0x6c, 0xbb, 0xa8, 0xcf, 0x9e, 0x86, + 0xa3, 0xc3, 0x3e, 0x75, 0x3c, 0x44, 0x28, 0xf4, 0x82, 0x04, 0x30, 0x31, 0x23, 0x44, 0x04, 0x8f, + 0x42, 0x13, 0xf5, 0xe9, 0x38, 0x40, 0x64, 0x06, 0x20, 0xb6, 0xd3, 0xc4, 0x9e, 0x87, 0x7d, 0x01, + 0x68, 0xcf, 0x00, 0xa4, 0x16, 0xd0, 0x7e, 0x5e, 0x05, 0x6b, 0xd7, 0x23, 0xc7, 0x76, 0x43, 0x04, + 0x29, 0xda, 0x19, 0x99, 0xf7, 0x10, 0x55, 0x7a, 0xa0, 0x8a, 0xef, 0xfb, 0x28, 0x54, 0xa5, 0x8e, + 0xd4, 0x5d, 0xd9, 0x51, 0x5f, 0x3c, 0xb9, 0xb2, 0x2e, 0xfc, 0xd9, 0xb6, 0xac, 0x10, 0x11, 0xb2, + 0x4f, 0x43, 0xc7, 0xb7, 0x75, 0x0e, 0x53, 0x36, 0x81, 0x3c, 0x64, 0x33, 0x0d, 0x1f, 0x7a, 0x48, + 0x2d, 0x45, 0xb3, 0x74, 0xc0, 0x87, 0x6e, 0x42, 0x0f, 0x29, 0x3b, 0x00, 0x1c, 0x3b, 0xc4, 0x19,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6b, 0x1c, 0x3b, 0x21, 0x1d, 0x41, 0xd7, 0xb0, 0x43, 0x3c, 0x0a, + 0x8c, 0x43, 0xe8, 0x39, 0xee, 0x38, 0x9a, 0x04, 0xd8, 0xa4, 0x0d, 0x8e, 0xba, 0xcb, 0x41, 0xdf, + 0x8f, 0x30, 0xdf, 0x63, 0x90, 0x81, 0xa5, 0x5c, 0x05, 0x35, 0x42, 0x21, 0x1d, 0x11, 0x55, 0x66, + 0xa4, 0x74, 0x66, 0x91, 0xc2, 0x15, 0xb3, 0xcf, 0x70, 0xba, 0xc0, 0x2b, 0x5f, 0x82, 0x0a, 0x85, + 0x36, 0x51, 0x57, 0x3b, 0x52, 0x57, 0x9e, 0x3d, 0x4f, 0x17, 0x72, 0x3e, 0x80, 0x36, 0xd1, 0x19, + 0x5a, 0xfb, 0x55, 0x49, 0x68, 0x71, 0x0f, 0xb9, 0x28, 0xd1, 0xe2, 0x97, 0xa0, 0x8e, 0x03, 0x14, + 0x42, 0x8a, 0xe7, 0xcb, 0x31, 0x41, 0x4e, 0x14, 0x5c, 0x5a, 0x48, 0xc1, 0xe5, 0x9c, 0x82, 0x33, + 0x02, 0xab, 0x14, 0x11, 0xd8, 0xfc, 0xad, 0xa8, 0xce, 0xdb, 0x0a, 0xed, 0x67, 0x65, 0xf0, 0x55, + 0x46, 0xcd, 0x9d, 0xc0, 0x4a, 0xc2, 0x74, 0xe0, 0x1f, 0xe2, 0x05, 0xe9, 0x99, 0x1b, 0xb0, 0x19, + 0x77, 0xcb, 0x45, 0xdc, 0x9d, 0x1d, 0x0e, 0x95, 0x13, 0xc2, 0xe1, 0x1b, 0xf9, 0x70, 0x60, 0xd1, + 0x9b, 0x13, 0x7d, 0x36, 0x83, 0xd4, 0x16, 0xca, 0x20, 0xf3, 0x77, 0x62, 0x79, 0xee, 0x4e, 0xfc, + 0x56, 0x02, 0x97, 0xb9, 0x48, 0x1d, 0x62, 0x62, 0x9f, 0x3a, 0xfe, 0x28, 0x56, 0x6a, 0x86, 0x33, + 0xa9, 0x08, 0x67, 0x73, 0xb7, 0xe3, 0x32, 0xa8, 0x85, 0x08, 0x12, 0xec, 0x0b, 0x65, 0x8a, 0xa7, + 0x28, 0x27, 0x5a, 0x2c, 0x58, 0x52, 0x39, 0x91, 0x0f, 0x6c, 0x53, 0xed, 0x59, 0x2d, 0x93, 0xdb, + 0x6f, 0x0d, 0x7f, 0x82, 0x4c, 0xaa, 0x6c, 0x81, 0x65, 0x96, 0x35, 0x4f, 0xa1, 0x97, 0x18, 0xf8, + 0xbf, 0x8f, 0xa6, 0x4d, 0x20, 0x63, 0x66, 0x0e, 0x07, 0x54, 0x38, 0x80, 0x0f, 0xe5, 0xf5, 0x57, + 0x2b, 0xc2, 0xe5, 0x55, 0xb0, 0x22, 0x96, 0x16, 0xfb, 0x39, 0x6f, 0x26, 0x47, 0x0f, 0xac, 0x7c, + 0x5e, 0xad, 0xe7, 0xf3, 0xea, 0xa7, 0x60, 0x35, 0x80, 0x63, 0x17, 0x43, 0xcb, 0x20, 0xce, 0x43, + 0xc4, 0x52, 0x6f, 0x45, 0x97, 0xc5, 0xd8, 0xbe, 0xf3, 0x70, 0xba, 0xd6, 0x81, 0x85, 0x94, 0xfa, + 0x29, 0x58, 0x8d, 0xc4, 0x15, 0x85, 0x05, 0xab, 0x4a, 0x32, 0x23, 0x48, 0x16, 0x63, 0xac, 0xec, + 0x64, 0xca, 0xe1, 0x6a, 0xae, 0x1c, 0xc6, 0xa9, 0xbb, 0x71, 0x72, 0xea, 0xe6, 0x82, 0x98, 0x4a, + 0xdd, 0x3f, 0x00, 0xad, 0x10, 0x59, 0x23, 0xdf, 0x82, 0xbe, 0x39, 0xe6, 0x2f, 0x6f, 0x9e, 0xec, + 0x82, 0x9e, 0x40, 0x99, 0x0b, 0xcd, 0x30, 0xf3, 0x3c, 0x5d, 0x5b, 0x5b, 0x85, 0x6b, 0xeb, 0x27, + 0x60, 0xc5, 0x3c, 0x42, 0xe6, 0x3d, 0x32, 0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3, 0x2e, 0xed, + 0x9a, 0x16, 0xa1, 0xb7, 0x27, 0xf7, 0x76, 0xda, 0xef, 0x25, 0xb0, 0x91, 0xba, 0x6f, 0xbc, 0xe8, + 0xae, 0x45, 0x52, 0x55, 0x53, 0x77, 0x04, 0xdc, 0x5e, 0x74, 0x51, 0xad, 0x7d, 0x5c, 0x02, 0x9f, + 0x88, 0xfb, 0x36, 0x2f, 0x88, 0x84, 0x74, 0xe1, 0xa5, 0x33, 0xff, 0xa7, 0xab, 0xca, 0xdc, 0xdf, + 0x73, 0x3f, 0x07, 0x6b, 0x24, 0x34, 0xa7, 0xe4, 0xc7, 0xd3, 0x66, 0x93, 0x84, 0x66, 0x5a, 0x7e, + 0x06, 0x90, 0xc5, 0xdd, 0x2f, 0x3d, 0x80, 0x76, 0x14, 0xbf, 0xf1, 0xdf, 0x0f, 0xc4, 0xbd, 0x48, + 0xf2, 0x9c, 0x9c, 0x51, 0x4b, 0x45, 0xce, 0xa8, 0x3b, 0x83, 0xa7, 0xaf, 0xda, 0xd2, 0xf3, 0x57, + 0x6d, 0xe9, 0x1f, 0xaf, 0xda, 0xd2, 0xa3, 0xd7, 0xed, 0xa5, 0xe7, 0xaf, 0xdb, 0x4b, 0x7f, 0x7e, + 0xdd, 0x5e, 0xfa, 0x71, 0xdf, 0x76, 0xe8, 0xd1, 0x68, 0xd8, 0x33, 0xb1, 0xd7, 0x1f, 0xfa, 0xc3, + 0x2b, 0x2c, 0xe5, 0xf4, 0x53, 0x7f, 0x63, 0x78, 0x90, 0xfd, 0x23, 0xc3, 0xb0, 0xc6, 0x5a, 0xc7, + 0x2f, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xf1, 0xd5, 0x62, 0x2f, 0xb4, 0x21, 0x00, 0x00, } func (m *EventCreateBucket) Marshal() (dAtA []byte, err error) { @@ -2481,6 +2568,18 @@ func (m *EventCreateBucket) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Tags != nil { + { + size, err := m.Tags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } if m.Status != 0 { i = encodeVarintEvents(dAtA, i, uint64(m.Status)) i-- @@ -2750,6 +2849,20 @@ func (m *EventCreateObject) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Tags != nil { + { + size, err := m.Tags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } if m.LocalVirtualGroupId != 0 { i = encodeVarintEvents(dAtA, i, uint64(m.LocalVirtualGroupId)) i-- @@ -3316,6 +3429,18 @@ func (m *EventCreateGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Tags != nil { + { + size, err := m.Tags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } if len(m.Extra) > 0 { i -= len(m.Extra) copy(dAtA[i:], m.Extra) @@ -3627,12 +3752,12 @@ func (m *EventGroupMemberDetail) MarshalToSizedBuffer(dAtA []byte) (int, error) var l int _ = l if m.ExpirationTime != nil { - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.ExpirationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ExpirationTime):]) - if err1 != nil { - return 0, err1 + n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.ExpirationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ExpirationTime):]) + if err4 != nil { + return 0, err4 } - i -= n1 - i = encodeVarintEvents(dAtA, i, uint64(n1)) + i -= n4 + i = encodeVarintEvents(dAtA, i, uint64(n4)) i-- dAtA[i] = 0x12 } @@ -4270,6 +4395,48 @@ func (m *EventCompleteMigrationBucket) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *EventSetTag) 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 *EventSetTag) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSetTag) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Tags != nil { + { + size, err := m.Tags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Resource) > 0 { + i -= len(m.Resource) + copy(dAtA[i:], m.Resource) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Resource))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -4322,6 +4489,10 @@ func (m *EventCreateBucket) Size() (n int) { if m.Status != 0 { n += 1 + sovEvents(uint64(m.Status)) } + if m.Tags != nil { + l = m.Tags.Size() + n += 1 + l + sovEvents(uint64(l)) + } return n } @@ -4465,6 +4636,10 @@ func (m *EventCreateObject) Size() (n int) { if m.LocalVirtualGroupId != 0 { n += 2 + sovEvents(uint64(m.LocalVirtualGroupId)) } + if m.Tags != nil { + l = m.Tags.Size() + n += 2 + l + sovEvents(uint64(l)) + } return n } @@ -4682,6 +4857,10 @@ func (m *EventCreateGroup) Size() (n int) { if l > 0 { n += 1 + l + sovEvents(uint64(l)) } + if m.Tags != nil { + l = m.Tags.Size() + n += 1 + l + sovEvents(uint64(l)) + } return n } @@ -5076,6 +5255,23 @@ func (m *EventCompleteMigrationBucket) Size() (n int) { return n } +func (m *EventSetTag) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Resource) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.Tags != nil { + l = m.Tags.Size() + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + func sovEvents(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -5374,6 +5570,42 @@ func (m *EventCreateBucket) Unmarshal(dAtA []byte) error { break } } + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tags == nil { + m.Tags = &ResourceTags{} + } + if err := m.Tags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) @@ -6439,6 +6671,42 @@ func (m *EventCreateObject) Unmarshal(dAtA []byte) error { break } } + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tags == nil { + m.Tags = &ResourceTags{} + } + if err := m.Tags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) @@ -8116,6 +8384,42 @@ func (m *EventCreateGroup) Unmarshal(dAtA []byte) error { } m.Extra = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tags == nil { + m.Tags = &ResourceTags{} + } + if err := m.Tags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) @@ -11055,6 +11359,124 @@ func (m *EventCompleteMigrationBucket) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventSetTag) 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 ErrIntOverflowEvents + } + 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: EventSetTag: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSetTag: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resource = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tags == nil { + m.Tags = &ResourceTags{} + } + if err := m.Tags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvents(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/storage/types/genesis.go b/x/storage/types/genesis.go index b89c5f179..9d633ecd7 100644 --- a/x/storage/types/genesis.go +++ b/x/storage/types/genesis.go @@ -3,7 +3,6 @@ package types // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } } @@ -11,7 +10,5 @@ func DefaultGenesis() *GenesisState { // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - // this line is used by starport scaffolding # genesis/types/validate - return gs.Params.Validate() } diff --git a/x/storage/types/genesis_test.go b/x/storage/types/genesis_test.go index 5cf47bdb6..e71c8ae55 100644 --- a/x/storage/types/genesis_test.go +++ b/x/storage/types/genesis_test.go @@ -52,12 +52,9 @@ func TestGenesisState_Validate(t *testing.T) { MinQuotaUpdateInterval: 10000, MaxLocalVirtualGroupNumPerBucket: 100, }, - - // this line is used by starport scaffolding # types/genesis/validField }, valid: true, }, - // this line is used by starport scaffolding # types/genesis/testcase } { t.Run(tc.desc, func(t *testing.T) { err := tc.genState.Validate() diff --git a/x/storage/types/message.go b/x/storage/types/message.go index 1ffb6c133..a0ee67da4 100644 --- a/x/storage/types/message.go +++ b/x/storage/types/message.go @@ -53,7 +53,12 @@ const ( TypeMsgPutPolicy = "put_policy" TypeMsgDeletePolicy = "delete_policy" + TypeMsgSetTag = "set_tag" + MaxGroupMemberLimitOnce = 20 + MaxTagCount = 4 + MaxTagKeyLength = 32 + MaxTagValueLength = 64 // For discontinue MaxDiscontinueReasonLen = 128 @@ -101,8 +106,26 @@ var ( // NewMsgCreateBucket creates a new MsgCreateBucket instance. func NewMsgCreateBucket( - creator sdk.AccAddress, bucketName string, Visibility VisibilityType, - primarySPAddress sdk.AccAddress, paymentAddress sdk.AccAddress, timeoutHeight uint64, sig []byte, chargedReadQuota uint64) *MsgCreateBucket { + creator sdk.AccAddress, bucketName string, Visibility VisibilityType, primarySPAddress, paymentAddress sdk.AccAddress, + timeoutHeight uint64, sig []byte, chargedReadQuota uint64, +) *MsgCreateBucket { + return &MsgCreateBucket{ + Creator: creator.String(), + BucketName: bucketName, + Visibility: Visibility, + PaymentAddress: paymentAddress.String(), + PrimarySpAddress: primarySPAddress.String(), + PrimarySpApproval: &common.Approval{ExpiredHeight: timeoutHeight, Sig: sig}, + ChargedReadQuota: chargedReadQuota, + } +} + +// NewMsgCreateBucketWithTags creates a new MsgCreateBucket instance with tags. +// Since: Manchurian upgrade +func NewMsgCreateBucketWithTags( + creator sdk.AccAddress, bucketName string, Visibility VisibilityType, primarySPAddress, paymentAddress sdk.AccAddress, + timeoutHeight uint64, sig []byte, chargedReadQuota uint64, tags ResourceTags, +) *MsgCreateBucket { return &MsgCreateBucket{ Creator: creator.String(), BucketName: bucketName, @@ -111,6 +134,7 @@ func NewMsgCreateBucket( PrimarySpAddress: primarySPAddress.String(), PrimarySpApproval: &common.Approval{ExpiredHeight: timeoutHeight, Sig: sig}, ChargedReadQuota: chargedReadQuota, + Tags: tags, } } @@ -181,6 +205,29 @@ func (msg *MsgCreateBucket) ValidateBasic() error { return nil } +func (msg *MsgCreateBucket) ValidateRuntime(ctx sdk.Context) error { + if ctx.IsUpgraded(upgradetypes.Manchurian) { + if len(msg.Tags.GetTags()) > MaxTagCount { + return gnfderrors.ErrInvalidParameter.Wrapf("Tags count limit exceeded") + } + if len(msg.Tags.GetTags()) > 0 { + for _, tag := range msg.Tags.GetTags() { + if len(tag.GetKey()) > MaxTagKeyLength { + return gnfderrors.ErrInvalidParameter.Wrapf("Tag key length exceeded") + } + if len(tag.GetValue()) > MaxTagValueLength { + return gnfderrors.ErrInvalidParameter.Wrapf("Tag value length exceeded") + } + } + } + } else { + if len(msg.Tags.GetTags()) > 0 { + return gnfderrors.ErrInvalidParameter.Wrapf("Tags are not supported") + } + } + return nil +} + // NewMsgDeleteBucket creates a new MsgDeleteBucket instance func NewMsgDeleteBucket(operator sdk.AccAddress, bucketName string) *MsgDeleteBucket { return &MsgDeleteBucket{ @@ -289,9 +336,29 @@ func (msg *MsgUpdateBucketInfo) ValidateBasic() error { // NewMsgCreateObject creates a new MsgCreateObject instance. func NewMsgCreateObject( - creator sdk.AccAddress, bucketName string, objectName string, payloadSize uint64, - Visibility VisibilityType, expectChecksums [][]byte, contentType string, redundancyType RedundancyType, timeoutHeight uint64, sig []byte) *MsgCreateObject { + creator sdk.AccAddress, bucketName, objectName string, payloadSize uint64, Visibility VisibilityType, + expectChecksums [][]byte, contentType string, redundancyType RedundancyType, timeoutHeight uint64, sig []byte, +) *MsgCreateObject { + return &MsgCreateObject{ + Creator: creator.String(), + BucketName: bucketName, + ObjectName: objectName, + PayloadSize: payloadSize, + Visibility: Visibility, + ContentType: contentType, + PrimarySpApproval: &common.Approval{ExpiredHeight: timeoutHeight, Sig: sig}, + ExpectChecksums: expectChecksums, + RedundancyType: redundancyType, + } +} +// NewMsgCreateObjectWithTags creates a new MsgCreateObject instance with tags. +// Since: Manchurian upgrade +func NewMsgCreateObjectWithTags( + creator sdk.AccAddress, bucketName, objectName string, payloadSize uint64, Visibility VisibilityType, + expectChecksums [][]byte, contentType string, redundancyType RedundancyType, timeoutHeight uint64, sig []byte, + tags ResourceTags, +) *MsgCreateObject { return &MsgCreateObject{ Creator: creator.String(), BucketName: bucketName, @@ -302,6 +369,7 @@ func NewMsgCreateObject( PrimarySpApproval: &common.Approval{ExpiredHeight: timeoutHeight, Sig: sig}, ExpectChecksums: expectChecksums, RedundancyType: redundancyType, + Tags: tags, } } @@ -367,6 +435,29 @@ func (msg *MsgCreateObject) ValidateBasic() error { return nil } +func (msg *MsgCreateObject) ValidateRuntime(ctx sdk.Context) error { + if ctx.IsUpgraded(upgradetypes.Manchurian) { + if len(msg.Tags.GetTags()) > MaxTagCount { + return gnfderrors.ErrInvalidParameter.Wrapf("Tags count limit exceeded") + } + if len(msg.Tags.GetTags()) > 0 { + for _, tag := range msg.Tags.GetTags() { + if len(tag.GetKey()) > MaxTagKeyLength { + return gnfderrors.ErrInvalidParameter.Wrapf("Tag key length exceeded") + } + if len(tag.GetValue()) > MaxTagValueLength { + return gnfderrors.ErrInvalidParameter.Wrapf("Tag value length exceeded") + } + } + } + } else { + if len(msg.Tags.GetTags()) > 0 { + return gnfderrors.ErrInvalidParameter.Wrapf("Tags are not supported") + } + } + return nil +} + // GetApprovalBytes returns the message bytes of approval info. func (msg *MsgCreateObject) GetApprovalBytes() []byte { fakeMsg := proto.Clone(msg).(*MsgCreateObject) @@ -374,7 +465,7 @@ func (msg *MsgCreateObject) GetApprovalBytes() []byte { return fakeMsg.GetSignBytes() } -func NewMsgCancelCreateObject(operator sdk.AccAddress, bucketName string, objectName string) *MsgCancelCreateObject { +func NewMsgCancelCreateObject(operator sdk.AccAddress, bucketName, objectName string) *MsgCancelCreateObject { return &MsgCancelCreateObject{ Operator: operator.String(), BucketName: bucketName, @@ -421,7 +512,7 @@ func (msg *MsgCancelCreateObject) ValidateBasic() error { return nil } -func NewMsgDeleteObject(operator sdk.AccAddress, bucketName string, objectName string) *MsgDeleteObject { +func NewMsgDeleteObject(operator sdk.AccAddress, bucketName, objectName string) *MsgDeleteObject { return &MsgDeleteObject{ Operator: operator.String(), BucketName: bucketName, @@ -474,9 +565,9 @@ func (msg *MsgDeleteObject) ValidateBasic() error { } func NewMsgSealObject( - operator sdk.AccAddress, bucketName string, objectName string, globalVirtualGroupID uint32, - secondarySpBlsSignatures []byte) *MsgSealObject { - + operator sdk.AccAddress, bucketName, objectName string, globalVirtualGroupID uint32, + secondarySpBlsSignatures []byte, +) *MsgSealObject { return &MsgSealObject{ Operator: operator.String(), BucketName: bucketName, @@ -538,8 +629,9 @@ func (msg *MsgSealObject) ValidateBasic() error { } func NewMsgCopyObject( - operator sdk.AccAddress, srcBucketName string, dstBucketName string, - srcObjectName string, dstObjectName string, timeoutHeight uint64, sig []byte) *MsgCopyObject { + operator sdk.AccAddress, srcBucketName, dstBucketName string, + srcObjectName, dstObjectName string, timeoutHeight uint64, sig []byte, +) *MsgCopyObject { return &MsgCopyObject{ Operator: operator.String(), SrcBucketName: srcBucketName, @@ -614,7 +706,7 @@ func (msg *MsgCopyObject) ValidateBasic() error { return nil } -func NewMsgRejectUnsealedObject(operator sdk.AccAddress, bucketName string, objectName string) *MsgRejectSealObject { +func NewMsgRejectUnsealedObject(operator sdk.AccAddress, bucketName, objectName string) *MsgRejectSealObject { return &MsgRejectSealObject{ Operator: operator.String(), BucketName: bucketName, @@ -723,7 +815,7 @@ func (msg *MsgDiscontinueObject) ValidateBasic() error { return nil } -func NewMsgDiscontinueBucket(operator sdk.AccAddress, bucketName string, reason string) *MsgDiscontinueBucket { +func NewMsgDiscontinueBucket(operator sdk.AccAddress, bucketName, reason string) *MsgDiscontinueBucket { return &MsgDiscontinueBucket{ Operator: operator.String(), BucketName: bucketName, @@ -776,8 +868,9 @@ func (msg *MsgDiscontinueBucket) ValidateBasic() error { } func NewMsgUpdateObjectInfo( - operator sdk.AccAddress, bucketName string, objectName string, - visibility VisibilityType) *MsgUpdateObjectInfo { + operator sdk.AccAddress, bucketName, objectName string, + visibility VisibilityType, +) *MsgUpdateObjectInfo { return &MsgUpdateObjectInfo{ Operator: operator.String(), BucketName: bucketName, @@ -834,11 +927,20 @@ func (msg *MsgUpdateObjectInfo) ValidateBasic() error { return nil } -func NewMsgCreateGroup(creator sdk.AccAddress, groupName string, extra string) *MsgCreateGroup { +func NewMsgCreateGroup(creator sdk.AccAddress, groupName, extra string) *MsgCreateGroup { + return &MsgCreateGroup{ + Creator: creator.String(), + GroupName: groupName, + Extra: extra, + } +} + +func NewMsgCreateGroupWithTags(creator sdk.AccAddress, groupName, extra string, tags ResourceTags) *MsgCreateGroup { return &MsgCreateGroup{ Creator: creator.String(), GroupName: groupName, Extra: extra, + Tags: tags, } } @@ -885,6 +987,29 @@ func (msg *MsgCreateGroup) ValidateBasic() error { return nil } +func (msg *MsgCreateGroup) ValidateRuntime(ctx sdk.Context) error { + if ctx.IsUpgraded(upgradetypes.Manchurian) { + if len(msg.Tags.GetTags()) > MaxTagCount { + return gnfderrors.ErrInvalidParameter.Wrapf("Tags count limit exceeded") + } + if len(msg.Tags.GetTags()) > 0 { + for _, tag := range msg.Tags.GetTags() { + if len(tag.GetKey()) > MaxTagKeyLength { + return gnfderrors.ErrInvalidParameter.Wrapf("Tag key length exceeded") + } + if len(tag.GetValue()) > MaxTagValueLength { + return gnfderrors.ErrInvalidParameter.Wrapf("Tag value length exceeded") + } + } + } + } else { + if len(msg.Tags.GetTags()) > 0 { + return gnfderrors.ErrInvalidParameter.Wrapf("Tags are not supported") + } + } + return nil +} + func NewMsgDeleteGroup(operator sdk.AccAddress, groupName string) *MsgDeleteGroup { return &MsgDeleteGroup{ Operator: operator.String(), @@ -931,7 +1056,7 @@ func (msg *MsgDeleteGroup) ValidateBasic() error { return nil } -func NewMsgLeaveGroup(member sdk.AccAddress, groupOwner sdk.AccAddress, groupName string) *MsgLeaveGroup { +func NewMsgLeaveGroup(member, groupOwner sdk.AccAddress, groupName string) *MsgLeaveGroup { return &MsgLeaveGroup{ Member: member.String(), GroupOwner: groupOwner.String(), @@ -984,8 +1109,9 @@ func (msg *MsgLeaveGroup) ValidateBasic() error { } func NewMsgUpdateGroupMember( - operator sdk.AccAddress, groupOwner sdk.AccAddress, groupName string, membersToAdd []*MsgGroupMember, - membersToDelete []sdk.AccAddress) *MsgUpdateGroupMember { + operator, groupOwner sdk.AccAddress, groupName string, membersToAdd []*MsgGroupMember, + membersToDelete []sdk.AccAddress, +) *MsgUpdateGroupMember { var membersAddrToDelete []string for _, member := range membersToDelete { membersAddrToDelete = append(membersAddrToDelete, member.String()) @@ -1063,7 +1189,7 @@ func (msg *MsgUpdateGroupMember) ValidateBasic() error { return nil } -func NewMsgUpdateGroupExtra(operator sdk.AccAddress, groupOwner sdk.AccAddress, groupName, extra string) *MsgUpdateGroupExtra { +func NewMsgUpdateGroupExtra(operator, groupOwner sdk.AccAddress, groupName, extra string) *MsgUpdateGroupExtra { return &MsgUpdateGroupExtra{ Operator: operator.String(), GroupOwner: groupOwner.String(), @@ -1121,7 +1247,8 @@ func (msg *MsgUpdateGroupExtra) ValidateBasic() error { } func NewMsgPutPolicy(operator sdk.AccAddress, resource string, - principal *permtypes.Principal, statements []*permtypes.Statement, expirationTime *time.Time) *MsgPutPolicy { + principal *permtypes.Principal, statements []*permtypes.Statement, expirationTime *time.Time, +) *MsgPutPolicy { return &MsgPutPolicy{ Operator: operator.String(), Resource: resource, @@ -1441,8 +1568,8 @@ func (msg *MsgMirrorGroup) ValidateBasic() error { } // GetSignBytes implements the LegacyMsg interface. -func (m MsgUpdateParams) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +func (m *MsgUpdateParams) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) } // GetSigners returns the expected signers for a MsgUpdateParams message. @@ -1465,8 +1592,8 @@ func (m *MsgUpdateParams) ValidateBasic() error { } func NewMsgRenewGroupMember( - operator sdk.AccAddress, groupOwner sdk.AccAddress, groupName string, members []*MsgGroupMember) *MsgRenewGroupMember { - + operator, groupOwner sdk.AccAddress, groupName string, members []*MsgGroupMember, +) *MsgRenewGroupMember { return &MsgRenewGroupMember{ Operator: operator.String(), GroupOwner: groupOwner.String(), @@ -1532,3 +1659,66 @@ func (msg *MsgRenewGroupMember) ValidateBasic() error { return nil } + +func NewMsgSetTag(operator sdk.AccAddress, resource string, tags *ResourceTags) *MsgSetTag { + return &MsgSetTag{ + Operator: operator.String(), + Resource: resource, + Tags: tags, + } +} + +// Route implements the sdk.Msg interface. +func (msg *MsgSetTag) Route() string { + return RouterKey +} + +// Type implements the sdk.Msg interface. +func (msg *MsgSetTag) Type() string { + return TypeMsgSetTag +} + +// GetSigners implements the sdk.Msg interface. +func (msg *MsgSetTag) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromHexUnsafe(msg.Operator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +// GetSignBytes returns the message bytes to sign over. +func (msg *MsgSetTag) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +// ValidateBasic implements the sdk.Msg interface. +func (msg *MsgSetTag) ValidateBasic() error { + _, err := sdk.AccAddressFromHexUnsafe(msg.Operator) + if err != nil { + return errors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + + var grn grn2.GRN + err = grn.ParseFromString(msg.Resource, true) + if err != nil { + return errors.Wrapf(gnfderrors.ErrInvalidGRN, "invalid greenfield resource name (%s)", err) + } + + if len(msg.Tags.GetTags()) > MaxTagCount { + return gnfderrors.ErrInvalidParameter.Wrapf("Tags count limit exceeded") + } + if len(msg.Tags.GetTags()) > 0 { + for _, tag := range msg.Tags.GetTags() { + if len(tag.GetKey()) > MaxTagKeyLength { + return gnfderrors.ErrInvalidParameter.Wrapf("Tag key length exceeded") + } + if len(tag.GetValue()) > MaxTagValueLength { + return gnfderrors.ErrInvalidParameter.Wrapf("Tag value length exceeded") + } + } + } + + return nil +} diff --git a/x/storage/types/options.go b/x/storage/types/options.go index a16ced30c..ff4dd68b0 100644 --- a/x/storage/types/options.go +++ b/x/storage/types/options.go @@ -13,6 +13,7 @@ type CreateBucketOptions struct { PaymentAddress string PrimarySpApproval *common.Approval ApprovalMsgBytes []byte + Tags *ResourceTags } type DeleteBucketOptions struct { @@ -34,6 +35,7 @@ type CreateObjectOptions struct { Checksums [][]byte PrimarySpApproval *common.Approval ApprovalMsgBytes []byte + Tags *ResourceTags } type CancelCreateObjectOptions struct { @@ -50,10 +52,13 @@ type CopyObjectOptions struct { PrimarySpApproval *common.Approval ApprovalMsgBytes []byte } + type CreateGroupOptions struct { SourceType SourceType Extra string + Tags *ResourceTags } + type LeaveGroupOptions struct { SourceType SourceType } diff --git a/x/storage/types/tx.pb.go b/x/storage/types/tx.pb.go index 95729c350..8b9901832 100644 --- a/x/storage/types/tx.pb.go +++ b/x/storage/types/tx.pb.go @@ -54,6 +54,8 @@ type MsgCreateBucket struct { // The available read data for each user is the sum of the free read data provided by SP and // the ChargeReadQuota specified here. ChargedReadQuota uint64 `protobuf:"varint,7,opt,name=charged_read_quota,json=chargedReadQuota,proto3" json:"charged_read_quota,omitempty"` + // tags defines a list of tags which will be set to the bucket + Tags ResourceTags `protobuf:"bytes,8,opt,name=tags,proto3" json:"tags"` } func (m *MsgCreateBucket) Reset() { *m = MsgCreateBucket{} } @@ -138,6 +140,13 @@ func (m *MsgCreateBucket) GetChargedReadQuota() uint64 { return 0 } +func (m *MsgCreateBucket) GetTags() ResourceTags { + if m != nil { + return m.Tags + } + return ResourceTags{} +} + type MsgCreateBucketResponse struct { BucketId Uint `protobuf:"bytes,1,opt,name=bucket_id,json=bucketId,proto3,customtype=Uint" json:"bucket_id"` } @@ -384,6 +393,8 @@ type MsgCreateObject struct { ExpectChecksums [][]byte `protobuf:"bytes,8,rep,name=expect_checksums,json=expectChecksums,proto3" json:"expect_checksums,omitempty"` // redundancy_type can be ec or replica RedundancyType RedundancyType `protobuf:"varint,9,opt,name=redundancy_type,json=redundancyType,proto3,enum=greenfield.storage.RedundancyType" json:"redundancy_type,omitempty"` + // tags defines a list of tags which will be set to the object + Tags ResourceTags `protobuf:"bytes,10,opt,name=tags,proto3" json:"tags"` } func (m *MsgCreateObject) Reset() { *m = MsgCreateObject{} } @@ -482,6 +493,13 @@ func (m *MsgCreateObject) GetRedundancyType() RedundancyType { return REDUNDANCY_EC_TYPE } +func (m *MsgCreateObject) GetTags() ResourceTags { + if m != nil { + return m.Tags + } + return ResourceTags{} +} + type MsgCreateObjectResponse struct { ObjectId Uint `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3,customtype=Uint" json:"object_id"` } @@ -1070,6 +1088,8 @@ type MsgCreateGroup struct { GroupName string `protobuf:"bytes,2,opt,name=group_name,json=groupName,proto3" json:"group_name,omitempty"` // extra defines extra info for the group Extra string `protobuf:"bytes,3,opt,name=extra,proto3" json:"extra,omitempty"` + // tags defines a list of tags which will be set to the group + Tags ResourceTags `protobuf:"bytes,4,opt,name=tags,proto3" json:"tags"` } func (m *MsgCreateGroup) Reset() { *m = MsgCreateGroup{} } @@ -1126,6 +1146,13 @@ func (m *MsgCreateGroup) GetExtra() string { return "" } +func (m *MsgCreateGroup) GetTags() ResourceTags { + if m != nil { + return m.Tags + } + return ResourceTags{} +} + type MsgCreateGroupResponse struct { GroupId Uint `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3,customtype=Uint" json:"group_id"` } @@ -2691,7 +2718,6 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo -// this line is used by starport scaffolding # proto/tx/message type MsgMigrateBucket struct { // operator defines the account address of the operator who initial the migrate bucket Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` @@ -3091,6 +3117,105 @@ func (m *MsgRejectMigrateBucketResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRejectMigrateBucketResponse proto.InternalMessageInfo +type MsgSetTag struct { + // operator defines the operator who adds the tags + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + // resource defines a greenfield standard resource name that can be generated by GRN structure + Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` + // tags defines a list of tags which will be set to the resource + Tags *ResourceTags `protobuf:"bytes,3,opt,name=tags,proto3" json:"tags,omitempty"` +} + +func (m *MsgSetTag) Reset() { *m = MsgSetTag{} } +func (m *MsgSetTag) String() string { return proto.CompactTextString(m) } +func (*MsgSetTag) ProtoMessage() {} +func (*MsgSetTag) Descriptor() ([]byte, []int) { + return fileDescriptor_ddb71b028305a3cc, []int{57} +} +func (m *MsgSetTag) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetTag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetTag.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 *MsgSetTag) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetTag.Merge(m, src) +} +func (m *MsgSetTag) XXX_Size() int { + return m.Size() +} +func (m *MsgSetTag) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetTag.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetTag proto.InternalMessageInfo + +func (m *MsgSetTag) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *MsgSetTag) GetResource() string { + if m != nil { + return m.Resource + } + return "" +} + +func (m *MsgSetTag) GetTags() *ResourceTags { + if m != nil { + return m.Tags + } + return nil +} + +type MsgSetTagResponse struct { +} + +func (m *MsgSetTagResponse) Reset() { *m = MsgSetTagResponse{} } +func (m *MsgSetTagResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetTagResponse) ProtoMessage() {} +func (*MsgSetTagResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ddb71b028305a3cc, []int{58} +} +func (m *MsgSetTagResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetTagResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetTagResponse.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 *MsgSetTagResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetTagResponse.Merge(m, src) +} +func (m *MsgSetTagResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetTagResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetTagResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetTagResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCreateBucket)(nil), "greenfield.storage.MsgCreateBucket") proto.RegisterType((*MsgCreateBucketResponse)(nil), "greenfield.storage.MsgCreateBucketResponse") @@ -3149,154 +3274,162 @@ func init() { proto.RegisterType((*MsgCancelMigrateBucketResponse)(nil), "greenfield.storage.MsgCancelMigrateBucketResponse") proto.RegisterType((*MsgRejectMigrateBucket)(nil), "greenfield.storage.MsgRejectMigrateBucket") proto.RegisterType((*MsgRejectMigrateBucketResponse)(nil), "greenfield.storage.MsgRejectMigrateBucketResponse") + proto.RegisterType((*MsgSetTag)(nil), "greenfield.storage.MsgSetTag") + proto.RegisterType((*MsgSetTagResponse)(nil), "greenfield.storage.MsgSetTagResponse") } func init() { proto.RegisterFile("greenfield/storage/tx.proto", fileDescriptor_ddb71b028305a3cc) } var fileDescriptor_ddb71b028305a3cc = []byte{ - // 2269 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0x4d, 0x6c, 0x1b, 0xc7, - 0x15, 0x36, 0x45, 0xca, 0x12, 0x1f, 0xa9, 0x1f, 0xaf, 0x15, 0x8b, 0xa1, 0x6a, 0x8a, 0x66, 0x8a, - 0x44, 0xfe, 0x13, 0x1d, 0xd5, 0x35, 0x52, 0xa1, 0x28, 0x2a, 0x29, 0x8d, 0x4b, 0x24, 0xac, 0x95, - 0x95, 0xed, 0x02, 0x01, 0x0a, 0x66, 0xc8, 0x1d, 0xaf, 0xb6, 0x21, 0x77, 0xb7, 0x33, 0x4b, 0xd9, - 0x4c, 0x81, 0x1e, 0x7a, 0xe9, 0xa9, 0x40, 0x80, 0xf4, 0xd0, 0x43, 0xd1, 0x73, 0x4f, 0x45, 0x51, - 0xe4, 0x5c, 0xf4, 0x12, 0xc0, 0xe8, 0xc9, 0xc8, 0xa9, 0x28, 0x0a, 0x37, 0xb0, 0x0b, 0x14, 0xbd, - 0xf6, 0xd2, 0x6b, 0x30, 0x3b, 0xb3, 0xbb, 0xc3, 0xfd, 0xa5, 0x64, 0x29, 0xd6, 0x49, 0xda, 0x99, - 0x6f, 0x66, 0xde, 0xff, 0xbc, 0xf7, 0x86, 0xb0, 0xa2, 0x13, 0x8c, 0xcd, 0x07, 0x06, 0xee, 0x6b, - 0x4d, 0xea, 0x58, 0x04, 0xe9, 0xb8, 0xe9, 0x3c, 0x5a, 0xb7, 0x89, 0xe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 0x47, - 0x7e, 0xe4, 0x2a, 0xc8, 0x91, 0x2b, 0x56, 0xf6, 0x61, 0x5e, 0x7c, 0xd9, 0xff, 0x21, 0xe7, 0x26, - 0x24, 0xef, 0x61, 0x74, 0x20, 0xe2, 0xd0, 0xe1, 0x45, 0x7f, 0x62, 0x1c, 0x6e, 0x96, 0x18, 0x2f, - 0xe2, 0x18, 0x91, 0x12, 0x06, 0x94, 0x06, 0x57, 0xe3, 0x94, 0xa4, 0x2f, 0x9e, 0xee, 0xb4, 0xcc, - 0x07, 0xd6, 0x49, 0xdd, 0x8c, 0xef, 0xc5, 0x16, 0xf2, 0x79, 0xd7, 0xd8, 0x6a, 0x31, 0x09, 0xcf, - 0xbd, 0x96, 0xe9, 0xdc, 0xba, 0x79, 0x1f, 0xf5, 0x87, 0x38, 0x5a, 0xe8, 0x1f, 0x47, 0xbb, 0xe3, - 0x18, 0x0a, 0xba, 0x34, 0xab, 0x09, 0x24, 0xea, 0x4b, 0xfc, 0xf7, 0x39, 0x9e, 0x96, 0x21, 0xb3, - 0x87, 0xfb, 0x63, 0x55, 0xef, 0x29, 0x49, 0xa4, 0x56, 0xe1, 0x62, 0x2c, 0x7d, 0x3e, 0x07, 0x7f, - 0x9d, 0x82, 0x72, 0x9b, 0xea, 0xbb, 0x43, 0x67, 0xd7, 0xea, 0x1b, 0xbd, 0xd1, 0x11, 0x09, 0xff, - 0x1e, 0x14, 0x6d, 0x62, 0x98, 0x3d, 0xc3, 0x46, 0x7d, 0x11, 0x6f, 0xea, 0xb2, 0xe4, 0x83, 0x9e, - 0xde, 0xfa, 0xae, 0x87, 0x53, 0x83, 0x25, 0x2c, 0xfb, 0x27, 0x98, 0x5a, 0x43, 0xd2, 0xf3, 0x98, - 0xf2, 0xbf, 0x95, 0xef, 0x03, 0x50, 0x07, 0x39, 0x98, 0xa9, 0xda, 0x8b, 0xc2, 0x49, 0x9b, 0xef, - 0x79, 0x40, 0x55, 0x5a, 0xa3, 0xb4, 0xa3, 0x31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 0x85, 0x31, 0xe7, 0x7b, 0x14, 0x6e, 0xfc, 0xf3, 0x02, 0xe4, 0xdb, - 0x54, 0x57, 0x3e, 0x84, 0xf2, 0xd8, 0xfb, 0xed, 0x6b, 0x09, 0xf5, 0xb8, 0x0c, 0xaa, 0x5e, 0x9d, - 0x00, 0xe4, 0x67, 0x2b, 0x1f, 0x42, 0x79, 0xec, 0x31, 0x30, 0xe9, 0x04, 0x19, 0x94, 0x78, 0x42, - 0xdc, 0xeb, 0x9e, 0xd2, 0x87, 0xc5, 0x48, 0x91, 0xf6, 0x46, 0xc2, 0x06, 0x61, 0x60, 0xb5, 0x39, - 0x21, 0x50, 0xe6, 0x67, 0x2c, 0x71, 0x48, 0xe2, 0x47, 0x06, 0x25, 0xf2, 0x13, 0x77, 0x6d, 0x29, - 0x16, 0x9c, 0x8b, 0xbe, 0x54, 0xae, 0x25, 0x49, 0x24, 0x8c, 0xac, 0xde, 0x98, 0x14, 0x29, 0xb3, - 0x34, 0x56, 0x6d, 0xa5, 0x1b, 0x01, 0x07, 0x65, 0x18, 0x41, 0xa8, 0xad, 0xfe, 0x01, 0x80, 0xf4, - 0xa8, 0x72, 0x29, 0x61, 0x69, 0x00, 0xa9, 0x5e, 0xce, 0x84, 0xc8, 0xea, 0x8f, 0x3c, 0xdb, 0x24, - 0xa9, 0x3f, 0x0c, 0x4c, 0x54, 0x7f, 0xd2, 0x53, 0x0b, 0xe3, 0x44, 0x7a, 0x66, 0x49, 0xe2, 0x24, - 0x80, 0x24, 0x72, 0x12, 0xf3, 0xf8, 0xe0, 0xbb, 0x4a, 0x86, 0x1e, 0x64, 0x50, 0x86, 0xab, 0x84, - 0x4e, 0x20, 0xa0, 0xc4, 0x54, 0xd7, 0x89, 0x24, 0x46, 0xa0, 0xd5, 0x37, 0x27, 0x86, 0x46, 0x1d, - 0x26, 0x83, 0x2b, 0x19, 0x94, 0xe1, 0x30, 0xa1, 0x13, 0xc6, 0x1d, 0x46, 0x1c, 0x33, 0x81, 0xc3, - 0x88, 0xb3, 0x6e, 0x4c, 0x8a, 0x8c, 0x46, 0x1c, 0x29, 0xa5, 0x4e, 0x8f, 0x38, 0x01, 0x30, 0x23, - 0xe2, 0x44, 0x93, 0x78, 0xe5, 0x27, 0x50, 0x92, 0x1f, 0x2b, 0x1a, 0xa9, 0x8e, 0xe7, 0x62, 0xaa, - 0x57, 0xb2, 0x31, 0xf2, 0xf6, 0xf2, 0x83, 0x41, 0x23, 0xd5, 0x9e, 0xd2, 0xb7, 0x8f, 0x79, 0x02, - 0x60, 0xca, 0x89, 0xb6, 0xff, 0xd7, 0x52, 0x65, 0x20, 0x21, 0x13, 0x95, 0x93, 0xd8, 0x0b, 0x0f, - 0x94, 0x23, 0xf5, 0x58, 0xdf, 0xc8, 0xde, 0xc5, 0x05, 0x66, 0x28, 0x27, 0xda, 0xe9, 0x64, 0xf1, - 0x40, 0xea, 0x72, 0x26, 0xc5, 0x83, 0x00, 0x92, 0x18, 0x0f, 0xa2, 0x1d, 0x48, 0xa6, 0x19, 0xb9, - 0x76, 0x69, 0xa4, 0xfa, 0x44, 0xba, 0x66, 0x62, 0x8a, 0x07, 0x1e, 0x38, 0x43, 0x0f, 0x06, 0xc9, - 0x81, 0x73, 0x1c, 0x98, 0x12, 0x38, 0xe3, 0xdb, 0xf1, 0xca, 0x8f, 0xa1, 0x18, 0xb4, 0xc5, 0xea, - 0x09, 0xab, 0x7d, 0x44, 0x75, 0x2d, 0x0b, 0x11, 0x8d, 0x9a, 0x62, 0xef, 0xf4, 0xa8, 0x29, 0xb6, - 0xbf, 0x3a, 0x01, 0x48, 0x3e, 0x61, 0xac, 0xc2, 0x7a, 0x2d, 0xd5, 0x48, 0x38, 0x28, 0xf1, 0x84, - 0xb8, 0xb2, 0x48, 0xe9, 0xc1, 0xdc, 0x78, 0x9e, 0xf8, 0xcd, 0x44, 0x3d, 0x4a, 0xa8, 0xea, 0xb5, - 0x49, 0x50, 0xfe, 0x21, 0x3f, 0x87, 0x57, 0xe2, 0x2b, 0x8c, 0x6b, 0x89, 0x57, 0x54, 0x0c, 0xba, - 0x7a, 0xf3, 0x30, 0x68, 0xff, 0xf0, 0x21, 0x9c, 0x8f, 0xcb, 0xd8, 0xaf, 0xa4, 0xde, 0x27, 0xe3, - 0x07, 0x6f, 0x4c, 0x8e, 0x95, 0x8f, 0x8d, 0x4b, 0xc3, 0xaf, 0xa4, 0x5e, 0xfb, 0x93, 0x1d, 0x9b, - 0x92, 0x5e, 0x6f, 0xb7, 0x1e, 0x3f, 0xab, 0xe5, 0x9e, 0x3c, 0xab, 0xe5, 0xbe, 0x7c, 0x56, 0xcb, - 0x7d, 0xf2, 0xbc, 0x76, 0xe6, 0xc9, 0xf3, 0xda, 0x99, 0xbf, 0x3f, 0xaf, 0x9d, 0xf9, 0xa0, 0xa9, - 0x1b, 0xce, 0xfe, 0xb0, 0xcb, 0x6a, 0xc8, 0x66, 0xd7, 0xec, 0x5e, 0x77, 0xdb, 0x00, 0x4d, 0xe9, - 0xa7, 0x96, 0x8f, 0x82, 0x1f, 0xa4, 0x8e, 0x6c, 0x4c, 0xbb, 0x67, 0xdd, 0x66, 0xea, 0xb7, 0xbe, - 0x0a, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x9d, 0xed, 0xbd, 0xb3, 0x2a, 0x00, 0x00, + // 2363 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xcb, 0x6f, 0x1b, 0xc7, + 0x19, 0x37, 0x45, 0xea, 0xc1, 0x21, 0xf5, 0x5a, 0x2b, 0x11, 0x43, 0xd5, 0x14, 0xcd, 0xb4, 0x89, + 0xfc, 0x12, 0x1d, 0xd5, 0x35, 0x52, 0xa1, 0x28, 0x2a, 0x29, 0x8d, 0x4b, 0x24, 0x8c, 0x95, 0x95, + 0xec, 0x02, 0x01, 0x0a, 0x66, 0xc8, 0x1d, 0xaf, 0xb6, 0x21, 0x77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4, 0x96, 0x49, 0x1d, 0xbd, 0xa8, + 0xf2, 0xaf, 0x30, 0xc7, 0x35, 0xf0, 0xb5, 0x38, 0xae, 0x04, 0xdb, 0xbf, 0x2b, 0x48, 0xc1, 0x79, + 0xbb, 0xfb, 0x63, 0xd4, 0x3b, 0xa5, 0xe0, 0x5c, 0x05, 0x25, 0x8b, 0x92, 0x67, 0x00, 0xc6, 0x34, + 0x60, 0x43, 0x14, 0x70, 0x11, 0x94, 0x6d, 0x38, 0xea, 0x5b, 0x50, 0xeb, 0x60, 0xe3, 0x63, 0x44, + 0xc3, 0xae, 0xa0, 0x96, 0xf8, 0xd8, 0x9e, 0xf1, 0x71, 0x38, 0xc0, 0x27, 0x8f, 0x15, 0xe0, 0x17, + 0x41, 0x99, 0xa8, 0x82, 0x04, 0x38, 0x49, 0x52, 0x34, 0x9c, 0x8a, 0x6a, 0x89, 0x8f, 0x11, 0x78, + 0x52, 0xe0, 0x4d, 0x1f, 0x2b, 0xf0, 0x2e, 0x81, 0x05, 0xf4, 0xc0, 0x26, 0x72, 0xf7, 0x0e, 0x50, + 0xef, 0x23, 0x3c, 0x1c, 0x90, 0xb0, 0xca, 0xaf, 0x95, 0xd5, 0x79, 0x36, 0xbe, 0xe3, 0x0d, 0x2b, + 0xef, 0x80, 0x79, 0x07, 0x69, 0x43, 0x53, 0x83, 0x66, 0x6f, 0xc4, 0xb8, 0x2b, 0x26, 0xcb, 0xa8, + 0x0a, 0x28, 0x95, 0x71, 0xce, 0x09, 0x7c, 0x8b, 0x10, 0x06, 0x27, 0x1a, 0xc2, 0xcc, 0x43, 0xe4, + 0x10, 0xe6, 0x46, 0x1d, 0x33, 0x84, 0x19, 0xba, 0xa5, 0x35, 0x3e, 0x9d, 0x00, 0xb3, 0x6d, 0xac, + 0xef, 0x21, 0xd8, 0xe7, 0x5e, 0x77, 0x4a, 0x71, 0x92, 0xe9, 0x77, 0xdf, 0x02, 0xcb, 0x7a, 0xdf, + 0xea, 0xc2, 0x7e, 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 0x72, 0x9e, 0x29, 0xb4, 0xae, + 0x80, 0x09, 0x43, 0xe3, 0x39, 0x39, 0x75, 0xf3, 0x09, 0x43, 0x0b, 0xc7, 0x61, 0x3e, 0x2b, 0x0e, + 0x0b, 0x91, 0xfe, 0x43, 0x03, 0xcc, 0x6a, 0x08, 0xbb, 0x9d, 0xde, 0x01, 0x34, 0x4c, 0x22, 0xf6, + 0x24, 0xed, 0x3a, 0x94, 0xc8, 0xe0, 0x0e, 0x19, 0x6b, 0x69, 0xf1, 0x17, 0x26, 0x59, 0x54, 0x11, + 0xa5, 0x0f, 0x65, 0x35, 0x3c, 0x53, 0x07, 0xf2, 0x64, 0xd5, 0x10, 0x91, 0xb2, 0x90, 0x29, 0xa5, + 0x9c, 0x51, 0x99, 0x94, 0x81, 0x8c, 0xfa, 0xa5, 0x5c, 0x73, 0xf8, 0xf3, 0x2f, 0xac, 0x8f, 0x14, + 0x3c, 0x53, 0x0a, 0x27, 0x71, 0xa6, 0xc8, 0x76, 0x0e, 0xf5, 0x6d, 0x3f, 0x67, 0x15, 0x20, 0x9b, + 0x7b, 0x96, 0xeb, 0xd0, 0x91, 0xcc, 0x9c, 0x51, 0x5e, 0x1d, 0xc3, 0xc8, 0xec, 0x7e, 0x25, 0x89, + 0x21, 0x24, 0xfc, 0x94, 0x79, 0x32, 0xb3, 0xef, 0x2e, 0x7d, 0x70, 0x52, 0x6e, 0x82, 0x22, 0x1c, + 0xba, 0x07, 0x96, 0x43, 0x54, 0x9c, 0x25, 0xa3, 0x0f, 0x55, 0xde, 0x04, 0x53, 0xec, 0xc9, 0xca, + 0xaf, 0x70, 0xa3, 0x76, 0x61, 0x7b, 0xf0, 0x3b, 0x2d, 0xc7, 0x6f, 0xce, 0x11, 0x76, 0x7d, 0x4a, + 0xdc, 0x24, 0x32, 0x53, 0x82, 0xe1, 0xff, 0xe5, 0xc0, 0x02, 0x95, 0x45, 0x77, 0xe0, 0x29, 0xbf, + 0x4b, 0x28, 0x97, 0xc0, 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12, 0x64, 0x50, 0xf5, 0xca, 0x18, 0x20, + 0x51, 0x67, 0x7d, 0x08, 0xca, 0x81, 0xe7, 0xd3, 0xa4, 0x1d, 0x64, 0x50, 0xe2, 0x0e, 0x71, 0xef, + 0xa1, 0x4a, 0x1f, 0x2c, 0x44, 0xae, 0x97, 0xaf, 0x27, 0x10, 0x08, 0x03, 0xab, 0xcd, 0x31, 0x81, + 0xb2, 0x3c, 0x81, 0x92, 0x27, 0x49, 0x1e, 0x19, 0x94, 0x28, 0x4f, 0xdc, 0x81, 0xab, 0x58, 0x60, + 0x31, 0xfa, 0xb6, 0xbb, 0x96, 0xa4, 0x91, 0x30, 0xb2, 0x7a, 0x7d, 0x5c, 0xa4, 0x2c, 0x52, 0xe0, + 0x9e, 0x98, 0xee, 0x04, 0x0c, 0x94, 0xe1, 0x04, 0xa1, 0xc7, 0x84, 0x0f, 0x00, 0x90, 0x9e, 0x92, + 0x2e, 0x26, 0x2c, 0xf5, 0x21, 0xd5, 0x4b, 0x99, 0x10, 0xd9, 0xfc, 0x91, 0xc7, 0xaa, 0x24, 0xf3, + 0x87, 0x81, 0x89, 0xe6, 0x4f, 0x7a, 0x60, 0x22, 0x92, 0x48, 0x8f, 0x4b, 0x49, 0x92, 0xf8, 0x90, + 0x44, 0x49, 0x62, 0x9e, 0x5c, 0x44, 0xa8, 0x64, 0xd8, 0x41, 0x06, 0x65, 0x84, 0x4a, 0x68, 0x07, + 0x07, 0x28, 0x31, 0x7d, 0x81, 0x44, 0x16, 0x23, 0xd0, 0xea, 0x1b, 0x63, 0x43, 0xa3, 0x01, 0x93, + 0x21, 0x95, 0x0c, 0xca, 0x08, 0x98, 0xd0, 0x0e, 0xc1, 0x80, 0xe1, 0xdb, 0x8c, 0x11, 0x30, 0x7c, + 0xaf, 0xeb, 0xe3, 0x22, 0xa3, 0x19, 0x47, 0xba, 0x0c, 0xa4, 0x67, 0x1c, 0x1f, 0x98, 0x91, 0x71, + 0xa2, 0xd7, 0x0f, 0xe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 0x2e, 0xa7, 0x9e, 0x27, 0xc1, 0x8d, + 0x37, 0xc6, 0xc7, 0xca, 0xdb, 0xc6, 0x5d, 0x20, 0x2e, 0xa7, 0x1e, 0xfb, 0xe3, 0x6d, 0x9b, 0x72, + 0x31, 0x50, 0xde, 0x03, 0x53, 0xfc, 0x52, 0x70, 0x21, 0xb1, 0x90, 0x21, 0xd3, 0xd5, 0x6f, 0xa4, + 0x4e, 0x7b, 0xf4, 0xb6, 0x5b, 0x0f, 0x9f, 0xd4, 0x72, 0x8f, 0x9e, 0xd4, 0x72, 0x5f, 0x3e, 0xa9, + 0xe5, 0x3e, 0x79, 0x5a, 0x3b, 0xf7, 0xe8, 0x69, 0xed, 0xdc, 0x3f, 0x9e, 0xd6, 0xce, 0x7d, 0xd0, + 0xd4, 0x0d, 0xf7, 0x60, 0xd8, 0x25, 0xb7, 0xe9, 0x66, 0xd7, 0xec, 0x5e, 0xa3, 0x0d, 0x91, 0xa6, + 0xf4, 0x3b, 0xd9, 0x07, 0xc1, 0x5f, 0xca, 0x76, 0xa7, 0x68, 0x5b, 0xf9, 0x9b, 0x5f, 0x05, 0x00, + 0x00, 0xff, 0xff, 0xf3, 0xf1, 0x88, 0x2c, 0x91, 0x2c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3340,11 +3473,12 @@ type MsgClient interface { DeletePolicy(ctx context.Context, in *MsgDeletePolicy, opts ...grpc.CallOption) (*MsgDeletePolicyResponse, error) // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - // this line is used by starport scaffolding # proto/tx/rpc MigrateBucket(ctx context.Context, in *MsgMigrateBucket, opts ...grpc.CallOption) (*MsgMigrateBucketResponse, error) CompleteMigrateBucket(ctx context.Context, in *MsgCompleteMigrateBucket, opts ...grpc.CallOption) (*MsgCompleteMigrateBucketResponse, error) CancelMigrateBucket(ctx context.Context, in *MsgCancelMigrateBucket, opts ...grpc.CallOption) (*MsgCancelMigrateBucketResponse, error) RejectMigrateBucket(ctx context.Context, in *MsgRejectMigrateBucket, opts ...grpc.CallOption) (*MsgRejectMigrateBucketResponse, error) + // Since: Manchurian upgrade + SetTag(ctx context.Context, in *MsgSetTag, opts ...grpc.CallOption) (*MsgSetTagResponse, error) } type msgClient struct { @@ -3607,6 +3741,15 @@ func (c *msgClient) RejectMigrateBucket(ctx context.Context, in *MsgRejectMigrat return out, nil } +func (c *msgClient) SetTag(ctx context.Context, in *MsgSetTag, opts ...grpc.CallOption) (*MsgSetTagResponse, error) { + out := new(MsgSetTagResponse) + err := c.cc.Invoke(ctx, "/greenfield.storage.Msg/SetTag", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // basic operation of bucket @@ -3638,11 +3781,12 @@ type MsgServer interface { DeletePolicy(context.Context, *MsgDeletePolicy) (*MsgDeletePolicyResponse, error) // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - // this line is used by starport scaffolding # proto/tx/rpc MigrateBucket(context.Context, *MsgMigrateBucket) (*MsgMigrateBucketResponse, error) CompleteMigrateBucket(context.Context, *MsgCompleteMigrateBucket) (*MsgCompleteMigrateBucketResponse, error) CancelMigrateBucket(context.Context, *MsgCancelMigrateBucket) (*MsgCancelMigrateBucketResponse, error) RejectMigrateBucket(context.Context, *MsgRejectMigrateBucket) (*MsgRejectMigrateBucketResponse, error) + // Since: Manchurian upgrade + SetTag(context.Context, *MsgSetTag) (*MsgSetTagResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -3733,6 +3877,9 @@ func (*UnimplementedMsgServer) CancelMigrateBucket(ctx context.Context, req *Msg func (*UnimplementedMsgServer) RejectMigrateBucket(ctx context.Context, req *MsgRejectMigrateBucket) (*MsgRejectMigrateBucketResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RejectMigrateBucket not implemented") } +func (*UnimplementedMsgServer) SetTag(ctx context.Context, req *MsgSetTag) (*MsgSetTagResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetTag not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -4242,6 +4389,24 @@ func _Msg_RejectMigrateBucket_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Msg_SetTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetTag) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetTag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greenfield.storage.Msg/SetTag", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetTag(ctx, req.(*MsgSetTag)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "greenfield.storage.Msg", HandlerType: (*MsgServer)(nil), @@ -4358,6 +4523,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "RejectMigrateBucket", Handler: _Msg_RejectMigrateBucket_Handler, }, + { + MethodName: "SetTag", + Handler: _Msg_SetTag_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "greenfield/storage/tx.proto", @@ -4383,6 +4552,16 @@ func (m *MsgCreateBucket) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.Tags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 if m.ChargedReadQuota != 0 { i = encodeVarintTx(dAtA, i, uint64(m.ChargedReadQuota)) i-- @@ -4616,6 +4795,16 @@ func (m *MsgCreateObject) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.Tags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 if m.RedundancyType != 0 { i = encodeVarintTx(dAtA, i, uint64(m.RedundancyType)) i-- @@ -5133,6 +5322,16 @@ func (m *MsgCreateGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.Tags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 if len(m.Extra) > 0 { i -= len(m.Extra) copy(dAtA[i:], m.Extra) @@ -5442,12 +5641,12 @@ func (m *MsgGroupMember) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.ExpirationTime != nil { - n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.ExpirationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ExpirationTime):]) - if err4 != nil { - return 0, err4 + n7, err7 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.ExpirationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ExpirationTime):]) + if err7 != nil { + return 0, err7 } - i -= n4 - i = encodeVarintTx(dAtA, i, uint64(n4)) + i -= n7 + i = encodeVarintTx(dAtA, i, uint64(n7)) i-- dAtA[i] = 0x12 } @@ -5774,12 +5973,12 @@ func (m *MsgPutPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.ExpirationTime != nil { - n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.ExpirationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ExpirationTime):]) - if err6 != nil { - return 0, err6 + n9, err9 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.ExpirationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.ExpirationTime):]) + if err9 != nil { + return 0, err9 } - i -= n6 - i = encodeVarintTx(dAtA, i, uint64(n6)) + i -= n9 + i = encodeVarintTx(dAtA, i, uint64(n9)) i-- dAtA[i] = 0x3a } @@ -6584,6 +6783,78 @@ func (m *MsgRejectMigrateBucketResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgSetTag) 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 *MsgSetTag) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetTag) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Tags != nil { + { + size, err := m.Tags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Resource) > 0 { + i -= len(m.Resource) + copy(dAtA[i:], m.Resource) + i = encodeVarintTx(dAtA, i, uint64(len(m.Resource))) + i-- + dAtA[i] = 0x12 + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetTagResponse) 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 *MsgSetTagResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetTagResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -6627,6 +6898,8 @@ func (m *MsgCreateBucket) Size() (n int) { if m.ChargedReadQuota != 0 { n += 1 + sovTx(uint64(m.ChargedReadQuota)) } + l = m.Tags.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -6738,6 +7011,8 @@ func (m *MsgCreateObject) Size() (n int) { if m.RedundancyType != 0 { n += 1 + sovTx(uint64(m.RedundancyType)) } + l = m.Tags.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -6947,6 +7222,8 @@ func (m *MsgCreateGroup) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = m.Tags.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -7561,6 +7838,36 @@ func (m *MsgRejectMigrateBucketResponse) Size() (n int) { return n } +func (m *MsgSetTag) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Resource) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Tags != nil { + l = m.Tags.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetTagResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -7798,6 +8105,39 @@ func (m *MsgCreateBucket) Unmarshal(dAtA []byte) error { break } } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Tags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -8545,6 +8885,39 @@ func (m *MsgCreateObject) Unmarshal(dAtA []byte) error { break } } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Tags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -9978,6 +10351,39 @@ func (m *MsgCreateGroup) Unmarshal(dAtA []byte) error { } m.Extra = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Tags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -14093,6 +14499,206 @@ func (m *MsgRejectMigrateBucketResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSetTag) 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 ErrIntOverflowTx + } + 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: MsgSetTag: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetTag: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resource = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tags == nil { + m.Tags = &ResourceTags{} + } + if err := m.Tags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetTagResponse) 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 ErrIntOverflowTx + } + 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: MsgSetTagResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetTagResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/storage/types/types.pb.go b/x/storage/types/types.pb.go index ab312aaf3..66cd17923 100644 --- a/x/storage/types/types.pb.go +++ b/x/storage/types/types.pb.go @@ -49,6 +49,8 @@ type BucketInfo struct { ChargedReadQuota uint64 `protobuf:"varint,9,opt,name=charged_read_quota,json=chargedReadQuota,proto3" json:"charged_read_quota,omitempty"` // bucket_status define the status of the bucket. BucketStatus BucketStatus `protobuf:"varint,10,opt,name=bucket_status,json=bucketStatus,proto3,enum=greenfield.storage.BucketStatus" json:"bucket_status,omitempty"` + // tags defines a list of tags the bucket has + Tags *ResourceTags `protobuf:"bytes,11,opt,name=tags,proto3" json:"tags,omitempty"` } func (m *BucketInfo) Reset() { *m = BucketInfo{} } @@ -147,6 +149,13 @@ func (m *BucketInfo) GetBucketStatus() BucketStatus { return BUCKET_STATUS_CREATED } +func (m *BucketInfo) GetTags() *ResourceTags { + if m != nil { + return m.Tags + } + return nil +} + type InternalBucketInfo struct { // the time of the payment price, used to calculate the charge rate of the bucket PriceTime int64 `protobuf:"varint,1,opt,name=price_time,json=priceTime,proto3" json:"price_time,omitempty"` @@ -248,6 +257,8 @@ type ObjectInfo struct { // checksums define the root hash of the pieces which stored in a SP. // add omit tag to omit the field when converting to NFT metadata Checksums [][]byte `protobuf:"bytes,14,rep,name=checksums,proto3" json:"checksums,omitempty" traits:"omit"` + // tags defines a list of tags the object has + Tags *ResourceTags `protobuf:"bytes,15,opt,name=tags,proto3" json:"tags,omitempty"` } func (m *ObjectInfo) Reset() { *m = ObjectInfo{} } @@ -374,6 +385,13 @@ func (m *ObjectInfo) GetChecksums() [][]byte { return nil } +func (m *ObjectInfo) GetTags() *ResourceTags { + if m != nil { + return m.Tags + } + return nil +} + type GroupInfo struct { // owner is the owner of the group. It can not changed once it created. Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` @@ -385,6 +403,8 @@ type GroupInfo struct { Id Uint `protobuf:"bytes,4,opt,name=id,proto3,customtype=Uint" json:"id"` // extra is used to store extra info for the group Extra string `protobuf:"bytes,5,opt,name=extra,proto3" json:"extra,omitempty"` + // tags defines a list of tags the group has + Tags *ResourceTags `protobuf:"bytes,6,opt,name=tags,proto3" json:"tags,omitempty"` } func (m *GroupInfo) Reset() { *m = GroupInfo{} } @@ -448,6 +468,13 @@ func (m *GroupInfo) GetExtra() string { return "" } +func (m *GroupInfo) GetTags() *ResourceTags { + if m != nil { + return m.Tags + } + return nil +} + type Trait struct { TraitType string `protobuf:"bytes,1,opt,name=trait_type,json=traitType,proto3" json:"trait_type,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` @@ -903,6 +930,103 @@ func (m *MigrationBucketInfo) GetDstSpId() uint32 { return 0 } +type ResourceTags struct { + // tags defines a list of tags the resource has + Tags []ResourceTags_Tag `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags"` +} + +func (m *ResourceTags) Reset() { *m = ResourceTags{} } +func (m *ResourceTags) String() string { return proto.CompactTextString(m) } +func (*ResourceTags) ProtoMessage() {} +func (*ResourceTags) Descriptor() ([]byte, []int) { + return fileDescriptor_bf95fa2efdc74d97, []int{11} +} +func (m *ResourceTags) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceTags) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResourceTags.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 *ResourceTags) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceTags.Merge(m, src) +} +func (m *ResourceTags) XXX_Size() int { + return m.Size() +} +func (m *ResourceTags) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceTags.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourceTags proto.InternalMessageInfo + +func (m *ResourceTags) GetTags() []ResourceTags_Tag { + if m != nil { + return m.Tags + } + return nil +} + +type ResourceTags_Tag struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *ResourceTags_Tag) Reset() { *m = ResourceTags_Tag{} } +func (m *ResourceTags_Tag) String() string { return proto.CompactTextString(m) } +func (*ResourceTags_Tag) ProtoMessage() {} +func (*ResourceTags_Tag) Descriptor() ([]byte, []int) { + return fileDescriptor_bf95fa2efdc74d97, []int{11, 0} +} +func (m *ResourceTags_Tag) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceTags_Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResourceTags_Tag.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 *ResourceTags_Tag) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceTags_Tag.Merge(m, src) +} +func (m *ResourceTags_Tag) XXX_Size() int { + return m.Size() +} +func (m *ResourceTags_Tag) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceTags_Tag.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourceTags_Tag proto.InternalMessageInfo + +func (m *ResourceTags_Tag) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *ResourceTags_Tag) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + func init() { proto.RegisterType((*BucketInfo)(nil), "greenfield.storage.BucketInfo") proto.RegisterType((*InternalBucketInfo)(nil), "greenfield.storage.InternalBucketInfo") @@ -915,85 +1039,92 @@ func init() { proto.RegisterType((*Ids)(nil), "greenfield.storage.Ids") proto.RegisterType((*DeleteInfo)(nil), "greenfield.storage.DeleteInfo") proto.RegisterType((*MigrationBucketInfo)(nil), "greenfield.storage.MigrationBucketInfo") + proto.RegisterType((*ResourceTags)(nil), "greenfield.storage.ResourceTags") + proto.RegisterType((*ResourceTags_Tag)(nil), "greenfield.storage.ResourceTags.Tag") } func init() { proto.RegisterFile("greenfield/storage/types.proto", fileDescriptor_bf95fa2efdc74d97) } var fileDescriptor_bf95fa2efdc74d97 = []byte{ - // 1166 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6e, 0xdb, 0xc6, - 0x13, 0x36, 0x4d, 0x29, 0x36, 0x47, 0x96, 0xf3, 0x0b, 0x23, 0xfc, 0xc2, 0x38, 0x88, 0xa4, 0x10, - 0x68, 0x21, 0xb4, 0xb5, 0x84, 0x38, 0x45, 0x50, 0x14, 0x01, 0x02, 0xab, 0x49, 0x03, 0xa1, 0x4d, - 0x8b, 0xd2, 0x4e, 0x0a, 0xf4, 0x42, 0x2c, 0xc9, 0x35, 0xbd, 0x0d, 0xc9, 0x55, 0x77, 0x97, 0x8e, - 0x95, 0xa7, 0xe8, 0x63, 0xf4, 0x5c, 0xe4, 0x05, 0x7a, 0x0b, 0x0a, 0x14, 0x08, 0x7c, 0x2a, 0x7a, - 0x30, 0x0a, 0xfb, 0x0d, 0x7a, 0xe8, 0xb9, 0xe0, 0xee, 0xca, 0xa1, 0x25, 0x39, 0xfe, 0x83, 0xe4, - 0xa6, 0x9d, 0xfd, 0x86, 0x3b, 0xf3, 0xcd, 0x37, 0xb3, 0x2b, 0x68, 0xc6, 0x0c, 0xe3, 0x6c, 0x8b, - 0xe0, 0x24, 0xea, 0x71, 0x41, 0x19, 0x8a, 0x71, 0x4f, 0x8c, 0x86, 0x98, 0x77, 0x87, 0x8c, 0x0a, - 0x6a, 0xdb, 0x6f, 0xf6, 0xbb, 0x7a, 0x7f, 0xa5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xfb, 0x6b, 0xbf, - 0x55, 0x79, 0x42, 0x32, 0xb1, 0xf7, 0x72, 0xb5, 0xa6, 0xa3, 0x2b, 0x96, 0xde, 0x3c, 0x89, 0xec, - 0xfb, 0x50, 0xe3, 0x34, 0x67, 0x21, 0xf6, 0x8b, 0xba, 0x39, 0x55, 0x79, 0x62, 0x73, 0xd6, 0x89, - 0x1b, 0x12, 0xa6, 0x4e, 0xe3, 0x47, 0xbf, 0xed, 0x1b, 0x60, 0x85, 0x0c, 0x23, 0x81, 0x7d, 0x24, - 0x9c, 0x4b, 0x6d, 0xa3, 0x63, 0x7a, 0x8b, 0xca, 0xb0, 0x2e, 0xec, 0x75, 0xb8, 0xac, 0xe9, 0xf6, - 0x91, 0xe2, 0xc3, 0x59, 0x38, 0x85, 0xa9, 0x65, 0xed, 0xa0, 0xad, 0x76, 0x1f, 0x9a, 0x71, 0x42, - 0x03, 0x94, 0xf8, 0x3b, 0x84, 0x89, 0x1c, 0x25, 0x7e, 0xcc, 0x68, 0x3e, 0xf4, 0xb7, 0x50, 0x4a, - 0x92, 0x91, 0x4f, 0x22, 0x67, 0xb1, 0x6d, 0x74, 0xea, 0xde, 0x8a, 0x42, 0x3d, 0x55, 0xa0, 0x47, - 0x05, 0xe6, 0x4b, 0x09, 0x19, 0x44, 0xf6, 0x27, 0x60, 0x87, 0xdb, 0x88, 0xc5, 0x38, 0xf2, 0x19, - 0x46, 0x91, 0xff, 0x53, 0x4e, 0x05, 0x72, 0xac, 0xb6, 0xd1, 0xa9, 0x78, 0xff, 0xd3, 0x3b, 0x1e, - 0x46, 0xd1, 0x77, 0x85, 0xdd, 0x7e, 0x08, 0x75, 0x5d, 0x24, 0x2e, 0x90, 0xc8, 0xb9, 0x03, 0x92, - 0x94, 0xf6, 0x2c, 0x52, 0x94, 0x16, 0x36, 0x24, 0xce, 0x5b, 0x0a, 0x4a, 0x2b, 0xf7, 0x5f, 0x03, - 0xec, 0x41, 0x26, 0x30, 0xcb, 0x50, 0x52, 0x92, 0xcc, 0x4d, 0x80, 0x21, 0x23, 0x05, 0xdf, 0x24, - 0xc5, 0x52, 0x37, 0xa6, 0x67, 0x49, 0xcb, 0x26, 0x49, 0xb1, 0xfd, 0x11, 0x5c, 0x11, 0x54, 0xa0, - 0xc4, 0x57, 0x61, 0xf9, 0x9c, 0xbc, 0x50, 0x3a, 0xa9, 0x78, 0x97, 0xe5, 0xc6, 0x17, 0xd2, 0xbe, - 0x41, 0x5e, 0x60, 0xfb, 0x7b, 0x68, 0x24, 0x34, 0x9c, 0x64, 0x86, 0x3b, 0x66, 0xdb, 0xec, 0xd4, - 0xd6, 0x3e, 0x98, 0x15, 0xef, 0xd7, 0x05, 0xbe, 0xcc, 0x91, 0x67, 0x27, 0x93, 0x26, 0x6e, 0xdf, - 0x83, 0x1b, 0x19, 0xde, 0x15, 0xfe, 0x8c, 0xaf, 0xfb, 0x5a, 0x5a, 0x75, 0xef, 0x5a, 0x01, 0x99, - 0xfa, 0xde, 0x20, 0x72, 0x7f, 0xab, 0x02, 0x7c, 0x1b, 0xfc, 0x88, 0xc3, 0x8b, 0xf5, 0xc8, 0x1a, - 0x2c, 0x48, 0xfd, 0x50, 0xa6, 0xfa, 0xe3, 0x2d, 0x1e, 0x63, 0xe0, 0x64, 0x5f, 0x99, 0x53, 0x7d, - 0xd5, 0x82, 0x1a, 0x95, 0x21, 0x29, 0x40, 0x45, 0x01, 0x94, 0x49, 0x02, 0x54, 0xd3, 0x54, 0xcf, - 0xd6, 0x34, 0x77, 0xe0, 0xff, 0x27, 0x50, 0x73, 0x49, 0x52, 0x73, 0x35, 0x99, 0xa6, 0xc5, 0xbe, - 0x05, 0x4b, 0x43, 0x34, 0x4a, 0x28, 0x8a, 0x54, 0x51, 0x17, 0x64, 0x51, 0x6b, 0xda, 0x26, 0x0b, - 0x7a, 0xbc, 0xfb, 0x17, 0x2f, 0xd4, 0xfd, 0xb7, 0x60, 0x29, 0xa4, 0x99, 0x28, 0x5a, 0x4e, 0x76, - 0xb4, 0x25, 0x53, 0xad, 0x69, 0xdb, 0x74, 0xcb, 0xc2, 0x44, 0xcb, 0x3e, 0x84, 0xba, 0x66, 0x4a, - 0xab, 0xbf, 0x76, 0xb2, 0xfa, 0x55, 0x95, 0xc7, 0xea, 0xa7, 0xa5, 0x95, 0xfd, 0x15, 0x5c, 0x66, - 0x38, 0xca, 0xb3, 0x08, 0x65, 0xe1, 0x48, 0x45, 0xb2, 0x74, 0x72, 0x3e, 0xde, 0x11, 0x54, 0xe6, - 0xb3, 0xcc, 0x8e, 0xad, 0x27, 0x87, 0x54, 0xfd, 0xdc, 0x43, 0xaa, 0x07, 0x56, 0xb8, 0x8d, 0xc3, - 0x67, 0x3c, 0x4f, 0xb9, 0xb3, 0xdc, 0x36, 0x3b, 0x4b, 0xfd, 0x2b, 0xff, 0xec, 0xb7, 0xea, 0x82, - 0x21, 0x22, 0xf8, 0xe7, 0x2e, 0x4d, 0x89, 0x70, 0xbd, 0x37, 0x18, 0x77, 0xdf, 0x00, 0x4b, 0x15, - 0xee, 0x22, 0x12, 0xbe, 0x09, 0xa0, 0x14, 0x51, 0x9a, 0xf2, 0x96, 0xb4, 0x48, 0xad, 0x4d, 0xa4, - 0x63, 0x9e, 0x3b, 0x9d, 0x73, 0x4d, 0xf8, 0x06, 0x54, 0xf1, 0xae, 0x60, 0x48, 0x89, 0xdb, 0x53, - 0x0b, 0xf7, 0x1e, 0x54, 0x37, 0x8b, 0xe4, 0x8b, 0x58, 0x25, 0x0b, 0x2a, 0x16, 0x43, 0xc5, 0x2a, - 0x2d, 0xf2, 0xa8, 0x06, 0x54, 0x77, 0x50, 0x92, 0x8f, 0xb3, 0x50, 0x0b, 0xf7, 0x0f, 0x03, 0x96, - 0xd5, 0x4c, 0x7b, 0x8c, 0x05, 0x7a, 0x80, 0x04, 0xb2, 0xdb, 0x50, 0x8b, 0x30, 0x0f, 0x19, 0x19, - 0x0a, 0x42, 0x33, 0xfd, 0xa1, 0xb2, 0xa9, 0x50, 0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xa3, 0xb8, 0x55, 0x06, - 0xe0, 0x16, 0x7b, 0xa7, 0x3c, 0x91, 0xe6, 0xa5, 0xd3, 0x4d, 0xce, 0xc2, 0x47, 0x27, 0xbf, 0x92, - 0x56, 0xc0, 0x8a, 0xb8, 0xd0, 0xc7, 0x98, 0xea, 0x98, 0x88, 0x0b, 0x79, 0xcc, 0x67, 0x60, 0x1d, - 0x11, 0x78, 0x96, 0xc1, 0xb3, 0x38, 0xe6, 0xb0, 0x3f, 0x78, 0x75, 0xd0, 0x34, 0x5e, 0x1f, 0x34, - 0x8d, 0xbf, 0x0f, 0x9a, 0xc6, 0xcf, 0x87, 0xcd, 0xb9, 0xd7, 0x87, 0xcd, 0xb9, 0x3f, 0x0f, 0x9b, - 0x73, 0x3f, 0xf4, 0x62, 0x22, 0xb6, 0xf3, 0xa0, 0x1b, 0xd2, 0xb4, 0x17, 0x64, 0xc1, 0x6a, 0xb8, - 0x8d, 0x48, 0xd6, 0x2b, 0xbd, 0xc0, 0x77, 0x8f, 0xff, 0xa7, 0x08, 0x2e, 0xc9, 0x37, 0xf8, 0x9d, - 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x44, 0x17, 0xd2, 0x5c, 0x76, 0x0c, 0x00, 0x00, + // 1240 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x51, 0x6f, 0xd4, 0x46, + 0x10, 0x8e, 0xe3, 0xbb, 0x24, 0x1e, 0xe7, 0x12, 0x58, 0xa2, 0x62, 0x82, 0xb8, 0x1c, 0xa7, 0xb6, + 0x3a, 0xb5, 0xcd, 0x9d, 0x08, 0x08, 0x55, 0x15, 0x2a, 0xe2, 0x0a, 0x45, 0xa7, 0x96, 0x56, 0x75, + 0x02, 0x95, 0xfa, 0x62, 0xed, 0xd9, 0x1b, 0x67, 0x8b, 0xed, 0xbd, 0xee, 0xae, 0x43, 0x0e, 0xa9, + 0x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x7d, 0x5c, 0x3c, 0x4e, 0x9f, 0x54, + 0xdd, 0xde, 0xd3, 0x17, 0x75, 0xeb, 0xd9, 0x8b, 0xba, 0xf5, 0xf7, 0x8b, 0xba, 0xf5, 0xcb, 0xcb, + 0xfa, 0xcc, 0xb3, 0x97, 0xf5, 0x99, 0x3f, 0x5f, 0xd6, 0x67, 0x7e, 0xe8, 0xc4, 0x54, 0xee, 0xe4, + 0xfd, 0x76, 0xc8, 0xd2, 0x4e, 0x3f, 0xeb, 0xaf, 0x87, 0x3b, 0x98, 0x66, 0x9d, 0xd2, 0x2f, 0xca, + 0xde, 0xe1, 0x9f, 0xae, 0xfe, 0x9c, 0xfa, 0x49, 0xb9, 0xfa, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x29, 0xb8, 0xed, 0x11, 0x97, 0x0d, 0x00, 0x00, } func (m *BucketInfo) Marshal() (dAtA []byte, err error) { @@ -1016,6 +1147,18 @@ func (m *BucketInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Tags != nil { + { + size, err := m.Tags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } if m.BucketStatus != 0 { i = encodeVarintTypes(dAtA, i, uint64(m.BucketStatus)) i-- @@ -1152,6 +1295,18 @@ func (m *ObjectInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Tags != nil { + { + size, err := m.Tags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } if len(m.Checksums) > 0 { for iNdEx := len(m.Checksums) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Checksums[iNdEx]) @@ -1264,6 +1419,18 @@ func (m *GroupInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Tags != nil { + { + size, err := m.Tags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } if len(m.Extra) > 0 { i -= len(m.Extra) copy(dAtA[i:], m.Extra) @@ -1679,6 +1846,80 @@ func (m *MigrationBucketInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ResourceTags) 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 *ResourceTags) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceTags) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Tags) > 0 { + for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tags[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ResourceTags_Tag) 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 *ResourceTags_Tag) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceTags_Tag) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -1728,6 +1969,10 @@ func (m *BucketInfo) Size() (n int) { if m.BucketStatus != 0 { n += 1 + sovTypes(uint64(m.BucketStatus)) } + if m.Tags != nil { + l = m.Tags.Size() + n += 1 + l + sovTypes(uint64(l)) + } return n } @@ -1810,6 +2055,10 @@ func (m *ObjectInfo) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } + if m.Tags != nil { + l = m.Tags.Size() + n += 1 + l + sovTypes(uint64(l)) + } return n } @@ -1836,6 +2085,10 @@ func (m *GroupInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.Tags != nil { + l = m.Tags.Size() + n += 1 + l + sovTypes(uint64(l)) + } return n } @@ -2005,6 +2258,38 @@ func (m *MigrationBucketInfo) Size() (n int) { return n } +func (m *ResourceTags) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Tags) > 0 { + for _, e := range m.Tags { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func (m *ResourceTags_Tag) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2284,6 +2569,42 @@ func (m *BucketInfo) Unmarshal(dAtA []byte) error { break } } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tags == nil { + m.Tags = &ResourceTags{} + } + if err := m.Tags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -2834,6 +3155,42 @@ func (m *ObjectInfo) Unmarshal(dAtA []byte) error { m.Checksums = append(m.Checksums, make([]byte, postIndex-iNdEx)) copy(m.Checksums[len(m.Checksums)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tags == nil { + m.Tags = &ResourceTags{} + } + if err := m.Tags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -3033,6 +3390,42 @@ func (m *GroupInfo) Unmarshal(dAtA []byte) error { } m.Extra = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tags == nil { + m.Tags = &ResourceTags{} + } + if err := m.Tags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -4189,6 +4582,204 @@ func (m *MigrationBucketInfo) Unmarshal(dAtA []byte) error { } return nil } +func (m *ResourceTags) 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 ErrIntOverflowTypes + } + 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: ResourceTags: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceTags: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tags = append(m.Tags, ResourceTags_Tag{}) + if err := m.Tags[len(m.Tags)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResourceTags_Tag) 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 ErrIntOverflowTypes + } + 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: Tag: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Tag: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/virtualgroup/client/cli/query.go b/x/virtualgroup/client/cli/query.go index 7193e9ffd..7e932f5a3 100644 --- a/x/virtualgroup/client/cli/query.go +++ b/x/virtualgroup/client/cli/query.go @@ -28,8 +28,6 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand(CmdGlobalVirtualGroupFamilies()) cmd.AddCommand(CmdQueryParams()) - // this line is used by starport scaffolding # 1 - return cmd } diff --git a/x/virtualgroup/client/cli/tx.go b/x/virtualgroup/client/cli/tx.go index 38567d27a..5a71891dc 100644 --- a/x/virtualgroup/client/cli/tx.go +++ b/x/virtualgroup/client/cli/tx.go @@ -24,7 +24,6 @@ func GetTxCmd() *cobra.Command { } cmd.AddCommand(CmdSettle()) - // this line is used by starport scaffolding # 1 return cmd } diff --git a/x/virtualgroup/genesis.go b/x/virtualgroup/genesis.go index 4e0649909..13154599d 100644 --- a/x/virtualgroup/genesis.go +++ b/x/virtualgroup/genesis.go @@ -9,7 +9,6 @@ import ( // InitGenesis initializes the module's state from a provided genesis state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - // this line is used by starport scaffolding # genesis/module/init err := k.SetParams(ctx, genState.Params) if err != nil { panic(err) @@ -21,8 +20,5 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - - // this line is used by starport scaffolding # genesis/module/export - return genesis } diff --git a/x/virtualgroup/keeper/genesis_test.go b/x/virtualgroup/keeper/genesis_test.go index 49adbad00..ca530c314 100644 --- a/x/virtualgroup/keeper/genesis_test.go +++ b/x/virtualgroup/keeper/genesis_test.go @@ -12,8 +12,6 @@ import ( func (s *TestSuite) TestGenesis() { genesisState := types.GenesisState{ Params: types.DefaultParams(), - - // this line is used by starport scaffolding # genesis/test/state } s.accountKeeper.EXPECT().GetModuleAccount(gomock.Any(), gomock.Any()).Return(types2.NewEmptyModuleAccount(types.ModuleName)) diff --git a/x/virtualgroup/keeper/keeper.go b/x/virtualgroup/keeper/keeper.go index c325bc1c1..2d96fbf41 100644 --- a/x/virtualgroup/keeper/keeper.go +++ b/x/virtualgroup/keeper/keeper.go @@ -11,6 +11,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/bnb-chain/greenfield/internal/sequence" sptypes "github.com/bnb-chain/greenfield/x/sp/types" @@ -162,7 +163,9 @@ func (k Keeper) DeleteGVG(ctx sdk.Context, primarySp *sptypes.StorageProvider, g return err } - if len(gvgFamily.GlobalVirtualGroupIds) == 0 && k.paymentKeeper.IsEmptyNetFlow(ctx, sdk.MustAccAddressFromHex(gvgFamily.VirtualPaymentAddress)) { + if len(gvgFamily.GlobalVirtualGroupIds) == 0 && + k.paymentKeeper.IsEmptyNetFlow(ctx, sdk.MustAccAddressFromHex(gvgFamily.VirtualPaymentAddress)) && + !ctx.IsUpgraded(upgradetypes.Manchurian) { store.Delete(types.GetGVGFamilyKey(gvg.FamilyId)) if err := ctx.EventManager().EmitTypedEvents(&types.EventDeleteGlobalVirtualGroupFamily{ Id: gvgFamily.Id, diff --git a/x/virtualgroup/keeper/msg_server.go b/x/virtualgroup/keeper/msg_server.go index 94726bd8a..98ff91f77 100644 --- a/x/virtualgroup/keeper/msg_server.go +++ b/x/virtualgroup/keeper/msg_server.go @@ -105,6 +105,23 @@ func (k msgServer) CreateGlobalVirtualGroup(goCtx context.Context, req *types.Ms return nil, err } + if ctx.IsUpgraded(upgradetypes.Manchurian) { + for _, gvgID := range gvgFamily.GlobalVirtualGroupIds { + gvg, found := k.GetGVG(ctx, gvgID) + if !found { + return nil, types.ErrGVGNotExist + } + for i, secondarySPId := range gvg.SecondarySpIds { + if secondarySPId != secondarySpIds[i] { + break + } + if i == len(secondarySpIds)-1 { + return nil, types.ErrDuplicateGVG.Wrapf("the global virtual group family already has a GVG with same SP in same order") + } + } + } + } + // Each family supports only a limited number of GVGS if k.MaxGlobalVirtualGroupNumPerFamily(ctx) < uint32(len(gvgFamily.GlobalVirtualGroupIds)) { return nil, types.ErrLimitationExceed.Wrapf("The gvg number within the family exceeds the limit.") diff --git a/x/virtualgroup/module_simulation.go b/x/virtualgroup/module_simulation.go index 1862eda20..ecc47c65a 100644 --- a/x/virtualgroup/module_simulation.go +++ b/x/virtualgroup/module_simulation.go @@ -39,8 +39,6 @@ const ( opWeightMsgCancelSwapOut = "op_weight_msg_cancel_swap_out" // TODO: Determine the simulation weight value defaultWeightMsgCancelSwapOut int = 100 - - // this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module. @@ -51,7 +49,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } virtualgroupGenesis := types.GenesisState{ Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&virtualgroupGenesis) } @@ -112,8 +109,6 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp virtualgroupsimulation.SimulateMsgCancelSwapOut(am.accountKeeper, am.bankKeeper, am.keeper), )) - // this line is used by starport scaffolding # simapp/module/operation - return operations } @@ -152,6 +147,5 @@ func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.Wei return nil }, ), - // this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/virtualgroup/types/codec.go b/x/virtualgroup/types/codec.go index 903cac2ac..d3c1444e0 100644 --- a/x/virtualgroup/types/codec.go +++ b/x/virtualgroup/types/codec.go @@ -12,7 +12,6 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgCompleteStorageProviderExit{}, "virtualgroup/CompleteStorageProviderExit", nil) cdc.RegisterConcrete(&MsgCompleteSwapOut{}, "virtualgroup/CompleteSwapOut", nil) cdc.RegisterConcrete(&MsgCancelSwapOut{}, "virtualgroup/CancelSwapOut", nil) - // this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -49,7 +48,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCancelSwapOut{}, ) - // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/virtualgroup/types/errors.go b/x/virtualgroup/types/errors.go index 6f5e85f98..4d19e72d5 100644 --- a/x/virtualgroup/types/errors.go +++ b/x/virtualgroup/types/errors.go @@ -22,6 +22,7 @@ var ( ErrLimitationExceed = errors.Register(ModuleName, 1123, "limitation exceed.") ErrDuplicateSecondarySP = errors.Register(ModuleName, 1124, "the global virtual group has duplicate secondary sp.") ErrInsufficientStaking = errors.Register(ModuleName, 1125, "insufficient staking for gvg") + ErrDuplicateGVG = errors.Register(ModuleName, 1126, "global virtual group is duplicate") ErrInvalidDenom = errors.Register(ModuleName, 2000, "Invalid denom.") ) diff --git a/x/virtualgroup/types/genesis.go b/x/virtualgroup/types/genesis.go index e523553eb..bdb9f4151 100644 --- a/x/virtualgroup/types/genesis.go +++ b/x/virtualgroup/types/genesis.go @@ -6,7 +6,6 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } } @@ -14,6 +13,5 @@ func DefaultGenesis() *GenesisState { // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() } diff --git a/x/virtualgroup/types/query.pb.go b/x/virtualgroup/types/query.pb.go index 36fdca30c..87be1e8f6 100644 --- a/x/virtualgroup/types/query.pb.go +++ b/x/virtualgroup/types/query.pb.go @@ -383,7 +383,6 @@ func (m *QueryGlobalVirtualGroupFamilyResponse) GetGlobalVirtualGroupFamily() *G return nil } -// this line is used by starport scaffolding # 3 type QueryGlobalVirtualGroupFamiliesRequest struct { Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` } diff --git a/x/virtualgroup/types/tx.pb.go b/x/virtualgroup/types/tx.pb.go index b05d00332..8b5d07a78 100644 --- a/x/virtualgroup/types/tx.pb.go +++ b/x/virtualgroup/types/tx.pb.go @@ -952,7 +952,6 @@ func (m *MsgSettleResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSettleResponse proto.InternalMessageInfo -// this line is used by starport scaffolding # proto/tx/message type MsgStorageProviderExit struct { // storage_provider defines the operator account address of the storage provider who want to exit from the greenfield storage network. StorageProvider string `protobuf:"bytes,1,opt,name=storage_provider,json=storageProvider,proto3" json:"storage_provider,omitempty"` @@ -1221,7 +1220,6 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // this line is used by starport scaffolding # proto/tx/import CreateGlobalVirtualGroup(ctx context.Context, in *MsgCreateGlobalVirtualGroup, opts ...grpc.CallOption) (*MsgCreateGlobalVirtualGroupResponse, error) DeleteGlobalVirtualGroup(ctx context.Context, in *MsgDeleteGlobalVirtualGroup, opts ...grpc.CallOption) (*MsgDeleteGlobalVirtualGroupResponse, error) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) @@ -1345,7 +1343,6 @@ func (c *msgClient) CancelSwapOut(ctx context.Context, in *MsgCancelSwapOut, opt // MsgServer is the server API for Msg service. type MsgServer interface { - // this line is used by starport scaffolding # proto/tx/import CreateGlobalVirtualGroup(context.Context, *MsgCreateGlobalVirtualGroup) (*MsgCreateGlobalVirtualGroupResponse, error) DeleteGlobalVirtualGroup(context.Context, *MsgDeleteGlobalVirtualGroup) (*MsgDeleteGlobalVirtualGroupResponse, error) Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error)