Skip to content

Commit

Permalink
Merge pull request #216 from bnb-chain/feat-add-pbinfo
Browse files Browse the repository at this point in the history
feat: add proto message info to ObjectDetail type so that it can be marshalled into json by using jsonpb
  • Loading branch information
unclezoro authored Dec 12, 2023
2 parents e8d62ae + 31f6ba4 commit 695488d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

env:
GreenfieldTag: develop
GreenfieldStorageProviderTag: feat-add-tags
GreenfieldStorageProviderTag: develop
GOPRIVATE: github.com/bnb-chain
GH_ACCESS_TOKEN: ${{ secrets.GH_TOKEN }}
MYSQL_USER: root
Expand Down
12 changes: 9 additions & 3 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import (
"net/url"
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
proto "github.com/cosmos/gogoproto/proto"

spTypes "github.com/bnb-chain/greenfield/x/sp/types"
storagetypes "github.com/bnb-chain/greenfield/x/storage/types"
"github.com/bnb-chain/greenfield/x/virtualgroup/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
Expand All @@ -27,10 +29,14 @@ type ObjectStat struct {

// ObjectDetail contains the detailed info of the object stored on Greenfield.
type ObjectDetail struct {
ObjectInfo *storagetypes.ObjectInfo
GlobalVirtualGroup *types.GlobalVirtualGroup
ObjectInfo *storagetypes.ObjectInfo `protobuf:"bytes,1,opt,name=object_info" json:"object_info,omitempty"`
GlobalVirtualGroup *types.GlobalVirtualGroup `protobuf:"bytes,2,opt,name=global_virtual_group" json:"global_virtual_group,omitempty"`
}

func (m *ObjectDetail) ProtoMessage() {}
func (m *ObjectDetail) Reset() { *m = ObjectDetail{} }
func (m *ObjectDetail) String() string { return proto.CompactTextString(m) }

// QueryPieceInfo indicates the challenge or recovery object piece info.
// If it is primary sp, the RedundancyIndex value should be -1, else it indicates the index of secondary sp.
type QueryPieceInfo struct {
Expand Down

0 comments on commit 695488d

Please sign in to comment.