diff --git a/e2e/tests/virtualgroup_test.go b/e2e/tests/virtualgroup_test.go index 3647bbe7b..012b8ea22 100644 --- a/e2e/tests/virtualgroup_test.go +++ b/e2e/tests/virtualgroup_test.go @@ -7,6 +7,7 @@ import ( "math" "reflect" "strconv" + "strings" "testing" "time" @@ -287,7 +288,7 @@ func (s *VirtualGroupTestSuite) TestSettle() { StorageProvider: user.GetAddr().String(), GlobalVirtualGroupFamilyId: gvgFamily.Id, } - s.SendTxBlock(user, &msgSettle) + txResp1 := s.SendTxBlock(user, &msgSettle) primaryBalanceAfter, err := s.Client.BankQueryClient.Balance(context.Background(), &types2.QueryBalanceRequest{ Denom: s.Config.Denom, Address: primarySp.FundingKey.GetAddr().String(), @@ -297,13 +298,18 @@ func (s *VirtualGroupTestSuite) TestSettle() { s.T().Logf("primaryBalance: %s, after: %s", primaryBalance.String(), primaryBalanceAfter.String()) s.Require().True(primaryBalanceAfter.Balance.Amount.GT(primaryBalance.Balance.Amount)) + settleGVGFamilyEvent := filterSettleGVGFamilyEventFromTx(txResp1) + s.Require().True(settleGVGFamilyEvent.Id == gvgFamilyId) + s.Require().True(settleGVGFamilyEvent.SpId == gvgFamily.PrimarySpId) + s.Require().True(settleGVGFamilyEvent.Amount.Equal(primaryBalanceAfter.Balance.Amount.Sub(primaryBalance.Balance.Amount))) + // settle gvg msgSettle = virtualgroupmoduletypes.MsgSettle{ StorageProvider: user.GetAddr().String(), GlobalVirtualGroupFamilyId: 0, GlobalVirtualGroupIds: []uint32{gvgId}, } - s.SendTxBlock(user, &msgSettle) + txResp2 := s.SendTxBlock(user, &msgSettle) secondaryBalancesAfter := make([]sdkmath.Int, 0, len(secondaryBalances)) for _, addr := range secondarySpAddrs { @@ -314,9 +320,12 @@ func (s *VirtualGroupTestSuite) TestSettle() { secondaryBalancesAfter = append(secondaryBalancesAfter, tempResp.Balance.Amount) } + settleGVGEvent := filterSettleGVGEventFromTx(txResp2) + s.Require().True(settleGVGEvent.Id == gvgId) for i := range secondaryBalances { s.T().Logf("secondaryBalance: %s, after: %s", secondaryBalances[i].String(), secondaryBalancesAfter[i].String()) s.Require().True(secondaryBalancesAfter[i].GT(secondaryBalances[i])) + s.Require().True(settleGVGEvent.Amount.Equal(secondaryBalancesAfter[i].Sub(secondaryBalances[i]))) } } @@ -1316,3 +1325,49 @@ func (s *VirtualGroupTestSuite) TestSPExit_SwapInfo_Expired() { _, err = s.Client.StorageProvider(context.Background(), &sptypes.QueryStorageProviderRequest{Id: spy.Info.Id}) s.Require().Error(err) } + +func filterSettleGVGEventFromTx(txRes *sdk.TxResponse) virtualgroupmoduletypes.EventSettleGlobalVirtualGroup { + idStr, amountStr := "", "" + for _, event := range txRes.Logs[0].Events { + if event.Type == "greenfield.virtualgroup.EventSettleGlobalVirtualGroup" { + for _, attr := range event.Attributes { + if attr.Key == "id" { + idStr = strings.Trim(attr.Value, `"`) + } else if attr.Key == "amount" { + amountStr = strings.Trim(attr.Value, `"`) + } + } + } + } + id, _ := strconv.ParseInt(idStr, 10, 32) + amount := sdkmath.NewUintFromString(amountStr) + return virtualgroupmoduletypes.EventSettleGlobalVirtualGroup{ + Id: uint32(id), + Amount: sdkmath.NewInt(int64(amount.Uint64())), + } +} + +func filterSettleGVGFamilyEventFromTx(txRes *sdk.TxResponse) virtualgroupmoduletypes.EventSettleGlobalVirtualGroupFamily { + idStr, spIdStr, amountStr := "", "", "" + for _, event := range txRes.Logs[0].Events { + if event.Type == "greenfield.virtualgroup.EventSettleGlobalVirtualGroupFamily" { + for _, attr := range event.Attributes { + if attr.Key == "id" { + idStr = strings.Trim(attr.Value, `"`) + } else if attr.Key == "sp_id" { + spIdStr = strings.Trim(attr.Value, `"`) + } else if attr.Key == "amount" { + amountStr = strings.Trim(attr.Value, `"`) + } + } + } + } + id, _ := strconv.ParseInt(idStr, 10, 32) + spId, _ := strconv.ParseInt(spIdStr, 10, 32) + amount := sdkmath.NewUintFromString(amountStr) + return virtualgroupmoduletypes.EventSettleGlobalVirtualGroupFamily{ + Id: uint32(id), + SpId: uint32(spId), + Amount: sdkmath.NewInt(int64(amount.Uint64())), + } +} diff --git a/proto/greenfield/virtualgroup/events.proto b/proto/greenfield/virtualgroup/events.proto index 5c3068d31..7a74aae0b 100644 --- a/proto/greenfield/virtualgroup/events.proto +++ b/proto/greenfield/virtualgroup/events.proto @@ -175,7 +175,7 @@ message EventCompleteStorageProviderExit { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; - // forced_exit whether the exit is a forced exit + // forced_exit whether the exit is a forced exit bool forced_exit = 5; } @@ -218,3 +218,33 @@ message EventStorageProviderForcedExit { // The id of the storage provider who wants to exit uint32 storage_provider_id = 1; } + +message EventSettleGlobalVirtualGroupFamily { + // The id of global virtual group family, which is auto generated by blockchain + uint32 id = 1; + // The id of the primary sp who will receive the fund + uint32 sp_id = 2; + // The funding address of the sp + string sp_funding_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // The amount the fund to send to sp + string amount = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +message EventSettleGlobalVirtualGroup { + // The id of global virtual group, which is auto generated by blockchain + uint32 id = 1; + // The ids of the secondary sps who will receive the fund + repeated uint32 sp_ids = 2; + // The funding address of the sps + repeated string sp_funding_addresses = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // The amount the fund to send to each sp + string amount = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} diff --git a/x/virtualgroup/keeper/payment.go b/x/virtualgroup/keeper/payment.go index 2539d1344..6414cb6f0 100644 --- a/x/virtualgroup/keeper/payment.go +++ b/x/virtualgroup/keeper/payment.go @@ -24,6 +24,16 @@ func (k Keeper) SettleAndDistributeGVGFamily(ctx sdk.Context, sp *sptypes.Storag return fmt.Errorf("fail to send coins: %s %s", paymentAddress, sp.FundingAddress) } + err = ctx.EventManager().EmitTypedEvent(&types.EventSettleGlobalVirtualGroupFamily{ + Id: family.Id, + SpId: sp.Id, + SpFundingAddress: sp.FundingAddress, + Amount: totalBalance, + }) + if err != nil { + ctx.Logger().Error("fail to send event for settlement", "vfg", family.Id, "err", err) + } + return nil } @@ -38,6 +48,8 @@ func (k Keeper) SettleAndDistributeGVG(ctx sdk.Context, gvg *types.GlobalVirtual if !amount.IsPositive() { return nil } + + fundingAddresses := make([]string, 0) for _, spID := range gvg.SecondarySpIds { sp, found := k.spKeeper.GetStorageProvider(ctx, spID) if !found { @@ -47,6 +59,19 @@ func (k Keeper) SettleAndDistributeGVG(ctx sdk.Context, gvg *types.GlobalVirtual if err != nil { return fmt.Errorf("fail to send coins: %s %s", paymentAddress, sp.FundingAddress) } + + fundingAddresses = append(fundingAddresses, sp.FundingAddress) } + + err = ctx.EventManager().EmitTypedEvent(&types.EventSettleGlobalVirtualGroup{ + Id: gvg.Id, + SpIds: gvg.SecondarySpIds, + SpFundingAddresses: fundingAddresses, + Amount: amount, + }) + if err != nil { + ctx.Logger().Error("fail to send event for settlement", "gvg", gvg.Id, "err", err) + } + return nil } diff --git a/x/virtualgroup/types/events.pb.go b/x/virtualgroup/types/events.pb.go index ed1e7a9e8..1ba6c38d7 100644 --- a/x/virtualgroup/types/events.pb.go +++ b/x/virtualgroup/types/events.pb.go @@ -1228,6 +1228,136 @@ func (m *EventStorageProviderForcedExit) GetStorageProviderId() uint32 { return 0 } +type EventSettleGlobalVirtualGroupFamily struct { + // The id of global virtual group family, which is auto generated by blockchain + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The id of the primary sp who will receive the fund + SpId uint32 `protobuf:"varint,2,opt,name=sp_id,json=spId,proto3" json:"sp_id,omitempty"` + // The funding address of the sp + SpFundingAddress string `protobuf:"bytes,3,opt,name=sp_funding_address,json=spFundingAddress,proto3" json:"sp_funding_address,omitempty"` + // The amount the fund to send to sp + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` +} + +func (m *EventSettleGlobalVirtualGroupFamily) Reset() { *m = EventSettleGlobalVirtualGroupFamily{} } +func (m *EventSettleGlobalVirtualGroupFamily) String() string { return proto.CompactTextString(m) } +func (*EventSettleGlobalVirtualGroupFamily) ProtoMessage() {} +func (*EventSettleGlobalVirtualGroupFamily) Descriptor() ([]byte, []int) { + return fileDescriptor_ece39ea12016bd5b, []int{18} +} +func (m *EventSettleGlobalVirtualGroupFamily) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSettleGlobalVirtualGroupFamily) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventSettleGlobalVirtualGroupFamily.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 *EventSettleGlobalVirtualGroupFamily) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSettleGlobalVirtualGroupFamily.Merge(m, src) +} +func (m *EventSettleGlobalVirtualGroupFamily) XXX_Size() int { + return m.Size() +} +func (m *EventSettleGlobalVirtualGroupFamily) XXX_DiscardUnknown() { + xxx_messageInfo_EventSettleGlobalVirtualGroupFamily.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSettleGlobalVirtualGroupFamily proto.InternalMessageInfo + +func (m *EventSettleGlobalVirtualGroupFamily) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *EventSettleGlobalVirtualGroupFamily) GetSpId() uint32 { + if m != nil { + return m.SpId + } + return 0 +} + +func (m *EventSettleGlobalVirtualGroupFamily) GetSpFundingAddress() string { + if m != nil { + return m.SpFundingAddress + } + return "" +} + +type EventSettleGlobalVirtualGroup struct { + // The id of global virtual group, which is auto generated by blockchain + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The ids of the secondary sps who will receive the fund + SpIds []uint32 `protobuf:"varint,2,rep,packed,name=sp_ids,json=spIds,proto3" json:"sp_ids,omitempty"` + // The funding address of the sps + SpFundingAddresses []string `protobuf:"bytes,3,rep,name=sp_funding_addresses,json=spFundingAddresses,proto3" json:"sp_funding_addresses,omitempty"` + // The amount the fund to send to each sp + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` +} + +func (m *EventSettleGlobalVirtualGroup) Reset() { *m = EventSettleGlobalVirtualGroup{} } +func (m *EventSettleGlobalVirtualGroup) String() string { return proto.CompactTextString(m) } +func (*EventSettleGlobalVirtualGroup) ProtoMessage() {} +func (*EventSettleGlobalVirtualGroup) Descriptor() ([]byte, []int) { + return fileDescriptor_ece39ea12016bd5b, []int{19} +} +func (m *EventSettleGlobalVirtualGroup) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSettleGlobalVirtualGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventSettleGlobalVirtualGroup.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 *EventSettleGlobalVirtualGroup) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSettleGlobalVirtualGroup.Merge(m, src) +} +func (m *EventSettleGlobalVirtualGroup) XXX_Size() int { + return m.Size() +} +func (m *EventSettleGlobalVirtualGroup) XXX_DiscardUnknown() { + xxx_messageInfo_EventSettleGlobalVirtualGroup.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSettleGlobalVirtualGroup proto.InternalMessageInfo + +func (m *EventSettleGlobalVirtualGroup) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *EventSettleGlobalVirtualGroup) GetSpIds() []uint32 { + if m != nil { + return m.SpIds + } + return nil +} + +func (m *EventSettleGlobalVirtualGroup) GetSpFundingAddresses() []string { + if m != nil { + return m.SpFundingAddresses + } + return nil +} + func init() { proto.RegisterType((*EventCreateGlobalVirtualGroup)(nil), "greenfield.virtualgroup.EventCreateGlobalVirtualGroup") proto.RegisterType((*EventUpdateGlobalVirtualGroup)(nil), "greenfield.virtualgroup.EventUpdateGlobalVirtualGroup") @@ -1247,6 +1377,8 @@ func init() { proto.RegisterType((*EventCompleteSwapIn)(nil), "greenfield.virtualgroup.EventCompleteSwapIn") proto.RegisterType((*EventCancelSwapIn)(nil), "greenfield.virtualgroup.EventCancelSwapIn") proto.RegisterType((*EventStorageProviderForcedExit)(nil), "greenfield.virtualgroup.EventStorageProviderForcedExit") + proto.RegisterType((*EventSettleGlobalVirtualGroupFamily)(nil), "greenfield.virtualgroup.EventSettleGlobalVirtualGroupFamily") + proto.RegisterType((*EventSettleGlobalVirtualGroup)(nil), "greenfield.virtualgroup.EventSettleGlobalVirtualGroup") } func init() { @@ -1254,65 +1386,71 @@ func init() { } var fileDescriptor_ece39ea12016bd5b = []byte{ - // 927 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xac, 0xdd, 0x12, 0xbf, 0xc4, 0x49, 0xbb, 0x75, 0xf1, 0x92, 0x52, 0xc7, 0x5a, 0x50, - 0xf1, 0x25, 0xf6, 0x01, 0x2a, 0x90, 0xe0, 0x42, 0xfa, 0x4f, 0x96, 0x10, 0x44, 0x6b, 0x8a, 0x04, - 0x97, 0xd5, 0x78, 0x67, 0xb2, 0x19, 0xd5, 0xde, 0x59, 0xcd, 0x8c, 0x43, 0xd2, 0x8f, 0xc0, 0x05, - 0xc4, 0x67, 0xe9, 0x07, 0xe0, 0xd8, 0x63, 0xd5, 0x13, 0xe2, 0x50, 0x55, 0x09, 0x17, 0x4e, 0x70, - 0x46, 0x42, 0xa0, 0x9d, 0x19, 0x3b, 0xfe, 0xdf, 0xd4, 0x69, 0x05, 0xe4, 0x94, 0xf8, 0xcd, 0x9b, - 0x37, 0xef, 0xf7, 0x7b, 0xbf, 0xf7, 0x66, 0x16, 0xde, 0x8d, 0x05, 0xa5, 0xc9, 0x2e, 0xa3, 0x1d, - 0xd2, 0xd8, 0x67, 0x42, 0xf5, 0x70, 0x27, 0x16, 0xbc, 0x97, 0x36, 0xe8, 0x3e, 0x4d, 0x94, 0xac, - 0xa7, 0x82, 0x2b, 0xee, 0x96, 0x4f, 0xbc, 0xea, 0xc3, 0x5e, 0x1b, 0x6f, 0x45, 0x5c, 0x76, 0xb9, - 0x0c, 0xb5, 0x5b, 0xc3, 0xfc, 0x30, 0x7b, 0x36, 0x4a, 0x31, 0x8f, 0xb9, 0xb1, 0x67, 0xff, 0x19, - 0xab, 0xff, 0x87, 0x03, 0xd7, 0xef, 0x64, 0xa1, 0x6f, 0x09, 0x8a, 0x15, 0xbd, 0xd7, 0xe1, 0x6d, - 0xdc, 0xf9, 0xca, 0x84, 0xbc, 0x97, 0x85, 0x74, 0xd7, 0xc0, 0x61, 0xc4, 0x43, 0x55, 0x54, 0x2b, - 0x06, 0x0e, 0x23, 0xee, 0x35, 0x28, 0xec, 0xe2, 0x2e, 0xeb, 0x1c, 0x86, 0x8c, 0x78, 0x8e, 0x36, - 0x2f, 0x1b, 0x43, 0x93, 0xb8, 0x3e, 0x14, 0x53, 0xc1, 0xba, 0x58, 0x1c, 0x86, 0x32, 0xcd, 0x1c, - 0x72, 0xda, 0x61, 0xc5, 0x1a, 0x5b, 0x69, 0x93, 0xb8, 0x35, 0xb8, 0x24, 0x69, 0xc4, 0x13, 0x32, - 0xf0, 0x92, 0x5e, 0xbe, 0x9a, 0xab, 0x15, 0x83, 0xb5, 0x81, 0x3d, 0x73, 0x94, 0xee, 0x26, 0xac, - 0x48, 0xc5, 0x05, 0x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x4b, 0xd6, 0xa5, 0xfe, 0x5f, 0x08, 0xae, 0x4c, 0x4c, 0xbe, - 0x05, 0xd8, 0xf8, 0x18, 0x36, 0xfa, 0x29, 0xcd, 0x9c, 0x7d, 0x65, 0x9b, 0xe0, 0x6b, 0x19, 0x7f, - 0x73, 0xa8, 0xcc, 0xcf, 0xa6, 0xd2, 0x7f, 0x8e, 0xe0, 0xf2, 0xd8, 0xf0, 0x3b, 0x67, 0x5a, 0xf0, - 0x77, 0xa0, 0x32, 0x6d, 0xe4, 0xdd, 0x1d, 0x74, 0xc4, 0xcb, 0xc2, 0xdd, 0xfe, 0xfc, 0xf1, 0x51, - 0x05, 0x3d, 0x39, 0xaa, 0xa0, 0xe7, 0x47, 0x15, 0xf4, 0xc3, 0x71, 0x65, 0xe9, 0xc9, 0x71, 0x65, - 0xe9, 0xe7, 0xe3, 0xca, 0xd2, 0x37, 0x1f, 0x0c, 0x35, 0x70, 0x3b, 0x69, 0x6f, 0x45, 0x7b, 0x98, - 0x25, 0x8d, 0xa1, 0x8f, 0xe8, 0x83, 0xd1, 0xcf, 0x68, 0xdd, 0xd2, 0xed, 0x8b, 0xfa, 0xe3, 0xf7, - 0xfd, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xa6, 0xb9, 0x16, 0x32, 0x6e, 0x0f, 0x00, 0x00, + // 1016 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0xae, 0x9d, 0x10, 0xbf, 0xc4, 0x49, 0xba, 0x71, 0xf0, 0x92, 0x12, 0xc7, 0x5a, 0x50, + 0xf1, 0x25, 0xf6, 0x01, 0x2a, 0x90, 0xe0, 0x42, 0xda, 0xa6, 0x32, 0x42, 0x10, 0xd9, 0x2d, 0x12, + 0x5c, 0x56, 0xeb, 0x9d, 0xc9, 0x66, 0x54, 0xef, 0xce,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0x56, 0x9a, 0xfb, 0xf9, 0xac, 0x34, 0xf7, 0xcd, + 0x07, 0x7d, 0x7e, 0x5b, 0x51, 0x6b, 0xc7, 0x3f, 0xf4, 0x48, 0x54, 0xeb, 0xfb, 0x34, 0x72, 0x3c, + 0xf8, 0x71, 0x44, 0x9e, 0xd4, 0x5a, 0x90, 0x9f, 0x34, 0xde, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, + 0x4c, 0x7d, 0xe7, 0x95, 0x44, 0x11, 0x00, 0x00, } func (m *EventCreateGlobalVirtualGroup) Marshal() (dAtA []byte, err error) { @@ -2195,6 +2333,121 @@ func (m *EventStorageProviderForcedExit) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *EventSettleGlobalVirtualGroupFamily) 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 *EventSettleGlobalVirtualGroupFamily) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSettleGlobalVirtualGroupFamily) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.SpFundingAddress) > 0 { + i -= len(m.SpFundingAddress) + copy(dAtA[i:], m.SpFundingAddress) + i = encodeVarintEvents(dAtA, i, uint64(len(m.SpFundingAddress))) + i-- + dAtA[i] = 0x1a + } + if m.SpId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.SpId)) + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventSettleGlobalVirtualGroup) 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 *EventSettleGlobalVirtualGroup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSettleGlobalVirtualGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.SpFundingAddresses) > 0 { + for iNdEx := len(m.SpFundingAddresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SpFundingAddresses[iNdEx]) + copy(dAtA[i:], m.SpFundingAddresses[iNdEx]) + i = encodeVarintEvents(dAtA, i, uint64(len(m.SpFundingAddresses[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.SpIds) > 0 { + dAtA16 := make([]byte, len(m.SpIds)*10) + var j15 int + for _, num := range m.SpIds { + for num >= 1<<7 { + dAtA16[j15] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j15++ + } + dAtA16[j15] = uint8(num) + j15++ + } + i -= j15 + copy(dAtA[i:], dAtA16[:j15]) + i = encodeVarintEvents(dAtA, i, uint64(j15)) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -2593,6 +2846,54 @@ func (m *EventStorageProviderForcedExit) Size() (n int) { return n } +func (m *EventSettleGlobalVirtualGroupFamily) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovEvents(uint64(m.Id)) + } + if m.SpId != 0 { + n += 1 + sovEvents(uint64(m.SpId)) + } + l = len(m.SpFundingAddress) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovEvents(uint64(l)) + return n +} + +func (m *EventSettleGlobalVirtualGroup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovEvents(uint64(m.Id)) + } + if len(m.SpIds) > 0 { + l = 0 + for _, e := range m.SpIds { + l += sovEvents(uint64(e)) + } + n += 1 + sovEvents(uint64(l)) + l + } + if len(m.SpFundingAddresses) > 0 { + for _, s := range m.SpFundingAddresses { + l = len(s) + n += 1 + l + sovEvents(uint64(l)) + } + } + l = m.Amount.Size() + n += 1 + l + sovEvents(uint64(l)) + return n +} + func sovEvents(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -5308,6 +5609,371 @@ func (m *EventStorageProviderForcedExit) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventSettleGlobalVirtualGroupFamily) 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: EventSettleGlobalVirtualGroupFamily: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSettleGlobalVirtualGroupFamily: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SpId", wireType) + } + m.SpId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SpId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpFundingAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpFundingAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.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 (m *EventSettleGlobalVirtualGroup) 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: EventSettleGlobalVirtualGroup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSettleGlobalVirtualGroup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType == 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SpIds = append(m.SpIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.SpIds) == 0 { + m.SpIds = make([]uint32, 0, elementCount) + } + for iNdEx < postIndex { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SpIds = append(m.SpIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field SpIds", wireType) + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpFundingAddresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpFundingAddresses = append(m.SpFundingAddresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.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