Skip to content

Commit

Permalink
Merge pull request #143 from bnb-chain/develop
Browse files Browse the repository at this point in the history
release: draft release v0.0.11
  • Loading branch information
pythonberg1997 authored Mar 28, 2023
2 parents 72baa3a + fca2f6a commit 6db815b
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 14 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Changelog
## v0.0.11
* [\#140](https://github.com/bnb-chain/greenfield/pull/140) fix: `Visibility` type in `CreateBucketSynPackage`
* [\#139](https://github.com/bnb-chain/greenfield/pull/139) fix: payment queries

## v0.0.10
* [\#136](https://github.com/bnb-chain/greenfield/pull/136)fix: forbid a stream account with negative static balance to pay
* [\#135](https://github.com/bnb-chain/greenfield/pull/135)modify default to inherit
* [\#136](https://github.com/bnb-chain/greenfield/pull/136) fix: forbid a stream account with negative static balance to pay
* [\#135](https://github.com/bnb-chain/greenfield/pull/135) modify default to inherit
* [\#132](https://github.com/bnb-chain/greenfield/pull/132) feat: allow unordered attestations
* [\#131](https://github.com/bnb-chain/greenfield/pull/131) feat: support delete bucket with non-zero charged read quota
* [\#108](https://github.com/bnb-chain/greenfield/pull/108) chore: refine storage module
Expand Down
7 changes: 7 additions & 0 deletions e2e/tests/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,13 @@ func (s *StorageTestSuite) TestPayment_Smoke() {
s.Require().Equal(userOutflowMap[secondarySpAddr].String(), secondaryStorePrice.MulInt(sdk.NewIntFromUint64(chargeSize)).TruncateInt().String())
}

// test query auto settle records
queryAllAutoSettleRecordRequest := paymenttypes.QueryAllAutoSettleRecordRequest{}
queryAllAutoSettleRecordResponse, err := s.Client.AutoSettleRecordAll(ctx, &queryAllAutoSettleRecordRequest)
s.Require().NoError(err)
s.T().Logf("queryAllAutoSettleRecordResponse %s", core.YamlString(queryAllAutoSettleRecordResponse))
s.Require().True(len(queryAllAutoSettleRecordResponse.AutoSettleRecord) >= 1)

// change read quota

// delete object
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ require (
replace (
cosmossdk.io/math => github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230228075616-68ac309b432c
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 v0.0.13
github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.0.14
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/tendermint/tendermint => github.com/bnb-chain/greenfield-tendermint v0.0.3
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdn
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c=
github.com/bnb-chain/greenfield-cosmos-sdk v0.0.13 h1:xm9qqrOjrGfX4imXxxruHIpuUUUAFbdtM/TXPXRc5zo=
github.com/bnb-chain/greenfield-cosmos-sdk v0.0.13/go.mod h1:rvAY7ga/AakZWyYkA1zAsNtvKpdoyRFZTqF4MhFYzZ8=
github.com/bnb-chain/greenfield-cosmos-sdk v0.0.14 h1:57q0qusqgA3bhzVGo4hXHHXYpWlXRFYfg/dP3Y7BUfs=
github.com/bnb-chain/greenfield-cosmos-sdk v0.0.14/go.mod h1:rvAY7ga/AakZWyYkA1zAsNtvKpdoyRFZTqF4MhFYzZ8=
github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230228075616-68ac309b432c h1:BLmdYaj7Dx0YOhfk77+KPPJSMCwpQl6f4Y30+801bf0=
github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230228075616-68ac309b432c/go.mod h1:u/MXvf8wbUbCsAEyQSSYXXMsczAsFX48e2D6JI86T4o=
github.com/bnb-chain/greenfield-tendermint v0.0.3 h1:oWD58n7U5phHpVyfnezhg6WBxITRQpRwOWOhKDQ/kVE=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ func (k Keeper) AutoSettleRecordAll(c context.Context, req *types.QueryAllAutoSe
autoSettleRecordStore := prefix.NewStore(store, types.AutoSettleRecordKeyPrefix)

pageRes, err := query.Paginate(autoSettleRecordStore, req.Pagination, func(key []byte, value []byte) error {
var autoSettleRecord types.AutoSettleRecord
if err := k.cdc.Unmarshal(value, &autoSettleRecord); err != nil {
return err
}

autoSettleRecord := types.ParseAutoSettleRecordKey(key)
autoSettleRecords = append(autoSettleRecords, autoSettleRecord)
return nil
})
Expand Down
1 change: 1 addition & 0 deletions x/payment/keeper/grpc_query_payment_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func (k Keeper) PaymentAccountAll(c context.Context, req *types.QueryAllPaymentA
if err := k.cdc.Unmarshal(value, &paymentAccount); err != nil {
return err
}
paymentAccount.Addr = sdk.AccAddress(key).String()

paymentAccounts = append(paymentAccounts, paymentAccount)
return nil
Expand Down
1 change: 1 addition & 0 deletions x/payment/keeper/grpc_query_payment_account_count.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func (k Keeper) PaymentAccountCountAll(c context.Context, req *types.QueryAllPay
if err := k.cdc.Unmarshal(value, &paymentAccountCount); err != nil {
return err
}
paymentAccountCount.Owner = sdk.AccAddress(key).String()

paymentAccountCounts = append(paymentAccountCounts, paymentAccountCount)
return nil
Expand Down
1 change: 1 addition & 0 deletions x/payment/keeper/grpc_query_stream_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func (k Keeper) StreamRecordAll(c context.Context, req *types.QueryAllStreamReco
if err := k.cdc.Unmarshal(value, &streamRecord); err != nil {
return err
}
streamRecord.Account = sdk.AccAddress(key).String()

streamRecords = append(streamRecords, streamRecord)
return nil
Expand Down
2 changes: 1 addition & 1 deletion x/storage/keeper/cross_app_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func (app *BucketApp) handleCreateBucketSynPackage(ctx sdk.Context, appCtx *sdk.
createBucketPackage.BucketName,
createBucketPackage.PrimarySpAddress,
&CreateBucketOptions{
Visibility: createBucketPackage.Visibility,
Visibility: types.VisibilityType(createBucketPackage.Visibility),
SourceType: types.SOURCE_TYPE_BSC_CROSS_CHAIN,
ChargedReadQuota: createBucketPackage.ChargedReadQuota,
PaymentAddress: createBucketPackage.PaymentAddress.String(),
Expand Down
6 changes: 3 additions & 3 deletions x/storage/types/crosschain.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func DeserializeMirrorGroupAckPackage(serializedPackage []byte) (interface{}, er
type CreateBucketSynPackage struct {
Creator sdk.AccAddress
BucketName string
Visibility VisibilityType
Visibility uint32
PaymentAddress sdk.AccAddress
PrimarySpAddress sdk.AccAddress
PrimarySpApprovalExpiredHeight uint64
Expand All @@ -239,7 +239,7 @@ func (p CreateBucketSynPackage) ValidateBasic() error {
msg := MsgCreateBucket{
Creator: p.Creator.String(),
BucketName: p.BucketName,
Visibility: p.Visibility,
Visibility: VisibilityType(p.Visibility),
PaymentAddress: p.PaymentAddress.String(),
PrimarySpAddress: p.PrimarySpAddress.String(),
PrimarySpApproval: &Approval{
Expand All @@ -256,7 +256,7 @@ func (p CreateBucketSynPackage) GetApprovalBytes() []byte {
msg := MsgCreateBucket{
Creator: p.Creator.String(),
BucketName: p.BucketName,
Visibility: p.Visibility,
Visibility: VisibilityType(p.Visibility),
PaymentAddress: p.PaymentAddress.String(),
PrimarySpAddress: p.PrimarySpAddress.String(),
PrimarySpApproval: &Approval{
Expand Down

0 comments on commit 6db815b

Please sign in to comment.