use of io.nem.symbol.sdk.api.FinalizationRepository in project nem2-sdk-java by nemtech.
the class FinalizationRepositoryIntegrationTest method getFinalizationProofAtHeight.
@ParameterizedTest
@EnumSource(RepositoryType.class)
void getFinalizationProofAtHeight(RepositoryType type) {
FinalizationRepository repository = getRepositoryFactory(type).createFinalizationRepository();
FinalizationProof finalizationProof = get(repository.getFinalizationProofAtHeight(BigInteger.ONE));
Assertions.assertEquals(1L, finalizationProof.getFinalizationEpoch());
Assertions.assertEquals(1L, finalizationProof.getFinalizationPoint());
Assertions.assertEquals(BigInteger.ONE, finalizationProof.getHeight());
Assertions.assertEquals(1, finalizationProof.getVersion());
}
use of io.nem.symbol.sdk.api.FinalizationRepository in project nem2-sdk-java by nemtech.
the class FinalizationRepositoryIntegrationTest method getFinalizationProofAtCurrentFinalizedHeight.
@ParameterizedTest
@EnumSource(RepositoryType.class)
void getFinalizationProofAtCurrentFinalizedHeight(RepositoryType type) {
RepositoryFactory repositoryFactory = getRepositoryFactory(type);
FinalizedBlock finalizedBlock = get(repositoryFactory.createChainRepository().getChainInfo()).getLatestFinalizedBlock();
FinalizationRepository repository = repositoryFactory.createFinalizationRepository();
FinalizationProof finalizationProof = get(repository.getFinalizationProofAtHeight(finalizedBlock.getHeight()));
Assertions.assertEquals(finalizationProof.getFinalizationEpoch(), finalizationProof.getFinalizationEpoch());
Assertions.assertEquals(finalizationProof.getFinalizationPoint(), finalizationProof.getFinalizationPoint());
Assertions.assertEquals(finalizationProof.getHeight(), finalizationProof.getHeight());
Assertions.assertEquals(1, finalizationProof.getVersion());
}
use of io.nem.symbol.sdk.api.FinalizationRepository in project nem2-sdk-java by nemtech.
the class FinalizationRepositoryIntegrationTest method getFinalizationProofAtEpochLatest.
@ParameterizedTest
@EnumSource(RepositoryType.class)
void getFinalizationProofAtEpochLatest(RepositoryType type) {
RepositoryFactory repositoryFactory = getRepositoryFactory(type);
FinalizedBlock finalizedBlock = get(repositoryFactory.createChainRepository().getChainInfo()).getLatestFinalizedBlock();
FinalizationRepository repository = repositoryFactory.createFinalizationRepository();
FinalizationProof finalizationProof = get(repository.getFinalizationProofAtEpoch(finalizedBlock.getFinalizationEpoch()));
Assertions.assertEquals(finalizationProof.getFinalizationEpoch(), finalizationProof.getFinalizationEpoch());
Assertions.assertEquals(finalizationProof.getFinalizationPoint(), finalizationProof.getFinalizationPoint());
Assertions.assertEquals(finalizationProof.getHeight(), finalizationProof.getHeight());
Assertions.assertEquals(1, finalizationProof.getVersion());
}
use of io.nem.symbol.sdk.api.FinalizationRepository in project nem2-sdk-java by nemtech.
the class FinalizationRepositoryIntegrationTest method getFinalizationProofAtEpoch.
@ParameterizedTest
@EnumSource(RepositoryType.class)
void getFinalizationProofAtEpoch(RepositoryType type) {
FinalizationRepository repository = getRepositoryFactory(type).createFinalizationRepository();
FinalizationProof finalizationProof = get(repository.getFinalizationProofAtEpoch(1));
Assertions.assertEquals(1L, finalizationProof.getFinalizationEpoch());
Assertions.assertEquals(1L, finalizationProof.getFinalizationPoint());
Assertions.assertEquals(BigInteger.ONE, finalizationProof.getHeight());
Assertions.assertEquals(1, finalizationProof.getVersion());
}
Aggregations