Search in sources :

Example 1 with Ed25519CryptoEngine

use of io.nem.symbol.core.crypto.ed25519.Ed25519CryptoEngine in project nem2-sdk-java by nemtech.

the class AccountTest method shouldAcceptKeyPairAsConstructor.

@Test
void shouldAcceptKeyPairAsConstructor() {
    KeyPair random = KeyPair.random(new Ed25519CryptoEngine());
    Account account = new Account(random, NetworkType.MIJIN_TEST);
    assertEquals(random.getPrivateKey().toString().toUpperCase(), account.getPrivateKey());
    assertEquals(account.getAddress().getNetworkType(), NetworkType.MIJIN_TEST);
}
Also used : KeyPair(io.nem.core.crypto.KeyPair) Ed25519CryptoEngine(io.nem.core.crypto.ed25519.Ed25519CryptoEngine) Test(org.junit.jupiter.api.Test)

Example 2 with Ed25519CryptoEngine

use of io.nem.symbol.core.crypto.ed25519.Ed25519CryptoEngine in project nem2-sdk-java by nemtech.

the class AccountTest method shouldAcceptKeyPairAsConstructor.

@Test
void shouldAcceptKeyPairAsConstructor() {
    NetworkType networkType = NetworkType.MIJIN_TEST;
    KeyPair random = KeyPair.random(new Ed25519CryptoEngine());
    Account account = new Account(random, networkType);
    assertEquals(random.getPrivateKey().toHex().toUpperCase(), account.getPrivateKey());
    assertEquals(networkType, account.getAddress().getNetworkType());
}
Also used : KeyPair(io.nem.symbol.core.crypto.KeyPair) Ed25519CryptoEngine(io.nem.symbol.core.crypto.ed25519.Ed25519CryptoEngine) NetworkType(io.nem.symbol.sdk.model.network.NetworkType) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 KeyPair (io.nem.core.crypto.KeyPair)1 Ed25519CryptoEngine (io.nem.core.crypto.ed25519.Ed25519CryptoEngine)1 KeyPair (io.nem.symbol.core.crypto.KeyPair)1 Ed25519CryptoEngine (io.nem.symbol.core.crypto.ed25519.Ed25519CryptoEngine)1 NetworkType (io.nem.symbol.sdk.model.network.NetworkType)1