From 985630a428830d766beb7ef0f2ffa98afcfc8add Mon Sep 17 00:00:00 2001 From: "Alisher A. Khassanov" Date: Fri, 10 May 2024 14:17:08 +0500 Subject: [PATCH] Remove custom events records and types definitions --- blockchain/pallets/contracts.go | 47 --------- blockchain/pallets/ddcclusters.go | 35 ------- blockchain/pallets/ddccustomers.go | 44 --------- blockchain/pallets/ddcnodes.go | 21 ----- blockchain/pallets/ddcpayouts.go | 147 ----------------------------- blockchain/pallets/ddcstaking.go | 59 ------------ blockchain/pallets/events.go | 61 ------------ 7 files changed, 414 deletions(-) delete mode 100644 blockchain/pallets/contracts.go delete mode 100644 blockchain/pallets/ddcstaking.go delete mode 100644 blockchain/pallets/events.go diff --git a/blockchain/pallets/contracts.go b/blockchain/pallets/contracts.go deleted file mode 100644 index 70b0270..0000000 --- a/blockchain/pallets/contracts.go +++ /dev/null @@ -1,47 +0,0 @@ -package pallets - -import "github.com/centrifuge/go-substrate-rpc-client/v4/types" - -// Events -type ( - // These commented-out names are already defined in go-substrate-rpc-client, but some other - // types are missing. - // https://github.com/centrifuge/go-substrate-rpc-client/blob/8f01d19/types/event_record.go#L127 - // - // EventContractsCodeRemoved - // EventContractsCodeStored - // EventContractsContractCodeUpdated - // EventContractsContractEmitted - // EventContractsInstantiated - // EventContractsTerminated - - EventContractsCalled struct { - Phase types.Phase - Caller types.AccountID - Contract types.AccountID - Topics []types.Hash - } - - EventContractsDelegateCalled struct { - Phase types.Phase - Contract types.AccountID - CodeHash types.Hash - Topics []types.Hash - } - - EventContractsStorageDepositTransferredAndHeld struct { - Phase types.Phase - From types.AccountID - To types.AccountID - Amount types.U128 - Topics []types.Hash - } - - EventContractsStorageDepositTransferredAndReleased struct { - Phase types.Phase - From types.AccountID - To types.AccountID - Amount types.U128 - Topics []types.Hash - } -) diff --git a/blockchain/pallets/ddcclusters.go b/blockchain/pallets/ddcclusters.go index 03dbe5c..346a2ac 100644 --- a/blockchain/pallets/ddcclusters.go +++ b/blockchain/pallets/ddcclusters.go @@ -21,41 +21,6 @@ type ClusterProps struct { NodeProviderAuthContract types.AccountID } -// Events -type ( - EventDdcClustersClusterCreated struct { - Phase types.Phase - ClusterId ClusterId - Topics []types.Hash - } - - EventDdcClustersClusterNodeAdded struct { - Phase types.Phase - ClusterId ClusterId - NodePubKey NodePubKey - Topics []types.Hash - } - - EventDdcClustersClusterNodeRemoved struct { - Phase types.Phase - ClusterId ClusterId - NodePubKey NodePubKey - Topics []types.Hash - } - - EventDdcClustersClusterParamsSet struct { - Phase types.Phase - ClusterId ClusterId - Topics []types.Hash - } - - EventDdcClustersClusterGovParamsSet struct { - Phase types.Phase - ClusterId ClusterId - Topics []types.Hash - } -) - type DdcClustersApi interface { GetClustersNodes(clusterId ClusterId) ([]NodePubKey, error) } diff --git a/blockchain/pallets/ddccustomers.go b/blockchain/pallets/ddccustomers.go index 28bb432..e361aa4 100644 --- a/blockchain/pallets/ddccustomers.go +++ b/blockchain/pallets/ddccustomers.go @@ -26,50 +26,6 @@ type UnlockChunk struct { Block types.BlockNumber } -// Events -type ( - EventDdcCustomersDeposited struct { - Phase types.Phase - OwnerId types.AccountID - Amount types.U128 - Topics []types.Hash - } - EventDdcCustomersInitialDepositUnlock struct { - Phase types.Phase - OwnerId types.AccountID - Amount types.U128 - Topics []types.Hash - } - EventDdcCustomersWithdrawn struct { - Phase types.Phase - OwnerId types.AccountID - Amount types.U128 - Topics []types.Hash - } - EventDdcCustomersCharged struct { - Phase types.Phase - OwnerId types.AccountID - Charged types.U128 - ExpectedToCharge types.U128 - Topics []types.Hash - } - EventDdcCustomersBucketCreated struct { - Phase types.Phase - BucketId BucketId - Topics []types.Hash - } - EventDdcCustomersBucketUpdated struct { - Phase types.Phase - BucketId BucketId - Topics []types.Hash - } - EventDdcCustomersBucketRemoved struct { - Phase types.Phase - BucketId BucketId - Topics []types.Hash - } -) - type DdcCustomersApi interface { GetBuckets(bucketId BucketId) (types.Option[Bucket], error) GetBucketsCount() (types.U64, error) diff --git a/blockchain/pallets/ddcnodes.go b/blockchain/pallets/ddcnodes.go index fc765ba..be73372 100644 --- a/blockchain/pallets/ddcnodes.go +++ b/blockchain/pallets/ddcnodes.go @@ -31,27 +31,6 @@ type StorageNodeProps struct { Mode StorageNodeMode } -// Events -type ( - EventDdcNodesNodeCreated struct { - Phase types.Phase - NodePubKey NodePubKey - Topics []types.Hash - } - - EventDdcNodesNodeDeleted struct { - Phase types.Phase - NodePubKey NodePubKey - Topics []types.Hash - } - - EventDdcNodesNodeParamsChanged struct { - Phase types.Phase - NodePubKey NodePubKey - Topics []types.Hash - } -) - type DdcNodesApi interface { GetStorageNodes(pubkey StorageNodePubKey) (types.Option[StorageNode], error) } diff --git a/blockchain/pallets/ddcpayouts.go b/blockchain/pallets/ddcpayouts.go index 9311dee..9df6876 100644 --- a/blockchain/pallets/ddcpayouts.go +++ b/blockchain/pallets/ddcpayouts.go @@ -90,153 +90,6 @@ func (m State) Encode(encoder scale.Encoder) error { return nil } -// Events -type ( - EventDdcPayoutsBillingReportInitialized struct { - Phase types.Phase - ClusterId ClusterId - Era DdcEra - 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 - Charged types.U128 - ExpectedToCharge 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 - } - - EventDdcPayoutsRewarded struct { - Phase types.Phase - ClusterId ClusterId - Era DdcEra - BatchIndex BatchIndex - NodeProviderId types.AccountID - Rewarded types.U128 - ExpectedToReward 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 { - 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 - } - - 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 { GetActiveBillingReports(cluster ClusterId, era DdcEra) (types.Option[BillingReport], error) GetAuthorisedCaller() (types.Option[types.AccountID], error) diff --git a/blockchain/pallets/ddcstaking.go b/blockchain/pallets/ddcstaking.go deleted file mode 100644 index 1b543f1..0000000 --- a/blockchain/pallets/ddcstaking.go +++ /dev/null @@ -1,59 +0,0 @@ -package pallets - -import "github.com/centrifuge/go-substrate-rpc-client/v4/types" - -// Events -type ( - EventDdcStakingBonded struct { - Phase types.Phase - Stash types.AccountID - Amount types.U128 - Topics []types.Hash - } - - EventDdcStakingChilled struct { - Phase types.Phase - Stash types.AccountID - Topics []types.Hash - } - - EventDdcStakingChillSoon struct { - Phase types.Phase - Stash types.AccountID - ClusterId ClusterId - Block types.BlockNumber - Topics []types.Hash - } - - EventDdcStakingUnbonded struct { - Phase types.Phase - Stash types.AccountID - Amount types.U128 - Topics []types.Hash - } - - EventDdcStakingWithdrawn struct { - Phase types.Phase - Stash types.AccountID - Amount types.U128 - Topics []types.Hash - } - - EventDdcStakingActivated struct { - Phase types.Phase - Stash types.AccountID - Topics []types.Hash - } - - EventDdcStakingLeaveSoon struct { - Phase types.Phase - Stash types.AccountID - Topics []types.Hash - } - - EventDdcStakingLeft struct { - Phase types.Phase - Stash types.AccountID - Topics []types.Hash - } -) diff --git a/blockchain/pallets/events.go b/blockchain/pallets/events.go deleted file mode 100644 index 396b972..0000000 --- a/blockchain/pallets/events.go +++ /dev/null @@ -1,61 +0,0 @@ -package pallets - -import ( - chainbridge "github.com/Cerebellum-Network/chainbridge-substrate-events" - "github.com/centrifuge/go-substrate-rpc-client/v4/types" -) - -type Events struct { - types.EventRecords - chainbridge.Events - - Contracts_Called []EventContractsCalled //nolint:stylecheck,golint - Contracts_DelegateCalled []EventContractsDelegateCalled //nolint:stylecheck,golint - Contracts_StorageDepositTransferredAndHeld []EventContractsStorageDepositTransferredAndHeld //nolint:stylecheck,golint - Contracts_StorageDepositTransferredAndReleased []EventContractsStorageDepositTransferredAndReleased //nolint:stylecheck,golint - - DdcClusters_ClusterCreated []EventDdcClustersClusterCreated //nolint:stylecheck,golint - DdcClusters_ClusterNodeAdded []EventDdcClustersClusterNodeAdded //nolint:stylecheck,golint - DdcClusters_ClusterNodeRemoved []EventDdcClustersClusterNodeRemoved //nolint:stylecheck,golint - DdcClusters_ClusterParamsSet []EventDdcClustersClusterParamsSet //nolint:stylecheck,golint - DdcClusters_ClusterGovParamsSet []EventDdcClustersClusterGovParamsSet //nolint:stylecheck,golint - - DdcCustomers_Deposited []EventDdcCustomersDeposited //nolint:stylecheck,golint - DdcCustomers_InitialDepositUnlock []EventDdcCustomersInitialDepositUnlock //nolint:stylecheck,golint - DdcCustomers_Withdrawn []EventDdcCustomersWithdrawn //nolint:stylecheck,golint - DdcCustomers_Charged []EventDdcCustomersCharged //nolint:stylecheck,golint - DdcCustomers_BucketCreated []EventDdcCustomersBucketCreated //nolint:stylecheck,golint - DdcCustomers_BucketUpdated []EventDdcCustomersBucketUpdated //nolint:stylecheck,golint - DdcCustomers_BucketRemoved []EventDdcCustomersBucketRemoved //nolint:stylecheck,golint - - DdcNodes_NodeCreated []EventDdcNodesNodeCreated //nolint:stylecheck,golint - DdcNodes_NodeDeleted []EventDdcNodesNodeDeleted //nolint:stylecheck,golint - DdcNodes_NodeParamsChanged []EventDdcNodesNodeParamsChanged //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 []EventDdcPayoutsTreasuryFeesCollected //nolint:stylecheck,golint - DdcPayouts_ClusterReserveFeesCollected []EventDdcPayoutsClusterReserveFeesCollected //nolint:stylecheck,golint - 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 - DdcStaking_ChillSoon []EventDdcStakingChillSoon //nolint:stylecheck,golint - DdcStaking_Unbonded []EventDdcStakingUnbonded //nolint:stylecheck,golint - DdcStaking_Withdrawn []EventDdcStakingWithdrawn //nolint:stylecheck,golint - DdcStaking_Activated []EventDdcStakingActivated //nolint:stylecheck,golint - DdcStaking_LeaveSoon []EventDdcStakingLeaveSoon //nolint:stylecheck,golint - DdcStaking_Left []EventDdcStakingLeft //nolint:stylecheck,golint -}