diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml index 67052077c..1741619f1 100644 --- a/.github/workflows/buf.yml +++ b/.github/workflows/buf.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: bufbuild/buf-setup-action@v1 + - uses: bufbuild/buf-setup-action@v1.28.0 - run: buf format --diff --exit-code - name: Install Go uses: actions/setup-go@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index c3ab569aa..30e5fdded 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,20 @@ # Changelog ## v1.1.0 -This release contains 2 new features, 3 bugfixes and 6 chores. +This release contains 4 new features, 5 bugfixes and 6 chores. Features: * [#493](https://github.com/bnb-chain/greenfield/pull/493) feat: support reject bucket migration * [#504](https://github.com/bnb-chain/greenfield/pull/504) feat: add a hardfork for the link to opBNB +* [#520](https://github.com/bnb-chain/greenfield/pull/520) feat: shuffle the result of StorageProviders query method +* [#521](https://github.com/bnb-chain/greenfield/pull/521) feat: disable sp exit and bucket migration msg Bugfixes: * [#506](https://github.com/bnb-chain/greenfield/pull/506) fix: add GlobalVirtualGroupFamilyId to createBucketPackage * [#509](https://github.com/bnb-chain/greenfield/pull/509) fix: make handleCreateBucketSynPackage forward compatible * [#511](https://github.com/bnb-chain/greenfield/pull/511) fix: policy key is not GC while a expired policy is GC +* [#518](https://github.com/bnb-chain/greenfield/pull/518) fix: emit event when sp status is forced updated +* [#519](https://github.com/bnb-chain/greenfield/pull/519) fix: enforce validation on SSP when creating GVG Chores: * [#484](https://github.com/bnb-chain/greenfield/pull/484) chore: improve the validations of messages diff --git a/app/app.go b/app/app.go index 2ed197734..c467d47bf 100644 --- a/app/app.go +++ b/app/app.go @@ -473,7 +473,6 @@ func New( app.BankKeeper, app.PaymentKeeper, ) - virtualgroupModule := virtualgroupmodule.NewAppModule(appCodec, app.VirtualgroupKeeper, app.SpKeeper) app.PermissionmoduleKeeper = *permissionmodulekeeper.NewKeeper( appCodec, @@ -497,6 +496,9 @@ func New( ) storageModule := storagemodule.NewAppModule(appCodec, app.StorageKeeper, app.AccountKeeper, app.BankKeeper, app.SpKeeper) + app.VirtualgroupKeeper.SetStorageKeeper(&app.StorageKeeper) + virtualgroupModule := virtualgroupmodule.NewAppModule(appCodec, app.VirtualgroupKeeper, app.SpKeeper) + app.ChallengeKeeper = *challengemodulekeeper.NewKeeper( appCodec, keys[challengemoduletypes.StoreKey], diff --git a/app/upgrade.go b/app/upgrade.go index 1bc7023e0..48185de08 100644 --- a/app/upgrade.go +++ b/app/upgrade.go @@ -4,7 +4,6 @@ import ( serverconfig "github.com/cosmos/cosmos-sdk/server/config" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "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" @@ -80,8 +79,17 @@ func (app *App) registerPampasUpgradeHandler() { app.CrossChainKeeper.SetChannelSendPermission(ctx, sdk.ChainID(app.appConfig.CrossChain.DestOpChainId), storagemoduletypes.ObjectChannelId, sdk.ChannelAllow) app.CrossChainKeeper.SetChannelSendPermission(ctx, sdk.ChainID(app.appConfig.CrossChain.DestOpChainId), storagemoduletypes.GroupChannelId, sdk.ChannelAllow) - // register MsgRejectMigrateBucket Gas param - app.GashubKeeper.SetMsgGasParams(ctx, *types.NewMsgGasParamsWithFixedGas("/greenfield.storage.MsgRejectMigrateBucket", 1.2e3)) + // disable sp exit + app.GashubKeeper.DeleteMsgGasParams(ctx, "/greenfield.virtualgroup.MsgSwapOut") + app.GashubKeeper.DeleteMsgGasParams(ctx, "/greenfield.virtualgroup.MsgCompleteSwapOut") + app.GashubKeeper.DeleteMsgGasParams(ctx, "/greenfield.virtualgroup.MsgCancelSwapOut") + app.GashubKeeper.DeleteMsgGasParams(ctx, "/greenfield.virtualgroup.MsgStorageProviderExit") + app.GashubKeeper.DeleteMsgGasParams(ctx, "/greenfield.virtualgroup.MsgCompleteStorageProviderExit") + + // disable bucket migration. + app.GashubKeeper.DeleteMsgGasParams(ctx, "/greenfield.storage.MsgMigrateBucket") + app.GashubKeeper.DeleteMsgGasParams(ctx, "/greenfield.storage.MsgCancelMigrateBucket") + app.GashubKeeper.DeleteMsgGasParams(ctx, "/greenfield.storage.MsgCompleteMigrateBucket") return app.mm.RunMigrations(ctx, app.configurator, fromVM) }) diff --git a/e2e/tests/payment_test.go b/e2e/tests/payment_test.go index 914026688..575f32206 100644 --- a/e2e/tests/payment_test.go +++ b/e2e/tests/payment_test.go @@ -1169,106 +1169,106 @@ func (s *PaymentTestSuite) TestVirtualGroup_Settle() { s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate).Int64(), int64(0)) } -func (s *PaymentTestSuite) TestVirtualGroup_SwapOut() { - ctx := context.Background() - user := s.GenAndChargeAccounts(1, 1000000)[0] - successorSp := s.PickStorageProvider() - - // create a new storage provider - sp := s.BaseSuite.CreateNewStorageProvider() - s.T().Logf("new SP Info: %s", sp.Info.String()) - - // create a new gvg group for this storage provider - var secondarySPIDs []uint32 - for _, ssp := range s.StorageProviders { - if ssp.Info.Id != successorSp.Info.Id { - secondarySPIDs = append(secondarySPIDs, ssp.Info.Id) - } - if len(secondarySPIDs) == 6 { - break - } - } - - gvgID, familyID := s.BaseSuite.CreateGlobalVirtualGroup(sp, 0, secondarySPIDs, 1) - - // create object - s.BaseSuite.CreateObject(user, sp, gvgID, storagetestutils.GenRandomBucketName(), storagetestutils.GenRandomObjectName()) - - // Create another gvg contains this new sp - anotherSP := s.PickDifferentStorageProvider(successorSp.Info.Id) - var anotherSecondarySPIDs []uint32 - for _, ssp := range s.StorageProviders { - if ssp.Info.Id != successorSp.Info.Id && ssp.Info.Id != anotherSP.Info.Id { - anotherSecondarySPIDs = append(anotherSecondarySPIDs, ssp.Info.Id) - } - if len(anotherSecondarySPIDs) == 5 { - break - } - } - anotherSecondarySPIDs = append(anotherSecondarySPIDs, sp.Info.Id) - - anotherGVGID, _ := s.BaseSuite.CreateGlobalVirtualGroup(anotherSP, 0, anotherSecondarySPIDs, 1) - - familyResp, err := s.Client.GlobalVirtualGroupFamily(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupFamilyRequest{FamilyId: familyID}) - s.Require().NoError(err) - gvgResp, err := s.Client.GlobalVirtualGroup(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupRequest{GlobalVirtualGroupId: anotherGVGID}) - s.Require().NoError(err) - - streamAddresses := []string{ - user.GetAddr().String(), - familyResp.GlobalVirtualGroupFamily.VirtualPaymentAddress, - gvgResp.GlobalVirtualGroup.VirtualPaymentAddress, - paymenttypes.ValidatorTaxPoolAddress.String(), - } - streamRecordsBefore := s.getStreamRecords(streamAddresses) - - // sp exit - s.SendTxBlock(sp.OperatorKey, &virtualgrouptypes.MsgStorageProviderExit{ - StorageProvider: sp.OperatorKey.GetAddr().String(), - }) - - resp, err := s.Client.StorageProvider(context.Background(), &sptypes.QueryStorageProviderRequest{Id: sp.Info.Id}) - s.Require().NoError(err) - s.Require().Equal(resp.StorageProvider.Status, sptypes.STATUS_GRACEFUL_EXITING) - - // swap out, as secondary sp - msgSwapOut2 := virtualgrouptypes.NewMsgSwapOut(sp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}, successorSp.Info.Id) - msgSwapOut2.SuccessorSpApproval = &common.Approval{ExpiredHeight: math.MaxUint} - msgSwapOut2.SuccessorSpApproval.Sig, err = successorSp.ApprovalKey.Sign(msgSwapOut2.GetApprovalBytes()) - s.Require().NoError(err) - s.SendTxBlock(sp.OperatorKey, msgSwapOut2) - - // complete swap out - msgCompleteSwapOut2 := virtualgrouptypes.NewMsgCompleteSwapOut(successorSp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}) - s.Require().NoError(err) - s.SendTxBlock(successorSp.OperatorKey, msgCompleteSwapOut2) - - // swap out, as primary sp - msgSwapOut := virtualgrouptypes.NewMsgSwapOut(sp.OperatorKey.GetAddr(), familyID, nil, successorSp.Info.Id) - msgSwapOut.SuccessorSpApproval = &common.Approval{ExpiredHeight: math.MaxUint} - msgSwapOut.SuccessorSpApproval.Sig, err = successorSp.ApprovalKey.Sign(msgSwapOut.GetApprovalBytes()) - s.Require().NoError(err) - s.SendTxBlock(sp.OperatorKey, msgSwapOut) - - // complete swap out, as primary sp - msgCompleteSwapOut := virtualgrouptypes.NewMsgCompleteSwapOut(successorSp.OperatorKey.GetAddr(), familyID, nil) - s.Require().NoError(err) - s.SendTxBlock(successorSp.OperatorKey, msgCompleteSwapOut) - - // sp complete exit success - s.SendTxBlock( - sp.OperatorKey, - &virtualgrouptypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, - ) - - // assertions - streamRecordsAfter := s.getStreamRecords(streamAddresses) - - s.Require().Equal(streamRecordsAfter.User.NetflowRate.Sub(streamRecordsBefore.User.NetflowRate).Int64(), int64(0)) - s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate).Int64(), int64(0)) - s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate).Int64(), int64(0)) - s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate).Int64(), int64(0)) -} +//func (s *PaymentTestSuite) TestVirtualGroup_SwapOut() { +// ctx := context.Background() +// user := s.GenAndChargeAccounts(1, 1000000)[0] +// successorSp := s.PickStorageProvider() +// +// // create a new storage provider +// sp := s.BaseSuite.CreateNewStorageProvider() +// s.T().Logf("new SP Info: %s", sp.Info.String()) +// +// // create a new gvg group for this storage provider +// var secondarySPIDs []uint32 +// for _, ssp := range s.StorageProviders { +// if ssp.Info.Id != successorSp.Info.Id { +// secondarySPIDs = append(secondarySPIDs, ssp.Info.Id) +// } +// if len(secondarySPIDs) == 6 { +// break +// } +// } +// +// gvgID, familyID := s.BaseSuite.CreateGlobalVirtualGroup(sp, 0, secondarySPIDs, 1) +// +// // create object +// s.BaseSuite.CreateObject(user, sp, gvgID, storagetestutils.GenRandomBucketName(), storagetestutils.GenRandomObjectName()) +// +// // Create another gvg contains this new sp +// anotherSP := s.PickDifferentStorageProvider(successorSp.Info.Id) +// var anotherSecondarySPIDs []uint32 +// for _, ssp := range s.StorageProviders { +// if ssp.Info.Id != successorSp.Info.Id && ssp.Info.Id != anotherSP.Info.Id { +// anotherSecondarySPIDs = append(anotherSecondarySPIDs, ssp.Info.Id) +// } +// if len(anotherSecondarySPIDs) == 5 { +// break +// } +// } +// anotherSecondarySPIDs = append(anotherSecondarySPIDs, sp.Info.Id) +// +// anotherGVGID, _ := s.BaseSuite.CreateGlobalVirtualGroup(anotherSP, 0, anotherSecondarySPIDs, 1) +// +// familyResp, err := s.Client.GlobalVirtualGroupFamily(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupFamilyRequest{FamilyId: familyID}) +// s.Require().NoError(err) +// gvgResp, err := s.Client.GlobalVirtualGroup(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupRequest{GlobalVirtualGroupId: anotherGVGID}) +// s.Require().NoError(err) +// +// streamAddresses := []string{ +// user.GetAddr().String(), +// familyResp.GlobalVirtualGroupFamily.VirtualPaymentAddress, +// gvgResp.GlobalVirtualGroup.VirtualPaymentAddress, +// paymenttypes.ValidatorTaxPoolAddress.String(), +// } +// streamRecordsBefore := s.getStreamRecords(streamAddresses) +// +// // sp exit +// s.SendTxBlock(sp.OperatorKey, &virtualgrouptypes.MsgStorageProviderExit{ +// StorageProvider: sp.OperatorKey.GetAddr().String(), +// }) +// +// resp, err := s.Client.StorageProvider(context.Background(), &sptypes.QueryStorageProviderRequest{Id: sp.Info.Id}) +// s.Require().NoError(err) +// s.Require().Equal(resp.StorageProvider.Status, sptypes.STATUS_GRACEFUL_EXITING) +// +// // swap out, as secondary sp +// msgSwapOut2 := virtualgrouptypes.NewMsgSwapOut(sp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}, successorSp.Info.Id) +// msgSwapOut2.SuccessorSpApproval = &common.Approval{ExpiredHeight: math.MaxUint} +// msgSwapOut2.SuccessorSpApproval.Sig, err = successorSp.ApprovalKey.Sign(msgSwapOut2.GetApprovalBytes()) +// s.Require().NoError(err) +// s.SendTxBlock(sp.OperatorKey, msgSwapOut2) +// +// // complete swap out +// msgCompleteSwapOut2 := virtualgrouptypes.NewMsgCompleteSwapOut(successorSp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}) +// s.Require().NoError(err) +// s.SendTxBlock(successorSp.OperatorKey, msgCompleteSwapOut2) +// +// // swap out, as primary sp +// msgSwapOut := virtualgrouptypes.NewMsgSwapOut(sp.OperatorKey.GetAddr(), familyID, nil, successorSp.Info.Id) +// msgSwapOut.SuccessorSpApproval = &common.Approval{ExpiredHeight: math.MaxUint} +// msgSwapOut.SuccessorSpApproval.Sig, err = successorSp.ApprovalKey.Sign(msgSwapOut.GetApprovalBytes()) +// s.Require().NoError(err) +// s.SendTxBlock(sp.OperatorKey, msgSwapOut) +// +// // complete swap out, as primary sp +// msgCompleteSwapOut := virtualgrouptypes.NewMsgCompleteSwapOut(successorSp.OperatorKey.GetAddr(), familyID, nil) +// s.Require().NoError(err) +// s.SendTxBlock(successorSp.OperatorKey, msgCompleteSwapOut) +// +// // sp complete exit success +// s.SendTxBlock( +// sp.OperatorKey, +// &virtualgrouptypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, +// ) +// +// // assertions +// streamRecordsAfter := s.getStreamRecords(streamAddresses) +// +// s.Require().Equal(streamRecordsAfter.User.NetflowRate.Sub(streamRecordsBefore.User.NetflowRate).Int64(), int64(0)) +// s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate).Int64(), int64(0)) +// s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate).Int64(), int64(0)) +// s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate).Int64(), int64(0)) +//} func (s *PaymentTestSuite) TestDiscontinue_InOneBlock_WithoutPriceChange() { ctx := context.Background() diff --git a/e2e/tests/permission_test.go b/e2e/tests/permission_test.go index 699d4f1b8..bf998799e 100644 --- a/e2e/tests/permission_test.go +++ b/e2e/tests/permission_test.go @@ -1925,7 +1925,7 @@ func (s *StorageTestSuite) TestExpiredAccountPolicyGCAndRePut() { Actions: []types.ActionType{types.ACTION_DELETE_BUCKET}, Effect: types.EFFECT_ALLOW, } - expirationTime := time.Now().Add(5 * time.Second) + expirationTime := time.Now().Add(3 * time.Second) msgPutBucketPolicy := storagetypes.NewMsgPutPolicy(owner.GetAddr(), types2.NewBucketGRN(bucketName).String(), principal, []*types.Statement{bucketStatement}, &expirationTime) @@ -1990,7 +1990,7 @@ func (s *StorageTestSuite) TestExpiredGroupPolicyGCAndRePut() { principal := types.NewPrincipalWithGroupId(headGroupResponse.GroupInfo.Id) // Put bucket policy for group - expirationTime := time.Now().Add(5 * time.Second) + expirationTime := time.Now().Add(3 * time.Second) bucketStatement := &types.Statement{ Actions: []types.ActionType{types.ACTION_DELETE_BUCKET}, diff --git a/e2e/tests/sp_test.go b/e2e/tests/sp_test.go index f53ebc798..9d2cca354 100644 --- a/e2e/tests/sp_test.go +++ b/e2e/tests/sp_test.go @@ -22,7 +22,6 @@ import ( "github.com/bnb-chain/greenfield/sdk/types" "github.com/bnb-chain/greenfield/testutil/sample" sptypes "github.com/bnb-chain/greenfield/x/sp/types" - virtualgroupmoduletypes "github.com/bnb-chain/greenfield/x/virtualgroup/types" ) type StorageProviderTestSuite struct { @@ -38,39 +37,39 @@ func (s *StorageProviderTestSuite) SetupSuite() { func (s *StorageProviderTestSuite) SetupTest() { } -func (s *StorageProviderTestSuite) TestCreateStorageProvider() { - // Create a New SP - sp := s.BaseSuite.CreateNewStorageProvider() - - // query sp by id - querySPResp, err := s.Client.StorageProvider(context.Background(), &sptypes.QueryStorageProviderRequest{ - Id: sp.Info.Id, - }) - s.Require().NoError(err) - s.Require().Equal(querySPResp.StorageProvider, querySPResp.StorageProvider) - - // sp exit - msgSPExit := virtualgroupmoduletypes.MsgStorageProviderExit{ - StorageProvider: sp.OperatorKey.GetAddr().String(), - } - s.SendTxBlock(sp.OperatorKey, &msgSPExit) - - // 9 query sp status - querySPResp2, err := s.Client.StorageProvider(context.Background(), &sptypes.QueryStorageProviderRequest{Id: sp.Info.Id}) - s.Require().NoError(err) - s.Require().Equal(querySPResp2.StorageProvider.Status, sptypes.STATUS_GRACEFUL_EXITING) - - // 10 complete sp exit - msgCompleteSPExit := virtualgroupmoduletypes.MsgCompleteStorageProviderExit{ - StorageProvider: sp.OperatorKey.GetAddr().String(), - } - - s.SendTxBlock(sp.OperatorKey, &msgCompleteSPExit) - - // 10 query sp - _, err = s.Client.StorageProvider(context.Background(), &sptypes.QueryStorageProviderRequest{Id: sp.Info.Id}) - s.Require().Error(err) -} +//func (s *StorageProviderTestSuite) TestCreateStorageProvider() { +// // Create a New SP +// sp := s.BaseSuite.CreateNewStorageProvider() +// +// // query sp by id +// querySPResp, err := s.Client.StorageProvider(context.Background(), &sptypes.QueryStorageProviderRequest{ +// Id: sp.Info.Id, +// }) +// s.Require().NoError(err) +// s.Require().Equal(querySPResp.StorageProvider, querySPResp.StorageProvider) +// +// // sp exit +// msgSPExit := virtualgroupmoduletypes.MsgStorageProviderExit{ +// StorageProvider: sp.OperatorKey.GetAddr().String(), +// } +// s.SendTxBlock(sp.OperatorKey, &msgSPExit) +// +// // 9 query sp status +// querySPResp2, err := s.Client.StorageProvider(context.Background(), &sptypes.QueryStorageProviderRequest{Id: sp.Info.Id}) +// s.Require().NoError(err) +// s.Require().Equal(querySPResp2.StorageProvider.Status, sptypes.STATUS_GRACEFUL_EXITING) +// +// // 10 complete sp exit +// msgCompleteSPExit := virtualgroupmoduletypes.MsgCompleteStorageProviderExit{ +// StorageProvider: sp.OperatorKey.GetAddr().String(), +// } +// +// s.SendTxBlock(sp.OperatorKey, &msgCompleteSPExit) +// +// // 10 query sp +// _, err = s.Client.StorageProvider(context.Background(), &sptypes.QueryStorageProviderRequest{Id: sp.Info.Id}) +// s.Require().Error(err) +//} func (s *StorageProviderTestSuite) TestEditStorageProvider() { ctx := context.Background() diff --git a/e2e/tests/storage_bill_test.go b/e2e/tests/storage_bill_test.go index 640f67ee5..056eac7b4 100644 --- a/e2e/tests/storage_bill_test.go +++ b/e2e/tests/storage_bill_test.go @@ -1746,422 +1746,422 @@ func (s *PaymentTestSuite) TestStorageBill_UpdatePaymentAddress() { s.SendTxBlockWithExpectErrorString(msgUpdateBucketInfo, user, "apply user flows list failed") } -func (s *PaymentTestSuite) TestStorageBill_MigrateBucket() { - var err error - ctx := context.Background() - primarySP := s.PickStorageProvider() - gvg, found := primarySP.GetFirstGlobalVirtualGroup() - s.Require().True(found) - queryFamilyResponse, err := s.Client.GlobalVirtualGroupFamily(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupFamilyRequest{ - FamilyId: gvg.FamilyId, - }) - s.Require().NoError(err) - family := queryFamilyResponse.GlobalVirtualGroupFamily - user := s.GenAndChargeAccounts(1, 10)[0] - - streamAddresses := []string{ - user.GetAddr().String(), - family.VirtualPaymentAddress, - gvg.VirtualPaymentAddress, - paymenttypes.ValidatorTaxPoolAddress.String(), - } - - streamAddresses0 := streamAddresses - paymentParams, err := s.Client.PaymentQueryClient.Params(ctx, &paymenttypes.QueryParamsRequest{}) - s.T().Logf("paymentParams %s, err: %v", paymentParams, err) - s.Require().NoError(err) - - bucketName := s.createBucket(primarySP, gvg, user, 0) - bucketInfo, err := s.Client.HeadBucket(context.Background(), &storagetypes.QueryHeadBucketRequest{ - BucketName: bucketName, - }) - s.Require().NoError(err) - - // create object with none zero payload size - streamRecordsBefore := s.getStreamRecords(streamAddresses) - _, _, objectName, objectId, checksums, payloadSize := s.createObject(user, bucketName, false) - - // assertions - streamRecordsAfter := s.getStreamRecords(streamAddresses) - s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) - lockFee := s.calculateLockFee(bucketName, objectName, payloadSize) - s.Require().Equal(streamRecordsAfter.User.LockBalance.Sub(streamRecordsBefore.User.LockBalance), lockFee) - s.Require().Equal(streamRecordsAfter.User.NetflowRate.Sub(streamRecordsBefore.User.NetflowRate).Int64(), int64(0)) - s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate).Int64(), int64(0)) - s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate).Int64(), int64(0)) - s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate).Int64(), int64(0)) - - // case: seal object without price change - s.sealObject(primarySP, gvg, bucketName, objectName, objectId, checksums) - - // assertions - streamRecordsAfter = s.getStreamRecords(streamAddresses) - gvgFamilyRate, gvgRate, taxRate, userTotalRate := s.calculateStorageRates(bucketName, objectName, payloadSize, 0) - s.T().Logf("gvgFamilyRate: %v, gvgRate: %v, taxRate: %v, userTotalRate: %v", gvgFamilyRate, gvgRate, taxRate, userTotalRate) - s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) - s.Require().Equal(streamRecordsAfter.User.LockBalance, sdkmath.ZeroInt()) - s.Require().Equal(streamRecordsAfter.User.NetflowRate.Sub(streamRecordsBefore.User.NetflowRate), userTotalRate.Neg()) - s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate), gvgFamilyRate) - s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate), gvgRate) - s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate) - taxRate0 := taxRate - - dstPrimarySP := s.CreateNewStorageProvider() - - // update price - priceRes, err := s.Client.QueryGlobalSpStorePriceByTime(ctx, &sptypes.QueryGlobalSpStorePriceByTimeRequest{ - Timestamp: 0, - }) - s.Require().NoError(err) - s.T().Log("price", priceRes.GlobalSpStorePrice) - - s.updateGlobalSpPrice(priceRes.GlobalSpStorePrice.ReadPrice.MulInt64(2), priceRes.GlobalSpStorePrice.PrimaryStorePrice.MulInt64(10)) - defer s.updateGlobalSpPrice(priceRes.GlobalSpStorePrice.ReadPrice, priceRes.GlobalSpStorePrice.PrimaryStorePrice) - - _, secondarySPIDs := s.GetSecondarySP(dstPrimarySP, primarySP) - gvgID, _ := s.BaseSuite.CreateGlobalVirtualGroup(dstPrimarySP, 0, secondarySPIDs, 1) - gvgResp, err := s.Client.VirtualGroupQueryClient.GlobalVirtualGroup(context.Background(), &virtualgrouptypes.QueryGlobalVirtualGroupRequest{ - GlobalVirtualGroupId: gvgID, - }) - s.Require().NoError(err) - dstGVG := gvgResp.GlobalVirtualGroup - s.Require().True(found) - - queryFamilyResponse, err = s.Client.GlobalVirtualGroupFamily(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupFamilyRequest{ - FamilyId: dstGVG.FamilyId, - }) - s.Require().NoError(err) - family = queryFamilyResponse.GlobalVirtualGroupFamily - streamAddresses = []string{ - user.GetAddr().String(), - family.VirtualPaymentAddress, - dstGVG.VirtualPaymentAddress, - paymenttypes.ValidatorTaxPoolAddress.String(), - } - fundAddress := primarySP.FundingKey.GetAddr() - streamRecordsBefore = s.getStreamRecords(streamAddresses) - - queryBalanceRequest := banktypes.QueryBalanceRequest{Denom: s.Config.Denom, Address: fundAddress.String()} - fundBalanceBefore, err := s.Client.BankQueryClient.Balance(context.Background(), &queryBalanceRequest) - s.Require().NoError(err) - - // MigrationBucket - msgMigrationBucket, msgCompleteMigrationBucket := s.NewMigrateBucket(primarySP, dstPrimarySP, user, bucketName, gvg.FamilyId, dstGVG.FamilyId, bucketInfo.BucketInfo.Id) - s.SendTxBlock(user, msgMigrationBucket) - s.Require().NoError(err) - - // complete MigrationBucket - s.SendTxBlock(dstPrimarySP.OperatorKey, msgCompleteMigrationBucket) - streamRecordsAfter = s.getStreamRecords(streamAddresses) - fundBalanceAfter, err := s.Client.BankQueryClient.Balance(context.Background(), &queryBalanceRequest) - s.Require().NoError(err) - s.T().Logf("fundBalanceBefore: %v, fundBalanceAfter: %v, diff: %v", fundBalanceBefore, fundBalanceAfter, fundBalanceAfter.Balance.Amount.Sub(fundBalanceBefore.Balance.Amount)) - s.Require().True(fundBalanceAfter.Balance.Amount.Sub(fundBalanceBefore.Balance.Amount).GT(sdkmath.NewInt(0)), "migrate sp fund address need settle") - gvgFamilyRate, gvgRate, taxRate, userTotalRate = s.calculateStorageRates(bucketName, objectName, payloadSize, time.Now().Unix()) - s.T().Logf("gvgFamilyRate: %v, gvgRate: %v, taxRate: %v, userTotalRate: %v", gvgFamilyRate, gvgRate, taxRate, userTotalRate) - s.T().Logf("NetflowRate: %v, userTotalRate: %v, actual taxRate diff: %v, expect taxRate diff: %v", streamRecordsAfter.User.NetflowRate.Neg(), userTotalRate.Neg(), streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate.Sub(taxRate0)) - - s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) - s.Require().Equal(streamRecordsAfter.User.LockBalance, sdkmath.ZeroInt()) - s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate), gvgFamilyRate) - s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate), gvgRate) - // tax rate diff - s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate.Sub(taxRate0)) - s.Require().Equal(streamRecordsAfter.User.NetflowRate.Neg(), userTotalRate.Abs()) - - // set price - s.updateGlobalSpPrice(priceRes.GlobalSpStorePrice.ReadPrice.MulInt64(120), priceRes.GlobalSpStorePrice.PrimaryStorePrice.MulInt64(5000)) - - queryBalanceRequest.Address = dstPrimarySP.FundingKey.GetAddr().String() - fundBalanceBefore, err = s.Client.BankQueryClient.Balance(context.Background(), &queryBalanceRequest) - s.Require().NoError(err) - streamRecordsBefore = s.getStreamRecords(streamAddresses0) - // send msgMigrationBucket - msgMigrationBucket, msgCompleteMigrationBucket = s.NewMigrateBucket(dstPrimarySP, primarySP, user, bucketName, dstGVG.FamilyId, gvg.FamilyId, bucketInfo.BucketInfo.Id) - - s.SendTxBlock(user, msgMigrationBucket) - s.Require().NoError(err) - s.reduceBNBBalance(user, s.Validator, sdkmath.NewIntWithDecimal(1, 1)) - - s.SendTxBlockWithExpectErrorString(msgCompleteMigrationBucket, primarySP.OperatorKey, "apply stream record changes for user failed") - - s.updateGlobalSpPrice(priceRes.GlobalSpStorePrice.ReadPrice.MulInt64(10), priceRes.GlobalSpStorePrice.PrimaryStorePrice.MulInt64(10)) - readPrice, primaryPrice, secondaryPrice := s.getPrices(time.Now().Unix()) - s.T().Logf("readPrice: %v, primaryPrice: %v,secondaryPrice: %v", readPrice, primaryPrice, secondaryPrice) - - s.transferBNB(s.Validator, user, sdkmath.NewIntWithDecimal(10000, 18)) - - s.SendTxBlock(primarySP.OperatorKey, msgCompleteMigrationBucket) - streamRecordsAfter = s.getStreamRecords(streamAddresses0) - fundBalanceAfter, err = s.Client.BankQueryClient.Balance(context.Background(), &queryBalanceRequest) - s.Require().NoError(err) - s.T().Logf("fundBalanceBefore: %v, fundBalanceAfter: %v, diff: %v", fundBalanceBefore, fundBalanceAfter, fundBalanceAfter.Balance.Amount.Sub(fundBalanceBefore.Balance.Amount)) - s.Require().True(fundBalanceAfter.Balance.Amount.Sub(fundBalanceBefore.Balance.Amount).GT(sdkmath.NewInt(0)), "migrate sp fund address need settle") - taxRate1 := taxRate - gvgFamilyRate, gvgRate, taxRate, userTotalRate = s.calculateStorageRates(bucketName, objectName, payloadSize, time.Now().Unix()) - s.T().Logf("gvgFamilyRate: %v, gvgRate: %v, taxRate: %v, userTotalRate: %v", gvgFamilyRate, gvgRate, taxRate, userTotalRate) - s.T().Logf("NetflowRate: %v, userTotalRate: %v, actual taxRate diff: %v, expect taxRate diff: %v", streamRecordsAfter.User.NetflowRate.Neg(), userTotalRate.Neg(), streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate.Sub(taxRate0)) - - s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) - s.Require().Equal(streamRecordsAfter.User.LockBalance, sdkmath.ZeroInt()) - s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate), gvgFamilyRate) - s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate), gvgRate) - // tax rate diff - s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate.Sub(taxRate1)) - s.Require().Equal(streamRecordsAfter.User.NetflowRate.Neg(), userTotalRate.Abs()) -} - -func (s *PaymentTestSuite) TestStorageBill_MigrateBucket_LockedFee_ThenDiscontinueBucket() { - var err error - ctx := context.Background() - primarySP := s.PickStorageProvider() - gvg, found := primarySP.GetFirstGlobalVirtualGroup() - s.Require().True(found) - queryFamilyResponse, err := s.Client.GlobalVirtualGroupFamily(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupFamilyRequest{ - FamilyId: gvg.FamilyId, - }) - s.Require().NoError(err) - family := queryFamilyResponse.GlobalVirtualGroupFamily - user := s.GenAndChargeAccounts(1, 10)[0] - - streamAddresses := []string{ - user.GetAddr().String(), - family.VirtualPaymentAddress, - gvg.VirtualPaymentAddress, - paymenttypes.ValidatorTaxPoolAddress.String(), - } - - paymentParams, err := s.Client.PaymentQueryClient.Params(ctx, &paymenttypes.QueryParamsRequest{}) - s.T().Logf("paymentParams %s, err: %v", paymentParams, err) - s.Require().NoError(err) - - bucketName := s.createBucket(primarySP, gvg, user, 0) - bucketInfo, err := s.Client.HeadBucket(context.Background(), &storagetypes.QueryHeadBucketRequest{ - BucketName: bucketName, - }) - s.Require().NoError(err) - - // create object with none zero payload size - streamRecordsBefore := s.getStreamRecords(streamAddresses) - _, _, objectName, objectId, checksums, payloadSize := s.createObject(user, bucketName, false) - - // assertions - streamRecordsAfter := s.getStreamRecords(streamAddresses) - s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) - lockFee := s.calculateLockFee(bucketName, objectName, payloadSize) - s.Require().Equal(streamRecordsAfter.User.LockBalance.Sub(streamRecordsBefore.User.LockBalance), lockFee) - s.Require().Equal(streamRecordsAfter.User.NetflowRate.Sub(streamRecordsBefore.User.NetflowRate).Int64(), int64(0)) - s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate).Int64(), int64(0)) - s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate).Int64(), int64(0)) - s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate).Int64(), int64(0)) - - // case: seal object - s.sealObject(primarySP, gvg, bucketName, objectName, objectId, checksums) - - // assertions - streamRecordsAfter = s.getStreamRecords(streamAddresses) - gvgFamilyRate, gvgRate, taxRate, userTotalRate := s.calculateStorageRates(bucketName, objectName, payloadSize, 0) - s.T().Logf("gvgFamilyRate: %v, gvgRate: %v, taxRate: %v, userTotalRate: %v", gvgFamilyRate, gvgRate, taxRate, userTotalRate) - s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) - s.Require().Equal(streamRecordsAfter.User.LockBalance, sdkmath.ZeroInt()) - s.Require().Equal(streamRecordsAfter.User.NetflowRate.Sub(streamRecordsBefore.User.NetflowRate), userTotalRate.Neg()) - s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate), gvgFamilyRate) - s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate), gvgRate) - s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate) - taxRate0 := taxRate - dstPrimarySP := s.CreateNewStorageProvider() - - // create a new object without seal - s.createObject(user, bucketName, false) - - // update price after lock - priceRes, err := s.Client.QueryGlobalSpStorePriceByTime(ctx, &sptypes.QueryGlobalSpStorePriceByTimeRequest{ - Timestamp: 0, - }) - s.Require().NoError(err) - s.T().Log("price", priceRes.GlobalSpStorePrice) - - s.updateGlobalSpPrice(priceRes.GlobalSpStorePrice.ReadPrice, priceRes.GlobalSpStorePrice.PrimaryStorePrice.MulInt64(10000)) - defer s.updateGlobalSpPrice(priceRes.GlobalSpStorePrice.ReadPrice, priceRes.GlobalSpStorePrice.PrimaryStorePrice) - - _, secondarySPIDs := s.GetSecondarySP(dstPrimarySP, primarySP) - gvgID, _ := s.BaseSuite.CreateGlobalVirtualGroup(dstPrimarySP, 0, secondarySPIDs, 1) - gvgResp, err := s.Client.VirtualGroupQueryClient.GlobalVirtualGroup(context.Background(), &virtualgrouptypes.QueryGlobalVirtualGroupRequest{ - GlobalVirtualGroupId: gvgID, - }) - s.Require().NoError(err) - dstGVG := gvgResp.GlobalVirtualGroup - s.Require().True(found) - - queryFamilyResponse, err = s.Client.GlobalVirtualGroupFamily(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupFamilyRequest{ - FamilyId: dstGVG.FamilyId, - }) - s.Require().NoError(err) - family = queryFamilyResponse.GlobalVirtualGroupFamily - streamAddresses = []string{ - user.GetAddr().String(), - family.VirtualPaymentAddress, - dstGVG.VirtualPaymentAddress, - paymenttypes.ValidatorTaxPoolAddress.String(), - } - fundAddress := primarySP.FundingKey.GetAddr() - streamRecordsBefore = s.getStreamRecords(streamAddresses) - - queryBalanceRequest := banktypes.QueryBalanceRequest{Denom: s.Config.Denom, Address: fundAddress.String()} - fundBalanceBefore, err := s.Client.BankQueryClient.Balance(context.Background(), &queryBalanceRequest) - s.Require().NoError(err) - - // MigrateBucket - msgMigrateBucket, msgCompleteMigrateBucket := s.NewMigrateBucket(primarySP, dstPrimarySP, user, bucketName, gvg.FamilyId, dstGVG.FamilyId, bucketInfo.BucketInfo.Id) - s.SendTxBlock(user, msgMigrateBucket) - s.Require().NoError(err) - - // complete MigrateBucket - s.SendTxBlock(dstPrimarySP.OperatorKey, msgCompleteMigrateBucket) - streamRecordsAfter = s.getStreamRecords(streamAddresses) - fundBalanceAfter, err := s.Client.BankQueryClient.Balance(context.Background(), &queryBalanceRequest) - s.Require().NoError(err) - s.T().Logf("fundBalanceBefore: %v, fundBalanceAfter: %v, diff: %v", fundBalanceBefore, fundBalanceAfter, fundBalanceAfter.Balance.Amount.Sub(fundBalanceBefore.Balance.Amount)) - s.Require().True(fundBalanceAfter.Balance.Amount.Sub(fundBalanceBefore.Balance.Amount).GT(sdkmath.NewInt(0)), "migrate sp fund address need settle") - gvgFamilyRate, gvgRate, taxRate, userTotalRate = s.calculateStorageRates(bucketName, objectName, payloadSize, time.Now().Unix()) - s.T().Logf("gvgFamilyRate: %v, gvgRate: %v, taxRate: %v, userTotalRate: %v", gvgFamilyRate, gvgRate, taxRate, userTotalRate) - s.T().Logf("NetflowRate: %v, userTotalRate: %v, actual taxRate diff: %v, expect taxRate diff: %v", streamRecordsAfter.User.NetflowRate.Neg(), userTotalRate.Neg(), streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate.Sub(taxRate0)) - - s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) - s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate), gvgFamilyRate) - s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate), gvgRate) - // tax rate diff - s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate.Sub(taxRate0)) - s.Require().Equal(streamRecordsAfter.User.NetflowRate.Neg(), userTotalRate.Abs()) - - // force delete bucket - headBucketResp, _ := s.Client.HeadBucket(ctx, &storagetypes.QueryHeadBucketRequest{BucketName: bucketName}) - s.T().Log("headBucketResp", core.YamlString(headBucketResp)) - msgDiscontinueBucket := storagetypes.NewMsgDiscontinueBucket(dstPrimarySP.GcKey.GetAddr(), bucketName, "test") - txRes := s.SendTxBlock(dstPrimarySP.GcKey, msgDiscontinueBucket) - deleteAt := filterDiscontinueBucketEventFromTx(txRes).DeleteAt - - for { - time.Sleep(200 * time.Millisecond) - statusRes, err := s.TmClient.TmClient.Status(context.Background()) - s.Require().NoError(err) - blockTime := statusRes.SyncInfo.LatestBlockTime.Unix() - - s.T().Logf("current blockTime: %d, delete blockTime: %d", blockTime, deleteAt) - - if blockTime > deleteAt { - break - } - } - - _, err = s.Client.HeadBucket(ctx, &storagetypes.QueryHeadBucketRequest{BucketName: bucketName}) - s.Require().ErrorContains(err, "No such bucket") -} - -func (s *PaymentTestSuite) TestStorageBill_MigrateBucket_FrozenAccount_NotAllowed() { - var err error - ctx := context.Background() - primarySP := s.PickStorageProvider() - gvg, found := primarySP.GetFirstGlobalVirtualGroup() - s.Require().True(found) - queryFamilyResponse, err := s.Client.GlobalVirtualGroupFamily(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupFamilyRequest{ - FamilyId: gvg.FamilyId, - }) - s.Require().NoError(err) - s.T().Log("queryFamilyResponse", core.YamlString(queryFamilyResponse)) - user := s.GenAndChargeAccounts(1, 10)[0] - - params := s.queryParams() - reserveTime := params.VersionedParams.ReserveTime - queryGetSpStoragePriceByTimeResp, err := s.Client.QueryGlobalSpStorePriceByTime(ctx, &sptypes.QueryGlobalSpStorePriceByTimeRequest{ - Timestamp: 0, - }) - s.T().Logf("queryGetSpStoragePriceByTimeResp %s, err: %v", queryGetSpStoragePriceByTimeResp, err) - s.Require().NoError(err) - - readPrice := queryGetSpStoragePriceByTimeResp.GlobalSpStorePrice.ReadPrice - bucketChargedReadQuota := uint64(1000) - readRate := readPrice.MulInt(sdkmath.NewIntFromUint64(bucketChargedReadQuota)).TruncateInt() - readTaxRate := params.VersionedParams.ValidatorTaxRate.MulInt(readRate).TruncateInt() - readTotalRate := readRate.Add(readTaxRate) - paymentAccountBNBNeeded := readTotalRate.Mul(sdkmath.NewIntFromUint64(reserveTime)) - - // create payment account and deposit - msgCreatePaymentAccount := &paymenttypes.MsgCreatePaymentAccount{ - Creator: user.GetAddr().String(), - } - _ = s.SendTxBlock(user, msgCreatePaymentAccount) - paymentAccountsReq := &paymenttypes.QueryPaymentAccountsByOwnerRequest{Owner: user.GetAddr().String()} - paymentAccounts, err := s.Client.PaymentQueryClient.PaymentAccountsByOwner(ctx, paymentAccountsReq) - s.Require().NoError(err) - s.T().Logf("paymentAccounts %s", core.YamlString(paymentAccounts)) - - paymentAddr := paymentAccounts.PaymentAccounts[0] - s.Require().Lenf(paymentAccounts.PaymentAccounts, 1, "paymentAccounts %s", core.YamlString(paymentAccounts)) - msgDeposit := &paymenttypes.MsgDeposit{ - Creator: user.GetAddr().String(), - To: paymentAddr, - Amount: paymentAccountBNBNeeded, - } - _ = s.SendTxBlock(user, msgDeposit) - - bucketName := "ch" + storagetestutils.GenRandomBucketName() - msgCreateBucket := storagetypes.NewMsgCreateBucket( - user.GetAddr(), bucketName, storagetypes.VISIBILITY_TYPE_PRIVATE, primarySP.OperatorKey.GetAddr(), - sdk.MustAccAddressFromHex(paymentAddr), math.MaxUint, nil, bucketChargedReadQuota) - msgCreateBucket.PrimarySpApproval.GlobalVirtualGroupFamilyId = gvg.FamilyId - msgCreateBucket.PrimarySpApproval.Sig, err = primarySP.ApprovalKey.Sign(msgCreateBucket.GetApprovalBytes()) - s.Require().NoError(err) - s.SendTxBlock(user, msgCreateBucket) - - queryHeadBucketRequest := storagetypes.QueryHeadBucketRequest{ - BucketName: bucketName, - } - _, err = s.Client.HeadBucket(context.Background(), &queryHeadBucketRequest) - s.Require().NoError(err) - bucketInfo, err := s.Client.HeadBucket(context.Background(), &storagetypes.QueryHeadBucketRequest{ - BucketName: bucketName, - }) - s.Require().NoError(err) - - // wait until settle time - paymentAccountStreamRecord := s.getStreamRecord(paymentAddr) - retryCount := 0 - for { - latestBlock, err := s.TmClient.TmClient.Block(ctx, nil) - s.Require().NoError(err) - currentTimestamp := latestBlock.Block.Time.Unix() - s.T().Logf("currentTimestamp %d, userStreamRecord.SettleTimestamp %d", currentTimestamp, paymentAccountStreamRecord.SettleTimestamp) - if currentTimestamp > paymentAccountStreamRecord.SettleTimestamp { - break - } - time.Sleep(time.Second) - retryCount++ - if retryCount > 60 { - s.T().Fatalf("wait for settle time timeout") - } - } - // check auto settle - paymentAccountStreamRecordAfterAutoSettle := s.getStreamRecord(paymentAddr) - s.T().Logf("paymentAccountStreamRecordAfterAutoSettle %s", core.YamlString(paymentAccountStreamRecordAfterAutoSettle)) - s.Require().Equal(paymentAccountStreamRecordAfterAutoSettle.Status, paymenttypes.STREAM_ACCOUNT_STATUS_FROZEN) - s.Require().Equal(paymentAccountStreamRecordAfterAutoSettle.NetflowRate.Int64(), int64(0)) - s.Require().Equal(paymentAccountStreamRecordAfterAutoSettle.FrozenNetflowRate.Int64(), readTotalRate.Neg().Int64()) - - dstPrimarySP := s.CreateNewStorageProvider() - _, secondarySPIDs := s.GetSecondarySP(dstPrimarySP, primarySP) - gvgID, _ := s.BaseSuite.CreateGlobalVirtualGroup(dstPrimarySP, 0, secondarySPIDs, 1) - gvgResp, err := s.Client.VirtualGroupQueryClient.GlobalVirtualGroup(context.Background(), &virtualgrouptypes.QueryGlobalVirtualGroupRequest{ - GlobalVirtualGroupId: gvgID, - }) - s.Require().NoError(err) - dstGVG := gvgResp.GlobalVirtualGroup - s.Require().True(found) - - // MigrateBucket - msgMigrateBucket, _ := s.NewMigrateBucket(primarySP, dstPrimarySP, user, bucketName, gvg.FamilyId, dstGVG.FamilyId, bucketInfo.BucketInfo.Id) - s.SendTxBlockWithExpectErrorString(msgMigrateBucket, user, "frozen") -} +//func (s *PaymentTestSuite) TestStorageBill_MigrateBucket() { +// var err error +// ctx := context.Background() +// primarySP := s.PickStorageProvider() +// gvg, found := primarySP.GetFirstGlobalVirtualGroup() +// s.Require().True(found) +// queryFamilyResponse, err := s.Client.GlobalVirtualGroupFamily(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupFamilyRequest{ +// FamilyId: gvg.FamilyId, +// }) +// s.Require().NoError(err) +// family := queryFamilyResponse.GlobalVirtualGroupFamily +// user := s.GenAndChargeAccounts(1, 10)[0] +// +// streamAddresses := []string{ +// user.GetAddr().String(), +// family.VirtualPaymentAddress, +// gvg.VirtualPaymentAddress, +// paymenttypes.ValidatorTaxPoolAddress.String(), +// } +// +// streamAddresses0 := streamAddresses +// paymentParams, err := s.Client.PaymentQueryClient.Params(ctx, &paymenttypes.QueryParamsRequest{}) +// s.T().Logf("paymentParams %s, err: %v", paymentParams, err) +// s.Require().NoError(err) +// +// bucketName := s.createBucket(primarySP, gvg, user, 0) +// bucketInfo, err := s.Client.HeadBucket(context.Background(), &storagetypes.QueryHeadBucketRequest{ +// BucketName: bucketName, +// }) +// s.Require().NoError(err) +// +// // create object with none zero payload size +// streamRecordsBefore := s.getStreamRecords(streamAddresses) +// _, _, objectName, objectId, checksums, payloadSize := s.createObject(user, bucketName, false) +// +// // assertions +// streamRecordsAfter := s.getStreamRecords(streamAddresses) +// s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) +// lockFee := s.calculateLockFee(bucketName, objectName, payloadSize) +// s.Require().Equal(streamRecordsAfter.User.LockBalance.Sub(streamRecordsBefore.User.LockBalance), lockFee) +// s.Require().Equal(streamRecordsAfter.User.NetflowRate.Sub(streamRecordsBefore.User.NetflowRate).Int64(), int64(0)) +// s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate).Int64(), int64(0)) +// s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate).Int64(), int64(0)) +// s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate).Int64(), int64(0)) +// +// // case: seal object without price change +// s.sealObject(primarySP, gvg, bucketName, objectName, objectId, checksums) +// +// // assertions +// streamRecordsAfter = s.getStreamRecords(streamAddresses) +// gvgFamilyRate, gvgRate, taxRate, userTotalRate := s.calculateStorageRates(bucketName, objectName, payloadSize, 0) +// s.T().Logf("gvgFamilyRate: %v, gvgRate: %v, taxRate: %v, userTotalRate: %v", gvgFamilyRate, gvgRate, taxRate, userTotalRate) +// s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) +// s.Require().Equal(streamRecordsAfter.User.LockBalance, sdkmath.ZeroInt()) +// s.Require().Equal(streamRecordsAfter.User.NetflowRate.Sub(streamRecordsBefore.User.NetflowRate), userTotalRate.Neg()) +// s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate), gvgFamilyRate) +// s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate), gvgRate) +// s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate) +// taxRate0 := taxRate +// +// dstPrimarySP := s.CreateNewStorageProvider() +// +// // update price +// priceRes, err := s.Client.QueryGlobalSpStorePriceByTime(ctx, &sptypes.QueryGlobalSpStorePriceByTimeRequest{ +// Timestamp: 0, +// }) +// s.Require().NoError(err) +// s.T().Log("price", priceRes.GlobalSpStorePrice) +// +// s.updateGlobalSpPrice(priceRes.GlobalSpStorePrice.ReadPrice.MulInt64(2), priceRes.GlobalSpStorePrice.PrimaryStorePrice.MulInt64(10)) +// defer s.updateGlobalSpPrice(priceRes.GlobalSpStorePrice.ReadPrice, priceRes.GlobalSpStorePrice.PrimaryStorePrice) +// +// _, secondarySPIDs := s.GetSecondarySP(dstPrimarySP, primarySP) +// gvgID, _ := s.BaseSuite.CreateGlobalVirtualGroup(dstPrimarySP, 0, secondarySPIDs, 1) +// gvgResp, err := s.Client.VirtualGroupQueryClient.GlobalVirtualGroup(context.Background(), &virtualgrouptypes.QueryGlobalVirtualGroupRequest{ +// GlobalVirtualGroupId: gvgID, +// }) +// s.Require().NoError(err) +// dstGVG := gvgResp.GlobalVirtualGroup +// s.Require().True(found) +// +// queryFamilyResponse, err = s.Client.GlobalVirtualGroupFamily(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupFamilyRequest{ +// FamilyId: dstGVG.FamilyId, +// }) +// s.Require().NoError(err) +// family = queryFamilyResponse.GlobalVirtualGroupFamily +// streamAddresses = []string{ +// user.GetAddr().String(), +// family.VirtualPaymentAddress, +// dstGVG.VirtualPaymentAddress, +// paymenttypes.ValidatorTaxPoolAddress.String(), +// } +// fundAddress := primarySP.FundingKey.GetAddr() +// streamRecordsBefore = s.getStreamRecords(streamAddresses) +// +// queryBalanceRequest := banktypes.QueryBalanceRequest{Denom: s.Config.Denom, Address: fundAddress.String()} +// fundBalanceBefore, err := s.Client.BankQueryClient.Balance(context.Background(), &queryBalanceRequest) +// s.Require().NoError(err) +// +// // MigrationBucket +// msgMigrationBucket, msgCompleteMigrationBucket := s.NewMigrateBucket(primarySP, dstPrimarySP, user, bucketName, gvg.FamilyId, dstGVG.FamilyId, bucketInfo.BucketInfo.Id) +// s.SendTxBlock(user, msgMigrationBucket) +// s.Require().NoError(err) +// +// // complete MigrationBucket +// s.SendTxBlock(dstPrimarySP.OperatorKey, msgCompleteMigrationBucket) +// streamRecordsAfter = s.getStreamRecords(streamAddresses) +// fundBalanceAfter, err := s.Client.BankQueryClient.Balance(context.Background(), &queryBalanceRequest) +// s.Require().NoError(err) +// s.T().Logf("fundBalanceBefore: %v, fundBalanceAfter: %v, diff: %v", fundBalanceBefore, fundBalanceAfter, fundBalanceAfter.Balance.Amount.Sub(fundBalanceBefore.Balance.Amount)) +// s.Require().True(fundBalanceAfter.Balance.Amount.Sub(fundBalanceBefore.Balance.Amount).GT(sdkmath.NewInt(0)), "migrate sp fund address need settle") +// gvgFamilyRate, gvgRate, taxRate, userTotalRate = s.calculateStorageRates(bucketName, objectName, payloadSize, time.Now().Unix()) +// s.T().Logf("gvgFamilyRate: %v, gvgRate: %v, taxRate: %v, userTotalRate: %v", gvgFamilyRate, gvgRate, taxRate, userTotalRate) +// s.T().Logf("NetflowRate: %v, userTotalRate: %v, actual taxRate diff: %v, expect taxRate diff: %v", streamRecordsAfter.User.NetflowRate.Neg(), userTotalRate.Neg(), streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate.Sub(taxRate0)) +// +// s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) +// s.Require().Equal(streamRecordsAfter.User.LockBalance, sdkmath.ZeroInt()) +// s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate), gvgFamilyRate) +// s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate), gvgRate) +// // tax rate diff +// s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate.Sub(taxRate0)) +// s.Require().Equal(streamRecordsAfter.User.NetflowRate.Neg(), userTotalRate.Abs()) +// +// // set price +// s.updateGlobalSpPrice(priceRes.GlobalSpStorePrice.ReadPrice.MulInt64(120), priceRes.GlobalSpStorePrice.PrimaryStorePrice.MulInt64(5000)) +// +// queryBalanceRequest.Address = dstPrimarySP.FundingKey.GetAddr().String() +// fundBalanceBefore, err = s.Client.BankQueryClient.Balance(context.Background(), &queryBalanceRequest) +// s.Require().NoError(err) +// streamRecordsBefore = s.getStreamRecords(streamAddresses0) +// // send msgMigrationBucket +// msgMigrationBucket, msgCompleteMigrationBucket = s.NewMigrateBucket(dstPrimarySP, primarySP, user, bucketName, dstGVG.FamilyId, gvg.FamilyId, bucketInfo.BucketInfo.Id) +// +// s.SendTxBlock(user, msgMigrationBucket) +// s.Require().NoError(err) +// s.reduceBNBBalance(user, s.Validator, sdkmath.NewIntWithDecimal(1, 1)) +// +// s.SendTxBlockWithExpectErrorString(msgCompleteMigrationBucket, primarySP.OperatorKey, "apply stream record changes for user failed") +// +// s.updateGlobalSpPrice(priceRes.GlobalSpStorePrice.ReadPrice.MulInt64(10), priceRes.GlobalSpStorePrice.PrimaryStorePrice.MulInt64(10)) +// readPrice, primaryPrice, secondaryPrice := s.getPrices(time.Now().Unix()) +// s.T().Logf("readPrice: %v, primaryPrice: %v,secondaryPrice: %v", readPrice, primaryPrice, secondaryPrice) +// +// s.transferBNB(s.Validator, user, sdkmath.NewIntWithDecimal(10000, 18)) +// +// s.SendTxBlock(primarySP.OperatorKey, msgCompleteMigrationBucket) +// streamRecordsAfter = s.getStreamRecords(streamAddresses0) +// fundBalanceAfter, err = s.Client.BankQueryClient.Balance(context.Background(), &queryBalanceRequest) +// s.Require().NoError(err) +// s.T().Logf("fundBalanceBefore: %v, fundBalanceAfter: %v, diff: %v", fundBalanceBefore, fundBalanceAfter, fundBalanceAfter.Balance.Amount.Sub(fundBalanceBefore.Balance.Amount)) +// s.Require().True(fundBalanceAfter.Balance.Amount.Sub(fundBalanceBefore.Balance.Amount).GT(sdkmath.NewInt(0)), "migrate sp fund address need settle") +// taxRate1 := taxRate +// gvgFamilyRate, gvgRate, taxRate, userTotalRate = s.calculateStorageRates(bucketName, objectName, payloadSize, time.Now().Unix()) +// s.T().Logf("gvgFamilyRate: %v, gvgRate: %v, taxRate: %v, userTotalRate: %v", gvgFamilyRate, gvgRate, taxRate, userTotalRate) +// s.T().Logf("NetflowRate: %v, userTotalRate: %v, actual taxRate diff: %v, expect taxRate diff: %v", streamRecordsAfter.User.NetflowRate.Neg(), userTotalRate.Neg(), streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate.Sub(taxRate0)) +// +// s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) +// s.Require().Equal(streamRecordsAfter.User.LockBalance, sdkmath.ZeroInt()) +// s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate), gvgFamilyRate) +// s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate), gvgRate) +// // tax rate diff +// s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate.Sub(taxRate1)) +// s.Require().Equal(streamRecordsAfter.User.NetflowRate.Neg(), userTotalRate.Abs()) +//} + +//func (s *PaymentTestSuite) TestStorageBill_MigrateBucket_LockedFee_ThenDiscontinueBucket() { +// var err error +// ctx := context.Background() +// primarySP := s.PickStorageProvider() +// gvg, found := primarySP.GetFirstGlobalVirtualGroup() +// s.Require().True(found) +// queryFamilyResponse, err := s.Client.GlobalVirtualGroupFamily(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupFamilyRequest{ +// FamilyId: gvg.FamilyId, +// }) +// s.Require().NoError(err) +// family := queryFamilyResponse.GlobalVirtualGroupFamily +// user := s.GenAndChargeAccounts(1, 10)[0] +// +// streamAddresses := []string{ +// user.GetAddr().String(), +// family.VirtualPaymentAddress, +// gvg.VirtualPaymentAddress, +// paymenttypes.ValidatorTaxPoolAddress.String(), +// } +// +// paymentParams, err := s.Client.PaymentQueryClient.Params(ctx, &paymenttypes.QueryParamsRequest{}) +// s.T().Logf("paymentParams %s, err: %v", paymentParams, err) +// s.Require().NoError(err) +// +// bucketName := s.createBucket(primarySP, gvg, user, 0) +// bucketInfo, err := s.Client.HeadBucket(context.Background(), &storagetypes.QueryHeadBucketRequest{ +// BucketName: bucketName, +// }) +// s.Require().NoError(err) +// +// // create object with none zero payload size +// streamRecordsBefore := s.getStreamRecords(streamAddresses) +// _, _, objectName, objectId, checksums, payloadSize := s.createObject(user, bucketName, false) +// +// // assertions +// streamRecordsAfter := s.getStreamRecords(streamAddresses) +// s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) +// lockFee := s.calculateLockFee(bucketName, objectName, payloadSize) +// s.Require().Equal(streamRecordsAfter.User.LockBalance.Sub(streamRecordsBefore.User.LockBalance), lockFee) +// s.Require().Equal(streamRecordsAfter.User.NetflowRate.Sub(streamRecordsBefore.User.NetflowRate).Int64(), int64(0)) +// s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate).Int64(), int64(0)) +// s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate).Int64(), int64(0)) +// s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate).Int64(), int64(0)) +// +// // case: seal object +// s.sealObject(primarySP, gvg, bucketName, objectName, objectId, checksums) +// +// // assertions +// streamRecordsAfter = s.getStreamRecords(streamAddresses) +// gvgFamilyRate, gvgRate, taxRate, userTotalRate := s.calculateStorageRates(bucketName, objectName, payloadSize, 0) +// s.T().Logf("gvgFamilyRate: %v, gvgRate: %v, taxRate: %v, userTotalRate: %v", gvgFamilyRate, gvgRate, taxRate, userTotalRate) +// s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) +// s.Require().Equal(streamRecordsAfter.User.LockBalance, sdkmath.ZeroInt()) +// s.Require().Equal(streamRecordsAfter.User.NetflowRate.Sub(streamRecordsBefore.User.NetflowRate), userTotalRate.Neg()) +// s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate), gvgFamilyRate) +// s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate), gvgRate) +// s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate) +// taxRate0 := taxRate +// dstPrimarySP := s.CreateNewStorageProvider() +// +// // create a new object without seal +// s.createObject(user, bucketName, false) +// +// // update price after lock +// priceRes, err := s.Client.QueryGlobalSpStorePriceByTime(ctx, &sptypes.QueryGlobalSpStorePriceByTimeRequest{ +// Timestamp: 0, +// }) +// s.Require().NoError(err) +// s.T().Log("price", priceRes.GlobalSpStorePrice) +// +// s.updateGlobalSpPrice(priceRes.GlobalSpStorePrice.ReadPrice, priceRes.GlobalSpStorePrice.PrimaryStorePrice.MulInt64(10000)) +// defer s.updateGlobalSpPrice(priceRes.GlobalSpStorePrice.ReadPrice, priceRes.GlobalSpStorePrice.PrimaryStorePrice) +// +// _, secondarySPIDs := s.GetSecondarySP(dstPrimarySP, primarySP) +// gvgID, _ := s.BaseSuite.CreateGlobalVirtualGroup(dstPrimarySP, 0, secondarySPIDs, 1) +// gvgResp, err := s.Client.VirtualGroupQueryClient.GlobalVirtualGroup(context.Background(), &virtualgrouptypes.QueryGlobalVirtualGroupRequest{ +// GlobalVirtualGroupId: gvgID, +// }) +// s.Require().NoError(err) +// dstGVG := gvgResp.GlobalVirtualGroup +// s.Require().True(found) +// +// queryFamilyResponse, err = s.Client.GlobalVirtualGroupFamily(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupFamilyRequest{ +// FamilyId: dstGVG.FamilyId, +// }) +// s.Require().NoError(err) +// family = queryFamilyResponse.GlobalVirtualGroupFamily +// streamAddresses = []string{ +// user.GetAddr().String(), +// family.VirtualPaymentAddress, +// dstGVG.VirtualPaymentAddress, +// paymenttypes.ValidatorTaxPoolAddress.String(), +// } +// fundAddress := primarySP.FundingKey.GetAddr() +// streamRecordsBefore = s.getStreamRecords(streamAddresses) +// +// queryBalanceRequest := banktypes.QueryBalanceRequest{Denom: s.Config.Denom, Address: fundAddress.String()} +// fundBalanceBefore, err := s.Client.BankQueryClient.Balance(context.Background(), &queryBalanceRequest) +// s.Require().NoError(err) +// +// // MigrateBucket +// msgMigrateBucket, msgCompleteMigrateBucket := s.NewMigrateBucket(primarySP, dstPrimarySP, user, bucketName, gvg.FamilyId, dstGVG.FamilyId, bucketInfo.BucketInfo.Id) +// s.SendTxBlock(user, msgMigrateBucket) +// s.Require().NoError(err) +// +// // complete MigrateBucket +// s.SendTxBlock(dstPrimarySP.OperatorKey, msgCompleteMigrateBucket) +// streamRecordsAfter = s.getStreamRecords(streamAddresses) +// fundBalanceAfter, err := s.Client.BankQueryClient.Balance(context.Background(), &queryBalanceRequest) +// s.Require().NoError(err) +// s.T().Logf("fundBalanceBefore: %v, fundBalanceAfter: %v, diff: %v", fundBalanceBefore, fundBalanceAfter, fundBalanceAfter.Balance.Amount.Sub(fundBalanceBefore.Balance.Amount)) +// s.Require().True(fundBalanceAfter.Balance.Amount.Sub(fundBalanceBefore.Balance.Amount).GT(sdkmath.NewInt(0)), "migrate sp fund address need settle") +// gvgFamilyRate, gvgRate, taxRate, userTotalRate = s.calculateStorageRates(bucketName, objectName, payloadSize, time.Now().Unix()) +// s.T().Logf("gvgFamilyRate: %v, gvgRate: %v, taxRate: %v, userTotalRate: %v", gvgFamilyRate, gvgRate, taxRate, userTotalRate) +// s.T().Logf("NetflowRate: %v, userTotalRate: %v, actual taxRate diff: %v, expect taxRate diff: %v", streamRecordsAfter.User.NetflowRate.Neg(), userTotalRate.Neg(), streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate.Sub(taxRate0)) +// +// s.Require().Equal(streamRecordsAfter.User.StaticBalance, sdkmath.ZeroInt()) +// s.Require().Equal(streamRecordsAfter.GVGFamily.NetflowRate.Sub(streamRecordsBefore.GVGFamily.NetflowRate), gvgFamilyRate) +// s.Require().Equal(streamRecordsAfter.GVG.NetflowRate.Sub(streamRecordsBefore.GVG.NetflowRate), gvgRate) +// // tax rate diff +// s.Require().Equal(streamRecordsAfter.Tax.NetflowRate.Sub(streamRecordsBefore.Tax.NetflowRate), taxRate.Sub(taxRate0)) +// s.Require().Equal(streamRecordsAfter.User.NetflowRate.Neg(), userTotalRate.Abs()) +// +// // force delete bucket +// headBucketResp, _ := s.Client.HeadBucket(ctx, &storagetypes.QueryHeadBucketRequest{BucketName: bucketName}) +// s.T().Log("headBucketResp", core.YamlString(headBucketResp)) +// msgDiscontinueBucket := storagetypes.NewMsgDiscontinueBucket(dstPrimarySP.GcKey.GetAddr(), bucketName, "test") +// txRes := s.SendTxBlock(dstPrimarySP.GcKey, msgDiscontinueBucket) +// deleteAt := filterDiscontinueBucketEventFromTx(txRes).DeleteAt +// +// for { +// time.Sleep(200 * time.Millisecond) +// statusRes, err := s.TmClient.TmClient.Status(context.Background()) +// s.Require().NoError(err) +// blockTime := statusRes.SyncInfo.LatestBlockTime.Unix() +// +// s.T().Logf("current blockTime: %d, delete blockTime: %d", blockTime, deleteAt) +// +// if blockTime > deleteAt { +// break +// } +// } +// +// _, err = s.Client.HeadBucket(ctx, &storagetypes.QueryHeadBucketRequest{BucketName: bucketName}) +// s.Require().ErrorContains(err, "No such bucket") +//} + +//func (s *PaymentTestSuite) TestStorageBill_MigrateBucket_FrozenAccount_NotAllowed() { +// var err error +// ctx := context.Background() +// primarySP := s.PickStorageProvider() +// gvg, found := primarySP.GetFirstGlobalVirtualGroup() +// s.Require().True(found) +// queryFamilyResponse, err := s.Client.GlobalVirtualGroupFamily(ctx, &virtualgrouptypes.QueryGlobalVirtualGroupFamilyRequest{ +// FamilyId: gvg.FamilyId, +// }) +// s.Require().NoError(err) +// s.T().Log("queryFamilyResponse", core.YamlString(queryFamilyResponse)) +// user := s.GenAndChargeAccounts(1, 10)[0] +// +// params := s.queryParams() +// reserveTime := params.VersionedParams.ReserveTime +// queryGetSpStoragePriceByTimeResp, err := s.Client.QueryGlobalSpStorePriceByTime(ctx, &sptypes.QueryGlobalSpStorePriceByTimeRequest{ +// Timestamp: 0, +// }) +// s.T().Logf("queryGetSpStoragePriceByTimeResp %s, err: %v", queryGetSpStoragePriceByTimeResp, err) +// s.Require().NoError(err) +// +// readPrice := queryGetSpStoragePriceByTimeResp.GlobalSpStorePrice.ReadPrice +// bucketChargedReadQuota := uint64(1000) +// readRate := readPrice.MulInt(sdkmath.NewIntFromUint64(bucketChargedReadQuota)).TruncateInt() +// readTaxRate := params.VersionedParams.ValidatorTaxRate.MulInt(readRate).TruncateInt() +// readTotalRate := readRate.Add(readTaxRate) +// paymentAccountBNBNeeded := readTotalRate.Mul(sdkmath.NewIntFromUint64(reserveTime)) +// +// // create payment account and deposit +// msgCreatePaymentAccount := &paymenttypes.MsgCreatePaymentAccount{ +// Creator: user.GetAddr().String(), +// } +// _ = s.SendTxBlock(user, msgCreatePaymentAccount) +// paymentAccountsReq := &paymenttypes.QueryPaymentAccountsByOwnerRequest{Owner: user.GetAddr().String()} +// paymentAccounts, err := s.Client.PaymentQueryClient.PaymentAccountsByOwner(ctx, paymentAccountsReq) +// s.Require().NoError(err) +// s.T().Logf("paymentAccounts %s", core.YamlString(paymentAccounts)) +// +// paymentAddr := paymentAccounts.PaymentAccounts[0] +// s.Require().Lenf(paymentAccounts.PaymentAccounts, 1, "paymentAccounts %s", core.YamlString(paymentAccounts)) +// msgDeposit := &paymenttypes.MsgDeposit{ +// Creator: user.GetAddr().String(), +// To: paymentAddr, +// Amount: paymentAccountBNBNeeded, +// } +// _ = s.SendTxBlock(user, msgDeposit) +// +// bucketName := "ch" + storagetestutils.GenRandomBucketName() +// msgCreateBucket := storagetypes.NewMsgCreateBucket( +// user.GetAddr(), bucketName, storagetypes.VISIBILITY_TYPE_PRIVATE, primarySP.OperatorKey.GetAddr(), +// sdk.MustAccAddressFromHex(paymentAddr), math.MaxUint, nil, bucketChargedReadQuota) +// msgCreateBucket.PrimarySpApproval.GlobalVirtualGroupFamilyId = gvg.FamilyId +// msgCreateBucket.PrimarySpApproval.Sig, err = primarySP.ApprovalKey.Sign(msgCreateBucket.GetApprovalBytes()) +// s.Require().NoError(err) +// s.SendTxBlock(user, msgCreateBucket) +// +// queryHeadBucketRequest := storagetypes.QueryHeadBucketRequest{ +// BucketName: bucketName, +// } +// _, err = s.Client.HeadBucket(context.Background(), &queryHeadBucketRequest) +// s.Require().NoError(err) +// bucketInfo, err := s.Client.HeadBucket(context.Background(), &storagetypes.QueryHeadBucketRequest{ +// BucketName: bucketName, +// }) +// s.Require().NoError(err) +// +// // wait until settle time +// paymentAccountStreamRecord := s.getStreamRecord(paymentAddr) +// retryCount := 0 +// for { +// latestBlock, err := s.TmClient.TmClient.Block(ctx, nil) +// s.Require().NoError(err) +// currentTimestamp := latestBlock.Block.Time.Unix() +// s.T().Logf("currentTimestamp %d, userStreamRecord.SettleTimestamp %d", currentTimestamp, paymentAccountStreamRecord.SettleTimestamp) +// if currentTimestamp > paymentAccountStreamRecord.SettleTimestamp { +// break +// } +// time.Sleep(time.Second) +// retryCount++ +// if retryCount > 60 { +// s.T().Fatalf("wait for settle time timeout") +// } +// } +// // check auto settle +// paymentAccountStreamRecordAfterAutoSettle := s.getStreamRecord(paymentAddr) +// s.T().Logf("paymentAccountStreamRecordAfterAutoSettle %s", core.YamlString(paymentAccountStreamRecordAfterAutoSettle)) +// s.Require().Equal(paymentAccountStreamRecordAfterAutoSettle.Status, paymenttypes.STREAM_ACCOUNT_STATUS_FROZEN) +// s.Require().Equal(paymentAccountStreamRecordAfterAutoSettle.NetflowRate.Int64(), int64(0)) +// s.Require().Equal(paymentAccountStreamRecordAfterAutoSettle.FrozenNetflowRate.Int64(), readTotalRate.Neg().Int64()) +// +// dstPrimarySP := s.CreateNewStorageProvider() +// _, secondarySPIDs := s.GetSecondarySP(dstPrimarySP, primarySP) +// gvgID, _ := s.BaseSuite.CreateGlobalVirtualGroup(dstPrimarySP, 0, secondarySPIDs, 1) +// gvgResp, err := s.Client.VirtualGroupQueryClient.GlobalVirtualGroup(context.Background(), &virtualgrouptypes.QueryGlobalVirtualGroupRequest{ +// GlobalVirtualGroupId: gvgID, +// }) +// s.Require().NoError(err) +// dstGVG := gvgResp.GlobalVirtualGroup +// s.Require().True(found) +// +// // MigrateBucket +// msgMigrateBucket, _ := s.NewMigrateBucket(primarySP, dstPrimarySP, user, bucketName, gvg.FamilyId, dstGVG.FamilyId, bucketInfo.BucketInfo.Id) +// s.SendTxBlockWithExpectErrorString(msgMigrateBucket, user, "frozen") +//} func (s *PaymentTestSuite) GetSecondarySP(sps ...*core.StorageProvider) ([]*core.StorageProvider, []uint32) { var secondarySPs []*core.StorageProvider @@ -2296,9 +2296,9 @@ func (s *PaymentTestSuite) reduceBNBBalance(user, to keys.KeyManager, leftBalanc s.T().Logf("balance: %v", queryBalanceResponse.Balance.Amount) } -func (s *PaymentTestSuite) transferBNB(from, to keys.KeyManager, amount sdkmath.Int) { - msgSend := banktypes.NewMsgSend(from.GetAddr(), to.GetAddr(), sdk.NewCoins( - sdk.NewCoin(s.Config.Denom, amount), - )) - s.SendTxBlock(from, msgSend) -} +//func (s *PaymentTestSuite) transferBNB(from, to keys.KeyManager, amount sdkmath.Int) { +// msgSend := banktypes.NewMsgSend(from.GetAddr(), to.GetAddr(), sdk.NewCoins( +// sdk.NewCoin(s.Config.Denom, amount), +// )) +// s.SendTxBlock(from, msgSend) +//} diff --git a/e2e/tests/storage_test.go b/e2e/tests/storage_test.go index 5ba1b62d9..9e4bff8c8 100644 --- a/e2e/tests/storage_test.go +++ b/e2e/tests/storage_test.go @@ -29,7 +29,6 @@ import ( storageutils "github.com/bnb-chain/greenfield/testutil/storage" sptypes "github.com/bnb-chain/greenfield/x/sp/types" storagetypes "github.com/bnb-chain/greenfield/x/storage/types" - types2 "github.com/bnb-chain/greenfield/x/virtualgroup/types" ) type StorageTestSuite struct { @@ -1666,86 +1665,86 @@ func (s *StorageTestSuite) TestRejectSealObject() { s.Require().True(strings.Contains(err.Error(), storagetypes.ErrNoSuchObject.Error())) } -func (s *StorageTestSuite) TestMigrationBucket() { - // construct bucket and object - primarySP := s.BaseSuite.PickStorageProvider() - gvg, found := primarySP.GetFirstGlobalVirtualGroup() - s.Require().True(found) - user := s.GenAndChargeAccounts(1, 1000000)[0] - bucketName := storageutils.GenRandomBucketName() - objectName := storageutils.GenRandomObjectName() - _, _, _, bucketInfo := s.BaseSuite.CreateObject(user, primarySP, gvg.Id, bucketName, objectName) - - var err error - dstPrimarySP := s.CreateNewStorageProvider() - - // migrate bucket - msgMigrationBucket := storagetypes.NewMsgMigrateBucket(user.GetAddr(), bucketName, dstPrimarySP.Info.Id) - msgMigrationBucket.DstPrimarySpApproval.ExpiredHeight = math.MaxInt - msgMigrationBucket.DstPrimarySpApproval.Sig, err = dstPrimarySP.ApprovalKey.Sign(msgMigrationBucket.GetApprovalBytes()) - s.SendTxBlock(user, msgMigrationBucket) - s.Require().NoError(err) - - // cancel migration bucket - msgCancelMigrationBucket := storagetypes.NewMsgCancelMigrateBucket(user.GetAddr(), bucketName) - s.SendTxBlock(user, msgCancelMigrationBucket) - s.Require().NoError(err) - - // complete migration bucket - var secondarySPIDs []uint32 - var secondarySPs []*core.StorageProvider - - for _, ssp := range s.StorageProviders { - if ssp.Info.Id != primarySP.Info.Id { - secondarySPIDs = append(secondarySPIDs, ssp.Info.Id) - secondarySPs = append(secondarySPs, ssp) - } - if len(secondarySPIDs) == 5 { - break - } - } - gvgID, _ := s.BaseSuite.CreateGlobalVirtualGroup(dstPrimarySP, 0, secondarySPIDs, 1) - gvgResp, err := s.Client.VirtualGroupQueryClient.GlobalVirtualGroup(context.Background(), &types2.QueryGlobalVirtualGroupRequest{ - GlobalVirtualGroupId: gvgID, - }) - s.Require().NoError(err) - dstGVG := gvgResp.GlobalVirtualGroup - s.Require().True(found) - - // construct the signatures - var gvgMappings []*storagetypes.GVGMapping - gvgMappings = append(gvgMappings, &storagetypes.GVGMapping{SrcGlobalVirtualGroupId: gvg.Id, DstGlobalVirtualGroupId: dstGVG.Id}) - for _, gvgMapping := range gvgMappings { - migrationBucketSignHash := storagetypes.NewSecondarySpMigrationBucketSignDoc(s.GetChainID(), bucketInfo.Id, dstPrimarySP.Info.Id, gvgMapping.SrcGlobalVirtualGroupId, gvgMapping.DstGlobalVirtualGroupId).GetBlsSignHash() - secondarySigs := make([][]byte, 0) - secondarySPBlsPubKeys := make([]bls.PublicKey, 0) - for _, ssp := range secondarySPs { - sig, err := core.BlsSignAndVerify(ssp, migrationBucketSignHash) - s.Require().NoError(err) - secondarySigs = append(secondarySigs, sig) - pk, err := bls.PublicKeyFromBytes(ssp.BlsKey.PubKey().Bytes()) - s.Require().NoError(err) - secondarySPBlsPubKeys = append(secondarySPBlsPubKeys, pk) - } - aggBlsSig, err := core.BlsAggregateAndVerify(secondarySPBlsPubKeys, migrationBucketSignHash, secondarySigs) - s.Require().NoError(err) - gvgMapping.SecondarySpBlsSignature = aggBlsSig - } - - msgCompleteMigrationBucket := storagetypes.NewMsgCompleteMigrateBucket(dstPrimarySP.OperatorKey.GetAddr(), bucketName, dstGVG.FamilyId, gvgMappings) - s.SendTxBlockWithExpectErrorString(msgCompleteMigrationBucket, dstPrimarySP.OperatorKey, "The bucket is not been migrating") - - // send again - msgMigrationBucket = storagetypes.NewMsgMigrateBucket(user.GetAddr(), bucketName, dstPrimarySP.Info.Id) - msgMigrationBucket.DstPrimarySpApproval.ExpiredHeight = math.MaxInt - msgMigrationBucket.DstPrimarySpApproval.Sig, err = dstPrimarySP.ApprovalKey.Sign(msgMigrationBucket.GetApprovalBytes()) - s.SendTxBlock(user, msgMigrationBucket) - s.Require().NoError(err) - - // complete again - msgCompleteMigrationBucket = storagetypes.NewMsgCompleteMigrateBucket(dstPrimarySP.OperatorKey.GetAddr(), bucketName, dstGVG.FamilyId, gvgMappings) - s.SendTxBlock(dstPrimarySP.OperatorKey, msgCompleteMigrationBucket) -} +//func (s *StorageTestSuite) TestMigrationBucket() { +// // construct bucket and object +// primarySP := s.BaseSuite.PickStorageProvider() +// gvg, found := primarySP.GetFirstGlobalVirtualGroup() +// s.Require().True(found) +// user := s.GenAndChargeAccounts(1, 1000000)[0] +// bucketName := storageutils.GenRandomBucketName() +// objectName := storageutils.GenRandomObjectName() +// _, _, _, bucketInfo := s.BaseSuite.CreateObject(user, primarySP, gvg.Id, bucketName, objectName) +// +// var err error +// dstPrimarySP := s.CreateNewStorageProvider() +// +// // migrate bucket +// msgMigrationBucket := storagetypes.NewMsgMigrateBucket(user.GetAddr(), bucketName, dstPrimarySP.Info.Id) +// msgMigrationBucket.DstPrimarySpApproval.ExpiredHeight = math.MaxInt +// msgMigrationBucket.DstPrimarySpApproval.Sig, err = dstPrimarySP.ApprovalKey.Sign(msgMigrationBucket.GetApprovalBytes()) +// s.SendTxBlock(user, msgMigrationBucket) +// s.Require().NoError(err) +// +// // cancel migration bucket +// msgCancelMigrationBucket := storagetypes.NewMsgCancelMigrateBucket(user.GetAddr(), bucketName) +// s.SendTxBlock(user, msgCancelMigrationBucket) +// s.Require().NoError(err) +// +// // complete migration bucket +// var secondarySPIDs []uint32 +// var secondarySPs []*core.StorageProvider +// +// for _, ssp := range s.StorageProviders { +// if ssp.Info.Id != primarySP.Info.Id { +// secondarySPIDs = append(secondarySPIDs, ssp.Info.Id) +// secondarySPs = append(secondarySPs, ssp) +// } +// if len(secondarySPIDs) == 6 { +// break +// } +// } +// gvgID, _ := s.BaseSuite.CreateGlobalVirtualGroup(dstPrimarySP, 0, secondarySPIDs, 1) +// gvgResp, err := s.Client.VirtualGroupQueryClient.GlobalVirtualGroup(context.Background(), &types2.QueryGlobalVirtualGroupRequest{ +// GlobalVirtualGroupId: gvgID, +// }) +// s.Require().NoError(err) +// dstGVG := gvgResp.GlobalVirtualGroup +// s.Require().True(found) +// +// // construct the signatures +// var gvgMappings []*storagetypes.GVGMapping +// gvgMappings = append(gvgMappings, &storagetypes.GVGMapping{SrcGlobalVirtualGroupId: gvg.Id, DstGlobalVirtualGroupId: dstGVG.Id}) +// for _, gvgMapping := range gvgMappings { +// migrationBucketSignHash := storagetypes.NewSecondarySpMigrationBucketSignDoc(s.GetChainID(), bucketInfo.Id, dstPrimarySP.Info.Id, gvgMapping.SrcGlobalVirtualGroupId, gvgMapping.DstGlobalVirtualGroupId).GetBlsSignHash() +// secondarySigs := make([][]byte, 0) +// secondarySPBlsPubKeys := make([]bls.PublicKey, 0) +// for _, ssp := range secondarySPs { +// sig, err := core.BlsSignAndVerify(ssp, migrationBucketSignHash) +// s.Require().NoError(err) +// secondarySigs = append(secondarySigs, sig) +// pk, err := bls.PublicKeyFromBytes(ssp.BlsKey.PubKey().Bytes()) +// s.Require().NoError(err) +// secondarySPBlsPubKeys = append(secondarySPBlsPubKeys, pk) +// } +// aggBlsSig, err := core.BlsAggregateAndVerify(secondarySPBlsPubKeys, migrationBucketSignHash, secondarySigs) +// s.Require().NoError(err) +// gvgMapping.SecondarySpBlsSignature = aggBlsSig +// } +// +// msgCompleteMigrationBucket := storagetypes.NewMsgCompleteMigrateBucket(dstPrimarySP.OperatorKey.GetAddr(), bucketName, dstGVG.FamilyId, gvgMappings) +// s.SendTxBlockWithExpectErrorString(msgCompleteMigrationBucket, dstPrimarySP.OperatorKey, "The bucket is not been migrating") +// +// // send again +// msgMigrationBucket = storagetypes.NewMsgMigrateBucket(user.GetAddr(), bucketName, dstPrimarySP.Info.Id) +// msgMigrationBucket.DstPrimarySpApproval.ExpiredHeight = math.MaxInt +// msgMigrationBucket.DstPrimarySpApproval.Sig, err = dstPrimarySP.ApprovalKey.Sign(msgMigrationBucket.GetApprovalBytes()) +// s.SendTxBlock(user, msgMigrationBucket) +// s.Require().NoError(err) +// +// // complete again +// msgCompleteMigrationBucket = storagetypes.NewMsgCompleteMigrateBucket(dstPrimarySP.OperatorKey.GetAddr(), bucketName, dstGVG.FamilyId, gvgMappings) +// s.SendTxBlock(dstPrimarySP.OperatorKey, msgCompleteMigrationBucket) +//} func (s *StorageTestSuite) TestUpdateStorageParams() { // 1. create proposal @@ -2011,66 +2010,66 @@ func (s *StorageTestSuite) TestMaintenanceSPCreateBucketAndObject() { s.Require().Equal(sptypes.STATUS_IN_SERVICE, spResp.StorageProvider.Status) } -func (s *StorageTestSuite) TestRejectMigrateBucket() { - // construct bucket and object - primarySP := s.BaseSuite.PickStorageProvider() - gvg, found := primarySP.GetFirstGlobalVirtualGroup() - s.Require().True(found) - user := s.GenAndChargeAccounts(1, 1000000)[0] - bucketName := storageutils.GenRandomBucketName() - objectName := storageutils.GenRandomObjectName() - s.BaseSuite.CreateObject(user, primarySP, gvg.Id, bucketName, objectName) - - var err error - dstPrimarySP := s.CreateNewStorageProvider() - - // migrate bucket - msgMigrationBucket := storagetypes.NewMsgMigrateBucket(user.GetAddr(), bucketName, dstPrimarySP.Info.Id) - msgMigrationBucket.DstPrimarySpApproval.ExpiredHeight = math.MaxInt - msgMigrationBucket.DstPrimarySpApproval.Sig, err = dstPrimarySP.ApprovalKey.Sign(msgMigrationBucket.GetApprovalBytes()) - s.SendTxBlock(user, msgMigrationBucket) - s.Require().NoError(err) - - ctx := context.Background() - queryHeadBucketRequest := storagetypes.QueryHeadBucketRequest{ - BucketName: bucketName, - } - queryHeadBucketResponse, err := s.Client.HeadBucket(ctx, &queryHeadBucketRequest) - s.Require().NoError(err) - s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketName, bucketName) - s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketStatus, storagetypes.BUCKET_STATUS_MIGRATING) - - // Dest SP reject the migration - rejectMigration := storagetypes.NewMsgRejectMigrateBucket(dstPrimarySP.OperatorKey.GetAddr(), bucketName) - s.SendTxBlock(dstPrimarySP.OperatorKey, rejectMigration) - s.Require().NoError(err) - - queryHeadBucketRequest = storagetypes.QueryHeadBucketRequest{ - BucketName: bucketName, - } - queryHeadBucketResponse, err = s.Client.HeadBucket(ctx, &queryHeadBucketRequest) - s.Require().NoError(err) - s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketStatus, storagetypes.BUCKET_STATUS_CREATED) - - // migrate bucket again - msgMigrationBucket = storagetypes.NewMsgMigrateBucket(user.GetAddr(), bucketName, dstPrimarySP.Info.Id) - msgMigrationBucket.DstPrimarySpApproval.ExpiredHeight = math.MaxInt - msgMigrationBucket.DstPrimarySpApproval.Sig, err = dstPrimarySP.ApprovalKey.Sign(msgMigrationBucket.GetApprovalBytes()) - s.SendTxBlock(user, msgMigrationBucket) - s.Require().NoError(err) - - // cancel migration by user - msgCancelMigrationBucket := storagetypes.NewMsgCancelMigrateBucket(user.GetAddr(), bucketName) - s.SendTxBlock(user, msgCancelMigrationBucket) - s.Require().NoError(err) - - queryHeadBucketResponse, err = s.Client.HeadBucket(ctx, &queryHeadBucketRequest) - s.Require().NoError(err) - s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketStatus, storagetypes.BUCKET_STATUS_CREATED) - - // dest SP should fail to reject - s.Client.SetKeyManager(dstPrimarySP.OperatorKey) - _, err = s.Client.BroadcastTx(context.Background(), []sdk.Msg{rejectMigration}, nil) - s.Require().Error(err) - s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketStatus, storagetypes.BUCKET_STATUS_CREATED) -} +//func (s *StorageTestSuite) TestRejectMigrateBucket() { +// // construct bucket and object +// primarySP := s.BaseSuite.PickStorageProvider() +// gvg, found := primarySP.GetFirstGlobalVirtualGroup() +// s.Require().True(found) +// user := s.GenAndChargeAccounts(1, 1000000)[0] +// bucketName := storageutils.GenRandomBucketName() +// objectName := storageutils.GenRandomObjectName() +// s.BaseSuite.CreateObject(user, primarySP, gvg.Id, bucketName, objectName) +// +// var err error +// dstPrimarySP := s.CreateNewStorageProvider() +// +// // migrate bucket +// msgMigrationBucket := storagetypes.NewMsgMigrateBucket(user.GetAddr(), bucketName, dstPrimarySP.Info.Id) +// msgMigrationBucket.DstPrimarySpApproval.ExpiredHeight = math.MaxInt +// msgMigrationBucket.DstPrimarySpApproval.Sig, err = dstPrimarySP.ApprovalKey.Sign(msgMigrationBucket.GetApprovalBytes()) +// s.SendTxBlock(user, msgMigrationBucket) +// s.Require().NoError(err) +// +// ctx := context.Background() +// queryHeadBucketRequest := storagetypes.QueryHeadBucketRequest{ +// BucketName: bucketName, +// } +// queryHeadBucketResponse, err := s.Client.HeadBucket(ctx, &queryHeadBucketRequest) +// s.Require().NoError(err) +// s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketName, bucketName) +// s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketStatus, storagetypes.BUCKET_STATUS_MIGRATING) +// +// // Dest SP reject the migration +// rejectMigration := storagetypes.NewMsgRejectMigrateBucket(dstPrimarySP.OperatorKey.GetAddr(), bucketName) +// s.SendTxBlock(dstPrimarySP.OperatorKey, rejectMigration) +// s.Require().NoError(err) +// +// queryHeadBucketRequest = storagetypes.QueryHeadBucketRequest{ +// BucketName: bucketName, +// } +// queryHeadBucketResponse, err = s.Client.HeadBucket(ctx, &queryHeadBucketRequest) +// s.Require().NoError(err) +// s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketStatus, storagetypes.BUCKET_STATUS_CREATED) +// +// // migrate bucket again +// msgMigrationBucket = storagetypes.NewMsgMigrateBucket(user.GetAddr(), bucketName, dstPrimarySP.Info.Id) +// msgMigrationBucket.DstPrimarySpApproval.ExpiredHeight = math.MaxInt +// msgMigrationBucket.DstPrimarySpApproval.Sig, err = dstPrimarySP.ApprovalKey.Sign(msgMigrationBucket.GetApprovalBytes()) +// s.SendTxBlock(user, msgMigrationBucket) +// s.Require().NoError(err) +// +// // cancel migration by user +// msgCancelMigrationBucket := storagetypes.NewMsgCancelMigrateBucket(user.GetAddr(), bucketName) +// s.SendTxBlock(user, msgCancelMigrationBucket) +// s.Require().NoError(err) +// +// queryHeadBucketResponse, err = s.Client.HeadBucket(ctx, &queryHeadBucketRequest) +// s.Require().NoError(err) +// s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketStatus, storagetypes.BUCKET_STATUS_CREATED) +// +// // dest SP should fail to reject +// s.Client.SetKeyManager(dstPrimarySP.OperatorKey) +// _, err = s.Client.BroadcastTx(context.Background(), []sdk.Msg{rejectMigration}, nil) +// s.Require().Error(err) +// s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketStatus, storagetypes.BUCKET_STATUS_CREATED) +//} diff --git a/e2e/tests/virtualgroup_test.go b/e2e/tests/virtualgroup_test.go index 1d9632177..c344ecfad 100644 --- a/e2e/tests/virtualgroup_test.go +++ b/e2e/tests/virtualgroup_test.go @@ -23,8 +23,6 @@ import ( "github.com/bnb-chain/greenfield/e2e/core" "github.com/bnb-chain/greenfield/sdk/types" storagetestutil "github.com/bnb-chain/greenfield/testutil/storage" - "github.com/bnb-chain/greenfield/types/common" - sptypes "github.com/bnb-chain/greenfield/x/sp/types" storagetypes "github.com/bnb-chain/greenfield/x/storage/types" virtualgroupmoduletypes "github.com/bnb-chain/greenfield/x/virtualgroup/types" ) @@ -172,6 +170,39 @@ func (s *VirtualGroupTestSuite) TestBasic() { context.Background(), &virtualgroupmoduletypes.QueryGlobalVirtualGroupRequest{GlobalVirtualGroupId: newGVG.Id}) s.Require().Error(err) + + // test number of secondary SP doest not match onchain requirement + secondarySPIDs = append(secondarySPIDs, secondarySPIDs[0]) + msgCreateGVG := virtualgroupmoduletypes.MsgCreateGlobalVirtualGroup{ + StorageProvider: primarySP.OperatorKey.GetAddr().String(), + FamilyId: virtualgroupmoduletypes.NoSpecifiedFamilyId, + SecondarySpIds: secondarySPIDs, + Deposit: sdk.Coin{ + Denom: s.Config.Denom, + Amount: types.NewIntFromInt64WithDecimal(1, types.DecimalBNB), + }, + } + s.SendTxBlockWithExpectErrorString(&msgCreateGVG, primarySP.OperatorKey, virtualgroupmoduletypes.ErrInvalidSecondarySPCount.Error()) + + // test GVG has duplicated secondary Sp + secondarySPIDs = make([]uint32, 0) + for _, ssp := range s.StorageProviders { + if ssp.Info.Id != primarySP.Info.Id { + secondarySPIDs = append(secondarySPIDs, ssp.Info.Id) + } + } + secondarySPIDs[len(secondarySPIDs)-1] = secondarySPIDs[0] + msgCreateGVG = virtualgroupmoduletypes.MsgCreateGlobalVirtualGroup{ + StorageProvider: primarySP.OperatorKey.GetAddr().String(), + FamilyId: virtualgroupmoduletypes.NoSpecifiedFamilyId, + SecondarySpIds: secondarySPIDs, + Deposit: sdk.Coin{ + Denom: s.Config.Denom, + Amount: types.NewIntFromInt64WithDecimal(1, types.DecimalBNB), + }, + } + s.SendTxBlockWithExpectErrorString(&msgCreateGVG, primarySP.OperatorKey, virtualgroupmoduletypes.ErrDuplicateSecondarySP.Error()) + } func (s *VirtualGroupTestSuite) TestSettle() { @@ -357,204 +388,204 @@ func (s *VirtualGroupTestSuite) createObject() (string, string, *core.StoragePro return bucketName, objectName, sp, secondarySps, gvg.FamilyId, gvg.Id } -func (s *VirtualGroupTestSuite) TestSPExit() { - user := s.GenAndChargeAccounts(1, 1000000)[0] - // 1, create a new storage provider - sp := s.BaseSuite.CreateNewStorageProvider() - s.T().Logf("new SP Info: %s", sp.Info.String()) - - successorSp := s.BaseSuite.PickStorageProvider() - - // 2, create a new gvg group for this storage provider - var secondarySPIDs []uint32 - for _, ssp := range s.StorageProviders { - if ssp.Info.Id != successorSp.Info.Id { - secondarySPIDs = append(secondarySPIDs, ssp.Info.Id) - } - if len(secondarySPIDs) == 6 { - break - } - } - - gvgID, familyID := s.BaseSuite.CreateGlobalVirtualGroup(sp, 0, secondarySPIDs, 1) - - // 3. create object - s.BaseSuite.CreateObject(user, sp, gvgID, storagetestutil.GenRandomBucketName(), storagetestutil.GenRandomObjectName()) - - // 4. Create another gvg contains this new sp - var anotherSP *core.StorageProvider - for _, tsp := range s.StorageProviders { - if tsp.Info.Id != sp.Info.Id && tsp.Info.Id != successorSp.Info.Id { - anotherSP = tsp - break - } - } - var anotherSecondarySPIDs []uint32 - for _, ssp := range s.StorageProviders { - if ssp.Info.Id != successorSp.Info.Id && ssp.Info.Id != anotherSP.Info.Id { - anotherSecondarySPIDs = append(anotherSecondarySPIDs, ssp.Info.Id) - } - if len(anotherSecondarySPIDs) == 5 { - break - } - } - anotherSecondarySPIDs = append(anotherSecondarySPIDs, sp.Info.Id) - - anotherGVGID, _ := s.BaseSuite.CreateGlobalVirtualGroup(anotherSP, 0, anotherSecondarySPIDs, 1) - - // 5. sp exit - s.SendTxBlock(sp.OperatorKey, &virtualgroupmoduletypes.MsgStorageProviderExit{ - StorageProvider: sp.OperatorKey.GetAddr().String(), - }) - - resp, err := s.Client.StorageProvider(context.Background(), &sptypes.QueryStorageProviderRequest{Id: sp.Info.Id}) - s.Require().NoError(err) - s.Require().Equal(resp.StorageProvider.Status, sptypes.STATUS_GRACEFUL_EXITING) - - // 6. sp complete exit failed - s.SendTxBlockWithExpectErrorString( - &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, - sp.OperatorKey, - "not swap out from all the family") - - // 7. swap out, as primary sp - msgSwapOut := virtualgroupmoduletypes.NewMsgSwapOut(sp.OperatorKey.GetAddr(), familyID, nil, successorSp.Info.Id) - msgSwapOut.SuccessorSpApproval = &common.Approval{ExpiredHeight: math.MaxUint} - msgSwapOut.SuccessorSpApproval.Sig, err = successorSp.ApprovalKey.Sign(msgSwapOut.GetApprovalBytes()) - s.Require().NoError(err) - s.SendTxBlock(sp.OperatorKey, msgSwapOut) - - // 9. cancel swap out - msgCancelSwapOut := virtualgroupmoduletypes.NewMsgCancelSwapOut(sp.OperatorKey.GetAddr(), familyID, nil) - s.Require().NoError(err) - s.SendTxBlock(sp.OperatorKey, msgCancelSwapOut) - - // 10. complete swap out, as primary sp - msgCompleteSwapOut := virtualgroupmoduletypes.NewMsgCompleteSwapOut(successorSp.OperatorKey.GetAddr(), familyID, nil) - s.Require().NoError(err) - s.SendTxBlockWithExpectErrorString(msgCompleteSwapOut, successorSp.OperatorKey, "The swap info not found in blockchain") - - // 11 swap again - msgSwapOut = virtualgroupmoduletypes.NewMsgSwapOut(sp.OperatorKey.GetAddr(), familyID, nil, successorSp.Info.Id) - msgSwapOut.SuccessorSpApproval = &common.Approval{ExpiredHeight: math.MaxUint} - msgSwapOut.SuccessorSpApproval.Sig, err = successorSp.ApprovalKey.Sign(msgSwapOut.GetApprovalBytes()) - s.Require().NoError(err) - s.SendTxBlock(sp.OperatorKey, msgSwapOut) - - // 12. sp complete exit failed - s.SendTxBlockWithExpectErrorString( - &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, - sp.OperatorKey, - "not swap out from all the family") - - // 13. complete swap out, as primary sp - msgCompleteSwapOut = virtualgroupmoduletypes.NewMsgCompleteSwapOut(successorSp.OperatorKey.GetAddr(), familyID, nil) - s.Require().NoError(err) - s.SendTxBlock(successorSp.OperatorKey, msgCompleteSwapOut) - - // 14. exist failed - s.SendTxBlockWithExpectErrorString( - &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, - sp.OperatorKey, - "not swap out from all the gvgs") - - // 15. swap out, as secondary sp - msgSwapOut2 := virtualgroupmoduletypes.NewMsgSwapOut(sp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}, successorSp.Info.Id) - msgSwapOut2.SuccessorSpApproval = &common.Approval{ExpiredHeight: math.MaxUint} - msgSwapOut2.SuccessorSpApproval.Sig, err = successorSp.ApprovalKey.Sign(msgSwapOut2.GetApprovalBytes()) - s.Require().NoError(err) - s.SendTxBlock(sp.OperatorKey, msgSwapOut2) - - // 16. exist failed - s.SendTxBlockWithExpectErrorString( - &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, - sp.OperatorKey, - "not swap out from all the gvgs") - - // 17 cancel swap out as secondary sp - msgCancelSwapOut = virtualgroupmoduletypes.NewMsgCancelSwapOut(sp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}) - s.Require().NoError(err) - s.SendTxBlock(sp.OperatorKey, msgCancelSwapOut) - - // 18. swap - msgCompleteSwapOut2 := virtualgroupmoduletypes.NewMsgCompleteSwapOut(successorSp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}) - s.Require().NoError(err) - s.SendTxBlockWithExpectErrorString(msgCompleteSwapOut2, successorSp.OperatorKey, "The swap info not found in blockchain") - - // 19. swap out again, as secondary sp - msgSwapOut2 = virtualgroupmoduletypes.NewMsgSwapOut(sp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}, successorSp.Info.Id) - msgSwapOut2.SuccessorSpApproval = &common.Approval{ExpiredHeight: math.MaxUint} - msgSwapOut2.SuccessorSpApproval.Sig, err = successorSp.ApprovalKey.Sign(msgSwapOut2.GetApprovalBytes()) - s.Require().NoError(err) - s.SendTxBlock(sp.OperatorKey, msgSwapOut2) - - // 20 complete swap out - msgCompleteSwapOut2 = virtualgroupmoduletypes.NewMsgCompleteSwapOut(successorSp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}) - s.Require().NoError(err) - s.SendTxBlock(successorSp.OperatorKey, msgCompleteSwapOut2) - - // 18. sp complete exit success - s.SendTxBlock( - sp.OperatorKey, - &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, - ) -} - -func (s *VirtualGroupTestSuite) TestSPExit_CreateAndDeleteBucket() { - user := s.GenAndChargeAccounts(1, 1000000)[0] - bucketName := storagetestutil.GenRandomBucketName() - objectName := storagetestutil.GenRandomObjectName() - // 1, create a new storage provider - sp := s.BaseSuite.CreateNewStorageProvider() - s.T().Logf("new SP Info: %s", sp.Info.String()) - - successorSp := s.BaseSuite.PickStorageProvider() - - // 2, create a new gvg group for this storage provider - var secondarySPIDs []uint32 - for _, ssp := range s.StorageProviders { - if ssp.Info.Id != successorSp.Info.Id { - secondarySPIDs = append(secondarySPIDs, ssp.Info.Id) - } - if len(secondarySPIDs) == 6 { - break - } - } - - gvgID, _ := s.BaseSuite.CreateGlobalVirtualGroup(sp, 0, secondarySPIDs, 1) - - // 3. create object - s.BaseSuite.CreateObject(user, sp, gvgID, bucketName, objectName) - - // 4. sp apply exit - s.SendTxBlock(sp.OperatorKey, &virtualgroupmoduletypes.MsgStorageProviderExit{ - StorageProvider: sp.OperatorKey.GetAddr().String(), - }) - - resp, err := s.Client.StorageProvider(context.Background(), &sptypes.QueryStorageProviderRequest{Id: sp.Info.Id}) - s.Require().NoError(err) - s.Require().Equal(resp.StorageProvider.Status, sptypes.STATUS_GRACEFUL_EXITING) - - // 5. sp complete exit failed - s.SendTxBlockWithExpectErrorString( - &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, - sp.OperatorKey, - "not swap out from all the family") - - // 6. delete object - s.SendTxBlock(user, storagetypes.NewMsgDeleteObject(user.GetAddr(), bucketName, objectName)) - - // 7. delete bucket - s.SendTxBlock(user, storagetypes.NewMsgDeleteBucket(user.GetAddr(), bucketName)) - - // 8. delete gvg - s.SendTxBlock(sp.OperatorKey, virtualgroupmoduletypes.NewMsgDeleteGlobalVirtualGroup(sp.OperatorKey.GetAddr(), gvgID)) - // 8. sp complete exit success - s.SendTxBlock( - sp.OperatorKey, - &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, - ) -} +//func (s *VirtualGroupTestSuite) TestSPExit() { +// user := s.GenAndChargeAccounts(1, 1000000)[0] +// // 1, create a new storage provider +// sp := s.BaseSuite.CreateNewStorageProvider() +// s.T().Logf("new SP Info: %s", sp.Info.String()) +// +// successorSp := s.BaseSuite.PickStorageProvider() +// +// // 2, create a new gvg group for this storage provider +// var secondarySPIDs []uint32 +// for _, ssp := range s.StorageProviders { +// if ssp.Info.Id != successorSp.Info.Id { +// secondarySPIDs = append(secondarySPIDs, ssp.Info.Id) +// } +// if len(secondarySPIDs) == 6 { +// break +// } +// } +// +// gvgID, familyID := s.BaseSuite.CreateGlobalVirtualGroup(sp, 0, secondarySPIDs, 1) +// +// // 3. create object +// s.BaseSuite.CreateObject(user, sp, gvgID, storagetestutil.GenRandomBucketName(), storagetestutil.GenRandomObjectName()) +// +// // 4. Create another gvg contains this new sp +// var anotherSP *core.StorageProvider +// for _, tsp := range s.StorageProviders { +// if tsp.Info.Id != sp.Info.Id && tsp.Info.Id != successorSp.Info.Id { +// anotherSP = tsp +// break +// } +// } +// var anotherSecondarySPIDs []uint32 +// for _, ssp := range s.StorageProviders { +// if ssp.Info.Id != successorSp.Info.Id && ssp.Info.Id != anotherSP.Info.Id { +// anotherSecondarySPIDs = append(anotherSecondarySPIDs, ssp.Info.Id) +// } +// if len(anotherSecondarySPIDs) == 5 { +// break +// } +// } +// anotherSecondarySPIDs = append(anotherSecondarySPIDs, sp.Info.Id) +// +// anotherGVGID, _ := s.BaseSuite.CreateGlobalVirtualGroup(anotherSP, 0, anotherSecondarySPIDs, 1) +// +// // 5. sp exit +// s.SendTxBlock(sp.OperatorKey, &virtualgroupmoduletypes.MsgStorageProviderExit{ +// StorageProvider: sp.OperatorKey.GetAddr().String(), +// }) +// +// resp, err := s.Client.StorageProvider(context.Background(), &sptypes.QueryStorageProviderRequest{Id: sp.Info.Id}) +// s.Require().NoError(err) +// s.Require().Equal(resp.StorageProvider.Status, sptypes.STATUS_GRACEFUL_EXITING) +// +// // 6. sp complete exit failed +// s.SendTxBlockWithExpectErrorString( +// &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, +// sp.OperatorKey, +// "not swap out from all the family") +// +// // 7. swap out, as primary sp +// msgSwapOut := virtualgroupmoduletypes.NewMsgSwapOut(sp.OperatorKey.GetAddr(), familyID, nil, successorSp.Info.Id) +// msgSwapOut.SuccessorSpApproval = &common.Approval{ExpiredHeight: math.MaxUint} +// msgSwapOut.SuccessorSpApproval.Sig, err = successorSp.ApprovalKey.Sign(msgSwapOut.GetApprovalBytes()) +// s.Require().NoError(err) +// s.SendTxBlock(sp.OperatorKey, msgSwapOut) +// +// // 9. cancel swap out +// msgCancelSwapOut := virtualgroupmoduletypes.NewMsgCancelSwapOut(sp.OperatorKey.GetAddr(), familyID, nil) +// s.Require().NoError(err) +// s.SendTxBlock(sp.OperatorKey, msgCancelSwapOut) +// +// // 10. complete swap out, as primary sp +// msgCompleteSwapOut := virtualgroupmoduletypes.NewMsgCompleteSwapOut(successorSp.OperatorKey.GetAddr(), familyID, nil) +// s.Require().NoError(err) +// s.SendTxBlockWithExpectErrorString(msgCompleteSwapOut, successorSp.OperatorKey, "The swap info not found in blockchain") +// +// // 11 swap again +// msgSwapOut = virtualgroupmoduletypes.NewMsgSwapOut(sp.OperatorKey.GetAddr(), familyID, nil, successorSp.Info.Id) +// msgSwapOut.SuccessorSpApproval = &common.Approval{ExpiredHeight: math.MaxUint} +// msgSwapOut.SuccessorSpApproval.Sig, err = successorSp.ApprovalKey.Sign(msgSwapOut.GetApprovalBytes()) +// s.Require().NoError(err) +// s.SendTxBlock(sp.OperatorKey, msgSwapOut) +// +// // 12. sp complete exit failed +// s.SendTxBlockWithExpectErrorString( +// &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, +// sp.OperatorKey, +// "not swap out from all the family") +// +// // 13. complete swap out, as primary sp +// msgCompleteSwapOut = virtualgroupmoduletypes.NewMsgCompleteSwapOut(successorSp.OperatorKey.GetAddr(), familyID, nil) +// s.Require().NoError(err) +// s.SendTxBlock(successorSp.OperatorKey, msgCompleteSwapOut) +// +// // 14. exist failed +// s.SendTxBlockWithExpectErrorString( +// &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, +// sp.OperatorKey, +// "not swap out from all the gvgs") +// +// // 15. swap out, as secondary sp +// msgSwapOut2 := virtualgroupmoduletypes.NewMsgSwapOut(sp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}, successorSp.Info.Id) +// msgSwapOut2.SuccessorSpApproval = &common.Approval{ExpiredHeight: math.MaxUint} +// msgSwapOut2.SuccessorSpApproval.Sig, err = successorSp.ApprovalKey.Sign(msgSwapOut2.GetApprovalBytes()) +// s.Require().NoError(err) +// s.SendTxBlock(sp.OperatorKey, msgSwapOut2) +// +// // 16. exist failed +// s.SendTxBlockWithExpectErrorString( +// &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, +// sp.OperatorKey, +// "not swap out from all the gvgs") +// +// // 17 cancel swap out as secondary sp +// msgCancelSwapOut = virtualgroupmoduletypes.NewMsgCancelSwapOut(sp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}) +// s.Require().NoError(err) +// s.SendTxBlock(sp.OperatorKey, msgCancelSwapOut) +// +// // 18. swap +// msgCompleteSwapOut2 := virtualgroupmoduletypes.NewMsgCompleteSwapOut(successorSp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}) +// s.Require().NoError(err) +// s.SendTxBlockWithExpectErrorString(msgCompleteSwapOut2, successorSp.OperatorKey, "The swap info not found in blockchain") +// +// // 19. swap out again, as secondary sp +// msgSwapOut2 = virtualgroupmoduletypes.NewMsgSwapOut(sp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}, successorSp.Info.Id) +// msgSwapOut2.SuccessorSpApproval = &common.Approval{ExpiredHeight: math.MaxUint} +// msgSwapOut2.SuccessorSpApproval.Sig, err = successorSp.ApprovalKey.Sign(msgSwapOut2.GetApprovalBytes()) +// s.Require().NoError(err) +// s.SendTxBlock(sp.OperatorKey, msgSwapOut2) +// +// // 20 complete swap out +// msgCompleteSwapOut2 = virtualgroupmoduletypes.NewMsgCompleteSwapOut(successorSp.OperatorKey.GetAddr(), 0, []uint32{anotherGVGID}) +// s.Require().NoError(err) +// s.SendTxBlock(successorSp.OperatorKey, msgCompleteSwapOut2) +// +// // 18. sp complete exit success +// s.SendTxBlock( +// sp.OperatorKey, +// &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, +// ) +//} + +//func (s *VirtualGroupTestSuite) TestSPExit_CreateAndDeleteBucket() { +// user := s.GenAndChargeAccounts(1, 1000000)[0] +// bucketName := storagetestutil.GenRandomBucketName() +// objectName := storagetestutil.GenRandomObjectName() +// // 1, create a new storage provider +// sp := s.BaseSuite.CreateNewStorageProvider() +// s.T().Logf("new SP Info: %s", sp.Info.String()) +// +// successorSp := s.BaseSuite.PickStorageProvider() +// +// // 2, create a new gvg group for this storage provider +// var secondarySPIDs []uint32 +// for _, ssp := range s.StorageProviders { +// if ssp.Info.Id != successorSp.Info.Id { +// secondarySPIDs = append(secondarySPIDs, ssp.Info.Id) +// } +// if len(secondarySPIDs) == 6 { +// break +// } +// } +// +// gvgID, _ := s.BaseSuite.CreateGlobalVirtualGroup(sp, 0, secondarySPIDs, 1) +// +// // 3. create object +// s.BaseSuite.CreateObject(user, sp, gvgID, bucketName, objectName) +// +// // 4. sp apply exit +// s.SendTxBlock(sp.OperatorKey, &virtualgroupmoduletypes.MsgStorageProviderExit{ +// StorageProvider: sp.OperatorKey.GetAddr().String(), +// }) +// +// resp, err := s.Client.StorageProvider(context.Background(), &sptypes.QueryStorageProviderRequest{Id: sp.Info.Id}) +// s.Require().NoError(err) +// s.Require().Equal(resp.StorageProvider.Status, sptypes.STATUS_GRACEFUL_EXITING) +// +// // 5. sp complete exit failed +// s.SendTxBlockWithExpectErrorString( +// &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, +// sp.OperatorKey, +// "not swap out from all the family") +// +// // 6. delete object +// s.SendTxBlock(user, storagetypes.NewMsgDeleteObject(user.GetAddr(), bucketName, objectName)) +// +// // 7. delete bucket +// s.SendTxBlock(user, storagetypes.NewMsgDeleteBucket(user.GetAddr(), bucketName)) +// +// // 8. delete gvg +// s.SendTxBlock(sp.OperatorKey, virtualgroupmoduletypes.NewMsgDeleteGlobalVirtualGroup(sp.OperatorKey.GetAddr(), gvgID)) +// // 8. sp complete exit success +// s.SendTxBlock( +// sp.OperatorKey, +// &virtualgroupmoduletypes.MsgCompleteStorageProviderExit{StorageProvider: sp.OperatorKey.GetAddr().String()}, +// ) +//} func (s *VirtualGroupTestSuite) TestUpdateVirtualGroupParams() { // 1. create proposal diff --git a/go.mod b/go.mod index 5304019c2..435b5327c 100644 --- a/go.mod +++ b/go.mod @@ -27,9 +27,9 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.15.0 github.com/stretchr/testify v1.8.4 - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 - google.golang.org/grpc v1.56.1 - google.golang.org/protobuf v1.30.0 + google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 + google.golang.org/grpc v1.58.3 + google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 sigs.k8s.io/yaml v1.3.0 ) @@ -158,13 +158,15 @@ require ( github.com/zondax/hid v0.9.1 // indirect github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.7 // indirect - golang.org/x/crypto v0.10.0 // indirect + golang.org/x/crypto v0.14.0 // indirect golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect - golang.org/x/net v0.11.0 // indirect - golang.org/x/sys v0.9.0 // indirect - golang.org/x/term v0.9.0 // indirect - golang.org/x/text v0.10.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/tools v0.10.0 // indirect + google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect @@ -175,10 +177,10 @@ replace ( cosmossdk.io/api => github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210 cosmossdk.io/math => github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210 github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.23.0 - github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.0-20231030090949-99ef7dbd1e62 + 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.0.2-0.20231101023808-a3c24a58eca0 + github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.1.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 026c7f9ea..4cc49b288 100644 --- a/go.sum +++ b/go.sum @@ -159,12 +159,12 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsy github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/bnb-chain/greenfield-cometbft v0.0.0-20231030090949-99ef7dbd1e62 h1:pakuREXV/XfWNwgsTXUQwYirem12Tt+2LGGHIar0z8o= -github.com/bnb-chain/greenfield-cometbft v0.0.0-20231030090949-99ef7dbd1e62/go.mod h1:43yICrTxu90VjEUpQN23bsqi9mua5m5sFQq/ekHwN9s= +github.com/bnb-chain/greenfield-cometbft v1.1.0 h1:jqnkDWIZW6f/rUn5/pE26YZMT9xzpp0qTswNy7FPRBk= +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.0.2-0.20231101023808-a3c24a58eca0 h1:5BQrQRqQ0GTR3UgvTtlTCJAYPkWrjk9Yk9kRnmzzut0= -github.com/bnb-chain/greenfield-cosmos-sdk v1.0.2-0.20231101023808-a3c24a58eca0/go.mod h1:ZWyfWX032fdHkICmEoJwylfqmL+Atf/QNVS8GzJq1Kc= +github.com/bnb-chain/greenfield-cosmos-sdk v1.1.0 h1:hHORuliVfVdkyWmCQ9I5C0pe8zIsgDUmG/IyVudRFe0= +github.com/bnb-chain/greenfield-cosmos-sdk v1.1.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= @@ -1518,8 +1518,8 @@ golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5 golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1629,8 +1629,8 @@ golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20170912212905-13449ad91cb2/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1765,13 +1765,13 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1782,8 +1782,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20170424234030-8be79e1e0910/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1956,8 +1956,12 @@ google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210426193834-eac7f76ac494/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 h1:Z0hjGZePRE0ZBWotvtrwxFNrNE9CUAGtplaDK5NNI/g= +google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98/go.mod h1:S7mY02OqCJTD0E1OiQy1F72PWFB4bZJ87cAtLPYgDR0= +google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw= +google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= google.golang.org/grpc v1.2.1-0.20170921194603-d4b75ebd4f9f/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= @@ -1990,8 +1994,8 @@ google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= -google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -2007,8 +2011,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UDAkHu8BrjI= diff --git a/swagger/static/swagger.yaml b/swagger/static/swagger.yaml index 680dca680..332447eb1 100644 --- a/swagger/static/swagger.yaml +++ b/swagger/static/swagger.yaml @@ -6082,7 +6082,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -6132,7 +6135,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6142,7 +6145,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -6172,6 +6175,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -6286,7 +6290,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -6336,7 +6343,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6346,7 +6353,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -6376,6 +6383,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -6494,7 +6502,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -6544,7 +6555,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6554,7 +6565,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -6584,6 +6595,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -6714,7 +6726,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -6764,7 +6779,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6774,7 +6789,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -6804,6 +6819,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -6962,7 +6978,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -7012,7 +7031,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7022,7 +7041,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -7052,6 +7071,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -7156,7 +7176,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -7206,7 +7229,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7216,7 +7239,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -7246,6 +7269,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -7375,7 +7399,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -7425,7 +7452,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7435,7 +7462,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -7465,6 +7492,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -7591,7 +7619,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -7641,7 +7672,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7651,7 +7682,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -7681,6 +7712,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -7791,7 +7823,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -7841,7 +7876,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7851,7 +7886,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -7881,6 +7916,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -7982,7 +8018,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -8032,7 +8071,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8042,7 +8081,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -8072,6 +8111,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -8176,7 +8216,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -8226,7 +8269,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8236,7 +8279,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -8266,6 +8309,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -8409,7 +8453,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -8459,7 +8506,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8469,7 +8516,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -8499,6 +8546,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -8606,7 +8654,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -8656,7 +8707,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8666,7 +8717,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -8696,6 +8747,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -8841,7 +8893,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -8891,7 +8946,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8901,7 +8956,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -8931,6 +8986,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -9115,7 +9171,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -9165,7 +9224,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9175,7 +9234,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -9205,6 +9264,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -9342,7 +9402,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -9392,7 +9455,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9402,7 +9465,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -9432,6 +9495,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -9605,7 +9669,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -9655,7 +9722,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9665,7 +9732,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -9695,6 +9762,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -9832,7 +9900,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -9882,7 +9953,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9892,7 +9963,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -9922,6 +9993,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -11554,7 +11626,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -11604,7 +11679,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -11614,7 +11689,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -11644,6 +11719,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -12887,7 +12963,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -12937,7 +13016,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -12947,7 +13026,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -12977,6 +13056,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -14201,7 +14281,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -14251,7 +14334,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14261,7 +14344,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -14291,6 +14374,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -14485,7 +14569,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -14535,7 +14622,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14545,7 +14632,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -14575,6 +14662,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -14696,7 +14784,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -14746,7 +14837,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14756,7 +14847,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -14786,6 +14877,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -14898,7 +14990,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -14948,7 +15043,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14958,7 +15053,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -14988,6 +15083,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -15123,7 +15219,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -15173,7 +15272,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15183,7 +15282,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -15213,6 +15312,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -15382,7 +15482,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -15432,7 +15535,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15442,7 +15545,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -15472,6 +15575,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -15607,7 +15711,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -15657,7 +15764,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15667,7 +15774,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -15697,6 +15804,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -16828,7 +16936,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -16878,7 +16989,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -16888,7 +16999,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -16918,6 +17029,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -17047,7 +17159,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -17097,7 +17212,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -17107,7 +17222,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -17137,6 +17252,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -17295,7 +17411,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -17345,7 +17464,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -17355,7 +17474,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -17385,6 +17504,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -17489,7 +17609,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -17539,7 +17662,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -17549,7 +17672,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -17579,6 +17702,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -17715,7 +17839,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -17802,7 +17929,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -17852,7 +17982,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -17862,7 +17992,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -17892,6 +18022,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -18027,7 +18158,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -18134,7 +18268,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -18184,7 +18321,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -18194,7 +18331,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -18224,6 +18361,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -18406,7 +18544,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -18516,7 +18657,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -18566,7 +18710,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -18576,7 +18720,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -18606,6 +18750,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -19170,7 +19315,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -19220,7 +19368,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -19230,7 +19378,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -19260,6 +19408,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -19383,7 +19532,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -19433,7 +19585,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -19443,7 +19595,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -19473,6 +19625,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -19705,7 +19858,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -19755,7 +19911,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -19765,7 +19921,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -19795,6 +19951,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -19999,7 +20156,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -20049,7 +20209,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -20059,7 +20219,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -20089,6 +20249,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -20298,7 +20459,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -20348,7 +20512,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -20358,7 +20522,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -20388,6 +20552,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -20572,7 +20737,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -20622,7 +20790,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -20632,7 +20800,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -20662,6 +20830,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -20881,7 +21050,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -20931,7 +21103,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -20941,7 +21113,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -20971,6 +21143,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -21122,7 +21295,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -21172,7 +21348,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -21182,7 +21358,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -21212,6 +21388,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -21406,7 +21583,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -21456,7 +21636,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -21466,7 +21646,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -21496,6 +21676,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -21724,7 +21905,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -21774,7 +21958,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -21784,7 +21968,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -21814,6 +21998,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -22628,7 +22813,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -22678,7 +22866,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -22688,7 +22876,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -22718,6 +22906,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -23062,7 +23251,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -23112,7 +23304,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23122,7 +23314,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -23152,6 +23344,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -23436,7 +23629,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -23486,7 +23682,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23496,7 +23692,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -23526,6 +23722,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -23707,7 +23904,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -23757,7 +23957,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23767,7 +23967,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -23797,6 +23997,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -24089,7 +24290,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -24139,7 +24343,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -24149,7 +24353,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -24179,6 +24383,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -24353,7 +24558,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -24403,7 +24611,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -24413,7 +24621,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -24443,6 +24651,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -24712,7 +24921,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -24762,7 +24974,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -24772,7 +24984,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -24802,6 +25014,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -25006,7 +25219,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are + no widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -25057,7 +25273,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -25067,7 +25283,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -25097,6 +25313,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -25372,7 +25589,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -25422,7 +25642,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -25432,7 +25652,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -25462,6 +25682,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -25624,7 +25845,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -25674,7 +25898,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -25684,7 +25908,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -25714,6 +25938,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -25839,7 +26064,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -25889,7 +26117,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -25899,7 +26127,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -25929,6 +26157,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -26046,7 +26275,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -26096,7 +26328,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -26106,7 +26338,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -26136,6 +26368,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -26428,7 +26661,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -26478,7 +26714,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -26488,7 +26724,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -26518,6 +26754,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -26690,7 +26927,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -26740,7 +26980,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -26750,7 +26990,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -26780,6 +27020,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -27049,7 +27290,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -27099,7 +27343,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -27109,7 +27353,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -27139,6 +27383,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -27338,7 +27583,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -27388,7 +27636,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -27398,7 +27646,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -27428,6 +27676,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -27657,7 +27906,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -27707,7 +27959,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -27717,7 +27969,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -27747,6 +27999,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -27938,7 +28191,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -27988,7 +28244,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -27998,7 +28254,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -28028,6 +28284,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -28249,7 +28506,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -28299,7 +28559,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -28309,7 +28569,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -28339,6 +28599,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -28517,7 +28778,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -28567,7 +28831,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -28577,7 +28841,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -28607,6 +28871,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -28750,7 +29015,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -28800,7 +29068,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -28810,7 +29078,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -28840,6 +29108,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -28984,7 +29253,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -29034,7 +29306,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -29044,7 +29316,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -29074,6 +29346,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -29208,7 +29481,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -29258,7 +29534,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -29268,7 +29544,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -29298,6 +29574,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -29497,7 +29774,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -29547,7 +29827,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -29557,7 +29837,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -29587,6 +29867,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -29702,7 +29983,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -29752,7 +30036,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -29762,7 +30046,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -29792,6 +30076,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -29913,7 +30198,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -29963,7 +30251,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -29973,7 +30261,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -30003,6 +30291,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -30286,7 +30575,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -30336,7 +30628,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -30346,7 +30638,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -30376,6 +30668,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -30542,7 +30835,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -30592,7 +30888,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -30602,7 +30898,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -30632,6 +30928,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -30784,7 +31081,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -30834,7 +31134,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -30844,7 +31144,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -30874,6 +31174,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -31052,7 +31353,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -31102,7 +31406,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -31112,7 +31416,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -31142,6 +31446,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -31500,7 +31805,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -31547,7 +31855,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -31557,7 +31865,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -31583,6 +31891,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -31704,7 +32013,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -31754,7 +32066,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -31764,7 +32076,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -31790,6 +32102,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -36327,7 +36640,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -36375,7 +36691,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -36385,7 +36701,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -36411,6 +36727,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -36544,7 +36861,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -36594,7 +36914,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -36604,7 +36924,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -36631,6 +36951,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -36725,7 +37046,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -36773,7 +37097,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -36783,7 +37107,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -36809,6 +37133,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -36898,7 +37223,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -36948,7 +37276,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -36958,7 +37286,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -36984,6 +37312,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -37093,7 +37422,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -37141,7 +37473,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -37151,7 +37483,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -37177,6 +37509,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -37266,7 +37599,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -37316,7 +37652,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -37326,7 +37662,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -37352,6 +37688,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -37464,7 +37801,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -37512,7 +37852,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -37522,7 +37862,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -37548,6 +37888,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -37648,7 +37989,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -37696,7 +38040,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -37706,7 +38050,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -37732,6 +38076,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -37836,7 +38181,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -37886,7 +38234,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -37896,7 +38244,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -37925,6 +38273,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -38053,7 +38402,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -38103,7 +38455,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -38113,7 +38465,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -38142,6 +38494,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -38266,7 +38619,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -38316,7 +38672,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -38326,7 +38682,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -38355,6 +38711,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -42004,7 +42361,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -42054,7 +42414,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -42064,7 +42424,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -42093,6 +42453,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -42303,7 +42664,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -42353,7 +42717,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -42363,7 +42727,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -42392,6 +42756,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -42661,7 +43026,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -42709,7 +43077,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -42719,7 +43087,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -42745,6 +43113,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -45682,7 +46051,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -45732,7 +46104,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -45742,7 +46114,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -45768,6 +46140,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -45876,7 +46249,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -45924,7 +46300,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -45934,7 +46310,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -45960,6 +46336,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -46057,7 +46434,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -46139,7 +46519,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -46228,7 +46611,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -46340,7 +46726,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -46736,7 +47125,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -46786,7 +47178,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -46796,7 +47188,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -46822,6 +47214,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -47260,7 +47653,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -47310,7 +47706,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -47320,7 +47716,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -47349,6 +47745,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -47542,7 +47939,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -47592,7 +47992,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -47602,7 +48002,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -47632,6 +48032,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -48689,7 +49090,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -48739,7 +49143,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -48749,7 +49153,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -48778,6 +49182,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -49290,7 +49695,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -49340,7 +49748,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -49350,7 +49758,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -49377,6 +49785,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -49628,7 +50037,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -49678,7 +50090,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -49688,7 +50100,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -49717,6 +50129,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -50072,7 +50485,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -50122,7 +50538,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -50132,7 +50548,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -50162,6 +50578,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -50757,7 +51174,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -50807,7 +51227,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -50817,7 +51237,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -50844,6 +51264,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -51175,7 +51596,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -51225,7 +51649,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -51235,7 +51659,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -51264,6 +51688,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -51873,7 +52298,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -51921,7 +52349,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -51931,7 +52359,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -51957,6 +52385,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -52308,7 +52737,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -52358,7 +52790,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -52368,7 +52800,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -52394,6 +52826,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -52582,7 +53015,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -52630,7 +53066,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -52640,7 +53076,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -52666,6 +53102,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -53119,7 +53556,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -53169,7 +53609,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -53179,7 +53619,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -53206,6 +53646,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -54071,7 +54512,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -54121,7 +54565,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -54131,7 +54575,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -54158,6 +54602,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -54395,7 +54840,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -54445,7 +54893,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -54455,7 +54903,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -54484,6 +54932,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -54856,7 +55305,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -54904,7 +55356,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -54914,7 +55366,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -54940,6 +55392,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -55143,7 +55596,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -55193,7 +55649,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -55203,7 +55659,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -55232,6 +55688,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -55360,7 +55817,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -55410,7 +55870,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -55420,7 +55880,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -55449,6 +55909,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -55571,7 +56032,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -55621,7 +56085,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -55631,7 +56095,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -55660,6 +56124,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -55755,7 +56220,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -55805,7 +56273,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -55815,7 +56283,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -55844,6 +56312,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -55959,7 +56428,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -56009,7 +56481,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -56019,7 +56491,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -56045,6 +56517,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -56160,7 +56633,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -56210,7 +56686,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -56220,7 +56696,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -56246,6 +56722,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -56336,7 +56813,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -56386,7 +56866,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -56396,7 +56876,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -56422,6 +56902,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular diff --git a/x/sp/keeper/grpc_query.go b/x/sp/keeper/grpc_query.go index 1fe961ee1..63e103fb8 100644 --- a/x/sp/keeper/grpc_query.go +++ b/x/sp/keeper/grpc_query.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "math/rand" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" @@ -31,6 +32,10 @@ func (k Keeper) StorageProviders(goCtx context.Context, req *types.QueryStorageP return nil, status.Error(codes.Internal, err.Error()) } + rand.Shuffle(len(sps), func(i, j int) { + sps[i], sps[j] = sps[j], sps[i] + }) + return &types.QueryStorageProvidersResponse{Sps: sps, Pagination: pageRes}, nil } diff --git a/x/sp/keeper/sp_status.go b/x/sp/keeper/sp_status.go index 0a7359a6a..32b3f94a5 100644 --- a/x/sp/keeper/sp_status.go +++ b/x/sp/keeper/sp_status.go @@ -89,6 +89,12 @@ func (k Keeper) ForceUpdateMaintenanceRecords(ctx sdk.Context) { sp.Status = types.STATUS_IN_SERVICE k.SetStorageProvider(ctx, sp) changed = true + _ = ctx.EventManager().EmitTypedEvents(&types.EventUpdateStorageProviderStatus{ + SpId: sp.Id, + SpAddress: sp.OperatorAddress, + PreStatus: types.STATUS_IN_MAINTENANCE.String(), + NewStatus: types.STATUS_IN_SERVICE.String(), + }) } } } diff --git a/x/storage/keeper/keeper.go b/x/storage/keeper/keeper.go index ba8033826..6e7c4f2c2 100644 --- a/x/storage/keeper/keeper.go +++ b/x/storage/keeper/keeper.go @@ -569,7 +569,6 @@ func (k Keeper) CreateObject( operator.String(), bucketName) } - // We use the last address in SecondarySpAddresses to store the creator so that it can be identified when canceling create var creator sdk.AccAddress if !operator.Equals(sdk.MustAccAddressFromHex(bucketInfo.Owner)) { creator = operator diff --git a/x/virtualgroup/keeper/keeper.go b/x/virtualgroup/keeper/keeper.go index 6cded1b3b..c325bc1c1 100644 --- a/x/virtualgroup/keeper/keeper.go +++ b/x/virtualgroup/keeper/keeper.go @@ -29,6 +29,7 @@ type ( accountKeeper types.AccountKeeper bankKeeper types.BankKeeper paymentKeeper types.PaymentKeeper + storageKeeper types.StorageKeeper // sequence gvgSequence sequence.Sequence[uint32] gvgFamilySequence sequence.Sequence[uint32] @@ -63,6 +64,10 @@ func NewKeeper( return &k } +func (k *Keeper) SetStorageKeeper(storageKeeper types.StorageKeeper) { + k.storageKeeper = storageKeeper +} + func (k Keeper) GetAuthority() string { return k.authority } diff --git a/x/virtualgroup/keeper/msg_server.go b/x/virtualgroup/keeper/msg_server.go index 2d5f9ceac..94726bd8a 100644 --- a/x/virtualgroup/keeper/msg_server.go +++ b/x/virtualgroup/keeper/msg_server.go @@ -53,6 +53,20 @@ func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParam func (k msgServer) CreateGlobalVirtualGroup(goCtx context.Context, req *types.MsgCreateGlobalVirtualGroup) (*types.MsgCreateGlobalVirtualGroupResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + if ctx.IsUpgraded(upgradetypes.Pampas) { + expectSecondarySPNum := int(k.storageKeeper.GetExpectSecondarySPNumForECObject(ctx, ctx.BlockTime().Unix())) + if len(req.GetSecondarySpIds()) != expectSecondarySPNum { + return nil, types.ErrInvalidSecondarySPCount.Wrapf("the number of secondary sp in the Global virtual group should be %d", expectSecondarySPNum) + } + spIdSet := make(map[uint32]struct{}, len(req.GetSecondarySpIds())) + for _, spId := range req.GetSecondarySpIds() { + if _, ok := spIdSet[spId]; ok { + return nil, types.ErrDuplicateSecondarySP.Wrapf("the SP(id=%d) is duplicate in the Global virtual group.", spId) + } + spIdSet[spId] = struct{}{} + } + } + var gvgStatisticsWithinSPs []*types.GVGStatisticsWithinSP spOperatorAddr := sdk.MustAccAddressFromHex(req.StorageProvider) diff --git a/x/virtualgroup/types/errors.go b/x/virtualgroup/types/errors.go index a16c2ca9e..6f5e85f98 100644 --- a/x/virtualgroup/types/errors.go +++ b/x/virtualgroup/types/errors.go @@ -6,21 +6,22 @@ import ( // x/virtualgroup module sentinel errors var ( - ErrGVGFamilyNotExist = errors.Register(ModuleName, 1100, "global virtual group family not exist.") - ErrGVGNotExistInFamily = errors.Register(ModuleName, 1101, "global virtual group not exist in family.") - ErrGVGNotExist = errors.Register(ModuleName, 1102, "global virtual group not exist.") - ErrGVGNotEmpty = errors.Register(ModuleName, 1103, "the store size of gvg is not zero") - ErrGenSequenceIDError = errors.Register(ModuleName, 1104, "generate sequence id error.") - ErrWithdrawAmountTooLarge = errors.Register(ModuleName, 1105, "withdrawal amount is too large.") - ErrSwapOutFailed = errors.Register(ModuleName, 1106, "swap out failed.") - ErrLVGNotExist = errors.Register(ModuleName, 1107, "local virtual group not exist.") - ErrSPCanNotExit = errors.Register(ModuleName, 1108, "the sp can not exit now.") - ErrSettleFailed = errors.Register(ModuleName, 1109, "fail to settle.") - ErrInvalidGVGCount = errors.Register(ModuleName, 1120, "the count of global virtual group ids is invalid.") - ErrWithdrawFailed = errors.Register(ModuleName, 1121, "with draw failed.") - - ErrLimitationExceed = errors.Register(ModuleName, 1123, "limitation exceed.") - ErrInsufficientStaking = errors.Register(ModuleName, 1125, "insufficient staking for gvg") + ErrGVGFamilyNotExist = errors.Register(ModuleName, 1100, "global virtual group family not exist.") + ErrGVGNotExistInFamily = errors.Register(ModuleName, 1101, "global virtual group not exist in family.") + ErrGVGNotExist = errors.Register(ModuleName, 1102, "global virtual group not exist.") + ErrGVGNotEmpty = errors.Register(ModuleName, 1103, "the store size of gvg is not zero") + ErrGenSequenceIDError = errors.Register(ModuleName, 1104, "generate sequence id error.") + ErrWithdrawAmountTooLarge = errors.Register(ModuleName, 1105, "withdrawal amount is too large.") + ErrSwapOutFailed = errors.Register(ModuleName, 1106, "swap out failed.") + ErrLVGNotExist = errors.Register(ModuleName, 1107, "local virtual group not exist.") + ErrSPCanNotExit = errors.Register(ModuleName, 1108, "the sp can not exit now.") + ErrSettleFailed = errors.Register(ModuleName, 1109, "fail to settle.") + ErrInvalidGVGCount = errors.Register(ModuleName, 1120, "the count of global virtual group ids is invalid.") + ErrWithdrawFailed = errors.Register(ModuleName, 1121, "with draw failed.") + ErrInvalidSecondarySPCount = errors.Register(ModuleName, 1122, "the number of secondary sp within the global virtual group is invalid.") + 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") ErrInvalidDenom = errors.Register(ModuleName, 2000, "Invalid denom.") ) diff --git a/x/virtualgroup/types/expected_keepers.go b/x/virtualgroup/types/expected_keepers.go index 9018acfda..240915cb7 100644 --- a/x/virtualgroup/types/expected_keepers.go +++ b/x/virtualgroup/types/expected_keepers.go @@ -44,3 +44,7 @@ type PaymentKeeper interface { Withdraw(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amount sdkmath.Int) error IsEmptyNetFlow(ctx sdk.Context, account sdk.AccAddress) bool } + +type StorageKeeper interface { + GetExpectSecondarySPNumForECObject(ctx sdk.Context, time int64) (res uint32) +} diff --git a/x/virtualgroup/types/expected_keepers_mocks.go b/x/virtualgroup/types/expected_keepers_mocks.go index 1377f7c0a..eacf13dd3 100644 --- a/x/virtualgroup/types/expected_keepers_mocks.go +++ b/x/virtualgroup/types/expected_keepers_mocks.go @@ -46,7 +46,7 @@ func (m *MockSpKeeper) DepositDenomForSP(ctx types0.Context) string { } // DepositDenomForSP indicates an expected call of DepositDenomForSP. -func (mr *MockSpKeeperMockRecorder) DepositDenomForSP(ctx interface{}) *gomock.Call { +func (mr *MockSpKeeperMockRecorder) DepositDenomForSP(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DepositDenomForSP", reflect.TypeOf((*MockSpKeeper)(nil).DepositDenomForSP), ctx) } @@ -60,7 +60,7 @@ func (m *MockSpKeeper) Exit(ctx types0.Context, sp *types.StorageProvider) error } // Exit indicates an expected call of Exit. -func (mr *MockSpKeeperMockRecorder) Exit(ctx, sp interface{}) *gomock.Call { +func (mr *MockSpKeeperMockRecorder) Exit(ctx, sp any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exit", reflect.TypeOf((*MockSpKeeper)(nil).Exit), ctx, sp) } @@ -75,7 +75,7 @@ func (m *MockSpKeeper) GetStorageProvider(ctx types0.Context, id uint32) (*types } // GetStorageProvider indicates an expected call of GetStorageProvider. -func (mr *MockSpKeeperMockRecorder) GetStorageProvider(ctx, id interface{}) *gomock.Call { +func (mr *MockSpKeeperMockRecorder) GetStorageProvider(ctx, id any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageProvider", reflect.TypeOf((*MockSpKeeper)(nil).GetStorageProvider), ctx, id) } @@ -90,7 +90,7 @@ func (m *MockSpKeeper) GetStorageProviderByFundingAddr(ctx types0.Context, sealA } // GetStorageProviderByFundingAddr indicates an expected call of GetStorageProviderByFundingAddr. -func (mr *MockSpKeeperMockRecorder) GetStorageProviderByFundingAddr(ctx, sealAddr interface{}) *gomock.Call { +func (mr *MockSpKeeperMockRecorder) GetStorageProviderByFundingAddr(ctx, sealAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageProviderByFundingAddr", reflect.TypeOf((*MockSpKeeper)(nil).GetStorageProviderByFundingAddr), ctx, sealAddr) } @@ -105,7 +105,7 @@ func (m *MockSpKeeper) GetStorageProviderByOperatorAddr(ctx types0.Context, addr } // GetStorageProviderByOperatorAddr indicates an expected call of GetStorageProviderByOperatorAddr. -func (mr *MockSpKeeperMockRecorder) GetStorageProviderByOperatorAddr(ctx, addr interface{}) *gomock.Call { +func (mr *MockSpKeeperMockRecorder) GetStorageProviderByOperatorAddr(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageProviderByOperatorAddr", reflect.TypeOf((*MockSpKeeper)(nil).GetStorageProviderByOperatorAddr), ctx, addr) } @@ -117,7 +117,7 @@ func (m *MockSpKeeper) SetStorageProvider(ctx types0.Context, sp *types.StorageP } // SetStorageProvider indicates an expected call of SetStorageProvider. -func (mr *MockSpKeeperMockRecorder) SetStorageProvider(ctx, sp interface{}) *gomock.Call { +func (mr *MockSpKeeperMockRecorder) SetStorageProvider(ctx, sp any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetStorageProvider", reflect.TypeOf((*MockSpKeeper)(nil).SetStorageProvider), ctx, sp) } @@ -154,7 +154,7 @@ func (m *MockAccountKeeper) GetAccount(ctx types0.Context, addr types0.AccAddres } // GetAccount indicates an expected call of GetAccount. -func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) } @@ -168,7 +168,7 @@ func (m *MockAccountKeeper) GetModuleAccount(ctx types0.Context, moduleName stri } // GetModuleAccount indicates an expected call of GetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, moduleName) } @@ -182,7 +182,7 @@ func (m *MockAccountKeeper) GetModuleAddress(name string) types0.AccAddress { } // GetModuleAddress indicates an expected call of GetModuleAddress. -func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), name) } @@ -194,7 +194,7 @@ func (m *MockAccountKeeper) IterateAccounts(ctx types0.Context, process func(typ } // IterateAccounts indicates an expected call of IterateAccounts. -func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).IterateAccounts), ctx, process) } @@ -206,7 +206,7 @@ func (m *MockAccountKeeper) SetModuleAccount(arg0 types0.Context, arg1 types1.Mo } // SetModuleAccount indicates an expected call of SetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetModuleAccount), arg0, arg1) } @@ -243,7 +243,7 @@ func (m *MockBankKeeper) GetAllBalances(ctx types0.Context, addr types0.AccAddre } // GetAllBalances indicates an expected call of GetAllBalances. -func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr) } @@ -257,7 +257,7 @@ func (m *MockBankKeeper) GetBalance(ctx types0.Context, addr types0.AccAddress, } // GetBalance indicates an expected call of GetBalance. -func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBalance", reflect.TypeOf((*MockBankKeeper)(nil).GetBalance), ctx, addr, denom) } @@ -271,7 +271,7 @@ func (m *MockBankKeeper) LockedCoins(ctx types0.Context, addr types0.AccAddress) } // LockedCoins indicates an expected call of LockedCoins. -func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LockedCoins", reflect.TypeOf((*MockBankKeeper)(nil).LockedCoins), ctx, addr) } @@ -285,7 +285,7 @@ func (m *MockBankKeeper) SendCoins(ctx types0.Context, fromAddr, toAddr types0.A } // SendCoins indicates an expected call of SendCoins. -func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) } @@ -299,7 +299,7 @@ func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx types0.Context, sender } // SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) } @@ -313,7 +313,7 @@ func (m *MockBankKeeper) SendCoinsFromModuleToAccount(ctx types0.Context, sender } // SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } @@ -327,7 +327,7 @@ func (m *MockBankKeeper) SpendableCoins(ctx types0.Context, addr types0.AccAddre } // SpendableCoins indicates an expected call of SpendableCoins. -func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } @@ -364,7 +364,7 @@ func (m *MockPaymentKeeper) IsEmptyNetFlow(ctx types0.Context, account types0.Ac } // IsEmptyNetFlow indicates an expected call of IsEmptyNetFlow. -func (mr *MockPaymentKeeperMockRecorder) IsEmptyNetFlow(ctx, account interface{}) *gomock.Call { +func (mr *MockPaymentKeeperMockRecorder) IsEmptyNetFlow(ctx, account any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsEmptyNetFlow", reflect.TypeOf((*MockPaymentKeeper)(nil).IsEmptyNetFlow), ctx, account) } @@ -379,7 +379,7 @@ func (m *MockPaymentKeeper) QueryDynamicBalance(ctx types0.Context, addr types0. } // QueryDynamicBalance indicates an expected call of QueryDynamicBalance. -func (mr *MockPaymentKeeperMockRecorder) QueryDynamicBalance(ctx, addr interface{}) *gomock.Call { +func (mr *MockPaymentKeeperMockRecorder) QueryDynamicBalance(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryDynamicBalance", reflect.TypeOf((*MockPaymentKeeper)(nil).QueryDynamicBalance), ctx, addr) } @@ -393,7 +393,44 @@ func (m *MockPaymentKeeper) Withdraw(ctx types0.Context, fromAddr, toAddr types0 } // Withdraw indicates an expected call of Withdraw. -func (mr *MockPaymentKeeperMockRecorder) Withdraw(ctx, fromAddr, toAddr, amount interface{}) *gomock.Call { +func (mr *MockPaymentKeeperMockRecorder) Withdraw(ctx, fromAddr, toAddr, amount any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Withdraw", reflect.TypeOf((*MockPaymentKeeper)(nil).Withdraw), ctx, fromAddr, toAddr, amount) } + +// MockStorageKeeper is a mock of StorageKeeper interface. +type MockStorageKeeper struct { + ctrl *gomock.Controller + recorder *MockStorageKeeperMockRecorder +} + +// MockStorageKeeperMockRecorder is the mock recorder for MockStorageKeeper. +type MockStorageKeeperMockRecorder struct { + mock *MockStorageKeeper +} + +// NewMockStorageKeeper creates a new mock instance. +func NewMockStorageKeeper(ctrl *gomock.Controller) *MockStorageKeeper { + mock := &MockStorageKeeper{ctrl: ctrl} + mock.recorder = &MockStorageKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockStorageKeeper) EXPECT() *MockStorageKeeperMockRecorder { + return m.recorder +} + +// GetExpectSecondarySPNumForECObject mocks base method. +func (m *MockStorageKeeper) GetExpectSecondarySPNumForECObject(ctx types0.Context, time int64) uint32 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetExpectSecondarySPNumForECObject", ctx, time) + ret0, _ := ret[0].(uint32) + return ret0 +} + +// GetExpectSecondarySPNumForECObject indicates an expected call of GetExpectSecondarySPNumForECObject. +func (mr *MockStorageKeeperMockRecorder) GetExpectSecondarySPNumForECObject(ctx, time any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExpectSecondarySPNumForECObject", reflect.TypeOf((*MockStorageKeeper)(nil).GetExpectSecondarySPNumForECObject), ctx, time) +}