From 463de8b2f6692716b704176d6c73ec3d661afce8 Mon Sep 17 00:00:00 2001 From: envestcc Date: Wed, 7 Jun 2023 22:49:40 +0800 Subject: [PATCH] remove unnecessary interface --- blockindex/contractstaking/indexer.go | 20 -------------------- chainservice/chainservice.go | 2 +- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/blockindex/contractstaking/indexer.go b/blockindex/contractstaking/indexer.go index f4e063d188..0f251ce14a 100644 --- a/blockindex/contractstaking/indexer.go +++ b/blockindex/contractstaking/indexer.go @@ -15,7 +15,6 @@ import ( "github.com/pkg/errors" "github.com/iotexproject/iotex-core/blockchain/block" - "github.com/iotexproject/iotex-core/blockchain/blockdao" "github.com/iotexproject/iotex-core/db" ) @@ -24,25 +23,6 @@ const ( ) type ( - // ContractIndexer defines the interface of contract staking reader - ContractIndexer interface { - blockdao.BlockIndexerWithStart - - // CandidateVotes returns the total staked votes of a candidate - // candidate identified by owner address - CandidateVotes(ownerAddr address.Address) *big.Int - // Buckets returns active buckets - Buckets() ([]*Bucket, error) - // BucketsByIndices returns active buckets by indices - BucketsByIndices([]uint64) ([]*Bucket, error) - // BucketsByCandidate returns active buckets by candidate - BucketsByCandidate(ownerAddr address.Address) ([]*Bucket, error) - // TotalBucketCount returns the total number of buckets including burned buckets - TotalBucketCount() uint64 - // BucketTypes returns the active bucket types - BucketTypes() ([]*BucketType, error) - } - // Indexer is the contract staking indexer // Main functions: // 1. handle contract staking contract events when new block comes to generate index data diff --git a/chainservice/chainservice.go b/chainservice/chainservice.go index 63a68ffd52..7172167bab 100644 --- a/chainservice/chainservice.go +++ b/chainservice/chainservice.go @@ -86,7 +86,7 @@ type ChainService struct { candidateIndexer *poll.CandidateIndexer candBucketsIndexer *staking.CandidatesBucketsIndexer sgdIndexer blockindex.SGDRegistry - contractStakingIndexer contractstaking.ContractIndexer + contractStakingIndexer *contractstaking.Indexer registry *protocol.Registry nodeInfoManager *nodeinfo.InfoManager }