Skip to content

Commit

Permalink
Merge pull request #137 from bnb-chain/develop
Browse files Browse the repository at this point in the history
release: prepare for release v0.2.3
  • Loading branch information
unclezoro authored Jul 31, 2023
2 parents 2766c09 + 3c69c3a commit 5de6de9
Show file tree
Hide file tree
Showing 12 changed files with 220 additions and 180 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
- develop

env:
GreenfieldTag: v0.2.3-alpha.6
GreenfieldStorageProviderTag: v0.2.3-alpha.8
GreenfieldTag: v0.2.3
GreenfieldStorageProviderTag: v0.2.3-alpha.18
GOPRIVATE: github.com/bnb-chain
GH_ACCESS_TOKEN: ${{ secrets.GH_TOKEN }}
MYSQL_USER: root
Expand All @@ -26,7 +26,7 @@ jobs:
end-to-end-test:
strategy:
matrix:
go-version: [1.19.x]
go-version: [1.20.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gosec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: gosec
strategy:
matrix:
go-version: [1.19.x]
go-version: [1.20.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: golangci-lint
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [1.20.x]
os: [ ubuntu-20.04 ]
runs-on: ${{ matrix.os }}
env:
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ replace dependencies
```go.mod
cosmossdk.io/api => github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230425074444-eb5869b05fe9
cosmossdk.io/math => github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230425074444-eb5869b05fe9
github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.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 v0.2.1
github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.2
github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1
github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3
github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1-alpha.1
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
```

### Initialize Client
Expand Down
9 changes: 6 additions & 3 deletions client/api_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type Bucket interface {
// userAddr indicates the HEX-encoded string of the user address
IsBucketPermissionAllowed(ctx context.Context, userAddr string, bucketName string, action permTypes.ActionType) (permTypes.Effect, error)

ListBuckets(ctx context.Context, opts types.EndPointOptions) (types.ListBucketsResult, error)
ListBuckets(ctx context.Context, opts types.ListBucketsOptions) (types.ListBucketsResult, error)
ListBucketReadRecord(ctx context.Context, bucketName string, opts types.ListReadRecordOptions) (types.QuotaRecordInfo, error)

BuyQuotaForBucket(ctx context.Context, bucketName string, targetQuota uint64, opt types.BuyQuotaOption) (string, error)
Expand Down Expand Up @@ -371,8 +371,11 @@ func (c *client) GetBucketPolicy(ctx context.Context, bucketName string, princip
}

// ListBuckets list buckets for the owner
func (c *client) ListBuckets(ctx context.Context, opts types.EndPointOptions) (types.ListBucketsResult, error) {
func (c *client) ListBuckets(ctx context.Context, opts types.ListBucketsOptions) (types.ListBucketsResult, error) {
params := url.Values{}
params.Set("include-removed", strconv.FormatBool(opts.ShowRemovedBucket))
reqMeta := requestMeta{
urlValues: params,
contentSHA256: types.EmptyStringSHA256,
userAddress: c.MustGetDefaultAccount().GetAddress().String(),
}
Expand All @@ -382,7 +385,7 @@ func (c *client) ListBuckets(ctx context.Context, opts types.EndPointOptions) (t
disableCloseBody: true,
}

endpoint, err := c.getEndpointByOpt(&opts)
endpoint, err := c.getEndpointByOpt(opts.EndPointOptions)
if err != nil {
log.Error().Msg(fmt.Sprintf("get endpoint by option failed %s", err.Error()))
return types.ListBucketsResult{}, err
Expand Down
1 change: 1 addition & 0 deletions client/api_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ func (c *client) ListObjects(ctx context.Context, bucketName string, opts types.
params.Set("continuation-token", opts.ContinuationToken)
params.Set("delimiter", opts.Delimiter)
params.Set("prefix", opts.Prefix)
params.Set("include-removed", strconv.FormatBool(opts.ShowRemovedObject))
reqMeta := requestMeta{
urlValues: params,
bucketName: bucketName,
Expand Down
34 changes: 16 additions & 18 deletions e2e/e2e_migrate_bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,36 @@ import (
"bytes"
"fmt"
"io"
"testing"
"time"

"github.com/bnb-chain/greenfield-go-sdk/e2e/basesuite"
"github.com/bnb-chain/greenfield-go-sdk/types"
storageTestUtil "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"
"github.com/stretchr/testify/suite"
)

type BucketMigrateTestSuite struct {
basesuite.BaseSuite
PrimarySP spTypes.StorageProvider
}

func (s *BucketMigrateTestSuite) SetupSuite() {
s.BaseSuite.SetupSuite()

spList, err := s.Client.ListStorageProviders(s.ClientContext, false)
s.Require().NoError(err)
for _, sp := range spList {
if sp.Endpoint != "https://sp0.greenfield.io" {
s.PrimarySP = sp
break
}
}
}

func TestBucketMigrateTestSuiteTestSuite(t *testing.T) {
suite.Run(t, new(BucketMigrateTestSuite))
}
//func (s *BucketMigrateTestSuite) SetupSuite() {
// s.BaseSuite.SetupSuite()
//
// spList, err := s.Client.ListStorageProviders(s.ClientContext, false)
// s.Require().NoError(err)
// for _, sp := range spList {
// if sp.Endpoint != "https://sp0.greenfield.io" {
// s.PrimarySP = sp
// break
// }
// }
//}

//func TestBucketMigrateTestSuiteTestSuite(t *testing.T) {
// suite.Run(t, new(BucketMigrateTestSuite))
//}

func (s *BucketMigrateTestSuite) CreateObjects(bucketName string, count int) ([]*types.ObjectDetail, []bytes.Buffer, error) {
var (
Expand Down
Loading

0 comments on commit 5de6de9

Please sign in to comment.