Search in sources :

Example 6 with NamespaceId

use of io.nem.sdk.model.namespace.NamespaceId 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());
}
Also used : PublicAccount(io.nem.sdk.model.account.PublicAccount) BigInteger(java.math.BigInteger) NamespaceId(io.nem.sdk.model.namespace.NamespaceId) Test(org.junit.jupiter.api.Test)

Example 7 with NamespaceId

use of io.nem.sdk.model.namespace.NamespaceId in project nem2-sdk-java by nemtech.

the class MosaicInfoTest method shouldReturnIsSupplyMutableWhenIsMutable.

@Test
void shouldReturnIsSupplyMutableWhenIsMutable() {
    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.isSupplyMutable());
}
Also used : PublicAccount(io.nem.sdk.model.account.PublicAccount) BigInteger(java.math.BigInteger) NamespaceId(io.nem.sdk.model.namespace.NamespaceId) Test(org.junit.jupiter.api.Test)

Example 8 with NamespaceId

use of io.nem.sdk.model.namespace.NamespaceId in project nem2-sdk-java by nemtech.

the class MosaicInfoTest method shouldReturnIsTransferableWhenItsTransferable.

@Test
void shouldReturnIsTransferableWhenItsTransferable() {
    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.isTransferable());
}
Also used : PublicAccount(io.nem.sdk.model.account.PublicAccount) BigInteger(java.math.BigInteger) NamespaceId(io.nem.sdk.model.namespace.NamespaceId) Test(org.junit.jupiter.api.Test)

Example 9 with NamespaceId

use of io.nem.sdk.model.namespace.NamespaceId in project nem2-sdk-java by nemtech.

the class MosaicInfoTest method createAMosaicInfoViaConstructor.

@Test
void createAMosaicInfoViaConstructor() {
    MosaicProperties mosaicProperties = new MosaicProperties(true, true, true, 3, BigInteger.valueOf(10));
    NamespaceId namespaceId = new NamespaceId(new BigInteger("-8884663987180930485"));
    MosaicId mosaicId = new MosaicId(new BigInteger("-3087871471161192663"));
    MosaicInfo mosaicInfo = new MosaicInfo(true, 0, "5A3CD9B09CD1E8000159249B", namespaceId, mosaicId, new BigInteger("100"), new BigInteger("0"), new PublicAccount("B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF", NetworkType.MIJIN_TEST), mosaicProperties);
    assertEquals(true, mosaicInfo.isActive());
    assertTrue(mosaicInfo.getIndex() == 0);
    assertEquals("5A3CD9B09CD1E8000159249B", mosaicInfo.getMetaId());
    assertEquals(namespaceId, mosaicInfo.getNamespaceId());
    assertEquals(mosaicId, mosaicInfo.getMosaicId());
    assertEquals(new BigInteger("100"), mosaicInfo.getSupply());
    assertEquals(new BigInteger("0"), mosaicInfo.getHeight());
    assertEquals(new PublicAccount("B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF", NetworkType.MIJIN_TEST), mosaicInfo.getOwner());
    assertTrue(mosaicInfo.isSupplyMutable());
    assertTrue(mosaicInfo.isTransferable());
    assertTrue(mosaicInfo.isLevyMutable());
    assertEquals(3, mosaicInfo.getDivisibility());
    assertEquals(BigInteger.valueOf(10), mosaicInfo.getDuration());
}
Also used : PublicAccount(io.nem.sdk.model.account.PublicAccount) BigInteger(java.math.BigInteger) NamespaceId(io.nem.sdk.model.namespace.NamespaceId) Test(org.junit.jupiter.api.Test)

Example 10 with NamespaceId

use of io.nem.sdk.model.namespace.NamespaceId in project nem2-sdk-java by nemtech.

the class MosaicNameTest method createAMosaicName.

@Test
void createAMosaicName() {
    NamespaceId namespaceId = new NamespaceId(new BigInteger("-8884663987180930485"));
    MosaicId mosaicId = new MosaicId(new BigInteger("-3087871471161192663"));
    MosaicName mosaicName = new MosaicName(mosaicId, "xem", namespaceId);
    assertEquals(mosaicId, mosaicName.getMosaicId());
    assertEquals("xem", mosaicName.getName());
    assertEquals(namespaceId, mosaicName.getParentId());
}
Also used : BigInteger(java.math.BigInteger) NamespaceId(io.nem.sdk.model.namespace.NamespaceId) Test(org.junit.jupiter.api.Test)

Aggregations

NamespaceId (io.nem.sdk.model.namespace.NamespaceId)16 PublicAccount (io.nem.sdk.model.account.PublicAccount)11 BigInteger (java.math.BigInteger)10 Test (org.junit.jupiter.api.Test)10 TypeReference (com.fasterxml.jackson.core.type.TypeReference)4 NetworkType (io.nem.sdk.model.blockchain.NetworkType)4 UInt64 (io.nem.sdk.model.transaction.UInt64)4 Observable (io.reactivex.Observable)4 JsonObject (io.vertx.core.json.JsonObject)4 HttpResponse (io.vertx.reactivex.ext.web.client.HttpResponse)4 BodyCodec (io.vertx.reactivex.ext.web.codec.BodyCodec)4 MalformedURLException (java.net.MalformedURLException)4 List (java.util.List)4 Optional (java.util.Optional)4 Collectors (java.util.stream.Collectors)4 MosaicId (io.nem.sdk.model.mosaic.MosaicId)3 Address (io.nem.sdk.model.account.Address)2 MosaicInfo (io.nem.sdk.model.mosaic.MosaicInfo)2 MosaicName (io.nem.sdk.model.mosaic.MosaicName)2 MosaicProperties (io.nem.sdk.model.mosaic.MosaicProperties)2