diff --git a/proto/umee/leverage/v1/events.proto b/proto/umee/leverage/v1/events.proto index 3b9eaf7736..117ac2918b 100644 --- a/proto/umee/leverage/v1/events.proto +++ b/proto/umee/leverage/v1/events.proto @@ -108,3 +108,8 @@ message EventFundOracle { // Assets sent to oracle module repeated cosmos.base.v1beta1.Coin assets = 1 [(gogoproto.nullable) = false]; } + +// EventFundAuction is emitted when sending rewards to auction module +message EventFundAuction { + repeated cosmos.base.v1beta1.Coin assets = 1 [(gogoproto.nullable) = false]; +} diff --git a/x/leverage/keeper/oracle.go b/x/leverage/keeper/oracle.go index 7989c32ac0..b721dcf48b 100644 --- a/x/leverage/keeper/oracle.go +++ b/x/leverage/keeper/oracle.go @@ -288,13 +288,16 @@ func (k Keeper) fundModules(ctx sdk.Context, toOracle, toAuction sdk.Coins) erro "to oracle", toOracleCheck, "to auction", toAuctionCheck, ) - sdkutil.Emit(&ctx, &types.EventFundOracle{Assets: toOracleCheck}) - + send := k.bankKeeper.SendCoinsFromModuleToModule if !toOracleCheck.IsZero() { - return k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, oracletypes.ModuleName, toOracleCheck) + sdkutil.Emit(&ctx, &types.EventFundOracle{Assets: toOracleCheck}) + if err := send(ctx, types.ModuleName, oracletypes.ModuleName, toOracleCheck); err != nil { + return err + } } - if !toOracleCheck.IsZero() { - return k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, auction.ModuleName, toOracleCheck) + if !toAuctionCheck.IsZero() { + sdkutil.Emit(&ctx, &types.EventFundAuction{Assets: toOracleCheck}) + return send(ctx, types.ModuleName, auction.ModuleName, toAuctionCheck) } return nil diff --git a/x/leverage/types/events.pb.go b/x/leverage/types/events.pb.go index 03065ec232..610e0a47bc 100644 --- a/x/leverage/types/events.pb.go +++ b/x/leverage/types/events.pb.go @@ -487,6 +487,44 @@ func (m *EventFundOracle) XXX_DiscardUnknown() { var xxx_messageInfo_EventFundOracle proto.InternalMessageInfo +// EventFundAuction is emitted when sending rewards to auction module +type EventFundAuction struct { + Assets []types.Coin `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets"` +} + +func (m *EventFundAuction) Reset() { *m = EventFundAuction{} } +func (m *EventFundAuction) String() string { return proto.CompactTextString(m) } +func (*EventFundAuction) ProtoMessage() {} +func (*EventFundAuction) Descriptor() ([]byte, []int) { + return fileDescriptor_aaf62b4902d7471c, []int{11} +} +func (m *EventFundAuction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventFundAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventFundAuction.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventFundAuction) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventFundAuction.Merge(m, src) +} +func (m *EventFundAuction) XXX_Size() int { + return m.Size() +} +func (m *EventFundAuction) XXX_DiscardUnknown() { + xxx_messageInfo_EventFundAuction.DiscardUnknown(m) +} + +var xxx_messageInfo_EventFundAuction proto.InternalMessageInfo + func init() { proto.RegisterType((*EventSupply)(nil), "umee.leverage.v1.EventSupply") proto.RegisterType((*EventWithdraw)(nil), "umee.leverage.v1.EventWithdraw") @@ -499,53 +537,55 @@ func init() { proto.RegisterType((*EventRepayBadDebt)(nil), "umee.leverage.v1.EventRepayBadDebt") proto.RegisterType((*EventReservesExhausted)(nil), "umee.leverage.v1.EventReservesExhausted") proto.RegisterType((*EventFundOracle)(nil), "umee.leverage.v1.EventFundOracle") + proto.RegisterType((*EventFundAuction)(nil), "umee.leverage.v1.EventFundAuction") } func init() { proto.RegisterFile("umee/leverage/v1/events.proto", fileDescriptor_aaf62b4902d7471c) } var fileDescriptor_aaf62b4902d7471c = []byte{ - // 647 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x95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 0x27, 0xf5, 0xe9, 0x49, 0x13, 0xd5, 0xbb, 0xf2, 0x52, 0xde, 0x7b, 0x7a, 0xfc, 0xd3, 0x6a, 0x1d, - 0x9f, 0x5a, 0xe8, 0xe4, 0xd4, 0x42, 0x3f, 0x4e, 0x2d, 0xf4, 0xee, 0xcc, 0x6a, 0x9d, 0x9c, 0x59, - 0xad, 0xaf, 0x67, 0x56, 0xeb, 0xc5, 0x8d, 0x80, 0xa9, 0x61, 0xea, 0x39, 0x3e, 0x8f, 0xdc, 0xfc, - 0x41, 0x5e, 0x8d, 0x41, 0xed, 0x73, 0xb1, 0xa7, 0x17, 0x6e, 0x76, 0xd7, 0x3d, 0xa8, 0x5e, 0x70, - 0x75, 0x98, 0x80, 0xf4, 0x26, 0xf4, 0xdb, 0x7a, 0xeb, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe2, - 0x20, 0xab, 0xaf, 0xdf, 0x07, 0x00, 0x00, + // 660 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x96, 0xcb, 0x6e, 0xd4, 0x30, + 0x14, 0x86, 0xc7, 0x33, 0x43, 0xd5, 0xba, 0xf4, 0x42, 0x54, 0xa1, 0xb4, 0x82, 0x50, 0xb2, 0xea, + 0xa6, 0x09, 0xe5, 0x2e, 0xb1, 0x40, 0x9d, 0x5e, 0x04, 0x05, 0x81, 0x34, 0x5d, 0x20, 0xb1, 0x19, + 0x39, 0xf1, 0x51, 0xc6, 0x6a, 0xc6, 0x0e, 0xb6, 0x33, 0xbd, 0xb0, 0x01, 0xf1, 0x02, 0xbc, 0x01, + 0x0f, 0x01, 0x3c, 0x00, 0xbb, 0x2e, 0x2b, 0x56, 0x2c, 0x10, 0x82, 0xf6, 0x45, 0x50, 0x9c, 0xb4, + 0x19, 0x56, 0xa4, 0x59, 0xc0, 0x2e, 0x3e, 0xfe, 0xff, 0x73, 0xbe, 0xe3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, + 0x40, 0x05, 0x63, 0xe6, 0xa2, 0xbe, 0xf5, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x56, 0x89, 0x02, 0x0b, + 0x2c, 0x08, 0x00, 0x00, } func (m *EventSupply) Marshal() (dAtA []byte, err error) { @@ -1053,6 +1093,43 @@ func (m *EventFundOracle) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EventFundAuction) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventFundAuction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventFundAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Assets) > 0 { + for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Assets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -1253,6 +1330,21 @@ func (m *EventFundOracle) Size() (n int) { return n } +func (m *EventFundAuction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Assets) > 0 { + for _, e := range m.Assets { + l = e.Size() + n += 1 + l + sovEvents(uint64(l)) + } + } + return n +} + func sovEvents(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2698,6 +2790,90 @@ func (m *EventFundOracle) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventFundAuction) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventFundAuction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventFundAuction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Assets", 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.Assets = append(m.Assets, types.Coin{}) + if err := m.Assets[len(m.Assets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvents(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0