@Test public void testAccountLegacyNXT() throws UnsupportedEncodingException { byte[] pub = nxtAccount.getPublicKey(); long id = Account.getId(pub); assertArrayEquals(nxtPublicKey, pub); assertEquals(nxtRsAddress, Convert.rsAccount(NxtMain.get(), id)); assertEquals(nxtAccountId, id); }
@Test public void testAccountNxt() throws UnsupportedEncodingException { byte[] publicKey = Crypto.getPublicKey(nxtPrivateKey); long id = Account.getId(publicKey); assertArrayEquals(nxtPublicKey, publicKey); assertEquals(nxtRsAddress, Convert.rsAccount(NxtMain.get(), id)); assertEquals(nxtAccountId, id); }
@Test public void testHDAccountNxt() throws MnemonicException, UnreadableWalletException { DeterministicSeed seed = new DeterministicSeed(recoveryPhrase, null, "", 0); DeterministicKey masterKey = HDKeyDerivation.createMasterPrivateKey(seed.getSeedBytes()); DeterministicHierarchy hierarchy = new DeterministicHierarchy(masterKey); DeterministicKey entropy = hierarchy.get(NxtMain.get().getBip44Path(0), false, true); NxtFamilyKey nxtKey = new NxtFamilyKey(entropy, null, null); byte[] privateKey = nxtKey.getPrivateKey(); byte[] publicKey = nxtKey.getPublicKey(); NxtAddress address = new NxtAddress(NxtMain.get(), publicKey); assertArrayEquals(nxtPrivateKey, privateKey); assertArrayEquals(nxtPublicKey, publicKey); assertEquals(nxtRsAddress, address.toString()); assertEquals(nxtAccountId, address.getAccountId()); }
int timestamp = Convert.toNxtEpochTime(System.currentTimeMillis()); // different for nxt and burst short deadline = 1440; Long recipientLong = Convert.parseAccountId(NxtMain.get(), recipient); EncryptedData data = EncryptedData.encrypt(Convert.toBytes("test text"), nxtPrivateKey, recipientPublicKey);
int timestamp = Convert.toNxtEpochTime(System.currentTimeMillis()); // different for nxt and burst short deadline = 1440; long recipientLong = Convert.parseAccountId(NxtMain.get(), recipient);