Search in sources :

Example 1 with MosaicExpiryReceiptBuilder

use of io.nem.symbol.catapult.builders.MosaicExpiryReceiptBuilder in project nem2-sdk-java by nemtech.

the class ArtifactExpiryReceiptTest method shouldMosaicExpiryReceiptBuilderSerialize.

@Test
void shouldMosaicExpiryReceiptBuilderSerialize() {
    MosaicId mosaicId = new MosaicId("85BBEA6CC462B244");
    MosaicExpiryReceiptBuilder builder = MosaicExpiryReceiptBuilder.create((short) 1, ReceiptTypeDto.INFLATION, new MosaicIdDto(mosaicId.getId().longValue()));
    byte[] serialize = builder.serialize();
    // NOTE, size must be ignored for some reason!
    Assertions.assertEquals(12, serialize.length);
    Assertions.assertEquals(16, builder.getSize());
    String hex = ConvertUtils.toHex(serialize);
    Assertions.assertEquals("0100435144B262C46CEABB85", hex);
}
Also used : MosaicExpiryReceiptBuilder(io.nem.symbol.catapult.builders.MosaicExpiryReceiptBuilder) MosaicId(io.nem.symbol.sdk.model.mosaic.MosaicId) MosaicIdDto(io.nem.symbol.catapult.builders.MosaicIdDto) Test(org.junit.jupiter.api.Test)

Aggregations

MosaicExpiryReceiptBuilder (io.nem.symbol.catapult.builders.MosaicExpiryReceiptBuilder)1 MosaicIdDto (io.nem.symbol.catapult.builders.MosaicIdDto)1 MosaicId (io.nem.symbol.sdk.model.mosaic.MosaicId)1 Test (org.junit.jupiter.api.Test)1