diff --git a/proto/umee/auction/v1/events.proto b/proto/umee/auction/v1/events.proto index 9ffb14d39f..8295a45833 100644 --- a/proto/umee/auction/v1/events.proto +++ b/proto/umee/auction/v1/events.proto @@ -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 diff --git a/proto/umee/auction/v1/query.proto b/proto/umee/auction/v1/query.proto index f5377d39a5..e73af918a8 100644 --- a/proto/umee/auction/v1/query.proto +++ b/proto/umee/auction/v1/query.proto @@ -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"; } diff --git a/x/auction/events.pb.go b/x/auction/events.pb.go index 0c54dbcf56..d059d1e6a2 100644 --- a/x/auction/events.pb.go +++ b/x/auction/events.pb.go @@ -29,8 +29,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type EventRewardsAuctionResult struct { Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` - // Auctioned tokens. - Rewards []types.Coin `protobuf:"bytes,4,rep,name=rewards,proto3" json:"rewards"` } func (m *EventRewardsAuctionResult) Reset() { *m = EventRewardsAuctionResult{} } @@ -112,28 +110,27 @@ func init() { func init() { proto.RegisterFile("umee/auction/v1/events.proto", fileDescriptor_b5998c755af8caa1) } var fileDescriptor_b5998c755af8caa1 = []byte{ - // 321 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0xb1, 0x4a, 0x03, 0x31, - 0x18, 0xc7, 0x2f, 0xb5, 0x54, 0x8c, 0xa8, 0x70, 0x14, 0xbc, 0x16, 0x89, 0xa5, 0x53, 0x1d, 0x9a, - 0x78, 0x0a, 0x8a, 0x63, 0x2b, 0xea, 0x1e, 0x37, 0x17, 0xb9, 0xbb, 0x84, 0x33, 0x68, 0x13, 0x49, - 0x72, 0x57, 0x1f, 0xc3, 0xd1, 0x07, 0xf1, 0x21, 0x3a, 0x16, 0x27, 0x27, 0xd1, 0xde, 0x8b, 0xc8, - 0x5d, 0xd2, 0xc1, 0xcd, 0x2d, 0x1f, 0xbf, 0x1f, 0xdf, 0xff, 0xcf, 0x17, 0x78, 0x50, 0xcc, 0x38, - 0x27, 0x49, 0x91, 0x59, 0xa1, 0x24, 0x29, 0x63, 0xc2, 0x4b, 0x2e, 0xad, 0xc1, 0xcf, 0x5a, 0x59, - 0x15, 0xee, 0xd5, 0x14, 0x7b, 0x8a, 0xcb, 0xb8, 0xdf, 0xcd, 0x55, 0xae, 0x1a, 0x46, 0xea, 0x97, - 0xd3, 0xfa, 0xbd, 0x4c, 0x99, 0x99, 0x32, 0xf7, 0x0e, 0xb8, 0xc1, 0x23, 0xe4, 0x26, 0x92, 0x26, - 0x86, 0x93, 0x32, 0x4e, 0xb9, 0x4d, 0x62, 0x92, 0x29, 0x21, 0x1d, 0x1f, 0xbe, 0x01, 0xd8, 0xbb, - 0xaa, 0x23, 0x29, 0x9f, 0x27, 0x9a, 0x99, 0x89, 0xcb, 0xa2, 0xdc, 0x14, 0x4f, 0x36, 0xdc, 0x85, - 0x2d, 0xc1, 0x22, 0x30, 0x00, 0xa3, 0x1d, 0xda, 0x12, 0x2c, 0x3c, 0x86, 0x9d, 0x54, 0x30, 0xc6, - 0x75, 0xd4, 0x1a, 0x80, 0xd1, 0xd6, 0x34, 0xfa, 0x78, 0x1f, 0x77, 0x7d, 0xde, 0x84, 0x31, 0xcd, - 0x8d, 0xb9, 0xb5, 0x5a, 0xc8, 0x9c, 0x7a, 0x2f, 0xbc, 0x80, 0x9b, 0xda, 0x6d, 0x8e, 0xda, 0x83, - 0x8d, 0xd1, 0xf6, 0x49, 0x0f, 0x7b, 0xbf, 0x6e, 0x84, 0x7d, 0x23, 0x7c, 0xa9, 0x84, 0x9c, 0xb6, - 0x17, 0x5f, 0x87, 0x01, 0x5d, 0xfb, 0x43, 0x0a, 0xf7, 0x9b, 0x66, 0xd7, 0x85, 0x64, 0x7f, 0xdb, - 0x85, 0xe7, 0xb0, 0x93, 0x18, 0xc3, 0xad, 0x89, 0xc0, 0xff, 0x96, 0x7a, 0x7d, 0x7a, 0xb3, 0xf8, - 0x41, 0xc1, 0x62, 0x85, 0xc0, 0x72, 0x85, 0xc0, 0xf7, 0x0a, 0x81, 0xd7, 0x0a, 0x05, 0xcb, 0x0a, - 0x05, 0x9f, 0x15, 0x0a, 0xee, 0x8e, 0x72, 0x61, 0x1f, 0x8a, 0x14, 0x67, 0x6a, 0x46, 0xea, 0xcb, - 0x8f, 0x25, 0xb7, 0x73, 0xa5, 0x1f, 0x9b, 0x81, 0x94, 0x67, 0xe4, 0x65, 0xfd, 0x53, 0x69, 0xa7, - 0x39, 0xdf, 0xe9, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x37, 0xa7, 0x36, 0xeb, 0xc0, 0x01, 0x00, - 0x00, + // 306 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xc1, 0x4a, 0x33, 0x31, + 0x14, 0x85, 0x27, 0xfd, 0x7f, 0x0a, 0x46, 0x54, 0x18, 0x0a, 0x4e, 0x8b, 0xc4, 0xd2, 0x55, 0x5d, + 0x34, 0x71, 0x14, 0x74, 0xdd, 0x8a, 0xba, 0x8f, 0x3b, 0x41, 0x64, 0x66, 0x72, 0x19, 0x83, 0x36, + 0x91, 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b, 0xbf, 0xfc, 0x3c, 0x8c, 0x78, 0xb0, 0xcf, 0xae, + 0x97, 0xdf, 0x24, 0x5a, 0xae, 0x09, 0x5a, 0xad, 0x09, 0xfa, 0x5a, 0x13, 0xf4, 0xba, 0x21, 0xd1, + 0x6a, 0x43, 0xa2, 0x8f, 0x0d, 0x89, 0x6e, 0x8f, 0x4a, 0xe9, 0x1e, 0xaa, 0x9c, 0x16, 0x7a, 0xce, + 0x9a, 0xf5, 0x26, 0x0a, 0xdc, 0x42, 0x9b, 0xc7, 0x56, 0xb0, 0xfa, 0x8c, 0xbd, 0xfc, 0xae, 0x9d, + 0x77, 0xdb, 0x09, 0x4e, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xaa, 0xe5, 0xa1, 0x74, 0x84, 0x01, + 0x00, 0x00, } func (m *EventRewardsAuctionResult) Marshal() (dAtA []byte, err error) { @@ -156,20 +153,6 @@ func (m *EventRewardsAuctionResult) MarshalToSizedBuffer(dAtA []byte) (int, erro _ = i var l int _ = l - if len(m.Rewards) > 0 { - for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Rewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } if len(m.Bidder) > 0 { i -= len(m.Bidder) copy(dAtA[i:], m.Bidder) @@ -246,12 +229,6 @@ func (m *EventRewardsAuctionResult) Size() (n int) { if l > 0 { n += 1 + l + sovEvents(uint64(l)) } - if len(m.Rewards) > 0 { - for _, e := range m.Rewards { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } - } return n } @@ -356,40 +333,6 @@ func (m *EventRewardsAuctionResult) Unmarshal(dAtA []byte) error { } m.Bidder = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rewards", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Rewards = append(m.Rewards, types.Coin{}) - if err := m.Rewards[len(m.Rewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) diff --git a/x/auction/keeper/rewards.go b/x/auction/keeper/rewards.go index 2ac9f9744e..ebc54d0650 100644 --- a/x/auction/keeper/rewards.go +++ b/x/auction/keeper/rewards.go @@ -11,6 +11,7 @@ import ( "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" ) @@ -33,7 +34,10 @@ func (k Keeper) FinalizeRewardsAuction() error { 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(), + }) } else if len(a.Rewards) != 0 { // rollover the past rewards if there was no bidder newCoins = newCoins.Add(a.Rewards...) diff --git a/x/auction/query.pb.go b/x/auction/query.pb.go index 67414c1bed..4eeb13a82e 100644 --- a/x/auction/query.pb.go +++ b/x/auction/query.pb.go @@ -250,7 +250,7 @@ type QueryClient interface { // QueryRewardParams queries parameters for the reward auciton. RewardsParams(ctx context.Context, in *QueryRewardsParams, opts ...grpc.CallOption) (*QueryRewardsParamsResponse, error) // RewardAuction queries the information of the auction by ID. If ID is ommitted, returns - // current reward auction params. + // current reward auction. RewardsAuction(ctx context.Context, in *QueryRewardsAuction, opts ...grpc.CallOption) (*QueryRewardsAuctionResponse, error) } @@ -285,7 +285,7 @@ type QueryServer interface { // QueryRewardParams queries parameters for the reward auciton. RewardsParams(context.Context, *QueryRewardsParams) (*QueryRewardsParamsResponse, error) // RewardAuction queries the information of the auction by ID. If ID is ommitted, returns - // current reward auction params. + // current reward auction. RewardsAuction(context.Context, *QueryRewardsAuction) (*QueryRewardsAuctionResponse, error) }