use of org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftGetPendingVotes in project besu by hyperledger.
the class IbftJsonRpcMethods method create.
@Override
protected Map<String, JsonRpcMethod> create() {
final MutableBlockchain blockchain = context.getBlockchain();
final BlockchainQueries blockchainQueries = new BlockchainQueries(blockchain, context.getWorldStateArchive());
final BftContext bftContext = context.getConsensusContext(BftContext.class);
final BlockInterface blockInterface = bftContext.getBlockInterface();
final ValidatorProvider validatorProvider = context.getConsensusContext(BftContext.class).getValidatorProvider();
// Must create our own voteTallyCache as using this would pollute the main voteTallyCache
final ValidatorProvider readOnlyValidatorProvider = createValidatorProvider(context, blockchain);
return mapOf(new IbftProposeValidatorVote(validatorProvider), new IbftGetValidatorsByBlockNumber(blockchainQueries, blockInterface), new IbftDiscardValidatorVote(validatorProvider), new IbftGetValidatorsByBlockHash(blockchain, blockInterface), new IbftGetSignerMetrics(readOnlyValidatorProvider, blockInterface, blockchainQueries), new IbftGetPendingVotes(validatorProvider));
}
Aggregations