Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(auction): finalize events #2525

Merged
merged 2 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions proto/umee/auction/v1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ option (gogoproto.goproto_getters_all) = false;
message EventRewardsAuctionResult {
uint32 id = 1;
string bidder = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Auctioned tokens.
repeated cosmos.base.v1beta1.Coin rewards = 4 [(gogoproto.nullable) = false];
}

// EventFundRewardsAuction is emitted when sending rewards to auction module
Expand Down
2 changes: 1 addition & 1 deletion proto/umee/auction/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ service Query {
option (google.api.http).get = "/umee/auction/v1/rewards/params";
}
// RewardAuction queries the information of the auction by ID. If ID is ommitted, returns
// current reward auction params.
// current reward auction.
rpc RewardsAuction(QueryRewardsAuction) returns (QueryRewardsAuctionResponse) {
option (google.api.http).get = "/umee/auction/v1/rewards";
}
Expand Down
99 changes: 21 additions & 78 deletions x/auction/events.pb.go

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

6 changes: 5 additions & 1 deletion x/auction/keeper/rewards.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

"github.com/umee-network/umee/v6/util"
"github.com/umee-network/umee/v6/util/coin"
"github.com/umee-network/umee/v6/util/sdkutil"
"github.com/umee-network/umee/v6/util/store"
"github.com/umee-network/umee/v6/x/auction"
)
Expand All @@ -33,7 +34,10 @@
if err != nil {
return fmt.Errorf("can't burn rewards auction bid [%w]", err)
}

sdkutil.Emit(k.ctx, &auction.EventRewardsAuctionResult{
Id: id,
Bidder: sdk.AccAddress(bid.Bidder).String(),
})

Check warning on line 40 in x/auction/keeper/rewards.go

View check run for this annotation

Codecov / codecov/patch

x/auction/keeper/rewards.go#L37-L40

Added lines #L37 - L40 were not covered by tests
} else if len(a.Rewards) != 0 {
// rollover the past rewards if there was no bidder
newCoins = newCoins.Add(a.Rewards...)
Expand Down
4 changes: 2 additions & 2 deletions x/auction/query.pb.go

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

Loading