use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.
the class DepositOptionsTest method shouldReadDepositOptionsFromConfigurationFile.
@Test
public void shouldReadDepositOptionsFromConfigurationFile() {
final TekuConfiguration config = getTekuConfigurationFromFile("depositOptions_config.yaml");
assertThat(config.powchain().isEnabled()).isTrue();
assertThat(config.powchain().getEth1Endpoints()).containsExactly("http://example.com:1234/path/");
}
use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.
the class DepositOptionsTest method multiple_eth1Endpoints_areSupported_mixedParams.
@Test
public void multiple_eth1Endpoints_areSupported_mixedParams() {
final String[] args = { "--eth1-endpoint", "http://example-single.com:1234/path/", "--eth1-endpoints", "http://example.com:1234/path/,http://example-2.com:1234/path/", "http://example-3.com:1234/path/" };
final TekuConfiguration config = getTekuConfigurationFromArguments(args);
assertThat(config.powchain().getEth1Endpoints()).containsExactlyInAnyOrder("http://example-single.com:1234/path/", "http://example.com:1234/path/", "http://example-2.com:1234/path/", "http://example-3.com:1234/path/");
assertThat(config.powchain().isEnabled()).isTrue();
}
use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.
the class DepositOptionsTest method multiple_eth1Endpoints_areSupported.
@Test
public void multiple_eth1Endpoints_areSupported() {
final String[] args = { "--eth1-endpoints", "http://example.com:1234/path/,http://example-2.com:1234/path/", "http://example-3.com:1234/path/" };
final TekuConfiguration config = getTekuConfigurationFromArguments(args);
assertThat(config.powchain().getEth1Endpoints()).containsExactlyInAnyOrder("http://example.com:1234/path/", "http://example-2.com:1234/path/", "http://example-3.com:1234/path/");
assertThat(config.powchain().isEnabled()).isTrue();
assertThat(createConfigBuilder().powchain(b -> b.eth1Endpoints(List.of("http://example.com:1234/path/", "http://example-2.com:1234/path/", "http://example-3.com:1234/path/"))).build()).usingRecursiveComparison().isEqualTo(config);
}
use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.
the class Eth2P2PNetworkOptionsTest method initialState_shouldAcceptValue.
@Test
public void initialState_shouldAcceptValue() {
final String state = "state.ssz";
final TekuConfiguration config = getTekuConfigurationFromArguments("--initial-state", state);
assertThat(config.eth2NetworkConfiguration().getInitialState()).contains(state);
assertThat(createConfigBuilder().eth2NetworkConfig(b -> b.customInitialState(state)).build()).usingRecursiveComparison().isEqualTo(config);
}
use of tech.pegasys.teku.config.TekuConfiguration in project teku by ConsenSys.
the class Eth2P2PNetworkOptionsTest method overrideDepositContract.
@Test
public void overrideDepositContract() {
beaconNodeCommand.parse(new String[] { "--network", "mainnet", "--eth1-deposit-contract-address", "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73" });
TekuConfiguration tekuConfiguration = getResultingTekuConfiguration();
Eth2NetworkConfiguration configuration = tekuConfiguration.eth2NetworkConfiguration();
final Eth1Address configuredDepositContract = configuration.getEth1DepositContractAddress();
assertThat(configuredDepositContract).isEqualTo(Eth1Address.fromHexString("0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"));
assertThat(createConfigBuilder().eth2NetworkConfig(b -> {
b.applyNetworkDefaults(Eth2Network.MAINNET);
b.eth1DepositContractAddress("0xfe3b557e8fb62b89f4916b721be55ceb828dbd73");
}).build()).usingRecursiveComparison().isEqualTo(tekuConfiguration);
}
Aggregations