use of tech.pegasys.teku.infrastructure.async.StubAsyncRunner in project teku by ConsenSys.
the class BeaconRestApiV1Test method setup.
@BeforeEach
public void setup() {
final Eth1Address depositContractAddress = new Eth1Address(Bytes.fromHexString("0xdddddddddddddddddddddddddddddddddddddddd"));
BeaconRestApiConfig beaconRestApiConfig = BeaconRestApiConfig.builder().restApiDocsEnabled(false).eth1DepositContractAddress(depositContractAddress).restApiPort(THE_PORT).build();
when(app.jettyServer()).thenReturn(server);
final DataProvider dataProvider = DataProvider.builder().spec(TestSpecFactory.createMinimalPhase0()).recentChainData(storageClient).combinedChainDataClient(combinedChainDataClient).p2pNetwork(null).syncService(syncService).validatorApiChannel(null).blockManager(blockManager).attestationManager(attestationManager).isLivenessTrackingEnabled(false).activeValidatorChannel(activeValidatorChannel).attestationPool(attestationPool).attesterSlashingPool(attesterSlashingPool).proposerSlashingPool(proposerSlashingPool).voluntaryExitPool(voluntaryExitPool).syncCommitteeContributionPool(syncCommitteeContributionPool).build();
new BeaconRestApi(dataProvider, beaconRestApiConfig, eventChannels, new StubAsyncRunner(), app);
}
use of tech.pegasys.teku.infrastructure.async.StubAsyncRunner in project teku by ConsenSys.
the class BeaconRestApiTest method setup.
@BeforeEach
public void setup() {
BeaconRestApiConfig beaconRestApiConfig = BeaconRestApiConfig.builder().restApiDocsEnabled(false).restApiPort(THE_PORT).eth1DepositContractAddress(Eth1Address.ZERO).build();
when(app.jettyServer()).thenReturn(server);
final DataProvider dataProvider = DataProvider.builder().spec(TestSpecFactory.createMinimalPhase0()).recentChainData(storageClient).combinedChainDataClient(combinedChainDataClient).p2pNetwork(null).syncService(syncService).validatorApiChannel(null).blockManager(blockManager).attestationManager(attestationManager).isLivenessTrackingEnabled(false).activeValidatorChannel(activeValidatorChannel).attestationPool(attestationPool).attesterSlashingPool(attesterSlashingPool).proposerSlashingPool(proposerSlashingPool).voluntaryExitPool(voluntaryExitPool).syncCommitteeContributionPool(syncCommitteeContributionPool).build();
new BeaconRestApi(dataProvider, beaconRestApiConfig, eventChannels, new StubAsyncRunner(), app);
}
use of tech.pegasys.teku.infrastructure.async.StubAsyncRunner in project teku by ConsenSys.
the class FallbackAwareEth1ProviderSelectorTest method shouldWaitUntilProviderSelectorHasBeenNotified.
@Test
void shouldWaitUntilProviderSelectorHasBeenNotified() throws ExecutionException, InterruptedException {
asyncRunner = new StubAsyncRunner();
providerSelector = new Eth1ProviderSelector(providers);
fallbackAwareEth1Provider = new FallbackAwareEth1Provider(providerSelector, asyncRunner);
when(node1.isValid()).thenReturn(true);
when(node1.ethSyncing()).thenReturn(SafeFuture.completedFuture(true));
final SafeFuture<Boolean> ethSyncing = fallbackAwareEth1Provider.ethSyncing();
providerSelector.notifyValidationCompletion();
assertThat(ethSyncing.get()).isTrue();
}
use of tech.pegasys.teku.infrastructure.async.StubAsyncRunner in project teku by ConsenSys.
the class SlashingProtectionLoggerTest method beforeEach.
@BeforeEach
public void beforeEach() throws Exception {
when(slashingProtector.getSigningRecord(any())).thenReturn(Optional.empty());
this.asyncRunner = new StubAsyncRunner();
this.validatorLogger = mock(ValidatorLogger.class);
this.slashingProtectionLogger = new SlashingProtectionLogger(slashingProtector, spec, asyncRunner, validatorLogger);
this.slashingProtectionLogger.onSlot(UInt64.ONE);
}
use of tech.pegasys.teku.infrastructure.async.StubAsyncRunner in project teku by ConsenSys.
the class Web3jEth1ProviderTest method setup.
@BeforeEach
void setup() {
asyncRunner = new StubAsyncRunner();
timeProvider = StubTimeProvider.withTimeInSeconds(1000);
provider = new Web3jEth1Provider(spec.getGenesisSpecConfig(), new StubMetricsSystem(), Eth1Provider.generateEth1ProviderId(0, "https://eth.test.org:1234/test"), web3, asyncRunner, timeProvider);
}
Aggregations