use of io.nem.symbol.sdk.model.account.Account in project nem2-sdk-java by nemtech.
the class MosaicDefinitionTransactionTest method createAMosaicCreationTransactionViaStaticConstructor.
@Test
void createAMosaicCreationTransactionViaStaticConstructor() {
Account owner = Account.generateNewAccount(NetworkType.MIJIN_TEST);
Duration epochAdjustment = Duration.ofSeconds(100);
int nonceNumber = 12345;
MosaicNonce nonce = MosaicNonce.createFromInteger(nonceNumber);
MosaicDefinitionTransaction mosaicCreationTx = MosaicDefinitionTransactionFactory.create(NetworkType.MIJIN_TEST, Deadline.create(epochAdjustment), nonce, MosaicId.createFromNonce(nonce, owner.getPublicAccount()), MosaicFlags.create(true, true, true), 4, new BlockDuration(222222)).build();
System.out.println(ConvertUtils.toHex(BinarySerializationImpl.INSTANCE.serialize(mosaicCreationTx)));
assertEquals(NetworkType.MIJIN_TEST, mosaicCreationTx.getNetworkType());
assertEquals(1, (int) mosaicCreationTx.getVersion());
assertTrue(LocalDateTime.now().isBefore(mosaicCreationTx.getDeadline().getLocalDateTime(epochAdjustment)));
assertEquals(BigInteger.valueOf(0), mosaicCreationTx.getMaxFee());
// assertEquals(new BigInteger("0"), mosaicCreationTx.getMosaicId().getId());
assertTrue(mosaicCreationTx.getMosaicFlags().isSupplyMutable());
assertTrue(mosaicCreationTx.getMosaicFlags().isTransferable());
assertTrue(mosaicCreationTx.getMosaicFlags().isRestrictable());
assertEquals(nonceNumber, mosaicCreationTx.getMosaicNonce().getNonceAsInt());
assertEquals(4, mosaicCreationTx.getDivisibility());
assertEquals(new BlockDuration(222222), mosaicCreationTx.getBlockDuration());
}
use of io.nem.symbol.sdk.model.account.Account in project nem2-sdk-java by nemtech.
the class TransactionStatementTest method setup.
@BeforeAll
public static void setup() {
receiptSource = new ReceiptSource(1, 1);
Account account = new Account("787225aaff3d2c71f4ffa32d4f19ec4922f3cd869747f267378f81f8e3fcb12d", NetworkType.MIJIN_TEST);
MosaicId mosaicId = new MosaicId("85BBEA6CC462B244");
Address recipientAddress = new Address("SDZWZJUAYNOWGBTCUDBY3SE5JF4NCC2RDM6SIGQ", NetworkType.MIJIN_TEST);
ArtifactExpiryReceipt<MosaicId> mosaicExpiryReceipt = new ArtifactExpiryReceipt(mosaicId, ReceiptType.MOSAIC_EXPIRED, ReceiptVersion.ARTIFACT_EXPIRY);
BalanceChangeReceipt balanceChangeReceipt = new BalanceChangeReceipt(account.getAddress(), mosaicId, BigInteger.valueOf(10), ReceiptType.LOCK_SECRET_EXPIRED, ReceiptVersion.BALANCE_CHANGE);
BalanceTransferReceipt balanceTransferReceipt = new BalanceTransferReceipt(account.getAddress(), recipientAddress, mosaicId, BigInteger.valueOf(10), ReceiptType.MOSAIC_RENTAL_FEE, ReceiptVersion.BALANCE_TRANSFER);
List<Receipt> list = new ArrayList<>();
list.add(mosaicExpiryReceipt);
list.add(balanceChangeReceipt);
list.add(balanceTransferReceipt);
receipts = list;
}
use of io.nem.symbol.sdk.model.account.Account in project nem2-sdk-java by nemtech.
the class BalanceChangeReceiptTest method setup.
@BeforeAll
public void setup() {
account = new Account("787225aaff3d2c71f4ffa32d4f19ec4922f3cd869747f267378f81f8e3fcb12d", NetworkType.MIJIN_TEST);
mosaicId = new MosaicId("85BBEA6CC462B244");
}
Aggregations