use of tech.pegasys.teku.api.schema.Fork in project teku by ConsenSys.
the class GetForkIntegrationTest method shouldGetForkChoiceAtEmptyHeadSlot.
@Test
public void shouldGetForkChoiceAtEmptyHeadSlot() throws IOException {
createBlocksAtSlots(10, 11, 12);
setCurrentSlot(13);
final Response response = get("head");
assertThat(response.code()).isEqualTo(SC_OK);
final GetStateForkResponse body = jsonProvider.jsonToObject(response.body().string(), GetStateForkResponse.class);
final Fork data = body.data;
final Fork expected = new Fork(safeJoin(recentChainData.getBestState().get()).getFork());
assertThat(expected).isEqualTo(data);
}
use of tech.pegasys.teku.api.schema.Fork in project web3signer by ConsenSys.
the class Eth2RequestUtils method forkInfo.
public static ForkInfo forkInfo(long epoch) {
final Fork fork = new Fork(Bytes4.fromHexString("0x00000001"), Bytes4.fromHexString("0x00000001"), UInt64.valueOf(epoch));
final Bytes32 genesisValidatorsRoot = Bytes32.fromHexString(GENESIS_VALIDATORS_ROOT);
return new ForkInfo(fork, genesisValidatorsRoot);
}
use of tech.pegasys.teku.api.schema.Fork in project web3signer by ConsenSys.
the class Eth2RequestUtils method forkInfo.
public static ForkInfo forkInfo() {
final Fork fork = new Fork(Bytes4.fromHexString("0x00000001"), Bytes4.fromHexString("0x00000001"), UInt64.valueOf(1));
final Bytes32 genesisValidatorsRoot = Bytes32.fromHexString(GENESIS_VALIDATORS_ROOT);
return new ForkInfo(fork, genesisValidatorsRoot);
}
use of tech.pegasys.teku.api.schema.Fork in project teku by ConsenSys.
the class ChainDataProviderTest method getStateFork_shouldGetForkAtGenesis.
@Test
public void getStateFork_shouldGetForkAtGenesis() {
final ChainDataProvider provider = new ChainDataProvider(spec, recentChainData, combinedChainDataClient);
final Bytes4 bytes4 = Bytes4.fromHexString("0x00000001");
final SafeFuture<Optional<ObjectAndMetaData<Fork>>> result = provider.getStateFork("genesis");
assertThatSafeFuture(result).isCompletedWithOptionalContaining(addMetaData(new Fork(bytes4, bytes4, ZERO), ZERO));
}
Aggregations