use of com.radixdlt.store.EngineStore in project radixdlt by radixdlt.
the class RadixEngineStateComputerTest method getExternalModule.
private Module getExternalModule() {
return new AbstractModule() {
@Override
public void configure() {
var validatorSet = BFTValidatorSet.from(registeredNodes.stream().map(ECKeyPair::getPublicKey).map(BFTNode::create).map(n -> BFTValidator.from(n, UInt256.ONE)));
bind(ProposerElection.class).toInstance(new WeightedRotatingLeaders(validatorSet));
bind(Serialization.class).toInstance(serialization);
bind(Hasher.class).toInstance(Sha256Hasher.withDefaultSerialization());
bind(new TypeLiteral<EngineStore<LedgerAndBFTProof>>() {
}).toInstance(engineStore);
bind(PersistentVertexStore.class).toInstance(mock(PersistentVertexStore.class));
install(MempoolConfig.asModule(10, 10));
install(new MainnetForksModule());
install(new RadixEngineForksLatestOnlyModule());
install(new ForksModule());
// HACK
bind(CommittedReader.class).toInstance(new NoOpCommittedReader());
bind(ForksEpochStore.class).toInstance(new NoOpForksEpochStore());
bind(LedgerAccumulator.class).to(SimpleLedgerAccumulatorAndVerifier.class);
bind(new TypeLiteral<EventDispatcher<MempoolAddSuccess>>() {
}).toInstance(TypedMocks.rmock(EventDispatcher.class));
bind(new TypeLiteral<EventDispatcher<InvalidProposedTxn>>() {
}).toInstance(TypedMocks.rmock(EventDispatcher.class));
bind(new TypeLiteral<EventDispatcher<TxnsRemovedFromMempool>>() {
}).toInstance(TypedMocks.rmock(EventDispatcher.class));
bind(new TypeLiteral<EventDispatcher<REOutput>>() {
}).toInstance(TypedMocks.rmock(EventDispatcher.class));
bind(new TypeLiteral<EventDispatcher<MempoolRelayTrigger>>() {
}).toInstance(TypedMocks.rmock(EventDispatcher.class));
bind(new TypeLiteral<EventDispatcher<LedgerUpdate>>() {
}).toInstance(TypedMocks.rmock(EventDispatcher.class));
bind(SystemCounters.class).to(SystemCountersImpl.class);
}
};
}
Aggregations