Skip to content

Commit

Permalink
fixed linter issues by removing unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sstanculeanu committed Mar 7, 2024
1 parent 271fd46 commit 069b541
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/multiversx/mx-chain-core-go/hashing"
"github.com/multiversx/mx-chain-core-go/marshal"
"github.com/multiversx/mx-chain-go/common"
"github.com/multiversx/mx-chain-go/common/disabled"
"github.com/multiversx/mx-chain-go/common/statistics"
"github.com/multiversx/mx-chain-go/config"
"github.com/multiversx/mx-chain-go/dataRetriever"
Expand All @@ -20,9 +19,6 @@ import (
"github.com/multiversx/mx-chain-go/p2p"
"github.com/multiversx/mx-chain-go/process/factory"
"github.com/multiversx/mx-chain-go/sharding"
"github.com/multiversx/mx-chain-go/storage"
storageFactory "github.com/multiversx/mx-chain-go/storage/factory"
trieFactory "github.com/multiversx/mx-chain-go/trie/factory"
)

const defaultBeforeGracefulClose = time.Minute
Expand Down Expand Up @@ -239,46 +235,6 @@ func (brcf *baseRequestersContainerFactory) createMiniBlocksRequester(responseTo
return mbRequester, nil
}

func (brcf *baseRequestersContainerFactory) newImportDBTrieStorage(
mainStorer storage.Storer,
storageIdentifier dataRetriever.UnitType,
handler common.EnableEpochsHandler,
stateStatsHandler common.StateStatisticsHandler,
) (common.StorageManager, dataRetriever.TrieDataGetter, error) {
pathManager, err := storageFactory.CreatePathManager(
storageFactory.ArgCreatePathManager{
WorkingDir: brcf.workingDir,
ChainID: brcf.chainID,
},
)
if err != nil {
return nil, nil, err
}

trieFactoryArgs := trieFactory.TrieFactoryArgs{
Marshalizer: brcf.marshalizer,
Hasher: brcf.hasher,
PathManager: pathManager,
TrieStorageManagerConfig: brcf.generalConfig.TrieStorageManagerConfig,
}
trieFactoryInstance, err := trieFactory.NewTrieFactory(trieFactoryArgs)
if err != nil {
return nil, nil, err
}

args := trieFactory.TrieCreateArgs{
MainStorer: mainStorer,
PruningEnabled: brcf.generalConfig.StateTriesConfig.AccountsStatePruningEnabled,
MaxTrieLevelInMem: brcf.generalConfig.StateTriesConfig.MaxStateTrieLevelInMemory,
SnapshotsEnabled: brcf.snapshotsEnabled,
IdleProvider: disabled.NewProcessStatusHandler(),
Identifier: storageIdentifier.String(),
EnableEpochsHandler: handler,
StatsCollector: stateStatsHandler,
}
return trieFactoryInstance.Create(args)
}

func (brcf *baseRequestersContainerFactory) generatePeerAuthenticationRequester() error {
identifierPeerAuth := common.PeerAuthenticationTopic
peerAuthRequester := disabledRequesters.NewDisabledRequester()
Expand Down
9 changes: 0 additions & 9 deletions process/smartContract/scQueryService.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,6 @@ func (service *SCQueryService) recreateTrie(blockRootHash []byte, blockHeader da
return accountsAdapter.RecreateTrie(blockRootHash)
}

func (service *SCQueryService) getCurrentEpoch() uint32 {
header := service.mainBlockChain.GetCurrentBlockHeader()
if check.IfNil(header) {
return 0
}

return header.GetEpoch()
}

// TODO: extract duplicated code with nodeBlocks.go
func (service *SCQueryService) extractBlockHeaderAndRootHash(query *process.SCQuery) (data.HeaderHandler, []byte, error) {
if len(query.BlockHash) > 0 {
Expand Down
12 changes: 0 additions & 12 deletions process/transaction/metaProcess.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,6 @@ func (txProc *metaTxProcessor) processSCInvoking(
return txProc.scProcessor.ExecuteSmartContractTransaction(tx, acntSrc, acntDst)
}

func (txProc *metaTxProcessor) processBuiltInFunctionCall(
tx *transaction.Transaction,
adrSrc, adrDst []byte,
) (vmcommon.ReturnCode, error) {
acntSrc, acntDst, err := txProc.getAccounts(adrSrc, adrDst)
if err != nil {
return 0, err
}

return txProc.scProcessor.ExecuteBuiltInFunction(tx, acntSrc, acntDst)
}

// IsInterfaceNil returns true if there is no value under the interface
func (txProc *metaTxProcessor) IsInterfaceNil() bool {
return txProc == nil
Expand Down

0 comments on commit 069b541

Please sign in to comment.