Skip to content

Commit

Permalink
refactor: group member's expiration time process flow
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Aug 7, 2023
1 parent db49149 commit 1f99784
Show file tree
Hide file tree
Showing 23 changed files with 558 additions and 856 deletions.
8 changes: 5 additions & 3 deletions deployment/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ bash ./deployment/localup/localup.sh stop
VALIDATOR=$(./build/bin/gnfd keys show validator0 -a --home ./deployment/localup/.local/validator0 --keyring-backend test)
GROUP_NAME="admin2"

./build/bin/gnfd tx storage create-group $GROUP_NAME --members "0xfABDd8b607201667fE54054CB4AD9068Afa2993e,0xC6D661d5Ee633eA3DfD4D86f368cdd839D682D18,0xba8dde27ddc0f39041a1d9a4efd24b5b5d81fe17" --from validator0 --home ./deployment/localup/.local/validator0 --keyring-backend test --node http://localhost:26750 -b sync
./build/bin/gnfd tx storage create-group $GROUP_NAME --from validator0 --home ./deployment/localup/.local/validator0 --keyring-backend test --node http://localhost:26750 -b sync

./build/bin/gnfd q storage head-group-member $VALIDATOR $GROUP_NAME 0xfABDd8b607201667fE54054CB4AD9068Afa2993e --node http://localhost:26750
./build/bin/gnfd tx storage update-group-member $GROUP_NAME "0xfABDd8b607201667fE54054CB4AD9068Afa2993e,0xba8dde27ddc0f39041a1d9a4efd24b5b5d81fe17" "1691118864,2691118864" "" --from validator0 --home ./deployment/localup/.local/validator0 --keyring-backend test --node http://localhost:26750 -b sync
./build/bin/gnfd tx storage renew-group-member $GROUP_NAME 0xfABDd8b607201667fE54054CB4AD9068Afa2993e 1791118864 --from validator0 --home ./deployment/localup/.local/validator0 --keyring-backend test --node http://localhost:26750 -b sync

./build/bin/gnfd tx storage renew-group-member $GROUP_NAME 0xfABDd8b607201667fE54054CB4AD9068Afa2993e 1691118864 --from validator0 --home ./deployment/localup/.local/validator0 --keyring-backend test --node http://localhost:26750 -b sync
./build/bin/gnfd q storage head-group-member $VALIDATOR $GROUP_NAME 0xfABDd8b607201667fE54054CB4AD9068Afa2993e --node http://localhost:26750
./build/bin/gnfd q storage head-group-member $VALIDATOR $GROUP_NAME 0xba8dde27ddc0f39041a1d9a4efd24b5b5d81fe17 --node http://localhost:26750

