/
AddressTests.kt.erb
33 lines (26 loc) · 1.14 KB
/
AddressTests.kt.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright © 2017-2020 Trust Wallet.
//
// This file is part of Trust. The full Trust copyright notice, including
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.
package com.trustwallet.core.app.blockchains.<%= format_name_lowercase(coin) %>
import com.trustwallet.core.app.utils.toHex
import com.trustwallet.core.app.utils.toHexByteArray
import org.junit.Assert.assertEquals
import org.junit.Test
import wallet.core.jni.*
class Test<%= name %>Address {
init {
System.loadLibrary("TrustWalletCore")
}
@Test
fun testAddress() {
// TODO: Check and finalize implementation
val key = PrivateKey("__PRIVATE_KEY_DATA__".toHexByteArray())
val pubkey = key.publicKeyEd25519
val address = AnyAddress(pubkey, CoinType.<%= format_name_uppercase(coin) %>)
val expected = AnyAddress("__EXPECTED_RESULT_ADDRESS__", CoinType.<%= format_name_uppercase(coin) %>)
assertEquals(pubkey.data().toHex(), "0x__EXPECTED_PUBKEY_DATA__")
assertEquals(address.description(), expected.description())
}
}