Skip to content

Commit

Permalink
fix: replace picking strategy (#241)
Browse files Browse the repository at this point in the history
* fix: replace picking strategy

* fix: update to 1.6.1
  • Loading branch information
BarryTong65 committed Apr 18, 2024
1 parent 821b68c commit d6e82f8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/api_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (c *Client) CreateBucket(ctx context.Context, bucketName string, primaryAdd
return "", err
}

familyID, err := c.QuerySpOptimalGlobalVirtualGroupFamily(ctx, sp.Id, virtualgroupTypes.Strategy_Maximize_Free_Store_Size)
familyID, err := c.QuerySpOptimalGlobalVirtualGroupFamily(ctx, sp.Id, virtualgroupTypes.Strategy_Oldest_Create_Time)
if err != nil {
log.Error().Msg(fmt.Sprintf("failed to query sp ptimal vgf: %s", err.Error()))
var signedMsg *storageTypes.MsgCreateBucket
Expand Down
3 changes: 2 additions & 1 deletion client/api_virtual_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ func (c *Client) QuerySpAvailableGlobalVirtualGroupFamilies(ctx context.Context,
// - ret2: Return error when the request failed, otherwise return nil.
func (c *Client) QuerySpOptimalGlobalVirtualGroupFamily(ctx context.Context, spID uint32, strategy types.PickVGFStrategy) (uint32, error) {
queryResponse, err := c.chainClient.QuerySpOptimalGlobalVirtualGroupFamily(ctx, &types.QuerySpOptimalGlobalVirtualGroupFamilyRequest{
SpId: spID,
SpId: spID,
PickVgfStrategy: strategy,
})
if err != nil {
return 0, err
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
cosmossdk.io/errors v1.0.0-beta.7
cosmossdk.io/math v1.0.1
github.com/bnb-chain/greenfield v1.6.0
github.com/bnb-chain/greenfield v1.6.1
github.com/bnb-chain/greenfield-common/go v0.0.0-20240410092538-5e3891943cbb
github.com/cometbft/cometbft v0.37.2
github.com/consensys/gnark-crypto v0.7.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s=
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c=
github.com/bnb-chain/greenfield v1.6.0 h1:AAEJjtwED6XVckPRqMSa6nUciEeBNszeJhNiO/2KNiE=
github.com/bnb-chain/greenfield v1.6.0/go.mod h1:KCjy1bsc5q2G4IjyhKX0r3BQM+4rooZ1/fNnGlq8o3I=
github.com/bnb-chain/greenfield v1.6.1 h1:4MqLVBwv8igCE9EipVS2AUbl+JzljLCg1tA28nfmm6g=
github.com/bnb-chain/greenfield v1.6.1/go.mod h1:KCjy1bsc5q2G4IjyhKX0r3BQM+4rooZ1/fNnGlq8o3I=
github.com/bnb-chain/greenfield-cometbft v1.2.0 h1:LTStppZS9WkVj0TfEYKkk5OAQDGfYlUefWByr7Zr018=
github.com/bnb-chain/greenfield-cometbft v1.2.0/go.mod h1:WVOEZ59UYM2XePQH47/IQfcInspDn8wbRXhFSJrbU1c=
github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU=
Expand Down

0 comments on commit d6e82f8

Please sign in to comment.