use of com.radixdlt.modules.MockedKeyModule in project radixdlt by radixdlt.
the class MempoolRunnerTest method createModule.
@SuppressWarnings(// The mock method doesn't support type-safe generics due to type erasure
"unchecked")
public Module createModule() {
return new AbstractModule() {
@Override
public void configure() {
bind(BFTNode.class).annotatedWith(Self.class).toInstance(BFTNode.random());
bind(LedgerProof.class).annotatedWith(LastProof.class).toInstance(mock(LedgerProof.class));
bind(StateComputer.class).toInstance(stateComputer);
bind(SystemCounters.class).toInstance(new SystemCountersImpl());
bind(RxRemoteEnvironment.class).toInstance(new RxRemoteEnvironment() {
@Override
public <T> Flowable<RemoteEvent<T>> remoteEvents(Class<T> remoteEventClass) {
return Flowable.never();
}
});
bind(LedgerAccumulator.class).toInstance(mock(LedgerAccumulator.class));
bind(LedgerAccumulatorVerifier.class).toInstance(mock(LedgerAccumulatorVerifier.class));
bind(new TypeLiteral<Comparator<LedgerProof>>() {
}).toInstance(mock(Comparator.class));
bind(Addressing.class).toInstance(Addressing.ofNetwork(Network.LOCALNET));
bind(TimeSupplier.class).toInstance(System::currentTimeMillis);
Multibinder.newSetBinder(binder(), StartProcessorOnRunner.class);
install(MempoolConfig.asModule(100, 10));
install(new MockedKeyModule());
install(new MockedCryptoModule());
install(new RxEnvironmentModule());
install(new DispatcherModule());
install(new MempoolReceiverModule());
install(new EventLoggerModule());
}
};
}
Aggregations