Search in sources :

Example 1 with MetadataEntryDTO

use of io.nem.symbol.sdk.openapi.vertx.model.MetadataEntryDTO in project nem2-sdk-java by nemtech.

the class MetadataRepositoryVertxImplTest method createMetadataDto.

private MetadataInfoDTO createMetadataDto(String name, MetadataTypeEnum type, String targetId) {
    MetadataInfoDTO dto = new MetadataInfoDTO();
    dto.setId(name);
    Address sourceAddress = Account.generateNewAccount(networkType).getAddress();
    Address targetAddress = Account.generateNewAccount(networkType).getAddress();
    MetadataEntryDTO metadataEntry = new MetadataEntryDTO();
    metadataEntry.setVersion(1);
    metadataEntry.setCompositeHash("ompositeHash " + name);
    metadataEntry.setMetadataType(type);
    metadataEntry.setScopedMetadataKey("10");
    metadataEntry.sourceAddress(sourceAddress.encoded());
    metadataEntry.setTargetId(targetId);
    metadataEntry.setTargetAddress(targetAddress.encoded());
    metadataEntry.setValue(ConvertUtils.fromStringToHex(name + " message"));
    dto.setMetadataEntry(metadataEntry);
    return dto;
}
Also used : Address(io.nem.symbol.sdk.model.account.Address) MetadataInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.MetadataInfoDTO) MetadataEntryDTO(io.nem.symbol.sdk.openapi.vertx.model.MetadataEntryDTO)

Aggregations

Address (io.nem.symbol.sdk.model.account.Address)1 MetadataEntryDTO (io.nem.symbol.sdk.openapi.vertx.model.MetadataEntryDTO)1 MetadataInfoDTO (io.nem.symbol.sdk.openapi.vertx.model.MetadataInfoDTO)1