Skip to content

Commit

Permalink
adding events to msg bid txn
Browse files Browse the repository at this point in the history
  • Loading branch information
gsk967 committed Jul 8, 2024
1 parent 2966992 commit 21d83d1
Show file tree
Hide file tree
Showing 3 changed files with 279 additions and 21 deletions.
9 changes: 9 additions & 0 deletions proto/umee/auction/v1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ message EventRewardsAuctionResult {
message EventFundRewardsAuction {
repeated cosmos.base.v1beta1.Coin assets = 1 [(gogoproto.nullable) = false];
}

// EventRewardsBid is emitted when the user bid the auction rewward.
message EventRewardsBid {
string sender = 1;
// the current auction ID being bid on. Fails if the ID is not an ID of the current auction.
uint32 id = 2;
// amount of the bid in the bond base tokens (uumee)
cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
}
284 changes: 263 additions & 21 deletions x/auction/events.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions x/auction/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,12 @@ func (m msgServer) RewardsBid(ctx context.Context, msg *auction.MsgRewardsBid) (
if err := k.rewardsBid(msg); err != nil {
return nil, err
}

sdkutil.Emit(&sdkCtx, &auction.EventRewardsBid{
Sender: msg.Sender,
Id: msg.Id,
Amount: msg.Amount,
})

return &auction.MsgRewardsBidResponse{}, nil
}

0 comments on commit 21d83d1

Please sign in to comment.