Skip to content

Commit

Permalink
Merge pull request #87 from Cerebellum-Network/feature/blockchain-v5.…
Browse files Browse the repository at this point in the history
…0.0-events-types

Update events types to blockchain `v5.0.0`
  • Loading branch information
khssnv authored May 2, 2024
2 parents 7e693f3 + 1f606dc commit 262e8fd
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 34 deletions.
33 changes: 17 additions & 16 deletions blockchain/pallets/ddccustomers.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,29 @@ type UnlockChunk struct {
// Events
type (
EventDdcCustomersDeposited struct {
Phase types.Phase
Owner types.AccountID
Amount types.U128
Topics []types.Hash
Phase types.Phase
OwnerId types.AccountID
Amount types.U128
Topics []types.Hash
}
EventDdcCustomersInitialDepositUnlock struct {
Phase types.Phase
Owner types.AccountID
Amount types.U128
Topics []types.Hash
Phase types.Phase
OwnerId types.AccountID
Amount types.U128
Topics []types.Hash
}
EventDdcCustomersWithdrawn struct {
Phase types.Phase
Owner types.AccountID
Amount types.U128
Topics []types.Hash
Phase types.Phase
OwnerId types.AccountID
Amount types.U128
Topics []types.Hash
}
EventDdcCustomersCharged struct {
Phase types.Phase
Owner types.AccountID
Amount types.U128
Topics []types.Hash
Phase types.Phase
OwnerId types.AccountID
Charged types.U128
ExpectedToCharge types.U128
Topics []types.Hash
}
EventDdcCustomersBucketCreated struct {
Phase types.Phase
Expand Down
65 changes: 47 additions & 18 deletions blockchain/pallets/ddcpayouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ type (
EventDdcPayoutsBillingReportInitialized struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
Topics []types.Hash
}

Expand All @@ -116,13 +117,14 @@ type (
}

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

EventDdcPayoutsIndebted struct {
Expand Down Expand Up @@ -172,19 +174,35 @@ type (
Topics []types.Hash
}

EventDdcPayouts struct {
Phase types.Phase
ClusterId ClusterId
Topics []types.Hash
EventDdcPayoutsRewarded struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
BatchIndex BatchIndex
NodeProviderId types.AccountID
Rewarded types.U128
ExpectedToReward types.U128
Topics []types.Hash
}

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

EventDdcPayoutsNotDistributedOverallReward struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
ExpectedReward types.U128
TotalDistributedReward types.U128
Topics []types.Hash
}

EventDdcPayoutsRewardingFinished struct {
Expand All @@ -206,6 +224,17 @@ type (
AuthorisedCaller types.AccountID
Topics []types.Hash
}

EventDdcPayoutsChargeError struct {
Phase types.Phase
ClusterId ClusterId
Era DdcEra
BatchIndex BatchIndex
CustomerId types.AccountID
Amount types.U128
Error types.DispatchError
Topics []types.Hash
}
)

type DdcPayoutsApi interface {
Expand Down
3 changes: 3 additions & 0 deletions blockchain/pallets/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ type Events struct {
DdcPayouts_ValidatorFeesCollected []EventDdcPayoutsValidatorFeesCollected //nolint:stylecheck,golint
DdcPayouts_RewardingStarted []EventDdcPayoutsRewardingStarted //nolint:stylecheck,golint
DdcPayouts_Rewarded []EventDdcPayoutsRewarded //nolint:stylecheck,golint
DdcPayouts_NotDistributedReward []EventDdcPayoutsNotDistributedReward //nolint:stylecheck,golint
DdcPayouts_NotDistributedOverallReward []EventDdcPayoutsNotDistributedOverallReward //nolint:stylecheck,golint
DdcPayouts_RewardingFinished []EventDdcPayoutsRewardingFinished //nolint:stylecheck,golint
DdcPayouts_BillingReportFinalized []EventDdcPayoutsBillingReportFinalized //nolint:stylecheck,golint
DdcPayouts_AuthorisedCaller []EventDdcPayoutsAuthorisedCaller //nolint:stylecheck,golint
DdcPayouts_ChargeError []EventDdcPayoutsChargeError //nolint:stylecheck,golint

DdcStaking_Bonded []EventDdcStakingBonded //nolint:stylecheck,golint
DdcStaking_Chilled []EventDdcStakingChilled //nolint:stylecheck,golint
Expand Down

0 comments on commit 262e8fd

Please sign in to comment.