Skip to content

Commit

Permalink
Add pallet-ddc-payouts event types
Browse files Browse the repository at this point in the history
  • Loading branch information
khssnv committed Jan 3, 2024
1 parent daae22b commit ec30fe8
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 0 deletions.
118 changes: 118 additions & 0 deletions blockchain/pallets/ddcpayouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,124 @@ func (m State) Encode(encoder scale.Encoder) error {
return nil
}

// Events
type (
EventDdcPayoutsBillingReportInitialized struct {
Phase types.Phase
ClusterId ClusterId
Topics []types.Hash
}

EventDdcPayoutsChargingStarted struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
Topics []types.Hash
}

EventDdcPayoutsCharged struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
BatchIndex BatchIndex
CustomerId types.AccountID
Amount types.U128
Topics []types.Hash
}

EventDdcPayoutsChargeFailed struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
BatchIndex BatchIndex
CustomerId types.AccountID
Amount types.U128
Topics []types.Hash
}

EventDdcPayoutsIndebted struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
BatchIndex BatchIndex
CustomerId types.AccountID
Amount types.U128
Topics []types.Hash
}

EventDdcPayoutsChargingFinished struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
Topics []types.Hash
}

EventDdcPayoutsTreasuryFeesCollected struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
Topics []types.Hash
}

EventDdcPayoutsClusterReserveFeesCollected struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
Amount types.U128
Topics []types.Hash
}

EventDdcPayoutsValidatorFeesCollected struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
Amount types.U128
Topics []types.Hash
}

EventDdcPayoutsRewardingStarted struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
Topics []types.Hash
}

EventDdcPayouts struct {
Phase types.Phase
ClusterId ClusterId
Topics []types.Hash
}

EventDdcPayoutsRewarded struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
NodeProviderId types.AccountID
Amount types.U128
Topics []types.Hash
}

EventDdcPayoutsRewardingFinished struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
Topics []types.Hash
}

EventDdcPayoutsBillingReportFinalized struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
Topics []types.Hash
}

EventDdcPayoutsAuthorisedCaller struct {
Phase types.Phase
AuthorisedCaller types.AccountID
Topics []types.Hash
}
)

type DdcPayoutsApi interface {
GetActiveBillingReports(cluster ClusterId, era DdcEra) (types.Option[BillingReport], error)
GetAuthorisedCaller() (types.Option[types.AccountID], error)
Expand Down
15 changes: 15 additions & 0 deletions blockchain/pallets/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ type Events struct {
DdcCustomers_Charged []EventDdcCustomersCharged //nolint:stylecheck,golint
DdcCustomers_BucketCreated []EventDdcCustomersBucketCreated //nolint:stylecheck,golint
DdcCustomers_BucketUpdated []EventDdcCustomersBucketUpdated //nolint:stylecheck,golint

DdcPayouts_BillingReportInitialized []EventDdcPayoutsBillingReportInitialized //nolint:stylecheck,golint
DdcPayouts_ChargingStarted []EventDdcPayoutsChargingStarted //nolint:stylecheck,golint
DdcPayouts_Charged []EventDdcPayoutsCharged //nolint:stylecheck,golint
DdcPayouts_ChargeFailed []EventDdcPayoutsChargeFailed //nolint:stylecheck,golint
DdcPayouts_Indebted []EventDdcPayoutsIndebted //nolint:stylecheck,golint
DdcPayouts_ChargingFinished []EventDdcPayoutsChargingFinished //nolint:stylecheck,golint
DdcPayouts_TreasuryFeesCollected []EventDdcPayoutsClusterReserveFeesCollected //nolint:stylecheck,golint
DdcPayouts_ClusterReserveFeesCollected []EventDdcPayoutsTreasuryFeesCollected //nolint:stylecheck,golint
DdcPayouts_ValidatorFeesCollected []EventDdcPayoutsValidatorFeesCollected //nolint:stylecheck,golint
DdcPayouts_RewardingStarted []EventDdcPayoutsRewardingStarted //nolint:stylecheck,golint
DdcPayouts_Rewarded []EventDdcPayoutsRewarded //nolint:stylecheck,golint
DdcPayouts_RewardingFinished []EventDdcPayoutsRewardingFinished //nolint:stylecheck,golint
DdcPayouts_BillingReportFinalized []EventDdcPayoutsBillingReportFinalized //nolint:stylecheck,golint
DdcPayouts_AuthorisedCaller []EventDdcPayoutsAuthorisedCaller //nolint:stylecheck,golint
}

type NewEventSubscription[T any] struct {
Expand Down

0 comments on commit ec30fe8

Please sign in to comment.