./build/bin/gnfd tx bank send validator0 0x32Ff14Fa1547314b95991976DB432F9Aa648A423 500000000000000000000BNB --home ./deployment/localup/.local/validator0 --keyring-backend test --node http://localhost:26750 -b sync
```
Expand Down
16 changes: 5 additions & 11 deletions e2e/tests/permission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ func (s *StorageTestSuite) TestGrantsPermissionToGroup() {

// Create Group
testGroupName := "testGroup"
msgCreateGroup := storagetypes.NewMsgCreateGroup(user[0].GetAddr(), testGroupName, []sdk.AccAddress{user[1].GetAddr()}, "")
msgCreateGroup := storagetypes.NewMsgCreateGroup(user[0].GetAddr(), testGroupName, "")
s.SendTxBlock(user[0], msgCreateGroup)

// Head Group
Expand Down Expand Up @@ -1168,9 +1168,7 @@ func (s *StorageTestSuite) TestDeleteGroupPolicy() {

// Create Group
testGroupName := "testGroup"
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), testGroupName,
[]sdk.AccAddress{user[1].GetAddr(), user[2].GetAddr(), user[3].GetAddr()},
"")
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), testGroupName, "")
s.SendTxBlock(owner, msgCreateGroup)

// Head Group
Expand Down Expand Up @@ -1219,7 +1217,7 @@ func (s *StorageTestSuite) TestStalePermissionForGroupGC() {

// Create Group
testGroupName := "testGroup"
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), testGroupName, []sdk.AccAddress{user[0].GetAddr(), user[1].GetAddr(), user[2].GetAddr()}, "")
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), testGroupName, "")
s.SendTxBlock(owner, msgCreateGroup)

// Head Group
Expand Down Expand Up @@ -1316,9 +1314,7 @@ func (s *StorageTestSuite) TestGroupMembersAndPolicyGC() {

// Create Group
testGroupName := "testGroup"
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), testGroupName,
[]sdk.AccAddress{user[1].GetAddr(), user[2].GetAddr(), user[3].GetAddr()},
"")
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), testGroupName, "")
s.SendTxBlock(owner, msgCreateGroup)

// Head Group
Expand Down Expand Up @@ -1489,9 +1485,7 @@ func (s *StorageTestSuite) TestUpdateGroupExtraWithPermission() {

// Create Group
testGroupName := "testGroup"
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), testGroupName,
[]sdk.AccAddress{user[1].GetAddr(), user[2].GetAddr(), user[3].GetAddr()},
"")
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), testGroupName, "")
s.SendTxBlock(owner, msgCreateGroup)

// Head Group
Expand Down
97 changes: 71 additions & 26 deletions e2e/tests/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (s *StorageTestSuite) TestCreateGroup() {
groupName := storageutils.GenRandomGroupName()

// 1. CreateGroup
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), groupName, []sdk.AccAddress{member.GetAddr()}, "")
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), groupName, "")
s.SendTxBlock(owner, msgCreateGroup)
s.T().Logf("CerateGroup success, owner: %s, group name: %s", owner.GetAddr().String(), groupName)

Expand All @@ -300,7 +300,14 @@ func (s *StorageTestSuite) TestCreateGroup() {
s.Require().NoError(err)
s.Require().GreaterOrEqual(len(queryListGroupResp.GroupInfos), 1)

// 3. HeadGroupMember
// 4. UpdateGroupMember(add)
membersToAdd := []*storagetypes.MsgGroupMember{
&storagetypes.MsgGroupMember{Member: member.GetAddr().String(), ExpirationTime: storagetypes.MaxTimeStamp}}

Check failure on line 305 in e2e/tests/storage_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint (1.20.x, ubuntu-latest)

File is not `gofmt`-ed with `-s` `-r 'a[b:len(a)] -> a[b:]'` (gofmt)
membersToDelete := []sdk.AccAddress{}
msgUpdateGroupMember := storagetypes.NewMsgUpdateGroupMember(owner.GetAddr(), owner.GetAddr(), groupName, membersToAdd, membersToDelete)
s.SendTxBlock(owner, msgUpdateGroupMember)

// 4-1. HeadGroupMember(add)
queryHeadGroupMemberReq := storagetypes.QueryHeadGroupMemberRequest{
Member: member.GetAddr().String(),
GroupName: groupName,
Expand All @@ -310,33 +317,25 @@ func (s *StorageTestSuite) TestCreateGroup() {
s.Require().NoError(err)
s.Require().Equal(queryHeadGroupMemberResp.GroupMember.GroupId, queryHeadGroupResp.GroupInfo.Id)

// 4. UpdateGroupMember
// 5. UpdateGroupMember(delete)
member2 := s.GenAndChargeAccounts(1, 1000000)[0]
membersToAdd := []sdk.AccAddress{member2.GetAddr()}
membersToDelete := []sdk.AccAddress{member.GetAddr()}
msgUpdateGroupMember := storagetypes.NewMsgUpdateGroupMember(owner.GetAddr(), owner.GetAddr(), groupName, membersToAdd, membersToDelete)
membersToAdd = []*storagetypes.MsgGroupMember{
&storagetypes.MsgGroupMember{Member: member2.GetAddr().String(), ExpirationTime: storagetypes.MaxTimeStamp}}
membersToDelete = []sdk.AccAddress{member.GetAddr()}
msgUpdateGroupMember = storagetypes.NewMsgUpdateGroupMember(owner.GetAddr(), owner.GetAddr(), groupName, membersToAdd, membersToDelete)
s.SendTxBlock(owner, msgUpdateGroupMember)

// 5. HeadGroupMember (delete)
// 5-1. HeadGroupMember (delete)
queryHeadGroupMemberReqDelete := storagetypes.QueryHeadGroupMemberRequest{
Member: member.GetAddr().String(),
GroupName: groupName,
GroupOwner: owner.GetAddr().String(),
}
_, err = s.Client.HeadGroupMember(ctx, &queryHeadGroupMemberReqDelete)
s.Require().True(strings.Contains(err.Error(), storagetypes.ErrNoSuchGroupMember.Error()))
// 5. HeadGroupMember (add)
queryHeadGroupMemberReqAdd := storagetypes.QueryHeadGroupMemberRequest{
Member: member2.GetAddr().String(),
GroupName: groupName,
GroupOwner: owner.GetAddr().String(),
}
queryHeadGroupMemberRespAdd, err := s.Client.HeadGroupMember(ctx, &queryHeadGroupMemberReqAdd)
s.Require().NoError(err)
s.Require().Equal(queryHeadGroupMemberRespAdd.GroupMember.GroupId, queryHeadGroupResp.GroupInfo.Id)

// 6. Create a group with the same name
msgCreateGroup = storagetypes.NewMsgCreateGroup(owner.GetAddr(), groupName, []sdk.AccAddress{member.GetAddr()}, "")
msgCreateGroup = storagetypes.NewMsgCreateGroup(owner.GetAddr(), groupName, "")
s.SendTxBlockWithExpectErrorString(msgCreateGroup, owner, "exists")
}

Expand All @@ -348,9 +347,14 @@ func (s *StorageTestSuite) TestLeaveGroup() {
groupName := storageutils.GenRandomGroupName()

// 1. CreateGroup
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), groupName, []sdk.AccAddress{member.GetAddr()}, "")
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), groupName, "")
s.SendTxBlock(owner, msgCreateGroup)
s.T().Logf("CerateGroup success, owner: %s, group name: %s", owner.GetAddr().String(), groupName)
membersToAdd := []*storagetypes.MsgGroupMember{
&storagetypes.MsgGroupMember{Member: member.GetAddr().String(), ExpirationTime: storagetypes.MaxTimeStamp}}
membersToDelete := []sdk.AccAddress{}
msgUpdateGroupMember := storagetypes.NewMsgUpdateGroupMember(owner.GetAddr(), owner.GetAddr(), groupName, membersToAdd, membersToDelete)
s.SendTxBlock(owner, msgUpdateGroupMember)

// 2. HeadGroup
queryHeadGroupReq := storagetypes.QueryHeadGroupRequest{GroupOwner: owner.GetAddr().String(), GroupName: groupName}
Expand Down Expand Up @@ -384,9 +388,10 @@ func (s *StorageTestSuite) TestLeaveGroup() {

// 4. UpdateGroupMember
member2 := s.GenAndChargeAccounts(1, 1000000)[0]
membersToAdd := []sdk.AccAddress{member2.GetAddr()}
membersToDelete := []sdk.AccAddress{member.GetAddr()}
msgUpdateGroupMember := storagetypes.NewMsgUpdateGroupMember(owner.GetAddr(), owner.GetAddr(), groupName, membersToAdd, membersToDelete)
membersToAdd = []*storagetypes.MsgGroupMember{
&storagetypes.MsgGroupMember{Member: member2.GetAddr().String(), ExpirationTime: storagetypes.MaxTimeStamp}}
membersToDelete = []sdk.AccAddress{member.GetAddr()}
msgUpdateGroupMember = storagetypes.NewMsgUpdateGroupMember(owner.GetAddr(), owner.GetAddr(), groupName, membersToAdd, membersToDelete)
s.SendTxBlock(owner, msgUpdateGroupMember)

// 5. leave group
Expand Down Expand Up @@ -692,11 +697,10 @@ func (s *StorageTestSuite) TestMirrorGroup() {
ctx := context.Background()

owner := s.GenAndChargeAccounts(1, 1000000)[0]
member := s.GenAndChargeAccounts(1, 1000000)[0]
groupName := storageutils.GenRandomGroupName()

// 1. CreateGroup
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), groupName, []sdk.AccAddress{member.GetAddr()}, "")
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), groupName, "")
s.SendTxBlock(owner, msgCreateGroup)
s.T().Logf("CerateGroup success, owner: %s, group name: %s", owner.GetAddr().String(), groupName)

Expand All @@ -713,7 +717,7 @@ func (s *StorageTestSuite) TestMirrorGroup() {

// CreateGroup
groupName = storageutils.GenRandomGroupName()
msgCreateGroup = storagetypes.NewMsgCreateGroup(owner.GetAddr(), groupName, []sdk.AccAddress{member.GetAddr()}, "")
msgCreateGroup = storagetypes.NewMsgCreateGroup(owner.GetAddr(), groupName, "")
s.SendTxBlock(owner, msgCreateGroup)

// MirrorGroup using name
Expand Down Expand Up @@ -1488,10 +1492,10 @@ func (s *StorageTestSuite) TestCreateAndUpdateGroupExtraField() {
ctx := context.Background()
owner := s.GenAndChargeAccounts(1, 1000000)[0]

// Create a group without members
// Create a group
testGroupName := "appName/bucketName"
extra := "{\"description\":\"no description\",\"imageUrl\":\"www.images.com/image1\"}"
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), testGroupName, nil, extra)
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), testGroupName, extra)
s.SendTxBlock(owner, msgCreateGroup)

// Head Group
Expand Down Expand Up @@ -1532,6 +1536,47 @@ func (s *StorageTestSuite) TestCreateAndUpdateGroupExtraField() {
s.T().Logf("GroupInfo: %s", headGroupResponse.GetGroupInfo().String())
}

func (s *StorageTestSuite) TestCreateAndRenewGroup() {
var err error
ctx := context.Background()
owner := s.GenAndChargeAccounts(1, 1000000)[0]
member := s.GenAndChargeAccounts(1, 1000000)[0]

// Create a group
testGroupName := "appName/bucketName"
extra := "{\"description\":\"no description\",\"imageUrl\":\"www.images.com/image1\"}"
msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), testGroupName, extra)
s.SendTxBlock(owner, msgCreateGroup)
s.T().Logf("CerateGroup success, owner: %s, group name: %s", owner.GetAddr().String(), testGroupName)

// Head Group
headGroupRequest := storagetypes.QueryHeadGroupRequest{GroupOwner: owner.GetAddr().String(), GroupName: testGroupName}
headGroupResponse, err := s.Client.HeadGroup(ctx, &headGroupRequest)
s.Require().NoError(err)
s.Require().Equal(headGroupResponse.GroupInfo.GroupName, testGroupName)
s.Require().True(owner.GetAddr().Equals(sdk.MustAccAddressFromHex(headGroupResponse.GroupInfo.Owner)))
s.Require().Equal(headGroupResponse.GroupInfo.Extra, extra)

// Renew GroupMember
expiration, err := time.Parse(time.RFC3339, "2022-12-31T23:59:59Z")
s.Require().NoError(err)
members := []*storagetypes.MsgGroupMember{
&storagetypes.MsgGroupMember{Member: member.GetAddr().String(), ExpirationTime: expiration}}
msgUpdateGroupMember := storagetypes.NewMsgRenewGroupMember(owner.GetAddr(), owner.GetAddr(), testGroupName, members)
s.SendTxBlock(owner, msgUpdateGroupMember)

// Head GroupMember
queryHeadGroupMemberReq := storagetypes.QueryHeadGroupMemberRequest{
Member: member.GetAddr().String(),
GroupName: testGroupName,
GroupOwner: owner.GetAddr().String(),
}
queryHeadGroupMemberResp, err := s.Client.HeadGroupMember(ctx, &queryHeadGroupMemberReq)
s.Require().NoError(err)
s.Require().Equal(queryHeadGroupMemberResp.GroupMember.GroupId, headGroupResponse.GroupInfo.Id)
s.Require().True(queryHeadGroupMemberResp.GroupMember.ExpirationTime.Equal(expiration))
}

func (s *StorageTestSuite) TestRejectSealObject() {
var err error
// CreateBucket
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
github.com/stretchr/testify v1.8.4
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
google.golang.org/grpc v1.56.1
google.golang.org/protobuf v1.31.0
google.golang.org/protobuf v1.30.0
gopkg.in/yaml.v2 v2.4.0
sigs.k8s.io/yaml v1.3.0
)
Expand Down Expand Up @@ -176,7 +176,7 @@ replace (
github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.2-alpha.2
github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.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.3-alpha.3.0.20230804065518-1a504101bd5e
github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230807083232-9a0d3b09e97f
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
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ github.com/bnb-chain/greenfield-cometbft v0.0.2-alpha.2 h1:ys9kmgtRx04wcCextE6Cr
github.com/bnb-chain/greenfield-cometbft v0.0.2-alpha.2/go.mod h1:EBmwmUdaNbGPyGjf1cMuoN3pAeM2tQu7Lfg95813EAw=
github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU=
github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1/go.mod h1:ey1CiK4bYo1RBNJLRiVbYr5CMdSxci9S/AZRINLtppI=
github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230804065518-1a504101bd5e h1:4epfOfdg9rYRiaOmMMji4Os09e67+0Yx6zS1WSLqJGM=
github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230804065518-1a504101bd5e/go.mod h1:hpvg93+VGXHAcv/pVVdp24Ik/9miw4uRh8+tD0DDYas=
github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230807083232-9a0d3b09e97f h1:3rBKrvNg2PXJUgkyZMgf2x8l6/7UWD1qGUgOTL7WmAk=
github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230807083232-9a0d3b09e97f/go.mod h1:hpvg93+VGXHAcv/pVVdp24Ik/9miw4uRh8+tD0DDYas=
github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230425074444-eb5869b05fe9 h1:6fLpmmI0EZvDTfPvI0zy5dBaaTUboHnEkoC5/p/w8TQ=
github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230425074444-eb5869b05fe9/go.mod h1:rbc4o84RSEvhf09o2+4Qiazsv0snRJLiEZdk17HeIDw=
github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230425074444-eb5869b05fe9 h1:1ZdK+iR1Up02bOa2YTZCml7PBpP//kcdamOcK6aWO/s=
Expand Down Expand Up @@ -1990,8 +1990,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610=
gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UDAkHu8BrjI=
Expand Down
2 changes: 1 addition & 1 deletion proto/greenfield/permission/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ message GroupMember {
// expiration_time defines the expiration time of the group member
google.protobuf.Timestamp expiration_time = 4 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = true
(gogoproto.nullable) = false
];
}
16 changes: 3 additions & 13 deletions proto/greenfield/storage/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,8 @@ message EventCreateGroup {
];
// source_type define the source of the group. CrossChain or Greenfield origin
SourceType source_type = 4;
// members define the all the address of the members.
repeated string members = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// extra defines extra info for the group
string extra = 6;
// added_members_detail defines the all the members detail of the group.
repeated EventGroupMemberDetail added_members_detail = 7;
string extra = 5;
}

// EventDeleteGroup is emitted on MsgDeleteGroup
Expand Down Expand Up @@ -338,11 +334,9 @@ message EventUpdateGroupMember {
(gogoproto.nullable) = false
];
// members_to_add defines all the members to be added to the group
repeated string members_to_add = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"];
repeated EventGroupMemberDetail members_to_add = 5;
// members_to_add defines all the members to be deleted from the group
repeated string members_to_delete = 6 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// added_members_detail defines the all the members detail of the group.
repeated EventGroupMemberDetail added_members_detail = 7;
}

message EventRenewGroupMember {
Expand All @@ -361,11 +355,7 @@ message EventRenewGroupMember {
// source_type define the source of the group. CrossChain or Greenfield origin
SourceType source_type = 5;
// members define the all the address of the members.
repeated string members = 6 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// extra defines extra info for the group
string extra = 7;
// members_detail defines the all the members detail of the group.
repeated EventGroupMemberDetail members_detail = 8;
repeated EventGroupMemberDetail members = 6;
}

message EventGroupMemberDetail {
Expand Down
7 changes: 2 additions & 5 deletions proto/greenfield/storage/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,8 @@ message MsgCreateGroup {
// group_name defines the name of the group. it's not globally unique.
string group_name = 2;

// member_request defines a list of member which to be add or remove
repeated string members = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// extra defines extra info for the group
string extra = 4;
string extra = 3;
}

message MsgCreateGroupResponse {
Expand Down Expand Up @@ -315,7 +312,7 @@ message MsgUpdateGroupMember {
string group_name = 3;

// members_to_add defines a list of members account address which will be add to the group
repeated string members_to_add = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"];
repeated MsgGroupMember members_to_add = 4;

// members_to_delete defines a list of members account address which will be remove from the group
repeated string members_to_delete = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"];
Expand Down
Loading

0 comments on commit 1f99784

Please sign in to comment.