Search in sources :

Example 16 with MerkleStateInfo

use of io.nem.symbol.sdk.model.blockchain.MerkleStateInfo in project nem2-sdk-java by nemtech.

the class RestrictionAccountRepositoryVertxImplTest method getAccountRestrictionsMerkle.

@Test
public void getAccountRestrictionsMerkle() throws Exception {
    Address address = Address.generateRandom(this.networkType);
    mockRemoteCall(new MerkleStateInfoDTO().raw("abc"));
    MerkleStateInfo merkle = repository.getAccountRestrictionsMerkle(address).toFuture().get();
    Assertions.assertEquals("abc", merkle.getRaw());
}
Also used : MerkleStateInfo(io.nem.symbol.sdk.model.blockchain.MerkleStateInfo) Address(io.nem.symbol.sdk.model.account.Address) MerkleStateInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.MerkleStateInfoDTO) Test(org.junit.jupiter.api.Test)

Example 17 with MerkleStateInfo

use of io.nem.symbol.sdk.model.blockchain.MerkleStateInfo in project nem2-sdk-java by nemtech.

the class MultisigRepositoryVertxImplTest method getMultisigAccountInfoMerkle.

@Test
public void getMultisigAccountInfoMerkle() throws Exception {
    Address address = Address.generateRandom(this.networkType);
    mockRemoteCall(new MerkleStateInfoDTO().raw("abc"));
    MerkleStateInfo merkle = repository.getMultisigAccountInfoMerkle(address).toFuture().get();
    Assertions.assertEquals("abc", merkle.getRaw());
}
Also used : MerkleStateInfo(io.nem.symbol.sdk.model.blockchain.MerkleStateInfo) Address(io.nem.symbol.sdk.model.account.Address) MerkleStateInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.MerkleStateInfoDTO) Test(org.junit.jupiter.api.Test)

Example 18 with MerkleStateInfo

use of io.nem.symbol.sdk.model.blockchain.MerkleStateInfo in project nem2-sdk-java by nemtech.

the class HashLockRepositoryVertxImplTest method getHashLockMerkle.

@Test
public void getHashLockMerkle() throws Exception {
    mockRemoteCall(new MerkleStateInfoDTO().raw("abc"));
    MerkleStateInfo merkle = repository.getHashLockMerkle("hash").toFuture().get();
    Assertions.assertEquals("abc", merkle.getRaw());
}
Also used : MerkleStateInfo(io.nem.symbol.sdk.model.blockchain.MerkleStateInfo) MerkleStateInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.MerkleStateInfoDTO) Test(org.junit.jupiter.api.Test)

Example 19 with MerkleStateInfo

use of io.nem.symbol.sdk.model.blockchain.MerkleStateInfo in project nem2-sdk-java by nemtech.

the class MerkleMapperVertxTest method testDtoToModelMapping.

@ParameterizedTest
@MethodSource("merkleJsonFiles")
void testDtoToModelMapping(String jsonFilename) {
    String json = TestHelperVertx.loadResource(jsonFilename);
    MerkleMapper merkleMapper = new MerkleMapper(jsonHelper);
    MerkleStateInfoDTO dto = jsonHelper.parse(json, MerkleStateInfoDTO.class);
    MerkleStateInfo merkleStateInfo = merkleMapper.toMerkleStateInfo(dto);
    Assertions.assertFalse(merkleStateInfo.getTree().getBranches().isEmpty());
    Assertions.assertNotNull(merkleStateInfo.getTree().getLeaf());
}
Also used : MerkleStateInfo(io.nem.symbol.sdk.model.blockchain.MerkleStateInfo) MerkleStateInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.MerkleStateInfoDTO) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 20 with MerkleStateInfo

use of io.nem.symbol.sdk.model.blockchain.MerkleStateInfo in project nem2-sdk-java by nemtech.

the class MosaicRepositoryVertxImplTest method getMetadataMerkle.

@Test
public void getMetadataMerkle() throws Exception {
    MosaicId mosaicId = MapperUtils.toMosaicId("481110499");
    mockRemoteCall(new MerkleStateInfoDTO().raw("abc"));
    MerkleStateInfo merkle = repository.getMosaicMerkle(mosaicId).toFuture().get();
    Assertions.assertEquals("abc", merkle.getRaw());
}
Also used : MerkleStateInfo(io.nem.symbol.sdk.model.blockchain.MerkleStateInfo) MosaicId(io.nem.symbol.sdk.model.mosaic.MosaicId) MerkleStateInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.MerkleStateInfoDTO) Test(org.junit.jupiter.api.Test)

Aggregations

MerkleStateInfo (io.nem.symbol.sdk.model.blockchain.MerkleStateInfo)21 Test (org.junit.jupiter.api.Test)17 MerkleStateInfoDTO (io.nem.symbol.sdk.openapi.vertx.model.MerkleStateInfoDTO)10 MerkleStateInfoDTO (io.nem.symbol.sdk.openapi.okhttp_gson.model.MerkleStateInfoDTO)9 Address (io.nem.symbol.sdk.model.account.Address)4 MosaicId (io.nem.symbol.sdk.model.mosaic.MosaicId)2 NamespaceId (io.nem.symbol.sdk.model.namespace.NamespaceId)2 MerkleTree (io.nem.symbol.sdk.model.state.MerkleTree)2 MerkleTreeBranch (io.nem.symbol.sdk.model.state.MerkleTreeBranch)2 MerkleTreeLeaf (io.nem.symbol.sdk.model.state.MerkleTreeLeaf)2 Objects (java.util.Objects)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 MethodSource (org.junit.jupiter.params.provider.MethodSource)2