Skip to content

Commit

Permalink
add create gvg family event
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnss committed Jun 20, 2023
1 parent 83f6676 commit f4f3e61
Show file tree
Hide file tree
Showing 3 changed files with 271 additions and 51 deletions.
6 changes: 6 additions & 0 deletions proto/greenfield/virtualgroup/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ message EventCreateGlobalVirtualGroup {
];
}

message EventCreateGlobalVirtualGroupFamily {
uint32 id = 1;

string virtual_payment_address = 6 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

message EventDeleteGlobalVirtualGroup {
uint32 id = 1;
}
Expand Down
8 changes: 8 additions & 0 deletions x/virtualgroup/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ func (k msgServer) CreateGlobalVirtualGroup(goCtx context.Context, req *types.Ms
}); err != nil {
return nil, err
}
if req.FamilyId == types.NoSpecifiedFamilyId {
if err := ctx.EventManager().EmitTypedEvents(&types.EventCreateGlobalVirtualGroupFamily{
Id: gvg.Id,
VirtualPaymentAddress: gvgFamily.VirtualPaymentAddress,
}); err != nil {
return nil, err
}
}
return &types.MsgCreateGlobalVirtualGroupResponse{}, nil
}

Expand Down
Loading

0 comments on commit f4f3e61

Please sign in to comment.