From 25cca86c53a89d040b8f6238b1328ddc8c3236e8 Mon Sep 17 00:00:00 2001 From: MadReza Date: Wed, 28 Jun 2023 16:14:29 +0330 Subject: [PATCH] feat: emit event on asset take rate deduction --- docs/proto/proto-docs.md | 16 +++ proto/alliance/events.proto | 7 + x/alliance/keeper/asset.go | 1 + x/alliance/types/events.pb.go | 251 +++++++++++++++++++++++++++++----- 4 files changed, 241 insertions(+), 34 deletions(-) diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index ed32c475..919b8df1 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -21,6 +21,7 @@ - [alliance/events.proto](#alliance/events.proto) - [ClaimAllianceRewardsEvent](#alliance.ClaimAllianceRewardsEvent) + - [DeductAllianceAssetsEvent](#alliance.DeductAllianceAssetsEvent) - [DelegateAllianceEvent](#alliance.DelegateAllianceEvent) - [RedelegateAllianceEvent](#alliance.RedelegateAllianceEvent) - [UndelegateAllianceEvent](#alliance.UndelegateAllianceEvent) @@ -324,6 +325,21 @@ key: denom value: AllianceAsset + + +### DeductAllianceAssetsEvent + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `coins` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | + + + + + + ### DelegateAllianceEvent diff --git a/proto/alliance/events.proto b/proto/alliance/events.proto index 5d52acae..8cd51ed1 100644 --- a/proto/alliance/events.proto +++ b/proto/alliance/events.proto @@ -53,4 +53,11 @@ message ClaimAllianceRewardsEvent { (gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; +} + +message DeductAllianceAssetsEvent { + repeated cosmos.base.v1beta1.Coin coins = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } \ No newline at end of file diff --git a/x/alliance/keeper/asset.go b/x/alliance/keeper/asset.go index f4a7907c..308630cf 100644 --- a/x/alliance/keeper/asset.go +++ b/x/alliance/keeper/asset.go @@ -326,6 +326,7 @@ func (k Keeper) DeductAssetsWithTakeRate(ctx sdk.Context, lastClaim time.Time, a } // Only update if there was a token transfer to prevent < 1 amounts to be ignored k.SetLastRewardClaimTime(ctx, lastClaim.Add(rewardClaimInterval*time.Duration(intervalsSinceLastClaim))) + _ = ctx.EventManager().EmitTypedEvent(&types.DeductAllianceAssetsEvent{Coins: coins}) } return coins, nil } diff --git a/x/alliance/types/events.pb.go b/x/alliance/types/events.pb.go index b1cfec54..4ba7dcc3 100644 --- a/x/alliance/types/events.pb.go +++ b/x/alliance/types/events.pb.go @@ -6,8 +6,8 @@ package types import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" @@ -267,49 +267,96 @@ func (m *ClaimAllianceRewardsEvent) GetValidator() string { return "" } +type DeductAllianceAssetsEvent struct { + Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` +} + +func (m *DeductAllianceAssetsEvent) Reset() { *m = DeductAllianceAssetsEvent{} } +func (m *DeductAllianceAssetsEvent) String() string { return proto.CompactTextString(m) } +func (*DeductAllianceAssetsEvent) ProtoMessage() {} +func (*DeductAllianceAssetsEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_15eecd10e5e40bd4, []int{4} +} +func (m *DeductAllianceAssetsEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeductAllianceAssetsEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeductAllianceAssetsEvent.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 *DeductAllianceAssetsEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeductAllianceAssetsEvent.Merge(m, src) +} +func (m *DeductAllianceAssetsEvent) XXX_Size() int { + return m.Size() +} +func (m *DeductAllianceAssetsEvent) XXX_DiscardUnknown() { + xxx_messageInfo_DeductAllianceAssetsEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_DeductAllianceAssetsEvent proto.InternalMessageInfo + +func (m *DeductAllianceAssetsEvent) GetCoins() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Coins + } + return nil +} + func init() { proto.RegisterType((*DelegateAllianceEvent)(nil), "alliance.DelegateAllianceEvent") proto.RegisterType((*UndelegateAllianceEvent)(nil), "alliance.UndelegateAllianceEvent") proto.RegisterType((*RedelegateAllianceEvent)(nil), "alliance.RedelegateAllianceEvent") proto.RegisterType((*ClaimAllianceRewardsEvent)(nil), "alliance.ClaimAllianceRewardsEvent") + proto.RegisterType((*DeductAllianceAssetsEvent)(nil), "alliance.DeductAllianceAssetsEvent") } func init() { proto.RegisterFile("alliance/events.proto", fileDescriptor_15eecd10e5e40bd4) } var fileDescriptor_15eecd10e5e40bd4 = []byte{ - // 505 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x54, 0x3f, 0x6f, 0xd3, 0x40, - 0x14, 0x8f, 0xe3, 0x14, 0x35, 0x57, 0xa9, 0x48, 0x56, 0xaa, 0x3a, 0x19, 0x9c, 0x28, 0x03, 0x74, - 0x89, 0x8f, 0x16, 0x89, 0x89, 0x81, 0xba, 0x61, 0x41, 0x9d, 0x9c, 0xc2, 0xd0, 0x01, 0x38, 0xdb, - 0x0f, 0xf7, 0x84, 0x7d, 0x17, 0xdd, 0x5d, 0x52, 0xfa, 0x2d, 0xba, 0xf3, 0x35, 0xfa, 0x05, 0xd8, - 0xba, 0x20, 0x55, 0x9d, 0x10, 0x43, 0x41, 0xc9, 0x87, 0x60, 0x45, 0x3e, 0x9f, 0x1b, 0x14, 0x21, - 0xb5, 0x12, 0xff, 0x06, 0x26, 0xdf, 0xdd, 0x7b, 0xbf, 0xdf, 0xfb, 0xbd, 0xdf, 0x7b, 0x32, 0xda, - 0x20, 0x59, 0x46, 0x09, 0x8b, 0x01, 0xc3, 0x14, 0x98, 0x92, 0xfe, 0x58, 0x70, 0xc5, 0x9d, 0xd5, - 0xea, 0xb9, 0xd3, 0x4a, 0x79, 0xca, 0xf5, 0x23, 0x2e, 0x4e, 0x65, 0xbc, 0xe3, 0xc5, 0x5c, 0xe6, - 0x5c, 0xe2, 0x88, 0x48, 0xc0, 0xd3, 0xed, 0x08, 0x14, 0xd9, 0xc6, 0x31, 0xa7, 0xcc, 0xc4, 0xdb, - 0x65, 0xfc, 0x55, 0x09, 0x2c, 0x2f, 0x26, 0xd4, 0x4d, 0x39, 0x4f, 0x33, 0xc0, 0xfa, 0x16, 0x4d, - 0xde, 0x60, 0x45, 0x73, 0x90, 0x8a, 0xe4, 0xe3, 0x32, 0xa1, 0xff, 0xb1, 0x8e, 0x36, 0x86, 0x90, - 0x41, 0x4a, 0x14, 0xec, 0x1a, 0x19, 0x4f, 0x0b, 0x71, 0xce, 0x13, 0xb4, 0x5e, 0xe9, 0x1a, 0x01, - 0x4b, 0x40, 0xb8, 0x56, 0xcf, 0xda, 0x6a, 0x06, 0xee, 0xe5, 0xd9, 0xa0, 0x65, 0x8a, 0xec, 0x26, - 0x89, 0x00, 0x29, 0x47, 0x4a, 0x50, 0x96, 0x86, 0x4b, 0xf9, 0xce, 0x23, 0xd4, 0x9c, 0x92, 0x8c, - 0x26, 0x44, 0x71, 0xe1, 0xd6, 0x6f, 0x00, 0x2f, 0x52, 0x9d, 0x97, 0xa8, 0x51, 0x74, 0xe7, 0xda, - 0x3d, 0x6b, 0x6b, 0x6d, 0x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2, 0x5f, 0xef, 0xf8, 0x6b, - 0xb4, 0x52, 0x74, 0x2b, 0x5d, 0xbb, 0x67, 0xff, 0x66, 0x1b, 0x4b, 0xe2, 0xe0, 0xd9, 0xf9, 0xcc, - 0xb3, 0x2e, 0x66, 0x9e, 0xf5, 0x75, 0xe6, 0x59, 0xa7, 0x73, 0xaf, 0x76, 0x31, 0xf7, 0x6a, 0x9f, - 0xe6, 0x5e, 0xed, 0xf0, 0xc1, 0x0f, 0x4c, 0x0a, 0x84, 0x20, 0x83, 0x9c, 0x33, 0x38, 0xc1, 0xd7, - 0xff, 0xfb, 0x77, 0x8b, 0xa3, 0xe6, 0x8d, 0xee, 0x68, 0xcf, 0x1f, 0x7e, 0x0f, 0x00, 0x00, 0xff, - 0xff, 0xad, 0x71, 0x3d, 0x4d, 0x13, 0x06, 0x00, 0x00, + // 538 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x55, 0x3f, 0x6f, 0xd3, 0x40, + 0x14, 0x8f, 0x93, 0x14, 0x35, 0x57, 0xa9, 0x48, 0x56, 0xaa, 0x3a, 0x19, 0x9c, 0x28, 0x03, 0x64, + 0x89, 0xaf, 0x2d, 0x12, 0x13, 0x03, 0x71, 0xc3, 0x82, 0x3a, 0x39, 0x85, 0xa1, 0x03, 0x70, 0xb6, + 0x1f, 0xee, 0x09, 0xfb, 0x2e, 0xba, 0xbb, 0xa4, 0x74, 0xe1, 0x33, 0x74, 0xe7, 0x1b, 0x30, 0xf7, + 0x0b, 0xb0, 0x75, 0x41, 0xaa, 0x3a, 0x21, 0x86, 0x16, 0x25, 0x1f, 0x82, 0x15, 0xd9, 0x3e, 0x37, + 0x28, 0x42, 0x4a, 0x24, 0xfe, 0x0d, 0x4c, 0xbe, 0xbb, 0xf7, 0xde, 0xef, 0xcf, 0x7b, 0x4f, 0x32, + 0xda, 0x22, 0x71, 0x4c, 0x09, 0x0b, 0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0x27, 0xa5, 0xff, 0x70, 0xd3, 0xea, 0xae, 0x48, 0x2f, 0x35, 0xbf, 0xfb, 0xf4, 0x62, + 0x6a, 0x1b, 0x97, 0x53, 0xdb, 0xf8, 0x3a, 0xb5, 0x8d, 0xb3, 0x99, 0x5d, 0xba, 0x9c, 0xd9, 0xa5, + 0xcf, 0x33, 0xbb, 0x74, 0xb4, 0xf3, 0x03, 0x94, 0x02, 0x21, 0x48, 0x2f, 0xe1, 0x0c, 0x4e, 0xf1, + 0xed, 0xff, 0xe6, 0xed, 0xfc, 0x98, 0x01, 0xfb, 0x77, 0xb2, 0x99, 0x3f, 0xf8, 0x1e, 0x00, 0x00, + 0xff, 0xff, 0xe3, 0x7f, 0x13, 0xde, 0x93, 0x06, 0x00, 0x00, } func (m *DelegateAllianceEvent) Marshal() (dAtA []byte, err error) { @@ -537,6 +584,43 @@ func (m *ClaimAllianceRewardsEvent) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *DeductAllianceAssetsEvent) 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 *DeductAllianceAssetsEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeductAllianceAssetsEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Coins) > 0 { + for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Coins[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 @@ -638,6 +722,21 @@ func (m *ClaimAllianceRewardsEvent) Size() (n int) { return n } +func (m *DeductAllianceAssetsEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Coins) > 0 { + for _, e := range m.Coins { + 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 } @@ -1365,6 +1464,90 @@ func (m *ClaimAllianceRewardsEvent) Unmarshal(dAtA []byte) error { } return nil } +func (m *DeductAllianceAssetsEvent) 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: DeductAllianceAssetsEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeductAllianceAssetsEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Coins", 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.Coins = append(m.Coins, types.Coin{}) + if err := m.Coins[len(m.Coins)-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