use of io.nem.symbol.sdk.api.BlockService in project nem2-sdk-java by nemtech.
the class BlockServiceIntegrationTest method isValidTransactionInBlock.
@ParameterizedTest
@EnumSource(RepositoryType.class)
void isValidTransactionInBlock(RepositoryType type) {
BigInteger height = BigInteger.ONE;
RepositoryFactory repositoryFactory = getRepositoryFactory(type);
TransactionRepository transactionRepository = getRepositoryFactory(type).createTransactionRepository();
List<Transaction> transactions = get(transactionRepository.search(new TransactionSearchCriteria(TransactionGroup.CONFIRMED).height(height).pageNumber(1))).getData();
BlockService service = new BlockServiceImpl(repositoryFactory);
transactions.forEach(t -> {
String hash = t.getTransactionInfo().get().getHash().get();
Assertions.assertNotNull(hash);
Boolean valid = get(service.isValidTransactionInBlock(height, hash));
Assertions.assertTrue(valid);
});
}
Aggregations