From c74e2548236ab996f31d2c2408e2d46f9b317dd7 Mon Sep 17 00:00:00 2001 From: Clyde Date: Mon, 11 Dec 2023 16:45:33 +0800 Subject: [PATCH 1/2] feat: add proto message info to ObjectDetail type so that it can be marshalled into json by using jsonpb --- types/types.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/types/types.go b/types/types.go index 2194e4b6..0f6c03b0 100644 --- a/types/types.go +++ b/types/types.go @@ -6,10 +6,11 @@ import ( "net/url" "time" + sdk "github.com/cosmos/cosmos-sdk/types" + 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") @@ -27,8 +28,8 @@ 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"` } // QueryPieceInfo indicates the challenge or recovery object piece info. From 31f6ba42ee34deae4ca8bb9c661f19d6211c975a Mon Sep 17 00:00:00 2001 From: Clyde Date: Mon, 11 Dec 2023 16:57:29 +0800 Subject: [PATCH 2/2] feat: add proto message info to ObjectDetail type so that it can be marshalled into json by using jsonpb --- .github/workflows/e2e.yml | 2 +- types/types.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 31d8c4b3..4effe535 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -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 diff --git a/types/types.go b/types/types.go index 0f6c03b0..27a9da77 100644 --- a/types/types.go +++ b/types/types.go @@ -7,6 +7,7 @@ import ( "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" @@ -32,6 +33,10 @@ type ObjectDetail struct { 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 {