use of io.nem.sdk.model.account.PublicAccount in project nem2-sdk-java by nemtech.
the class BlockInfoTest method createANewBlockInfo.
@Test
void createANewBlockInfo() {
BlockInfo blockInfo = new BlockInfo("24E92B511B54EDB48A4850F9B42485FDD1A30589D92C775632DDDD71D7D1D691", "57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6", Optional.of(UInt64.fromIntArray(new int[] { 0, 0 })), Optional.of(25), "37351C8244AC166BE6664E3FA954E99A3239AC46E51E2B32CEA1C72DD0851100A7731868E932E1A9BEF8A27D48E1" + "FFEE401E933EB801824373E7537E51733E0F", new PublicAccount("B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF", NetworkType.MIJIN_TEST), NetworkType.MIJIN_TEST, 3, 32768, UInt64.fromIntArray(new int[] { 1, 0 }), UInt64.fromIntArray(new int[] { 0, 0 }), UInt64.fromIntArray(new int[] { 276447232, 23283 }), "702090BA31CEF9E90C62BBDECC0CCCC0F88192B6625839382850357F70DD68A0", "0000000000000000000000000000000000000000000000000000000000000000");
assertEquals("24E92B511B54EDB48A4850F9B42485FDD1A30589D92C775632DDDD71D7D1D691", blockInfo.getHash());
assertEquals("57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6", blockInfo.getGenerationHash());
assertEquals(UInt64.fromIntArray(new int[] { 0, 0 }), blockInfo.getTotalFee().get());
assertEquals(new Integer(25), blockInfo.getNumTransactions().get());
assertEquals("37351C8244AC166BE6664E3FA954E99A3239AC46E51E2B32CEA1C72DD0851100A7731868E932E1A9BEF8A27D48E1" + "FFEE401E933EB801824373E7537E51733E0F", blockInfo.getSignature());
Assertions.assertEquals(new PublicAccount("B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF", NetworkType.MIJIN_TEST), blockInfo.getSigner());
assertEquals(NetworkType.MIJIN_TEST, blockInfo.getNetworkType());
assertTrue(3 == blockInfo.getVersion());
assertEquals(32768, blockInfo.getType());
assertEquals(UInt64.fromIntArray(new int[] { 1, 0 }), blockInfo.getHeight());
assertEquals(UInt64.fromIntArray(new int[] { 0, 0 }), blockInfo.getTimestamp());
assertEquals(UInt64.fromIntArray(new int[] { 276447232, 23283 }), blockInfo.getDifficulty());
assertEquals("702090BA31CEF9E90C62BBDECC0CCCC0F88192B6625839382850357F70DD68A0", blockInfo.getPreviousBlockHash());
assertEquals("0000000000000000000000000000000000000000000000000000000000000000", blockInfo.getBlockTransactionsHash());
}
use of io.nem.sdk.model.account.PublicAccount in project nem2-sdk-java by nemtech.
the class MosaicInfoTest method shouldReturnIsTransferableWhenLevyIsImmutable.
@Test
void shouldReturnIsTransferableWhenLevyIsImmutable() {
MosaicProperties mosaicProperties = new MosaicProperties(true, true, false, 3, BigInteger.valueOf(10));
MosaicInfo mosaicInfo = new MosaicInfo(true, 0, "5A3CD9B09CD1E8000159249B", new NamespaceId(new BigInteger("-8884663987180930485")), new MosaicId(new BigInteger("-3087871471161192663")), new BigInteger("100"), new BigInteger("0"), new PublicAccount("B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF", NetworkType.MIJIN_TEST), mosaicProperties);
assertFalse(mosaicInfo.isLevyMutable());
}
use of io.nem.sdk.model.account.PublicAccount in project nem2-sdk-java by nemtech.
the class MosaicInfoTest method shouldReturnIsSupplyMutableWhenIsImmutable.
@Test
void shouldReturnIsSupplyMutableWhenIsImmutable() {
MosaicProperties mosaicProperties = new MosaicProperties(false, true, true, 3, BigInteger.valueOf(10));
MosaicInfo mosaicInfo = new MosaicInfo(true, 0, "5A3CD9B09CD1E8000159249B", new NamespaceId(new BigInteger("-8884663987180930485")), new MosaicId(new BigInteger("-3087871471161192663")), new BigInteger("100"), new BigInteger("0"), new PublicAccount("B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF", NetworkType.MIJIN_TEST), mosaicProperties);
assertFalse(mosaicInfo.isSupplyMutable());
}
use of io.nem.sdk.model.account.PublicAccount in project nem2-sdk-java by nemtech.
the class MosaicInfoTest method shouldReturnIsTransferableWhenItsNotTransferable.
@Test
void shouldReturnIsTransferableWhenItsNotTransferable() {
MosaicProperties mosaicProperties = new MosaicProperties(true, false, true, 3, BigInteger.valueOf(10));
MosaicInfo mosaicInfo = new MosaicInfo(true, 0, "5A3CD9B09CD1E8000159249B", new NamespaceId(new BigInteger("-8884663987180930485")), new MosaicId(new BigInteger("-3087871471161192663")), new BigInteger("100"), new BigInteger("0"), new PublicAccount("B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF", NetworkType.MIJIN_TEST), mosaicProperties);
assertFalse(mosaicInfo.isTransferable());
}
use of io.nem.sdk.model.account.PublicAccount in project nem2-sdk-java by nemtech.
the class MosaicInfoTest method shouldReturnIsTransferableWhenLevyIsMutable.
@Test
void shouldReturnIsTransferableWhenLevyIsMutable() {
MosaicProperties mosaicProperties = new MosaicProperties(true, true, true, 3, BigInteger.valueOf(10));
MosaicInfo mosaicInfo = new MosaicInfo(true, 0, "5A3CD9B09CD1E8000159249B", new NamespaceId(new BigInteger("-8884663987180930485")), new MosaicId(new BigInteger("-3087871471161192663")), new BigInteger("100"), new BigInteger("0"), new PublicAccount("B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF", NetworkType.MIJIN_TEST), mosaicProperties);
assertTrue(mosaicInfo.isLevyMutable());
}
Aggregations