use of org.tron.core.Wallet in project java-tron by tronprotocol.
the class WalletTest method testGetAddress.
@Test
public void testGetAddress() {
ECKey ecKey = new ECKey(Utils.getRandom());
Wallet wallet = new Wallet(ecKey);
logger.info("ecKey address = {}", ByteArray.toHexString(ecKey.getAddress()));
logger.info("wallet address = {}", ByteArray.toHexString(wallet.getAddress()));
assertArrayEquals(wallet.getAddress(), ecKey.getAddress());
}
use of org.tron.core.Wallet in project java-tron by tronprotocol.
the class WalletTest method testWallet.
@Test
public void testWallet() {
Wallet wallet = new Wallet();
Wallet wallet2 = new Wallet();
logger.info("wallet address = {}", ByteArray.toHexString(wallet.getAddress()));
logger.info("wallet2 address = {}", ByteArray.toHexString(wallet2.getAddress()));
assertFalse(wallet.getAddress().equals(wallet2.getAddress()));
}
use of org.tron.core.Wallet in project java-tron by tronprotocol.
the class WalletTest method testGetEcKey.
@Test
public void testGetEcKey() {
ECKey ecKey = new ECKey(Utils.getRandom());
ECKey ecKey2 = new ECKey(Utils.getRandom());
Wallet wallet = new Wallet(ecKey);
logger.info("ecKey address = {}", ByteArray.toHexString(ecKey.getAddress()));
logger.info("wallet address = {}", ByteArray.toHexString(wallet.getAddress()));
assertEquals("Wallet ECKey should match provided ECKey", wallet.getEcKey(), ecKey);
}