use of io.nem.symbol.sdk.model.blockchain.MerkleStateInfo in project nem2-sdk-java by nemtech.
the class RestrictionMosaicRepositoryOkHttpImplTest method getMosaicRestrictionsMerkle.
@Test
public void getMosaicRestrictionsMerkle() throws Exception {
mockRemoteCall(new MerkleStateInfoDTO().raw("abc"));
MerkleStateInfo merkle = repository.getMosaicRestrictionsMerkle("abc").toFuture().get();
Assertions.assertEquals("abc", merkle.getRaw());
}
use of io.nem.symbol.sdk.model.blockchain.MerkleStateInfo in project nem2-sdk-java by nemtech.
the class MerkleMapper method toMerkleStateInfo.
public MerkleStateInfo toMerkleStateInfo(MerkleStateInfoDTO dto) {
MerkleTreeLeaf leaf = dto.getTree().stream().map(this::toLeaf).filter(Objects::nonNull).findFirst().orElse(null);
List<MerkleTreeBranch> branches = dto.getTree().stream().map(this::toBranch).filter(Objects::nonNull).collect(Collectors.toList());
MerkleTree tree = new MerkleTree(branches, leaf);
return new MerkleStateInfo(dto.getRaw(), tree);
}
use of io.nem.symbol.sdk.model.blockchain.MerkleStateInfo in project nem2-sdk-java by nemtech.
the class NamespaceRepositoryOkHttpImplTest method getNamespaceMerkle.
@Test
public void getNamespaceMerkle() throws Exception {
NamespaceId namespaceId = NamespaceId.createFromName("accountalias");
mockRemoteCall(new MerkleStateInfoDTO().raw("abc"));
MerkleStateInfo merkle = repository.getNamespaceMerkle(namespaceId).toFuture().get();
Assertions.assertEquals("abc", merkle.getRaw());
}
use of io.nem.symbol.sdk.model.blockchain.MerkleStateInfo in project nem2-sdk-java by nemtech.
the class MetadataRepositoryOkHttpImplTest method getMetadataMerkle.
@Test
public void getMetadataMerkle() throws Exception {
mockRemoteCall(new MerkleStateInfoDTO().raw("abc"));
MerkleStateInfo merkle = repository.getMetadataMerkle("abc").toFuture().get();
Assertions.assertEquals("abc", merkle.getRaw());
}
use of io.nem.symbol.sdk.model.blockchain.MerkleStateInfo in project nem2-sdk-java by nemtech.
the class RestrictionMosaicRepositoryVertxImplTest method getMosaicRestrictionsMerkle.
@Test
public void getMosaicRestrictionsMerkle() throws Exception {
mockRemoteCall(new MerkleStateInfoDTO().raw("abc"));
MerkleStateInfo merkle = repository.getMosaicRestrictionsMerkle("hash").toFuture().get();
Assertions.assertEquals("abc", merkle.getRaw());
}
Aggregations