Skip to content

Commit

Permalink
fix(group): Allow group total weight to be 0 (#11682) (#11685)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Apr 19, 2022
1 parent d4da6db commit 07d982f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion x/group/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2759,7 +2759,7 @@ func (s *TestSuite) TestLeaveGroup() {
math.NewDecFromInt64(0),
},
{
"valid testcase: decision policy is not present",
"valid testcase: decision policy is not present (and group total weight can be 0)",
&group.MsgLeaveGroup{
GroupId: groupID2,
Address: member1.String(),
Expand Down
2 changes: 1 addition & 1 deletion x/group/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (k Keeper) UpdateGroupMembers(goCtx context.Context, req *group.MsgUpdateGr
action := func(g *group.GroupInfo) error {
totalWeight, err := math.NewNonNegativeDecFromString(g.TotalWeight)
if err != nil {
return err
return sdkerrors.Wrap(err, "group total weight")
}
for i := range req.MemberUpdates {
if err := k.assertMetadataLength(req.MemberUpdates[i].Metadata, "group member metadata"); err != nil {
Expand Down

0 comments on commit 07d982f

Please sign in to comment.